Make your own free website on Tripod.com

Table of Contents:



REPORT zfvendors  LINE-SIZE 60
       NO STANDARD PAGE HEADING.
*@----------------------------------------------------------------------
*@ Program id    : ZFVENDORS
*@
*@ Program Desc  : This program Lists the vendors' numbers and names.
*@
*@ Transaction Code - none
*@ Input files   : ID - none
*@ Output files  : ID - none
*@
*@ Tables Updated: Table - none
*@
*@
*@ Author      : IJADALOW
*@ Date        : January 15, 2002
*@ Requested by: Christina Tam
*@----------------------------------------------------------------------
*@ Algorithm:
*@
*@----------------------------------------------------------------------
** Change History:
**
** Correction  Mod by    Date      Description
**
*@----------------------------------------------------------------------
INCLUDE zsmaster.

TABLES: lfb1, lfa1.
DATA: BEGIN OF itab OCCURS 100,
        lifnr LIKE lfb1-lifnr,
        bukrs LIKE lfb1-bukrs,
        deleted LIKE lfb1-loevm,
        name1 LIKE lfa1-name1,
      END OF itab.

SELECTION-SCREEN BEGIN OF BLOCK rec1
              WITH FRAME TITLE text-001.
SELECT-OPTIONS: co_code FOR lfb1-bukrs,
            ven_nr FOR lfb1-lifnr.
PARAMETERS: exclude AS CHECKBOX DEFAULT 'X'.
SELECTION-SCREEN END OF BLOCK rec1.


START-OF-SELECTION.

  SELECT lifnr bukrs loevm FROM lfb1
    INTO TABLE itab
    WHERE lifnr IN ven_nr AND
          bukrs IN co_code.

  LOOP AT itab.
    SELECT SINGLE name1 FROM lfa1
      INTO itab-name1
      WHERE lifnr = itab-lifnr.
    MODIFY itab.
  ENDLOOP.

  SORT itab BY bukrs lifnr.

  LOOP AT itab.
    IF exclude = 'X'.
      IF itab-deleted <> 'X'.
        PERFORM write_line.
      ENDIF.
    ELSE.
      PERFORM write_line.
    ENDIF.
  ENDLOOP.

  WRITE sy-uline.

*/---------------------------------------------------------\*
TOP-OF-PAGE.
  mac_generic_report_header 'List of Vendors'
                            ' '
                            mac_c_true
                            mac_c_false.
  PERFORM print_col_headings.

*/---------------------------------------------------------\*

FORM write_line.

  FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
  WRITE: /01 sy-vline NO-GAP,
        03 itab-bukrs,
        11 sy-vline NO-GAP,
        13 itab-lifnr,
        21 sy-vline NO-GAP,
        23 itab-name1,
        60 sy-vline NO-GAP.
ENDFORM.

*&---------------------------------------------------------------------*
*&      Form  PRINT_COL_HEADINGS
*&---------------------------------------------------------------------*

FORM print_col_headings.

  FORMAT COLOR COL_HEADING.
  WRITE sy-uline.
  WRITE: /01 sy-vline NO-GAP,
          03 'Co. Code',
          11 sy-vline NO-GAP,
          13 'Vendor #',
          21 sy-vline NO-GAP,
          23 'Vendor Name',
          60 sy-vline NO-GAP.
  WRITE sy-uline.
ENDFORM.                    " PRINT_COL_HEADINGS