*&---------------------------------------------------------------------*
*& Report ZVVF_MR001_IMPPUR *
*& *
*&---------------------------------------------------------------------*
*& *
*& *
*&---------------------------------------------------------------------*
REPORT ZVVF_MR001_IMPPUR .
**---------------------------------------------------------------------*
* Tables
**---------------------------------------------------------------------*
TABLES: EKKO, "PURCHASING DOC. HEADER
EKPO, "PURCHASING DOC. ITEM
MAKT, "MATERIAL DISCRIPTION
LFA1, "VENDOR MASTER
RSEG, "DOC. ITEM - INCOMING INVOICE
KONV, "CONDITION (TRANSECTION DATA - CLUSTER TABLE)
EKPA. "Partner Roles in Purchasing
**---------------------------------------------------------------------*
* Types Begin with TY_
**---------------------------------------------------------------------*
TYPE-POOLS slis.
TYPES: BEGIN OF TY_HEAD ,
BSART LIKE EKKO-BSART,
AEDAT LIKE EKKO-AEDAT,
EBELN LIKE EKKO-EBELN,
EKGRP LIKE EKKO-EKGRP,
LIFNR LIKE EKKO-LIFNR,
NAME1 LIKE LFA1-Name1,
LIFN2 LIKE EKPA-LIFN2, "FOR PARVW = 'BR'
BNAME1 LIKE LFA1-NAME1,
MATNR LIKE EKPO-MATNR,
MATKL LIKE EKPO-MATKL,
WERKS LIKE EKPO-WERKS,
EBELP LIKE EKPO-EBELP,
MAKTX LIKE MAKT-MAKTX,
KNUMV LIKE EKKO-KNUMV,
BKBETR LIKE KONV-KBETR,
IKBETR LIKE KONV-KBETR,
FKBETR LIKE KONV-KBETR,
AKBETR LIKE KONV-KBETR,
KWERT LIKE KONV-KWERT,
JCDB LIKE RSEG-WRBTR,
JCV1 LIKE RSEG-WRBTR,
JECV LIKE RSEG-WRBTR,
JEDB LIKE RSEG-WRBTR,
JCDS LIKE RSEG-WRBTR,
ZISR LIKE RSEG-WRBTR,
ZSTD LIKE RSEG-WRBTR,
ZADM LIKE RSEG-WRBTR,
ZDOR LIKE RSEG-WRBTR,
ZBAR LIKE RSEG-WRBTR,
ZBKR LIKE RSEG-WRBTR,
ZOCM LIKE RSEG-WRBTR,
ZTRN LIKE RSEG-WRBTR,
ZBPT LIKE RSEG-WRBTR,
ZCLR LIKE RSEG-WRBTR,
ZBEC LIKE RSEG-WRBTR,
ZDEM LIKE RSEG-WRBTR,
ZHAN LIKE RSEG-WRBTR,
ZBRC LIKE RSEG-WRBTR,
ZMIS LIKE RSEG-WRBTR,
ZLCC LIKE RSEG-WRBTR,
ZCRN LIKE RSEG-WRBTR,
ZFLC LIKE RSEG-WRBTR,
ZTHC LIKE RSEG-WRBTR,
ZDOC LIKE RSEG-WRBTR,
ZDTN LIKE RSEG-WRBTR,
END OF TY_HEAD.
TYPES: BEGIN OF TY_KONV,
KNUMV LIKE KONV-KNUMV,
KBETR LIKE KONV-KBETR,
KSCHL LIKE KONV-KSCHL,
KWERT LIKE KONV-KAWRT,
END OF TY_KONV.
TYPES: BEGIN OF TY_KBETR,
* KBETR LIKE KONV-KBETR,
KWERT LIKE KONV-KWERT,
END OF TY_KBETR.
TYPES: BEGIN OF TY_RSEG,
EBELN LIKE RSEG-EBELN,
MATNR LIKE RSEG-MATNR,
WRBTR LIKE RSEG-WRBTR,
KSCHL LIKE RSEG-KSCHL,
LIFNR LIKE RSEG-LIFNR,
END OF TY_RSEG.
TYPES: BEGIN OF TY_NAME1,
NAME1 LIKE LFA1-NAME1,
END OF TY_NAME1.
**---------------------------------------------------------------------*
* Constants Begin with C_
**---------------------------------------------------------------------*
CONSTANTS: st_formname_top_of_page TYPE slis_formname
VALUE 'TOP_OF_PAGE-ALV'.
**---------------------------------------------------------------------*
* Data Begin with W_
**---------------------------------------------------------------------*
*-------- Declarations for ALV Grid.
DATA: it_st_list_top_of_page TYPE slis_t_listheader,
it_st_fieldcat TYPE slis_t_fieldcat_alv,
it_st_events TYPE slis_t_event,
st_layout TYPE slis_layout_alv,
s_status TYPE slis_formname VALUE 'STANDARD_ST01',
s_user_command TYPE slis_formname VALUE 'USER_COMMAND-ALV',
s_repid LIKE sy-repid,
s_save(1) TYPE c,
s_variant LIKE disvariant,
code LIKE disvariant-handle.
**---------------------------------------------------------------------*
*---------------------------------------------------------------------**
* Infotypes ( HR Module Specific)
**---------------------------------------------------------------------*
**---------------------------------------------------------------------*
* Internal tables Begin with IT_
**---------------------------------------------------------------------*
DATA : IT_HEAD TYPE STANDARD TABLE OF TY_HEAD WITH HEADER LINE.
DATA : IT_KONV TYPE STANDARD TABLE OF TY_KONV WITH HEADER LINE.
DATA : IT_KBETR TYPE STANDARD TABLE OF TY_KBETR WITH HEADER LINE.
DATA : IT_RSEG TYPE STANDARD TABLE OF TY_RSEG WITH HEADER LINE.
DATA : IT_NAME1 TYPE STANDARD TABLE OF TY_NAME1 WITH HEADER LINE.
**---------------------------------------------------------------------*
* R A N G E S
**---------------------------------------------------------------------*
ranges: r_loekz for ekko-loekz. " Deletion Indicator
**---------------------------------------------------------------------*
* Select Options Begin with SO_
**---------------------------------------------------------------------*
SELECTION-SCREEN BEGIN OF BLOCK MAIN WITH FRAME TITLE TEXT-001.
SELECTION-SCREEN SKIP 2.
SELECT-OPTIONS : SO_LIFNR FOR EKKO-LIFNR.
SELECT-OPTIONS : SO_EKORG FOR EKKO-EKORG OBLIGATORY.
SELECT-OPTIONS : SO_WERKS FOR EKPO-WERKS OBLIGATORY.
SELECT-OPTIONS : SO_EBELN FOR EKKO-EBELN.
SELECT-OPTIONS : SO_AEDAT FOR EKKO-AEDAT OBLIGATORY.
SELECT-OPTIONS : SO_EKGRP FOR EKKO-EKGRP.
SELECT-OPTIONS : SO_BSART FOR EKKO-BSART DEFAULT 'ZI' OBLIGATORY.
SELECT-OPTIONS : SO_MATKL FOR EKPO-MATKL.
SELECT-OPTIONS : SO_MATNR FOR EKPO-MATNR.
SELECTION-SCREEN SKIP 2.
selection-screen: skip,
begin of line,
comment (15) text-034.
parameters: p_all radiobutton group del.
selection-screen comment 25(9) for field p_all.
parameters: p_del radiobutton group del.
selection-screen comment 45(12) for field p_del.
parameters: p_undel radiobutton group del default 'X'.
selection-screen comment 65(14) for field p_undel.
selection-screen end of line.
SELECTION-SCREEN SKIP 2.
SELECTION-SCREEN END OF BLOCK MAIN.
**---------------------------------------------------------------------*
* Parameters Begin with PR_
**---------------------------------------------------------------------*
**---------------------------------------------------------------------*
* Initialisation
**---------------------------------------------------------------------*
INITIALIZATION.
s_repid = sy-repid.
s_save = 'A'.
PERFORM eventtab_build USING it_st_events[].
PERFORM variant_init.
************************************************************************
* S T A R T O F S E L E C T I O N
************************************************************************
START-OF-SELECTION.
PERFORM GET_DATA.
PERFORM initialize.
PERFORM comment_build USING it_st_list_top_of_page[].
PERFORM fieldcat USING it_st_fieldcat[].
PERFORM layout_build USING st_layout.
PERFORM reuse_alv_list_display.
************************************************************************
* E N D O F S E L E C T I O N
************************************************************************
END-OF-SELECTION.
************************************************************************
* FORM : I N I T I A L I Z E
************************************************************************
form initialize.
clear: r_loekz.
refresh: r_loekz.
*--- Deleted PO's only
if p_del = 'X'.
r_loekz-sign = 'I'.
r_loekz-option = 'EQ'.
r_loekz-low = 'L'.
append r_loekz.
endif.
*--- UnDeleted PO's only
if p_undel = 'X'.
r_loekz-sign = 'E'.
r_loekz-option = 'EQ'.
r_loekz-low = 'L'.
append r_loekz.
endif.
endform. "initialize
*&---------------------------------------------------------------------*
*& Form GET_DATA
*&---------------------------------------------------------------------*
* DATA REQUIRED FROM VERIOUS TABLES
*----------------------------------------------------------------------*
* -->text
*----------------------------------------------------------------------*
FORM GET_DATA.
SELECT
A~EBELN A~AEDAT A~LIFNR A~BSART A~EKGRP A~KNUMV
B~MATNR B~WERKS B~MATKL B~EBELP
C~NAME1
D~MAKTX
E~LIFN2
INTO CORRESPONDING FIELDS OF TABLE IT_HEAD
FROM
EKKO AS A INNER JOIN EKPO AS B
ON A~EBELN = B~EBELN
INNER JOIN LFA1 AS C
ON A~LIFNR = C~LIFNR
LEFT OUTER JOIN MAKT AS D
ON B~MATNR = D~MATNR
LEFT OUTER JOIN EKPA AS E
ON A~EBELN = E~EBELN
AND PARVW = 'BR'
WHERE A~LIFNR IN SO_LIFNR
AND A~EKORG IN SO_EKORG
AND B~WERKS IN SO_WERKS
AND A~EBELN IN SO_EBELN
AND A~AEDAT IN SO_AEDAT
AND A~EKGRP IN SO_EKGRP
AND A~BSART IN SO_BSART
AND B~MATKL IN SO_MATKL
AND B~MATNR IN SO_MATNR
AND B~LOEKZ IN R_LOEKZ
AND ( A~FRGKE = 'Z' OR A~FRGRL <> 'X' ) .
SELECT EBELN MATNR WRBTR KSCHL LIFNR
INTO CORRESPONDING FIELDS OF TABLE IT_RSEG
FROM RSEG
FOR ALL ENTRIES IN IT_HEAD
WHERE EBELN = IT_HEAD-EBELN.
SELECT KNUMV KBETR KSCHL KWERT
INTO CORRESPONDING FIELDS OF TABLE IT_KONV
FROM KONV
FOR ALL ENTRIES IN IT_HEAD
WHERE KNUMV = IT_HEAD-KNUMV.
SELECT NAME1 INTO CORRESPONDING FIELDS OF TABLE IT_NAME1
FROM LFA1
FOR ALL ENTRIES IN IT_HEAD
WHERE LIFNR = IT_HEAD-LIFN2.
LOOP AT IT_HEAD.
LOOP AT IT_NAME1.
AT NEW NAME1.
IF SY-SUBRC = 0.
IT_HEAD-BNAME1 = IT_NAME1-NAME1.
MODIFY IT_HEAD TRANSPORTING BNAME1.
ENDIF.
ENDAT.
ENDLOOP.
LOOP AT IT_KONV WHERE KNUMV = IT_HEAD-KNUMV.
IF ( IT_KONV-KSCHL = 'ZP00' ) OR ( IT_KONV-KSCHL = 'ZP01' ).
IT_HEAD-KWERT = IT_KONV-KWERT.
MODIFY IT_HEAD TRANSPORTING KWERT.
ENDIF.
IF ( IT_KONV-KSCHL = 'ZINS' ).
IF SY-SUBRC = 0.
IT_HEAD-IKBETR = IT_KONV-KBETR.
MODIFY IT_HEAD TRANSPORTING IKBETR.
ENDIF.
ENDIF.
IF ( IT_KONV-KSCHL = 'ZFA1' ) AND ( IT_KONV-KSCHL = 'ZFB1' )
AND ( IT_KONV-KSCHL = 'ZFC1' ).
IF SY-SUBRC = 0.
IT_HEAD-FKBETR = IT_KONV-KBETR.
MODIFY IT_HEAD TRANSPORTING FKBETR.
ENDIF.
ENDIF.
IF ( IT_KONV-KSCHL = 'ZASV' ).
IF SY-SUBRC = 0.
IT_HEAD-AKBETR = IT_KONV-kwert.
MODIFY IT_HEAD TRANSPORTING AKBETR.
ENDIF.
ENDIF.
ENDLOOP.
LOOP AT IT_RSEG WHERE EBELN = IT_HEAD-EBELN.
IF ( IT_RSEG-KSCHL = 'JCDB' ).
IF SY-SUBRC = 0.
IT_HEAD-JCDB = IT_RSEG-WRBTR.
MODIFY IT_HEAD TRANSPORTING JCDB.
ENDIF.
ENDIF.
IF ( IT_RSEG-KSCHL = 'JCV1' ).
IF SY-SUBRC = 0.
IT_HEAD-JCV1 = IT_RSEG-WRBTR.
MODIFY IT_HEAD TRANSPORTING JCV1.
ENDIF.
ENDIF.
IF ( IT_RSEG-KSCHL = 'JECV' ).
IF SY-SUBRC = 0.
IT_HEAD-JECV = IT_RSEG-WRBTR.
MODIFY IT_HEAD TRANSPORTING JECV.
ENDIF.
ENDIF.
IF ( IT_RSEG-KSCHL = 'JEDB' ).
IF SY-SUBRC = 0.
IT_HEAD-JEDB = IT_RSEG-WRBTR.
MODIFY IT_HEAD TRANSPORTING JEDB.
ENDIF.
ENDIF.
IF ( IT_RSEG-KSCHL = 'JCDS' ).
IF SY-SUBRC = 0.
IT_HEAD-JCDS = IT_RSEG-WRBTR.
MODIFY IT_HEAD TRANSPORTING JCDS.
ENDIF.
ENDIF.
IF ( IT_RSEG-KSCHL = 'ZISR' ).
IF SY-SUBRC = 0.
IT_HEAD-ZISR = IT_RSEG-WRBTR.
MODIFY IT_HEAD TRANSPORTING ZISR.
ENDIF.
ENDIF.
IF ( IT_RSEG-KSCHL = 'ZSTD' ).
IF SY-SUBRC = 0.
IT_HEAD-ZSTD = IT_RSEG-WRBTR.
MODIFY IT_HEAD TRANSPORTING ZSTD.
ENDIF.
ENDIF.
IF ( IT_RSEG-KSCHL = 'ZADM' ).
IF SY-SUBRC = 0.
IT_HEAD-ZADM = IT_RSEG-WRBTR.
MODIFY IT_HEAD TRANSPORTING ZADM.
ENDIF.
ENDIF.
IF ( IT_RSEG-KSCHL = 'ZDOR' ).
IF SY-SUBRC = 0.
IT_HEAD-ZDOR = IT_RSEG-WRBTR.
MODIFY IT_HEAD TRANSPORTING ZDOR.
ENDIF.
ENDIF.
IF ( IT_RSEG-KSCHL = 'ZBAR' ).
IF SY-SUBRC = 0.
IT_HEAD-ZBAR = IT_RSEG-WRBTR.
MODIFY IT_HEAD TRANSPORTING ZBAR.
ENDIF.
ENDIF.
IF ( IT_RSEG-KSCHL = 'ZBKR' ).
IF SY-SUBRC = 0.
IT_HEAD-ZBKR = IT_RSEG-WRBTR.
MODIFY IT_HEAD TRANSPORTING ZBKR.
ENDIF.
ENDIF.
IF ( IT_RSEG-KSCHL = 'ZOCM' ).
IF SY-SUBRC = 0.
IT_HEAD-ZOCM = IT_RSEG-WRBTR.
MODIFY IT_HEAD TRANSPORTING ZOCM.
ENDIF.
ENDIF.
IF ( IT_RSEG-KSCHL = 'ZTRN' ).
IF SY-SUBRC = 0.
IT_HEAD-ZTRN = IT_RSEG-WRBTR.
MODIFY IT_HEAD TRANSPORTING ZTRN.
ENDIF.
ENDIF.
IF ( IT_RSEG-KSCHL = 'ZBPT' ).
IF SY-SUBRC = 0.
IT_HEAD-ZBPT = IT_RSEG-WRBTR.
MODIFY IT_HEAD TRANSPORTING ZBPT.
ENDIF.
ENDIF.
IF ( IT_RSEG-KSCHL = 'ZCLR' ).
IF SY-SUBRC = 0.
IT_HEAD-ZCLR = IT_RSEG-WRBTR.
MODIFY IT_HEAD TRANSPORTING ZCLR.
ENDIF.
ENDIF.
IF ( IT_RSEG-KSCHL = 'ZBEC' ).
IF SY-SUBRC = 0.
IT_HEAD-ZBEC = IT_RSEG-WRBTR.
MODIFY IT_HEAD TRANSPORTING ZBEC.
ENDIF.
ENDIF.
IF ( IT_RSEG-KSCHL = 'ZDEM' ).
IF SY-SUBRC = 0.
IT_HEAD-ZDEM = IT_RSEG-WRBTR.
MODIFY IT_HEAD TRANSPORTING ZDEM.
ENDIF.
ENDIF.
IF ( IT_RSEG-KSCHL = 'ZHAN' ).
IF SY-SUBRC = 0.
IT_HEAD-ZHAN = IT_RSEG-WRBTR.
MODIFY IT_HEAD TRANSPORTING ZHAN.
ENDIF.
ENDIF.
IF ( IT_RSEG-KSCHL = 'ZBRC' ).
IF SY-SUBRC = 0.
IT_HEAD-ZBRC = IT_RSEG-WRBTR.
MODIFY IT_HEAD TRANSPORTING ZBRC.
ENDIF.
ENDIF.
IF ( IT_RSEG-KSCHL = 'ZMIS' ).
IF SY-SUBRC = 0.
IT_HEAD-ZMIS = IT_RSEG-WRBTR.
MODIFY IT_HEAD TRANSPORTING ZMIS.
ENDIF.
ENDIF.
IF ( IT_RSEG-KSCHL = 'ZLCC' ).
IF SY-SUBRC = 0.
IT_HEAD-ZLCC = IT_RSEG-WRBTR.
MODIFY IT_HEAD TRANSPORTING ZLCC.
ENDIF.
ENDIF.
IF ( IT_RSEG-KSCHL = 'ZCRN' ).
IF SY-SUBRC = 0.
IT_HEAD-ZCRN = IT_RSEG-WRBTR.
MODIFY IT_HEAD TRANSPORTING ZCRN.
ENDIF.
ENDIF.
IF ( IT_RSEG-KSCHL = 'ZFLC' ).
IF SY-SUBRC = 0.
IT_HEAD-ZFLC = IT_RSEG-WRBTR.
MODIFY IT_HEAD TRANSPORTING ZFLC.
ENDIF.
ENDIF.
IF ( IT_RSEG-KSCHL = 'ZFLC' ).
IF SY-SUBRC = 0.
IT_HEAD-ZFLC = IT_RSEG-WRBTR.
MODIFY IT_HEAD TRANSPORTING ZFLC.
ENDIF.
ENDIF.
IF ( IT_RSEG-KSCHL = 'ZDOC' ).
IF SY-SUBRC = 0.
IT_HEAD-ZDOC = IT_RSEG-WRBTR.
MODIFY IT_HEAD TRANSPORTING ZDOC.
ENDIF.
ENDIF.
IF ( IT_RSEG-KSCHL = 'ZDTN' ).
IF SY-SUBRC = 0.
IT_HEAD-ZDTN = IT_RSEG-WRBTR.
MODIFY IT_HEAD TRANSPORTING ZDTN.
ENDIF.
ENDIF.
ENDLOOP.
ENDLOOP.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form COMMENT_BUILD
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text *----------------------------------------------------------------------* FORM comment_build USING p_it_st_list_top_of_page TYPE slis_t_listheader .. DATA: ls_line TYPE slis_listheader, mix_date(130) type c, mix(130) type c, mix_ekorg(40) type c, mixekorg(40) type c, mix_werks(40) type c, mixwerks(40) type c, mix_ebeln(40) type c, mixebeln(40) type c, mix_aedat(40) type c, mixaedat(40) type c, mix_ekgrp(40) type c, mixekgrp(40) type c, mixbsart(40) type c, mix_bsart(40) type c, mixmatkl(40) type c, mix_matkl(40) type c, mixmatnr(40) type c, mix_matnr(40) type c, temp(40) type c. REFRESH p_it_st_list_top_of_page. CLEAR ls_line. ls_line-typ = 'H'. ls_line-info = 'Import Purchases Report'. APPEND ls_line TO p_it_st_list_top_of_page. *----- Display Vendor concatenate so_lifnr-low ' To ' so_lifnr-high into mix_date SEPARATED BY SPACE. concatenate 'Vendor :' ' ' mix_date into mix SEPARATED BY SPACE. ls_line-typ = 'S'. ls_line-info = mix. APPEND ls_line TO p_it_st_list_top_of_page. *----- Display Pur. Org. concatenate so_ekorg-low ' To ' so_ekorg-high into mix_ekorg SEPARATED BY SPACE. concatenate 'Pur. Org. :' ' ' mix_ekorg into mixekorg SEPARATED BY SPACE . ls_line-typ = 'S'. ls_line-info = mixekorg. APPEND ls_line TO p_it_st_list_top_of_page. *----- Display Plant concatenate so_werks-low ' To ' so_werks-high into mix_werks SEPARATED BY SPACE. concatenate 'Plant :' ' ' mix_werks into mixwerks SEPARATED BY SPACE . ls_line-typ = 'S'. ls_line-info = mixwerks. APPEND ls_line TO p_it_st_list_top_of_page. *----- Display Document No. concatenate so_ebeln-low ' To ' so_ebeln-high into mix_ebeln SEPARATED BY SPACE. concatenate 'Document. No. :' ' ' mix_ebeln into mixebeln SEPARATED BY SPACE . ls_line-typ = 'S'. ls_line-info = mixebeln. APPEND ls_line TO p_it_st_list_top_of_page. *----- Display Document Date concatenate so_aedat-low ' To ' so_aedat-high into mix_aedat SEPARATED BY SPACE. concatenate 'Document. Date :' ' ' mix_aedat into mixaedat SEPARATED BY SPACE . ls_line-typ = 'S'. ls_line-info = mixaedat. APPEND ls_line TO p_it_st_list_top_of_page. *----- Display Purchasing Group concatenate so_ekgrp-low ' To ' so_ekgrp-high into mix_ekgrp SEPARATED BY SPACE. concatenate 'Purchasing Group :' ' ' mix_ekgrp into mixekgrp SEPARATED BY SPACE. ls_line-typ = 'S'. ls_line-info = mixekgrp. APPEND ls_line TO p_it_st_list_top_of_page. *----- Display Document Type concatenate so_bsart-low ' To ' so_bsart-high into mix_bsart SEPARATED BY SPACE. concatenate 'Document Type :' ' ' mix_bsart into mixbsart SEPARATED BY SPACE. ls_line-typ = 'S'. ls_line-info = mixbsart. APPEND ls_line TO p_it_st_list_top_of_page. *----- Display Material Group concatenate so_matkl-low ' To ' so_matkl-high into mix_matkl SEPARATED BY SPACE. concatenate 'Material Group :' ' ' mix_matkl into mixmatkl SEPARATED BY SPACE. ls_line-typ = 'S'. ls_line-info = mixmatkl. APPEND ls_line TO p_it_st_list_top_of_page. *----- Display Material concatenate so_matnr-low ' To ' so_matnr-high into mix_matnr SEPARATED BY SPACE. concatenate 'Material :' ' ' mix_matkl into mixmatnr SEPARATED BY SPACE. ls_line-typ = 'S'. ls_line-info = mixmatnr. APPEND ls_line TO p_it_st_list_top_of_page. ENDFORM. " COMMENT_BUILD *&--------------------------------------------------------------------* *& Form TOP_OF_PAGE-ALV *&--------------------------------------------------------------------* * text *---------------------------------------------------------------------* FORM top_of_page-alv. * CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE' EXPORTING it_list_commentary = it_st_list_top_of_page. ENDFORM. "TOP_OF_PAGE-ALV *&---------------------------------------------------------------------* *& Form FIELDCAT *&---------------------------------------------------------------------* * -->P_IT_ST_FIELDCAT[] text
*----------------------------------------------------------------------*
FORM fieldcat USING p_it_st_fieldcat TYPE slis_t_fieldcat_alv.
DATA: ls_fieldcat TYPE slis_fieldcat_alv.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'BSART'.
ls_fieldcat-datatype = 'CHAR'.
ls_fieldcat-outputlen = 4.
ls_fieldcat-seltext_m = text-002 .
ls_fieldcat-rollname = 'BSART'.
ls_fieldcat-key = 'X'.
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'EBELN'.
ls_fieldcat-rollname = 'EBELN'.
ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 10.
ls_fieldcat-key = 'X'.
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'AEDAT'.
ls_fieldcat-rollname = 'AEDAT'.
ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 8.
ls_fieldcat-key = 'X'.
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'EKGRP'.
ls_fieldcat-rollname = 'EKGRP'.
ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 3.
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'EBELP'.
ls_fieldcat-rollname = 'EBELP'.
ls_fieldcat-ddictxt = 'L'.
* ls_fieldcat-outputlen = 3.
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'LIFNR'.
ls_fieldcat-rollname = 'LIFNR'.
ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 10.
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'NAME1'.
ls_fieldcat-rollname = 'NAME1'.
ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-seltext_m = 'Vendor Name'.
ls_fieldcat-outputlen = 35.
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'LIFN2'.
* ls_fieldcat-rollname = 'LIFN2'.
ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-seltext_m = TEXT-100.
ls_fieldcat-outputlen = 10.
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'BNAME1'.
ls_fieldcat-rollname = 'BNAME1'.
ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-seltext_m = 'Broker''s Name' .
ls_fieldcat-outputlen = 35.
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'MATNR'.
ls_fieldcat-rollname = 'MATNR'.
ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 18.
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'MAKTX'.
ls_fieldcat-rollname = 'MAKTX'.
ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 40.
APPEND ls_fieldcat TO p_it_st_fieldcat.
* CLEAR ls_fieldcat.
* ls_fieldcat-fieldname = 'BKBETR'.
* ls_fieldcat-rollname = 'BKBETR'.
* ls_fieldcat-ddictxt = 'L'.
* ls_fieldcat-outputlen = 11.
* ls_fieldcat-seltext_m = text-003 .
* APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'KWERT'.
* ls_fieldcat-rollname = 'KWERT'.
ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 13.
ls_fieldcat-seltext_m = text-099 .
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'IKBETR'.
ls_fieldcat-rollname = 'IKBETR'.
ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 11.
ls_fieldcat-seltext_m = text-004 .
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'FKBETR'.
ls_fieldcat-rollname = 'FKBETR'.
ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 11.
ls_fieldcat-seltext_m = text-005 .
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'AKBETR'.
ls_fieldcat-rollname = 'AKBETR'.
ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 11.
ls_fieldcat-seltext_m = text-006 .
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'JCDB'.
ls_fieldcat-rollname = 'JCDB'.
ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 13.
ls_fieldcat-seltext_m = text-008 .
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'JCV1'.
ls_fieldcat-rollname = 'JCV1'.
ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 13.
ls_fieldcat-seltext_m = text-009 .
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'JECV'.
ls_fieldcat-rollname = 'JECV'.
ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 13.
ls_fieldcat-seltext_m = text-010 .
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'JEDB'.
ls_fieldcat-rollname = 'JEDB'.
ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 13.
ls_fieldcat-seltext_m = text-011 .
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'JCDS'.
ls_fieldcat-rollname = 'JCDS'.
ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 13.
ls_fieldcat-seltext_m = text-012 .
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'ZISR'.
ls_fieldcat-rollname = 'ZISR'.
ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 13.
ls_fieldcat-seltext_m = text-013 .
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'ZSTD'.
ls_fieldcat-rollname = 'ZSTD'.
ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 13.
ls_fieldcat-seltext_m = text-014 .
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'ZADM'.
ls_fieldcat-rollname = 'ZADM'.
ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 13.
ls_fieldcat-seltext_m = text-015 .
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'ZDOR'.
ls_fieldcat-rollname = 'ZDOR'.
ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 13.
ls_fieldcat-seltext_m = text-016 .
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'ZBAR'.
ls_fieldcat-rollname = 'ZBAR'.
ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 13.
ls_fieldcat-seltext_m = text-017 .
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'ZBKR'.
ls_fieldcat-rollname = 'ZBKR'.
ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 13.
ls_fieldcat-seltext_m = text-018 .
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'ZOCM'.
ls_fieldcat-rollname = 'ZOCM'.
ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 13.
ls_fieldcat-seltext_m = text-019 .
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'ZTRN'.
ls_fieldcat-rollname = 'ZTRN'.
ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 13.
ls_fieldcat-seltext_m = text-020 .
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'ZBPT'.
ls_fieldcat-rollname = 'ZBPT'.
ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 13.
ls_fieldcat-seltext_m = text-021 .
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'ZCLR'.
ls_fieldcat-rollname = 'ZCLR'.
ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 13.
ls_fieldcat-seltext_m = text-022 .
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'ZBEC'.
ls_fieldcat-rollname = 'ZBEC'.
ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 13.
ls_fieldcat-seltext_m = text-023 .
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'ZDEM'.
ls_fieldcat-rollname = 'ZDEM'.
ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 13.
ls_fieldcat-seltext_m = text-024 .
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'ZHAN'.
ls_fieldcat-rollname = 'ZHAN'.
ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 13.
ls_fieldcat-seltext_m = text-025 .
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'ZBRC'.
ls_fieldcat-rollname = 'ZBRC'.
ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 13.
ls_fieldcat-seltext_m = text-026 .
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'ZMIS'.
ls_fieldcat-rollname = 'ZMIS'.
ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 13.
ls_fieldcat-seltext_m = text-027 .
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'ZLCC'.
ls_fieldcat-rollname = 'ZLCC'.
ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 13.
ls_fieldcat-seltext_m = text-028 .
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'ZCRN'.
ls_fieldcat-rollname = 'ZCRN'.
ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 13.
ls_fieldcat-seltext_m = text-029 .
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'ZFLC'.
ls_fieldcat-rollname = 'ZFLC'.
ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 13.
ls_fieldcat-seltext_m = text-030 .
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'ZTHC'.
ls_fieldcat-rollname = 'ZTHC'.
ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 13.
ls_fieldcat-seltext_m = text-031 .
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'ZDOC'.
ls_fieldcat-rollname = 'ZDOC'.
ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 13.
ls_fieldcat-seltext_m = text-032 .
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'ZDTN'.
ls_fieldcat-rollname = 'ZDTN'.
ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 13.
ls_fieldcat-seltext_m = text-033 .
APPEND ls_fieldcat TO p_it_st_fieldcat.
ENDFORM. " FIELDCAT
*&---------------------------------------------------------------------*
*& Form LAYOUT_BUILD
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_ST_LAYOUT text
*----------------------------------------------------------------------*
FORM layout_build USING p_st_layout TYPE slis_layout_alv.
p_st_layout-box_fieldname = 'SELK'. " Checkbox
p_st_layout-get_selinfos = 'X'.
p_st_layout-f2code = 'PICK' . " Doppelklickfunktion
p_st_layout-confirmation_prompt = 'X'. "Sicherheitsabfrage
p_st_layout-key_hotspot = 'X'. "Schlüssel als Hotspot
p_st_layout-info_fieldname = 'COL'. "Zeilenfarbe
ENDFORM. " LAYOUT_BUILD
*&---------------------------------------------------------------------*
*& Form REUSE_ALV_LIST_DISPLAY
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM reuse_alv_list_display .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_background_id = 'ALV_BACKGROUND'
i_callback_program = s_repid
* I_CALLBACK_PF_STATUS_SET = S_STATUS
* I_CALLBACK_USER_COMMAND = S_USER_COMMAND
* I_STRUCTURE_NAME = ''
* IS_LAYOUT = ST_LAYOUT
it_fieldcat = it_st_fieldcat[]
* IT_EXCLUDING =
* IT_SPECIAL_GROUPS = ST_SP_GROUP
* IT_SORT =
* IT_FILTER =
* IS_SEL_HIDE =
* I_DEFAULT = 'X'
* I_SAVE = S_SAVE
* IS_VARIANT = S_VARIANT
IT_EVENTS = IT_ST_EVENTS[]
* IT_EVENT_EXIT =
* IS_PRINT =
* IS_REPREP_ID =
* I_SCREEN_START_COLUMN = 0
* I_SCREEN_START_LINE = 0
* I_SCREEN_END_COLUMN = 0
* I_SCREEN_END_LINE = 0
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = it_HEAD.
ENDFORM. " REUSE_ALV_LIST_DISPLAY
*&---------------------------------------------------------------------*
*& Form EVENTTAB_BUILD
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_IT_ST_EVENTS[] text
*----------------------------------------------------------------------*
FORM eventtab_build USING p_st_events TYPE slis_t_event .
DATA: ls_event TYPE slis_alv_event.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = p_st_events.
READ TABLE p_st_events WITH KEY name = slis_ev_top_of_page
INTO ls_event.
IF sy-subrc = 0.
MOVE st_formname_top_of_page TO ls_event-form.
APPEND ls_event TO p_st_events.
ENDIF.
READ TABLE p_st_events WITH KEY name = slis_ev_user_command
INTO ls_event.
IF sy-subrc = 0.
MOVE s_user_command TO ls_event-form.
APPEND ls_event TO p_st_events.
ENDIF.
* READ TABLE p_st_events WITH KEY name = slis_ev_pf_status_set
* INTO ls_event.
*
* IF sy-subrc = 0.
* MOVE s_status TO ls_event-form.
* APPEND ls_event TO p_st_events.
* ENDIF.
ENDFORM. " EVENTTAB_BUILD
*&---------------------------------------------------------------------*
*& Form VARIANT_INIT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text *----------------------------------------------------------------------* FORM variant_init . CLEAR s_variant. s_variant-report = s_repid. s_variant-handle = code. ENDFORM. " VARIANT_INIT
No comments:
Post a Comment