**********************************************************************
REPORT zvendor_master.
TYPE-POOLS: slis.
DATA: g_repid LIKE sy-repid,
gs_print TYPE slis_print_alv,
t_list_top_of_page TYPE slis_t_listheader,
gt_events TYPE slis_t_event,
i_sort TYPE slis_t_sortinfo_alv,
gs_layout TYPE slis_layout_alv,
gt_fieldcat TYPE slis_t_fieldcat_alv,
gs_cell TYPE slis_lineinfo,
fieldcat_ln LIKE LINE OF gt_fieldcat.
DATA : gs_variant LIKE disvariant,
g_save.
DATA : it_events TYPE slis_t_event WITH HEADER LINE.
DATA : l_list(105) TYPE c. "Store the Top-of-page headings
DATA : t_formname_top_of_page TYPE slis_formname VALUE 'TOP_OF_PAGE'.
DATA : it_fieldcat TYPE slis_t_fieldcat_alv WITH HEADER LINE.
DATA : ls_sort TYPE TABLE OF slis_sortinfo_alv.
DATA : wa_sort LIKE LINE OF ls_sort.
TABLES : LFA1,LFM1,LFB1.
DATA : BEGIN OF itab OCCURS 0,
lifnr LIKE lfa1-lifnr, " VENDOR NO.
BUKRS LIKE lfB1-BUKRS, " COMPANY CODE
name1 LIKE lfa1-name1, " VENDOR NAME
ort01 LIKE lfa1-ort01, " VENDOR CITY
pstlz LIKE lfa1-pstlz, " POSTAL CODE
regio LIKE lfa1-regio, " STATE
stras LIKE lfa1-stras, " STREET
telf1 LIKE lfa1-telf1, " TELEPHONE NO
telfx LIKE lfa1-telfx, " FAX. NO
adrnr LIKE lfa1-adrnr, " ADDRESS
sortl LIKE lfa1-sortl, " SEARCH TERM
erdat LIKE lfa1-erdat, " CREATED ON
ernam LIKE lfa1-ernam, " CREATED BY
spras LIKE lfa1-spras, " LANGUAGE
name2 LIKE lfa1-name2,
name3 LIKE lfa1-name3,
name4 LIKE lfa1-name4,
ort02 LIKE lfa1-ort02,
mcod1 LIKE lfa1-mcod1,
mcod2 LIKE lfa1-mcod2,
mcod3 LIKE lfa1-mcod3,
land1 LIKE lfa1-land1,
KTOKK LIKE lfa1-KTOKK, " VENDOR GRP
zterm LIKE knb1-zterm, " PAYMENT TERMS
bezei like t005u-bezei,
* EKORG like EKKO-EKORG,
adrc LIKE adrc-addrnumber,
text1 LIKE t052u-text1,
smtp_addr LIKE adr6-smtp_addr, " EMAIL-ADDRESS
j_1iexcd TYPE j_1iexcd, " ECC-NUMBER
j_1icstno TYPE j_1icstno, " CST NUMBER.
j_1ilstno TYPE j_1ilstno, " LST NUMBER
j_1ipanno TYPE j_1ipanno, " PAN NUMBER
J_1ISERN TYPE J_1ISERN, " SERVICE REG. NUMBER
END OF itab.
DATA:BEGIN OF t_j_1imovend OCCURS 0,
lifnr TYPE j_1imovend-lifnr,
j_1iexcd TYPE j_1iexcd,
j_1icstno TYPE j_1icstno,
j_1ilstno TYPE j_1ilstno,
j_1ipanno TYPE j_1ipanno,
J_1ISERN type J_1ISERN,
END OF t_j_1imovend.
SELECT-OPTIONS : lifnr FOR lfa1-lifnr,
BUKRS FOR lfB1-BUKRS.
START-OF-SELECTION.
SELECT lfa1~lifnr
lfa1~name1
lfa1~ort01
lfa1~pstlz
lfa1~regio
lfa1~stras
lfa1~KTOKK
lfa1~erdat
lfa1~ernam
lfa1~telf1
lfa1~telfx
lfa1~adrnr
lfa1~sortl
lfa1~spras
lfa1~name2
lfa1~name3
lfa1~name4
lfa1~ort02
lfa1~mcod1
lfa1~mcod2
lfa1~mcod3
lfa1~stcd2
lfa1~stceg
lfB1~BUKRS
INTO CORRESPONDING FIELDS OF TABLE itab
FROM lfa1
INNER JOIN LFB1 ON LFB1~lifnr = lfa1~lifnr
WHERE LFA1~lifnr IN lifnr
AND lfa1~spras = 'EN'
AND LFB1~BUKRS IN BUKRS.
SORT itab BY lifnr ASCENDING .
DELETE ADJACENT DUPLICATES FROM itab COMPARING lifnr.
IF itab[] IS NOT INITIAL.
SELECT lifnr
j_1iexcd
j_1icstno
j_1ilstno
j_1ipanno
J_1ISERN
INTO TABLE t_j_1imovend
FROM j_1imovend
FOR ALL ENTRIES IN itab
WHERE lifnr = itab-lifnr.
ENDIF.
LOOP AT itab.
SELECT SINGLE smtp_addr INTO itab-smtp_addr FROM adr6
WHERE addrnumber = itab-adrnr.
SELECT SINGLE zterm INTO itab-zterm FROM lfm1
WHERE lifnr = itab-lifnr.
SELECT SINGLE text1 INTO itab-text1 FROM t052u
WHERE zterm = itab-zterm
AND spras = 'EN'.
READ TABLE t_j_1imovend WITH KEY lifnr = itab-lifnr.
IF sy-subrc = 0.
itab-j_1iexcd = t_j_1imovend-j_1iexcd.
itab-j_1icstno = t_j_1imovend-j_1icstno.
itab-j_1ilstno = t_j_1imovend-j_1ilstno.
itab-j_1ipanno = t_j_1imovend-j_1ipanno.
itab-J_1ISERN = t_j_1imovend-J_1ISERN.
ENDIF.
MODIFY itab.
CLEAR:itab,t_j_1imovend.
ENDLOOP.
PERFORM build.
PERFORM get_events.
PERFORM sub_comment_build USING t_list_top_of_page.
PERFORM call_alv.
*&------------Form BUILD
FORM build.
DATA: fieldcat_in TYPE slis_fieldcat_alv.
REFRESH gt_fieldcat.
CLEAR fieldcat_ln.
fieldcat_ln-fieldname = 'BUKRS'. "1
fieldcat_ln-tabname = 'ITAB'.
fieldcat_ln-seltext_l = 'COMPANY CODE'.
fieldcat_ln-no_zero = 'X'.
fieldcat_ln-just = 'C'.
fieldcat_ln-outputlen = '10'.
APPEND fieldcat_ln TO gt_fieldcat.
CLEAR fieldcat_ln.
fieldcat_ln-fieldname = 'LIFNR'. "1
fieldcat_ln-tabname = 'ITAB'.
fieldcat_ln-seltext_l = 'VENDOR'.
fieldcat_ln-no_zero = 'X'.
fieldcat_ln-just = 'C'.
fieldcat_ln-outputlen = '10'.
APPEND fieldcat_ln TO gt_fieldcat.
CLEAR fieldcat_ln.
fieldcat_ln-fieldname = 'NAME1'. "1
fieldcat_ln-tabname = 'ITAB'.
fieldcat_ln-seltext_l = 'VENDOR NAME'.
fieldcat_ln-outputlen = '25'.
fieldcat_ln-just = 'C'.
APPEND fieldcat_ln TO gt_fieldcat.
CLEAR fieldcat_ln.
fieldcat_ln-fieldname = 'KTOKK'. "1
fieldcat_ln-tabname = 'ITAB'.
fieldcat_ln-seltext_l = 'VENDOR GRP'.
fieldcat_ln-outputlen = '10'.
fieldcat_ln-just = 'C'.
APPEND fieldcat_ln TO gt_fieldcat.
CLEAR fieldcat_ln.
fieldcat_ln-fieldname = 'SORTL'. "1
fieldcat_ln-tabname = 'ITAB'.
fieldcat_ln-seltext_l = 'SEARCH TERM'.
fieldcat_ln-outputlen = '25'.
fieldcat_ln-just = 'C'.
APPEND fieldcat_ln TO gt_fieldcat.
*
CLEAR fieldcat_ln.
fieldcat_ln-fieldname = 'STRAS'. "1
fieldcat_ln-tabname = 'ITAB'.
fieldcat_ln-seltext_l = 'STREET'.
fieldcat_ln-outputlen = '20'.
fieldcat_ln-just = 'C'.
APPEND fieldcat_ln TO gt_fieldcat.
CLEAR fieldcat_ln.
fieldcat_ln-fieldname = 'ORT01'. "1
fieldcat_ln-tabname = 'ITAB'.
fieldcat_ln-seltext_l = 'CITY'.
fieldcat_ln-outputlen = '15'.
fieldcat_ln-just = 'C'.
APPEND fieldcat_ln TO gt_fieldcat.
*
CLEAR fieldcat_ln.
fieldcat_ln-fieldname = 'PSTLZ'. "1
fieldcat_ln-tabname = 'ITAB'.
fieldcat_ln-seltext_l = 'POSTALCODE'.
fieldcat_ln-outputlen = '15'.
fieldcat_ln-just = 'C'.
APPEND fieldcat_ln TO gt_fieldcat.
CLEAR fieldcat_ln.
fieldcat_ln-fieldname = 'REGIO'. "1
fieldcat_ln-tabname = 'ITAB'.
fieldcat_ln-seltext_l = 'REGION'.
fieldcat_ln-outputlen = '10'.
fieldcat_ln-just = 'C'.
APPEND fieldcat_ln TO gt_fieldcat.
CLEAR fieldcat_ln.
fieldcat_ln-fieldname = 'SMTP_ADDR'. "1
fieldcat_ln-tabname = 'ITAB'.
fieldcat_ln-seltext_l = 'EMAIL-ADDR'.
fieldcat_ln-outputlen = '20'.
fieldcat_ln-just = 'C'.
APPEND fieldcat_ln TO gt_fieldcat.
**
CLEAR fieldcat_ln.
fieldcat_ln-fieldname = 'TELF1'. "1
fieldcat_ln-tabname = 'ITAB'.
fieldcat_ln-seltext_l = 'PHONE.NO'.
fieldcat_ln-outputlen = '15'.
fieldcat_ln-just = 'C'.
APPEND fieldcat_ln TO gt_fieldcat.
CLEAR fieldcat_ln.
fieldcat_ln-fieldname = 'TELFX'. "1
fieldcat_ln-tabname = 'ITAB'.
fieldcat_ln-seltext_l = 'FAX.NO'.
fieldcat_ln-outputlen = '15'.
fieldcat_ln-just = 'C'.
APPEND fieldcat_ln TO gt_fieldcat.
**
CLEAR fieldcat_ln.
fieldcat_ln-fieldname = 'ZTERM'. "1
fieldcat_ln-tabname = 'ITAB'.
fieldcat_ln-seltext_l = 'PAYMENT TERMS'.
fieldcat_ln-outputlen = '15'.
fieldcat_ln-just = 'C'.
APPEND fieldcat_ln TO gt_fieldcat.
**
CLEAR fieldcat_ln.
fieldcat_ln-fieldname = 'TEXT1'. "1
fieldcat_ln-tabname = 'ITAB'.
fieldcat_ln-seltext_l = 'TEXT'.
fieldcat_ln-outputlen = '20'.
fieldcat_ln-just = 'C'.
APPEND fieldcat_ln TO gt_fieldcat.
**
*
CLEAR fieldcat_ln.
fieldcat_ln-fieldname = 'ERNAM'. "1
fieldcat_ln-tabname = 'ITAB'.
fieldcat_ln-seltext_l = 'Created By'.
fieldcat_ln-outputlen = '15'.
fieldcat_ln-just = 'C'.
APPEND fieldcat_ln TO gt_fieldcat.
*
CLEAR fieldcat_ln.
fieldcat_ln-fieldname = 'ERDAT'. "1
fieldcat_ln-tabname = 'ITAB'.
fieldcat_ln-seltext_l = 'Created ON'.
fieldcat_ln-outputlen = '15'.
fieldcat_ln-just = 'C'.
APPEND fieldcat_ln TO gt_fieldcat.
CLEAR fieldcat_ln.
fieldcat_ln-fieldname = 'J_1IEXCD'. "1
fieldcat_ln-tabname = 'ITAB'.
fieldcat_ln-seltext_l = 'ECC NO'.
fieldcat_ln-outputlen = '15'.
fieldcat_ln-just = 'C'.
APPEND fieldcat_ln TO gt_fieldcat.
**
CLEAR fieldcat_ln.
fieldcat_ln-fieldname = 'J_1ICSTNO'. "1
fieldcat_ln-tabname = 'ITAB'.
fieldcat_ln-seltext_l = 'CST NO'.
fieldcat_ln-outputlen = '15'.
fieldcat_ln-just = 'C'.
APPEND fieldcat_ln TO gt_fieldcat.
CLEAR fieldcat_ln.
fieldcat_ln-fieldname = 'J_1ILSTNO'. "1
fieldcat_ln-tabname = 'ITAB'.
fieldcat_ln-seltext_l = 'LST NO'.
fieldcat_ln-outputlen = '15'.
fieldcat_ln-just = 'C'.
APPEND fieldcat_ln TO gt_fieldcat.
**
CLEAR fieldcat_ln.
fieldcat_ln-fieldname = 'J_1IPANNO'. "1
fieldcat_ln-tabname = 'ITAB'.
fieldcat_ln-seltext_l = 'PAN NO'.
fieldcat_ln-outputlen = '15'.
fieldcat_ln-just = 'C'.
APPEND fieldcat_ln TO gt_fieldcat.
*
CLEAR fieldcat_ln.
fieldcat_ln-fieldname = 'J_1ISERN'. "1
fieldcat_ln-tabname = 'ITAB'.
fieldcat_ln-seltext_l = 'SERVICE TAX REGN.NO.'.
fieldcat_ln-outputlen = '15'.
fieldcat_ln-just = 'C'.
APPEND fieldcat_ln TO gt_fieldcat.
g_repid = sy-repid.
gs_variant-report = g_repid.
g_save = 'A'.
ENDFORM. "BUILD
*&---------------Form CALL_ALV
DATA t_layout TYPE slis_layout_alv.
*&---------------------------------------------------------------------
*
*& Form CALL_ALV
*&---------------------------------------------------------------------
*
FORM call_alv.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = g_repid
i_save = g_save
is_variant = gs_variant
it_fieldcat = gt_fieldcat[]
it_events = it_events[]
TABLES
t_outtab = itab
EXCEPTIONS
program_error = 1
OTHERS = 2.
ENDFORM. "CALL_ALV
FORM get_events .
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = it_events[]
EXCEPTIONS
list_type_wrong = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
READ TABLE it_events WITH KEY name = slis_ev_top_of_page
INTO it_events.
IF sy-subrc = 0.
MOVE t_formname_top_of_page TO it_events-form.
APPEND it_events.
ENDIF.
ENDFORM. " get_events
*&---------------------------------------------------------------------
*
*& Form sub_comment_build
*&---------------------------------------------------------------------
*
FORM sub_comment_build USING i_top_of_page TYPE slis_t_listheader.
DATA: ls_line TYPE slis_listheader.
CLEAR ls_line.
ls_line-typ = 'H'.
ls_line-info = 'XYZ Limited'.
APPEND ls_line TO i_top_of_page.
ls_line-typ = 'H'.
ls_line-info = 'VENDOR MASTER'.
APPEND ls_line TO i_top_of_page.
CLEAR: ls_line, l_list.
ls_line-typ = 'S'.
ls_line-info = l_list.
APPEND ls_line TO i_top_of_page.
ENDFORM. " sub_comment_build
*&---------------------------------------------------------------------
*
*& Form top_of_page
*&---------------------------------------------------------------------
*
* text
*----------------------------------------------------------------------
*
FORM top_of_page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = t_list_top_of_page.
ENDFORM. "TOP_OF_PAGE
REPORT zvendor_master.
TYPE-POOLS: slis.
DATA: g_repid LIKE sy-repid,
gs_print TYPE slis_print_alv,
t_list_top_of_page TYPE slis_t_listheader,
gt_events TYPE slis_t_event,
i_sort TYPE slis_t_sortinfo_alv,
gs_layout TYPE slis_layout_alv,
gt_fieldcat TYPE slis_t_fieldcat_alv,
gs_cell TYPE slis_lineinfo,
fieldcat_ln LIKE LINE OF gt_fieldcat.
DATA : gs_variant LIKE disvariant,
g_save.
DATA : it_events TYPE slis_t_event WITH HEADER LINE.
DATA : l_list(105) TYPE c. "Store the Top-of-page headings
DATA : t_formname_top_of_page TYPE slis_formname VALUE 'TOP_OF_PAGE'.
DATA : it_fieldcat TYPE slis_t_fieldcat_alv WITH HEADER LINE.
DATA : ls_sort TYPE TABLE OF slis_sortinfo_alv.
DATA : wa_sort LIKE LINE OF ls_sort.
TABLES : LFA1,LFM1,LFB1.
DATA : BEGIN OF itab OCCURS 0,
lifnr LIKE lfa1-lifnr, " VENDOR NO.
BUKRS LIKE lfB1-BUKRS, " COMPANY CODE
name1 LIKE lfa1-name1, " VENDOR NAME
ort01 LIKE lfa1-ort01, " VENDOR CITY
pstlz LIKE lfa1-pstlz, " POSTAL CODE
regio LIKE lfa1-regio, " STATE
stras LIKE lfa1-stras, " STREET
telf1 LIKE lfa1-telf1, " TELEPHONE NO
telfx LIKE lfa1-telfx, " FAX. NO
adrnr LIKE lfa1-adrnr, " ADDRESS
sortl LIKE lfa1-sortl, " SEARCH TERM
erdat LIKE lfa1-erdat, " CREATED ON
ernam LIKE lfa1-ernam, " CREATED BY
spras LIKE lfa1-spras, " LANGUAGE
name2 LIKE lfa1-name2,
name3 LIKE lfa1-name3,
name4 LIKE lfa1-name4,
ort02 LIKE lfa1-ort02,
mcod1 LIKE lfa1-mcod1,
mcod2 LIKE lfa1-mcod2,
mcod3 LIKE lfa1-mcod3,
land1 LIKE lfa1-land1,
KTOKK LIKE lfa1-KTOKK, " VENDOR GRP
zterm LIKE knb1-zterm, " PAYMENT TERMS
bezei like t005u-bezei,
* EKORG like EKKO-EKORG,
adrc LIKE adrc-addrnumber,
text1 LIKE t052u-text1,
smtp_addr LIKE adr6-smtp_addr, " EMAIL-ADDRESS
j_1iexcd TYPE j_1iexcd, " ECC-NUMBER
j_1icstno TYPE j_1icstno, " CST NUMBER.
j_1ilstno TYPE j_1ilstno, " LST NUMBER
j_1ipanno TYPE j_1ipanno, " PAN NUMBER
J_1ISERN TYPE J_1ISERN, " SERVICE REG. NUMBER
END OF itab.
DATA:BEGIN OF t_j_1imovend OCCURS 0,
lifnr TYPE j_1imovend-lifnr,
j_1iexcd TYPE j_1iexcd,
j_1icstno TYPE j_1icstno,
j_1ilstno TYPE j_1ilstno,
j_1ipanno TYPE j_1ipanno,
J_1ISERN type J_1ISERN,
END OF t_j_1imovend.
SELECT-OPTIONS : lifnr FOR lfa1-lifnr,
BUKRS FOR lfB1-BUKRS.
START-OF-SELECTION.
SELECT lfa1~lifnr
lfa1~name1
lfa1~ort01
lfa1~pstlz
lfa1~regio
lfa1~stras
lfa1~KTOKK
lfa1~erdat
lfa1~ernam
lfa1~telf1
lfa1~telfx
lfa1~adrnr
lfa1~sortl
lfa1~spras
lfa1~name2
lfa1~name3
lfa1~name4
lfa1~ort02
lfa1~mcod1
lfa1~mcod2
lfa1~mcod3
lfa1~stcd2
lfa1~stceg
lfB1~BUKRS
INTO CORRESPONDING FIELDS OF TABLE itab
FROM lfa1
INNER JOIN LFB1 ON LFB1~lifnr = lfa1~lifnr
WHERE LFA1~lifnr IN lifnr
AND lfa1~spras = 'EN'
AND LFB1~BUKRS IN BUKRS.
SORT itab BY lifnr ASCENDING .
DELETE ADJACENT DUPLICATES FROM itab COMPARING lifnr.
IF itab[] IS NOT INITIAL.
SELECT lifnr
j_1iexcd
j_1icstno
j_1ilstno
j_1ipanno
J_1ISERN
INTO TABLE t_j_1imovend
FROM j_1imovend
FOR ALL ENTRIES IN itab
WHERE lifnr = itab-lifnr.
ENDIF.
LOOP AT itab.
SELECT SINGLE smtp_addr INTO itab-smtp_addr FROM adr6
WHERE addrnumber = itab-adrnr.
SELECT SINGLE zterm INTO itab-zterm FROM lfm1
WHERE lifnr = itab-lifnr.
SELECT SINGLE text1 INTO itab-text1 FROM t052u
WHERE zterm = itab-zterm
AND spras = 'EN'.
READ TABLE t_j_1imovend WITH KEY lifnr = itab-lifnr.
IF sy-subrc = 0.
itab-j_1iexcd = t_j_1imovend-j_1iexcd.
itab-j_1icstno = t_j_1imovend-j_1icstno.
itab-j_1ilstno = t_j_1imovend-j_1ilstno.
itab-j_1ipanno = t_j_1imovend-j_1ipanno.
itab-J_1ISERN = t_j_1imovend-J_1ISERN.
ENDIF.
MODIFY itab.
CLEAR:itab,t_j_1imovend.
ENDLOOP.
PERFORM build.
PERFORM get_events.
PERFORM sub_comment_build USING t_list_top_of_page.
PERFORM call_alv.
*&------------Form BUILD
FORM build.
DATA: fieldcat_in TYPE slis_fieldcat_alv.
REFRESH gt_fieldcat.
CLEAR fieldcat_ln.
fieldcat_ln-fieldname = 'BUKRS'. "1
fieldcat_ln-tabname = 'ITAB'.
fieldcat_ln-seltext_l = 'COMPANY CODE'.
fieldcat_ln-no_zero = 'X'.
fieldcat_ln-just = 'C'.
fieldcat_ln-outputlen = '10'.
APPEND fieldcat_ln TO gt_fieldcat.
CLEAR fieldcat_ln.
fieldcat_ln-fieldname = 'LIFNR'. "1
fieldcat_ln-tabname = 'ITAB'.
fieldcat_ln-seltext_l = 'VENDOR'.
fieldcat_ln-no_zero = 'X'.
fieldcat_ln-just = 'C'.
fieldcat_ln-outputlen = '10'.
APPEND fieldcat_ln TO gt_fieldcat.
CLEAR fieldcat_ln.
fieldcat_ln-fieldname = 'NAME1'. "1
fieldcat_ln-tabname = 'ITAB'.
fieldcat_ln-seltext_l = 'VENDOR NAME'.
fieldcat_ln-outputlen = '25'.
fieldcat_ln-just = 'C'.
APPEND fieldcat_ln TO gt_fieldcat.
CLEAR fieldcat_ln.
fieldcat_ln-fieldname = 'KTOKK'. "1
fieldcat_ln-tabname = 'ITAB'.
fieldcat_ln-seltext_l = 'VENDOR GRP'.
fieldcat_ln-outputlen = '10'.
fieldcat_ln-just = 'C'.
APPEND fieldcat_ln TO gt_fieldcat.
CLEAR fieldcat_ln.
fieldcat_ln-fieldname = 'SORTL'. "1
fieldcat_ln-tabname = 'ITAB'.
fieldcat_ln-seltext_l = 'SEARCH TERM'.
fieldcat_ln-outputlen = '25'.
fieldcat_ln-just = 'C'.
APPEND fieldcat_ln TO gt_fieldcat.
*
CLEAR fieldcat_ln.
fieldcat_ln-fieldname = 'STRAS'. "1
fieldcat_ln-tabname = 'ITAB'.
fieldcat_ln-seltext_l = 'STREET'.
fieldcat_ln-outputlen = '20'.
fieldcat_ln-just = 'C'.
APPEND fieldcat_ln TO gt_fieldcat.
CLEAR fieldcat_ln.
fieldcat_ln-fieldname = 'ORT01'. "1
fieldcat_ln-tabname = 'ITAB'.
fieldcat_ln-seltext_l = 'CITY'.
fieldcat_ln-outputlen = '15'.
fieldcat_ln-just = 'C'.
APPEND fieldcat_ln TO gt_fieldcat.
*
CLEAR fieldcat_ln.
fieldcat_ln-fieldname = 'PSTLZ'. "1
fieldcat_ln-tabname = 'ITAB'.
fieldcat_ln-seltext_l = 'POSTALCODE'.
fieldcat_ln-outputlen = '15'.
fieldcat_ln-just = 'C'.
APPEND fieldcat_ln TO gt_fieldcat.
CLEAR fieldcat_ln.
fieldcat_ln-fieldname = 'REGIO'. "1
fieldcat_ln-tabname = 'ITAB'.
fieldcat_ln-seltext_l = 'REGION'.
fieldcat_ln-outputlen = '10'.
fieldcat_ln-just = 'C'.
APPEND fieldcat_ln TO gt_fieldcat.
CLEAR fieldcat_ln.
fieldcat_ln-fieldname = 'SMTP_ADDR'. "1
fieldcat_ln-tabname = 'ITAB'.
fieldcat_ln-seltext_l = 'EMAIL-ADDR'.
fieldcat_ln-outputlen = '20'.
fieldcat_ln-just = 'C'.
APPEND fieldcat_ln TO gt_fieldcat.
**
CLEAR fieldcat_ln.
fieldcat_ln-fieldname = 'TELF1'. "1
fieldcat_ln-tabname = 'ITAB'.
fieldcat_ln-seltext_l = 'PHONE.NO'.
fieldcat_ln-outputlen = '15'.
fieldcat_ln-just = 'C'.
APPEND fieldcat_ln TO gt_fieldcat.
CLEAR fieldcat_ln.
fieldcat_ln-fieldname = 'TELFX'. "1
fieldcat_ln-tabname = 'ITAB'.
fieldcat_ln-seltext_l = 'FAX.NO'.
fieldcat_ln-outputlen = '15'.
fieldcat_ln-just = 'C'.
APPEND fieldcat_ln TO gt_fieldcat.
**
CLEAR fieldcat_ln.
fieldcat_ln-fieldname = 'ZTERM'. "1
fieldcat_ln-tabname = 'ITAB'.
fieldcat_ln-seltext_l = 'PAYMENT TERMS'.
fieldcat_ln-outputlen = '15'.
fieldcat_ln-just = 'C'.
APPEND fieldcat_ln TO gt_fieldcat.
**
CLEAR fieldcat_ln.
fieldcat_ln-fieldname = 'TEXT1'. "1
fieldcat_ln-tabname = 'ITAB'.
fieldcat_ln-seltext_l = 'TEXT'.
fieldcat_ln-outputlen = '20'.
fieldcat_ln-just = 'C'.
APPEND fieldcat_ln TO gt_fieldcat.
**
*
CLEAR fieldcat_ln.
fieldcat_ln-fieldname = 'ERNAM'. "1
fieldcat_ln-tabname = 'ITAB'.
fieldcat_ln-seltext_l = 'Created By'.
fieldcat_ln-outputlen = '15'.
fieldcat_ln-just = 'C'.
APPEND fieldcat_ln TO gt_fieldcat.
*
CLEAR fieldcat_ln.
fieldcat_ln-fieldname = 'ERDAT'. "1
fieldcat_ln-tabname = 'ITAB'.
fieldcat_ln-seltext_l = 'Created ON'.
fieldcat_ln-outputlen = '15'.
fieldcat_ln-just = 'C'.
APPEND fieldcat_ln TO gt_fieldcat.
CLEAR fieldcat_ln.
fieldcat_ln-fieldname = 'J_1IEXCD'. "1
fieldcat_ln-tabname = 'ITAB'.
fieldcat_ln-seltext_l = 'ECC NO'.
fieldcat_ln-outputlen = '15'.
fieldcat_ln-just = 'C'.
APPEND fieldcat_ln TO gt_fieldcat.
**
CLEAR fieldcat_ln.
fieldcat_ln-fieldname = 'J_1ICSTNO'. "1
fieldcat_ln-tabname = 'ITAB'.
fieldcat_ln-seltext_l = 'CST NO'.
fieldcat_ln-outputlen = '15'.
fieldcat_ln-just = 'C'.
APPEND fieldcat_ln TO gt_fieldcat.
CLEAR fieldcat_ln.
fieldcat_ln-fieldname = 'J_1ILSTNO'. "1
fieldcat_ln-tabname = 'ITAB'.
fieldcat_ln-seltext_l = 'LST NO'.
fieldcat_ln-outputlen = '15'.
fieldcat_ln-just = 'C'.
APPEND fieldcat_ln TO gt_fieldcat.
**
CLEAR fieldcat_ln.
fieldcat_ln-fieldname = 'J_1IPANNO'. "1
fieldcat_ln-tabname = 'ITAB'.
fieldcat_ln-seltext_l = 'PAN NO'.
fieldcat_ln-outputlen = '15'.
fieldcat_ln-just = 'C'.
APPEND fieldcat_ln TO gt_fieldcat.
*
CLEAR fieldcat_ln.
fieldcat_ln-fieldname = 'J_1ISERN'. "1
fieldcat_ln-tabname = 'ITAB'.
fieldcat_ln-seltext_l = 'SERVICE TAX REGN.NO.'.
fieldcat_ln-outputlen = '15'.
fieldcat_ln-just = 'C'.
APPEND fieldcat_ln TO gt_fieldcat.
g_repid = sy-repid.
gs_variant-report = g_repid.
g_save = 'A'.
ENDFORM. "BUILD
*&---------------Form CALL_ALV
DATA t_layout TYPE slis_layout_alv.
*&---------------------------------------------------------------------
*
*& Form CALL_ALV
*&---------------------------------------------------------------------
*
FORM call_alv.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = g_repid
i_save = g_save
is_variant = gs_variant
it_fieldcat = gt_fieldcat[]
it_events = it_events[]
TABLES
t_outtab = itab
EXCEPTIONS
program_error = 1
OTHERS = 2.
ENDFORM. "CALL_ALV
FORM get_events .
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = it_events[]
EXCEPTIONS
list_type_wrong = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
READ TABLE it_events WITH KEY name = slis_ev_top_of_page
INTO it_events.
IF sy-subrc = 0.
MOVE t_formname_top_of_page TO it_events-form.
APPEND it_events.
ENDIF.
ENDFORM. " get_events
*&---------------------------------------------------------------------
*
*& Form sub_comment_build
*&---------------------------------------------------------------------
*
FORM sub_comment_build USING i_top_of_page TYPE slis_t_listheader.
DATA: ls_line TYPE slis_listheader.
CLEAR ls_line.
ls_line-typ = 'H'.
ls_line-info = 'XYZ Limited'.
APPEND ls_line TO i_top_of_page.
ls_line-typ = 'H'.
ls_line-info = 'VENDOR MASTER'.
APPEND ls_line TO i_top_of_page.
CLEAR: ls_line, l_list.
ls_line-typ = 'S'.
ls_line-info = l_list.
APPEND ls_line TO i_top_of_page.
ENDFORM. " sub_comment_build
*&---------------------------------------------------------------------
*
*& Form top_of_page
*&---------------------------------------------------------------------
*
* text
*----------------------------------------------------------------------
*
FORM top_of_page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = t_list_top_of_page.
ENDFORM. "TOP_OF_PAGE
No comments:
Post a Comment