Go on link..

link us with ...

Thursday, December 30, 2010

REPORT ON DETAILS OF IMPORT PURCHASE

*&---------------------------------------------------------------------*
*& Report ZVVF_MR017_IMPPUR *
*& *
*&---------------------------------------------------------------------*
*& *
*& *
*&---------------------------------------------------------------------*

REPORT ZVVF_MR017_IMPPUR .

*---------------------------------------------------------------------**
* MODULE MM.
**---------------------------------------------------------------------*
* Objective : REPORT ON DETAILS OF IMPORT PURCHASE

** Program : Updates Tables ( ) Downloads data ( ) **
* Outputs List ( ) **

* Technical Spec No

* Date Created --
*** Author
* Developer
*** Location ***
* LDB .....
**---------------------------------------------------------------------*
* External Dependencies
**---------------------------------------------------------------------*
*
**---------------------------------------------------------------------*
* Amendment History
**---------------------------------------------------------------------*
* Who Change ID Reason
*** ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
*---------------------------------------------------------------------**


**---------------------------------------------------------------------*
* 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,
ekorg like ekko-ekorg,
LIFNR LIKE EKKO-LIFNR,
WAERS LIKE EKKO-WAERS,
WKURS LIKE EKKO-WKURS,
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,
EFFWR LIKE EKPO-EFFWR,
MAKTX LIKE MAKT-MAKTX,
KNUMV LIKE EKKO-KNUMV,
BKWERT LIKE VBRL-netwr,
IKWERT LIKE VBRL-netwr,
FKWERT LIKE VBRL-netwr,
AKWERT LIKE VBRL-netwr,
JCDB like VBRL-netwr,
JCV1 LIKE VBRL-netwr,
JECV LIKE VBRL-netwr,
JEDB LIKE VBRL-netwr,
JCDS LIKE VBRL-netwr,
ZISR LIKE VBRL-netwr,
ZSTD LIKE VBRL-netwr,
ZADM LIKE VBRL-netwr,
ZDOR LIKE VBRL-netwr,
ZBAR LIKE VBRL-netwr,
ZBKR LIKE VBRL-netwr,
ZOCM LIKE VBRL-netwr,
ZTRN LIKE VBRL-netwr,
ZBPT LIKE VBRL-netwr,
ZCLR LIKE VBRL-netwr,
ZBEC LIKE VBRL-netwr,
ZDEM LIKE VBRL-netwr,
ZHAN LIKE VBRL-netwr,
ZBRC LIKE VBRL-netwr,
ZMIS LIKE VBRL-netwr,
ZLCC LIKE VBRL-netwr,
ZCRN LIKE VBRL-netwr,
ZFLC LIKE VBRL-netwr,
ZTHC LIKE VBRL-netwr,
ZDOC LIKE VBRL-netwr,
ZDTN LIKE VBRL-netwr,
ZINT LIKE VBRL-NETWR,
ZCOM LIKE VBRL-NETWR,
ZST1 LIKE VBRL-NETWR,
ZBR1 LIKE VBRL-NETWR,
ZLCA LIKE VBRL-NETWR,
ZFIR LIKE VBRL-NETWR,
ZLCM LIKE VBRL-NETWR,
LOEKZ LIKE EKPO-LOEKZ,
BEDAT LIKE EKKO-BEDAT,
KSCHL LIKE KONV-KSCHL,
KWERT LIKE KONV-KWERT,
END OF TY_HEAD.

TYPES: BEGIN OF TY_KONV,
KNUMV LIKE KONV-KNUMV,
KBETR LIKE KONV-KBETR,
KSCHL LIKE KONV-KSCHL,
KWERT like VBRL-NETWR,
KAWRT LIKE KONV-KAWRT,
END OF TY_KONV.


TYPES: BEGIN OF TY_KBETR,
KWERT LIKE KONV-KWERT,
END OF TY_KBETR.

TYPES: BEGIN OF TY_NAME1,
NAME1 LIKE LFA1-NAME1,
LIFnr LIKE EKPA-LIFN2,
END OF TY_NAME1.


types: begin of T_CURR,
WAERS LIKE EKKO-WAERS,
WKURS LIKE EKKO-WKURS,
EBELN LIKE EKKO-EBELN,
end of t_CURR.


**---------------------------------------------------------------------*
* 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.
DATA: G_VARIANT LIKE DISVARIANT.

**---------------------------------------------------------------------*
*---------------------------------------------------------------------**
* 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_NAME1 TYPE STANDARD TABLE OF TY_NAME1 WITH HEADER LINE.
DATA : i_CURR type STANDARD table of t_CURR 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 OBLIGATORY DEFAULT 'ZI'.
SELECT-OPTIONS : SO_MATKL FOR EKPO-MATKL.
SELECT-OPTIONS : SO_MATNR FOR EKPO-MATNR.
PARAMETERS : PR_WAERS LIKE EKKO-WAERS OBLIGATORY.
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.

**---------------------------------------------------------------------*
* AT SELECTION SCREEN
**---------------------------------------------------------------------*

AT SELECTION-SCREEN.

IF ( SO_BSART-LOW NE 'ZI' ) AND ( SO_BSART-HIGH NE 'ZI' ).

MESSAGE 'Document Type Not Allowed.' TYPE 'E'.

ENDIF.

**---------------------------------------------------------------------*
* 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 initialize.

PERFORM GET_DATA.

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.
*----ALL TYPE
if p_all = 'X'.
r_loekz-sign = 'I'.
r_loekz-option = 'EQ'.
r_loekz-low = ' '.
r_loekz-high = 'L'.

append r_loekz.

endif.
*--- Deleted PO's only
if p_del = 'X'.
r_loekz-sign = 'I'.
r_loekz-option = 'EQ'.
r_loekz-low = 'L'.
r_loekz-high = 'L'.
append r_loekz.
endif.
*--- UnDeleted PO's only
if p_undel = 'X'.
r_loekz-sign = 'E'.
r_loekz-option = 'EQ'.
r_loekz-low = ' '.
r_loekz-high = ' '.
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~ekorg A~KNUMV
A~WAERS A~WKURS
B~MATNR B~WERKS B~MATKL B~EBELP B~EFFWR
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 B~MATKL IN SO_MATKL
AND B~MATNR IN SO_MATNR
AND A~BSART IN SO_BSART
* AND A~WAERS EQ PR_WAERS
AND B~LOEKZ between R_LOEKZ-low and R_LOEKZ-high.

LOOP AT IT_HEAD.

IF PR_WAERS EQ 'INR'.
IT_HEAD-EFFWR = IT_HEAD-EFFWR * IT_HEAD-WKURS.
MODIFY IT_HEAD.
ENDIF.

ENDLOOP.

SORT IT_HEAD BY EBELN AEDAT KNUMV.

SELECT WAERS WKURS INTO CORRESPONDING FIELDS OF TABLE I_CURR
FROM EKKO
WHERE WAERS = PR_WAERS.
*AND EBELN = IT_HEAD-EBELN.
IF SY-SUBRC ne 0.
MESSAGE 'Record not Found.' Type 'E'.
ENDIF.

DELETE ADJACENT duplicates FROM I_CURR COMPARING WAERS.


SELECT KNUMV KBETR KSCHL KWERT KAWRT
INTO CORRESPONDING FIELDS OF TABLE IT_KONV
FROM KONV
FOR ALL ENTRIES IN IT_HEAD
WHERE KNUMV = IT_HEAD-KNUMV.

SORT IT_KONV BY KNUMV KSCHL.

SELECT NAME1 LIFNR INTO CORRESPONDING FIELDS OF TABLE IT_NAME1
FROM LFA1
FOR ALL ENTRIES IN IT_HEAD
WHERE LIFNR = IT_HEAD-LIFN2.


LOOP AT IT_HEAD.

shift it_head-matnr left deleting leading '0'.
modify it_head.

shift it_head-LIFNR left deleting leading '0'.
modify it_head.

LOOP AT IT_NAME1 where lifnr = it_head-lifn2 AND LIFNR NE SPACE.

AT NEW NAME1.

IF SY-SUBRC = 0.

IT_HEAD-BNAME1 = IT_NAME1-NAME1.

MODIFY IT_HEAD TRANSPORTING BNAME1.
clear it_name1-name1.

ENDIF.

ENDAT.
clear it_name1-name1.

ENDLOOP.

shift it_head-LIFN2 left deleting leading '0'.
modify it_head.

LOOP AT IT_KONV WHERE KNUMV = IT_HEAD-KNUMV.

LOOP AT I_CURR.

if i_curr-waers NE 'USD'.

IF I_CURR-WKURS NE 0 OR I_CURR-WKURS NE SPACE.

IT_KONV-KWERT = IT_KONV-KWERT * IT_HEAD-WKURS.
IT_KONV-KWERT = IT_KONV-KWERT / I_CURR-WKURS.

ENDIF.
endif.
endloop.

IF ( IT_KONV-KSCHL = 'ZP00' ) OR ( IT_KONV-KSCHL = 'ZP01' ).

IT_HEAD-BKWERT = IT_KONV-KWERT.
MODIFY IT_HEAD TRANSPORTING BKWERT WHERE KNUMV = IT_KONV-KNUMV.
ENDIF.

IF ( IT_KONV-KSCHL = 'ZINS' ).
IT_HEAD-IKWERT = IT_KONV-KWERT.
MODIFY IT_HEAD TRANSPORTING IKWERT WHERE KNUMV = IT_KONV-KNUMV.

ENDIF.


IF ( IT_KONV-KSCHL = 'ZFA1' ) OR
( IT_KONV-KSCHL = 'ZFB1' ) OR
( IT_KONV-KSCHL = 'ZFC1' ).

IT_HEAD-FKWERT = IT_KONV-KWERT.
MODIFY IT_HEAD TRANSPORTING FKWERT WHERE KNUMV = IT_KONV-KNUMV.

ENDIF.


IF ( IT_KONV-KSCHL = 'ZASV' ).

IT_HEAD-AKWERT = IT_KONV-KWERT.
MODIFY IT_HEAD TRANSPORTING AKWERT WHERE KNUMV = IT_KONV-KNUMV.

ENDIF.


IF ( IT_KONV-KSCHL = 'JCDB' ).
IT_HEAD-JCDB = IT_KONV-KWERT.
MODIFY IT_HEAD TRANSPORTING JCDB WHERE KNUMV = IT_KONV-KNUMV.

ENDIF.


IF ( IT_KONV-KSCHL = 'JCV1' ).
IT_HEAD-JCV1 = IT_KONV-KWERT.
MODIFY IT_HEAD TRANSPORTING JCV1 WHERE KNUMV = IT_KONV-KNUMV.

ENDIF.



IF ( IT_KONV-KSCHL = 'JECV' ).
IT_HEAD-JECV = IT_KONV-KWERT.
MODIFY IT_HEAD TRANSPORTING JECV WHERE KNUMV = IT_KONV-KNUMV.

ENDIF.



IF ( IT_KONV-KSCHL = 'JEDB' ).
IT_HEAD-JEDB = IT_KONV-KWERT.
MODIFY IT_HEAD TRANSPORTING JEDB WHERE KNUMV = IT_KONV-KNUMV.

ENDIF.



IF ( IT_KONV-KSCHL = 'JCDS' ).
IT_HEAD-JCDS = IT_KONV-KWERT.
MODIFY IT_HEAD TRANSPORTING JCDS WHERE KNUMV = IT_KONV-KNUMV.

ENDIF.



IF ( IT_KONV-KSCHL = 'ZISR' ).
IT_HEAD-ZISR = IT_KONV-KWERT.
MODIFY IT_HEAD TRANSPORTING ZISR WHERE KNUMV = IT_KONV-KNUMV.

ENDIF.



IF ( IT_KONV-KSCHL = 'ZST1' ) OR
( IT_KONV-KSCHL = 'ZST2' ) .
IT_HEAD-ZSTD = IT_KONV-KWERT.
MODIFY IT_HEAD TRANSPORTING ZSTD WHERE KNUMV = IT_KONV-KNUMV.

ENDIF.



IF ( IT_KONV-KSCHL = 'ZADM' ).
IT_HEAD-ZADM = IT_KONV-KWERT.
MODIFY IT_HEAD TRANSPORTING ZADM WHERE KNUMV = IT_KONV-KNUMV.

ENDIF.



IF ( IT_KONV-KSCHL = 'ZDOR' ).
IT_HEAD-ZDOR = IT_KONV-KWERT.
MODIFY IT_HEAD TRANSPORTING ZDOR WHERE KNUMV = IT_KONV-KNUMV.

ENDIF.



IF ( IT_KONV-KSCHL = 'ZBAR' ).
IT_HEAD-ZBAR = IT_KONV-KWERT.
MODIFY IT_HEAD TRANSPORTING ZBAR WHERE KNUMV = IT_KONV-KNUMV.

ENDIF.



IF ( IT_KONV-KSCHL = 'ZBKR' ).
IT_HEAD-ZBKR = IT_KONV-KWERT.
MODIFY IT_HEAD TRANSPORTING ZBKR WHERE KNUMV = IT_KONV-KNUMV.

ENDIF.



IF ( IT_KONV-KSCHL = 'ZOCM' ).
IT_HEAD-ZOCM = IT_KONV-KWERT.
MODIFY IT_HEAD TRANSPORTING ZOCM WHERE KNUMV = IT_KONV-KNUMV.

ENDIF.



IF ( IT_KONV-KSCHL = 'ZTRN' ).
IT_HEAD-ZTRN = IT_KONV-KWERT.
MODIFY IT_HEAD TRANSPORTING ZTRN WHERE KNUMV = IT_KONV-KNUMV.

ENDIF.



IF ( IT_KONV-KSCHL = 'ZBPT' ).
IT_HEAD-ZBPT = IT_KONV-KWERT.
MODIFY IT_HEAD TRANSPORTING ZBPT WHERE KNUMV = IT_KONV-KNUMV.

ENDIF.



IF ( IT_KONV-KSCHL = 'ZCLR' ) OR
( IT_KONV-KSCHL = 'ZCLV' ).
IT_HEAD-ZCLR = IT_KONV-KWERT.
MODIFY IT_HEAD TRANSPORTING ZCLR WHERE KNUMV = IT_KONV-KNUMV.

ENDIF.



IF ( IT_KONV-KSCHL = 'ZBEC' ).
IT_HEAD-ZBEC = IT_KONV-KWERT.
MODIFY IT_HEAD TRANSPORTING ZBEC WHERE KNUMV = IT_KONV-KNUMV.

ENDIF.



IF ( IT_KONV-KSCHL = 'ZDEM' ).
IT_HEAD-ZDEM = IT_KONV-KWERT.
MODIFY IT_HEAD TRANSPORTING ZDEM WHERE KNUMV = IT_KONV-KNUMV.

ENDIF.



IF ( IT_KONV-KSCHL = 'ZHAN' ).
IT_HEAD-ZHAN = IT_KONV-KWERT.
MODIFY IT_HEAD TRANSPORTING ZHAN WHERE KNUMV = IT_KONV-KNUMV.

ENDIF.



IF ( IT_KONV-KSCHL = 'ZBR1' ) OR
( IT_KONV-KSCHL = 'ZBR2' ).
IT_HEAD-ZBRC = IT_KONV-KWERT.
MODIFY IT_HEAD TRANSPORTING ZBRC WHERE KNUMV = IT_KONV-KNUMV.

ENDIF.



IF ( IT_KONV-KSCHL = 'ZMIS' ).
IT_HEAD-ZMIS = IT_KONV-KWERT.
MODIFY IT_HEAD TRANSPORTING ZMIS WHERE KNUMV = IT_KONV-KNUMV.

ENDIF.



IF ( IT_KONV-KSCHL = 'ZLCC' ) OR
( IT_KONV-KSCHL = 'ZLCA' ).
IT_HEAD-ZLCC = IT_KONV-KWERT.
MODIFY IT_HEAD TRANSPORTING ZLCC WHERE KNUMV = IT_KONV-KNUMV.

ENDIF.



IF ( IT_KONV-KSCHL = 'ZCRN' ).
IT_HEAD-ZCRN = IT_KONV-KWERT.
MODIFY IT_HEAD TRANSPORTING ZCRN WHERE KNUMV = IT_KONV-KNUMV.

ENDIF.



IF ( IT_KONV-KSCHL = 'ZFLC' ).
IT_HEAD-ZFLC = IT_KONV-KWERT.
MODIFY IT_HEAD TRANSPORTING ZFLC WHERE KNUMV = IT_KONV-KNUMV.

ENDIF.




IF ( IT_KONV-KSCHL = 'ZTHC' ).
IT_HEAD-ZTHC = IT_KONV-KWERT.
MODIFY IT_HEAD TRANSPORTING ZTHC WHERE KNUMV = IT_KONV-KNUMV.

ENDIF.



IF ( IT_KONV-KSCHL = 'ZDOC' ).
IT_HEAD-ZDOC = IT_KONV-KWERT.
MODIFY IT_HEAD TRANSPORTING ZDOC WHERE KNUMV = IT_KONV-KNUMV.

ENDIF.



IF ( IT_KONV-KSCHL = 'ZDTN' ).
IT_HEAD-ZDTN = IT_KONV-KWERT.
MODIFY IT_HEAD TRANSPORTING ZDTN WHERE KNUMV = IT_KONV-KNUMV.

ENDIF.

IF ( IT_KONV-KSCHL = 'ZINT' ).
IT_HEAD-ZINT = IT_KONV-KWERT.
MODIFY IT_HEAD TRANSPORTING ZINT WHERE KNUMV = IT_KONV-KNUMV.

ENDIF.


IF ( IT_KONV-KSCHL = 'ZCOM' ).
IT_HEAD-ZCOM = IT_KONV-KWERT.
MODIFY IT_HEAD TRANSPORTING ZCOM WHERE KNUMV = IT_KONV-KNUMV.

ENDIF.

IF ( IT_KONV-KSCHL = 'ZST1' OR IT_KONV-KSCHL = 'ZST2' ).
IT_HEAD-ZST1 = IT_KONV-KWERT.
MODIFY IT_HEAD TRANSPORTING ZST1 WHERE KNUMV = IT_KONV-KNUMV.

ENDIF.

IF ( IT_KONV-KSCHL = 'ZBR1' OR IT_KONV-KSCHL = 'ZBR2' ).
IT_HEAD-ZBR1 = IT_KONV-KWERT.
MODIFY IT_HEAD TRANSPORTING ZBR1 WHERE KNUMV = IT_KONV-KNUMV.

ENDIF.

IF ( IT_KONV-KSCHL = 'ZLCC' ).
IT_HEAD-ZLCC = IT_KONV-KWERT.
MODIFY IT_HEAD TRANSPORTING ZLCC WHERE KNUMV = IT_KONV-KNUMV.

ENDIF.

IF ( IT_KONV-KSCHL = 'ZLCA' ).
IT_HEAD-ZLCA = IT_KONV-KWERT.
MODIFY IT_HEAD TRANSPORTING ZLCA WHERE KNUMV = IT_KONV-KNUMV.

ENDIF.

IF ( IT_KONV-KSCHL = 'ZFIR' ).
IT_HEAD-ZFIR = IT_KONV-KWERT.
MODIFY IT_HEAD TRANSPORTING ZFIR WHERE KNUMV = IT_KONV-KNUMV.

ENDIF.


IF ( IT_KONV-KSCHL = 'ZLCM' ).
IT_HEAD-ZLCM = IT_KONV-KWERT.
MODIFY IT_HEAD TRANSPORTING ZLCM WHERE KNUMV = IT_KONV-KNUMV.

ENDIF.

ENDLOOP.
ENDLOOP.


ENDFORM. "GET_DATA

*&---------------------------------------------------------------------*
*& 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.
data : w_date_t(10) type c,
w_date_f(10) type c,
w_tdate(100) type c.

REFRESH p_it_st_list_top_of_page.
CLEAR ls_line.
ls_line-typ = 'H'.
ls_line-info = 'Details of Import Purchases'.
APPEND ls_line TO p_it_st_list_top_of_page.

*----- Display Vendor
concatenate so_lifnr-low ' - ' 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 ' - ' 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 ' - ' 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 ' - ' so_ebeln-high into mix_ebeln
SEPARATED BY SPACE.

concatenate 'PO 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.

if so_aedat-low ne SPACE and so_aedat-low gt 0.
concatenate SO_AEDAT-LOW+6(2) '-' SO_AEDAT-LOW+4(2) '-'
SO_AEDAT-LOW(4) into w_date_f.
concatenate SO_AEDAT-high+6(2) '-' SO_AEDAT-high+4(2) '-'
SO_AEDAT-high(4) into w_date_t.

concatenate 'PO Date :' ' ' w_date_f '-' w_date_t into
w_tdate
SEPARATED BY SPACE.
ls_line-typ = 'S'.
ls_line-info = w_tdate.
APPEND ls_line TO p_it_st_list_top_of_page.
endif.

clear mix_date.
clear mix.


*----- Display Purchasing Group
concatenate so_ekgrp-low ' - ' 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 ' - ' 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 ' - ' 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 ' - ' 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-outputlen = 4.
ls_fieldcat-seltext_m = text-002 .
ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-datatype = 'CHAR'.
ls_fieldcat-key = 'X'.
APPEND ls_fieldcat TO p_it_st_fieldcat.



CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'AEDAT'.
ls_fieldcat-outputlen = 8.
ls_fieldcat-seltext_m = 'PO Date'.
ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-key = 'X'.
APPEND ls_fieldcat TO p_it_st_fieldcat.

CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'EKGRP'.
ls_fieldcat-outputlen = 3.
ls_fieldcat-seltext_m = 'PGrp'.
ls_fieldcat-ddictxt = 'L'.
APPEND ls_fieldcat TO p_it_st_fieldcat.


CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'EBELN'.
ls_fieldcat-outputlen = 10.
ls_fieldcat-seltext_m = 'PO Number'.
ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-key = 'X'.
APPEND ls_fieldcat TO p_it_st_fieldcat.


CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'EBELP'.
ls_fieldcat-outputlen = 10.
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-outputlen = 10.
ls_fieldcat-rollname = 'LIFNR'.
ls_fieldcat-ddictxt = 'L'.
APPEND ls_fieldcat TO p_it_st_fieldcat.

CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'NAME1'.
ls_fieldcat-outputlen = 35.
ls_fieldcat-seltext_m = 'Vendor Name'.
ls_fieldcat-ddictxt = 'L'.
APPEND ls_fieldcat TO p_it_st_fieldcat.

CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'LIFN2'.
ls_fieldcat-outputlen = 10.
ls_fieldcat-seltext_m = TEXT-100.
ls_fieldcat-ddictxt = 'L'.
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 = 'BKWERT'.
* ls_fieldcat-rollname = 'KWERT'.
ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 20.
ls_fieldcat-seltext_L = text-099 .
APPEND ls_fieldcat TO p_it_st_fieldcat.



CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'IKWERT'.
* ls_fieldcat-rollname = 'IKBETR'.
ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 20.
ls_fieldcat-seltext_L = text-004 .
APPEND ls_fieldcat TO p_it_st_fieldcat.

CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'FKWERT'.
* ls_fieldcat-rollname = 'FKBETR'.
ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 20.
ls_fieldcat-seltext_L = text-005 .
APPEND ls_fieldcat TO p_it_st_fieldcat.


CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'ZINT'.
* ls_fieldcat-rollname = 'FKBETR'.
ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 20.
ls_fieldcat-seltext_L = text-035 .
APPEND ls_fieldcat TO p_it_st_fieldcat.


CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'ZCOM'.
* ls_fieldcat-rollname = 'FKBETR'.
ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 20.
ls_fieldcat-seltext_L = text-036 .
APPEND ls_fieldcat TO p_it_st_fieldcat.


CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'AKWERT'.
* ls_fieldcat-rollname = 'AKBETR'.
ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 20.
ls_fieldcat-seltext_L = text-006 .
APPEND ls_fieldcat TO p_it_st_fieldcat.



CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'ZST1'.
* ls_fieldcat-rollname = 'FKBETR'.
ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 20.
ls_fieldcat-seltext_L = text-037 .
APPEND ls_fieldcat TO p_it_st_fieldcat.


CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'ZBR1'.
* ls_fieldcat-rollname = 'FKBETR'.
ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 20.
ls_fieldcat-seltext_L = text-038.
APPEND ls_fieldcat TO p_it_st_fieldcat.

CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'ZLCC'.
* ls_fieldcat-rollname = 'FKBETR'.
ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 20.
ls_fieldcat-seltext_L = text-039.
APPEND ls_fieldcat TO p_it_st_fieldcat.


CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'ZLCA'.
* ls_fieldcat-rollname = 'FKBETR'.
ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 20.
ls_fieldcat-seltext_L = text-040.
APPEND ls_fieldcat TO p_it_st_fieldcat.


CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'ZFIR'.
* ls_fieldcat-rollname = 'FKBETR'.
ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 20.
ls_fieldcat-seltext_L = text-041.
APPEND ls_fieldcat TO p_it_st_fieldcat.


CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'ZLCM'.
* ls_fieldcat-rollname = 'FKBETR'.
ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 20.
ls_fieldcat-seltext_L = text-042.
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 = 20.
ls_fieldcat-seltext_L = 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 = 20.
ls_fieldcat-seltext_L = 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 = 20.
ls_fieldcat-seltext_L = 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 = 20.
ls_fieldcat-seltext_L = 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 = 20.
ls_fieldcat-seltext_L = 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 = 20.
ls_fieldcat-seltext_L = 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 = 20.
ls_fieldcat-seltext_L = 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 = 20.
ls_fieldcat-seltext_L = 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 = 20.
ls_fieldcat-seltext_l = 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 = 20.
ls_fieldcat-seltext_L = 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 = 20.
ls_fieldcat-seltext_L = 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 = 20.
ls_fieldcat-seltext_L = 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 = 20.
ls_fieldcat-seltext_L = 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 = 20.
ls_fieldcat-seltext_L = 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 = 20.
ls_fieldcat-seltext_L = 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 = 20.
ls_fieldcat-seltext_L = 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 = 20.
ls_fieldcat-seltext_L = 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 = 20.
ls_fieldcat-seltext_L = 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 = 20.
ls_fieldcat-seltext_L = 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 = 20.
ls_fieldcat-seltext_L = 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 = 20.
ls_fieldcat-seltext_L = 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 = 20.
ls_fieldcat-seltext_L = 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 = 20.
ls_fieldcat-seltext_L = 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 = 20.
ls_fieldcat-seltext_L = 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 = 20.
ls_fieldcat-seltext_L = 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 = 20.
ls_fieldcat-seltext_L = text-033 .
APPEND ls_fieldcat TO p_it_st_fieldcat.

CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'EFFWR'.
* ls_fieldcat-rollname = 'AKBETR'.
ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 20.
ls_fieldcat-seltext_M = 'Total Value' .
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
p_st_layout-zebra = 'X'.
p_st_layout-colwidth_optimize = 'X'.
p_st_layout-no_totalline = 'X'.


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_CALLBACK_TOP_OF_PAGE = st_formname_top_of_page
* 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 = 'A'
IS_VARIANT = G_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
EXCEPTIONS
PROGRAM_ERROR = 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.


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:

link us...

For Visitors

if you want to publish or Add something on ERP, SAP , SAP FUNCTIONAL, SAP ABAP then mail us along with your email-id. contain must be yours

email-id :- avinashkr_raj@yahoo.com(any email)

email-id :- avinaskr_raj.abap@blogger.com ( use only gmail)