Monday, November 30, 2009

WORKFLOW FROM

SAP FI-MM-SD INTEGRATION
Link Between SAP SD, MM & FI

The link between SD and MM :-
1. When you create sales order in SD, all the details of the items are copied from Material master of MM.
2. MRP and availability check related data is also taken from MM although you control this data in SD also.
3. While you create inbound/outbound delivery with reference to a sales order, the shipping point determination takes place with the help of the loading group, plant data, shipping conditions etc. This also refers to Material Master.
4. The material which you are entering in a sales order must be extended to the sales area of your sales order/customer otherwise you cannot transact with this material.
There are many such links between SD and MM.

Now the link between SD and FI :-
1. Whenever you create a delivery with reference to a sales order, goods movement takes place in the background. eg. In case of standard sales order, you create an outbound goods delivery to the customer.

Here movement 601 takes place. This movement is configured in MM. Also, this movement hits some G/L account in FI. Every such movement of good s hits some G/L account.
2. The accounts posting in FI is done with reference to the billing documents (invoice, debit note, credit note etc) created in SD. Thus this is a link between SD and FI
3. Tax determination: In case of a tax determination also, there is a direct link between SD and MM
SD Integration points with other modules

SD module is highly integrated with the other modules in SAP.

Sales Order -

Integration Points Module

•Availability Check - MM

•Credit Check - FI

•Costing - CO/ MM

•Tax Determination - FI

•Transfer of Requirements - PP/ MM

Delivery & Goods Issue -

Integration Points Module

•Availability Check - MM

•Credit Check - FI

•Reduces stock - MM

•Reduces Inventory $ - FI/ CO

•Requirement Eliminated - PP/ MM

Billing -

Integration Points Module

•Debit A/R - FI/ CO

•Credit Revenue - FI/ CO

•Updates G/ L - FI/ CO

(Tax, discounts, surcharges, etc.)

•Milestone Billing - PS

Return Delivery & Credit Memo -

Integration Points Module

•Increases Inventory - MM

•Updates G/ L - FI

•Credit Memo - FI

•Adjustment to A/R - FI

•Reduces Revenue - FI

SD Transaction Code Flow:

Inquiry / Document type IN

Transaction code for creation VA11,VA12,VA13. tables VBAK,VBAP

Quotation / QT

Transaction code for creation VA21,VA22,VA23. tables VBAK,VBAP

Sales Order OR

Transaction code for creation VA01,VA02,VA03. tables VBAK,VBAP

Delivery LF

Transaction code for creation VL01,VL02,VL03. tables LIKP,LIPS

Billing F2

Transaction code for creation VF01,VF02,VF03. tables VBRK,VBRP

Excise Invoice (Only for India - Manufacturing Scenario)

Transaction code for creation J1IIN.

Note: Tables for Document Flow VBFA

Thursday, October 22, 2009

SAP SD VARIANT CONFIGURATION : )


Steps : Variant Configuration




Create a Material - KMAT type with Item category (002)
Create Characteristics – T code CT04 - ZBIKE, where in values mention the Color of the bike like Red, Blue etc.
Create another characteristics in CT04 - ZPRICE, where directly go the additional data tab and maintain the table SDCOM and field VKOND (ABAP Dictionary it will ask for)
Assign these two characteristics to a Class in CL01 - ZBIKECLASS ( Type 300) in characteristics tab page.
Then go to T code CU41 - Configuration profile select the material and enter the description. Click on the class assignment and assign ZBIKECLASS.
Now go back to CT04 - enter ZBIKE -go to values- select Red- go to extras - Other Dependencies - Select Procedure enter in front 10 write - $self.ZPrice=\'Red\' and save.
Now go to extras - Other Dependencies - assignments and assign relationship ( by default it will come just save)
Now select Blue- go to extras - Other Dependencies - Editor - Select Procedure enter in front of 10 write - $self.ZPrice=\'Blue\' and save
Now go back go to extras - Other Dependencies - assignments and assign relationship ( by default it will come just save)

Now go to VK11 - Enter VA00 (Condition) (For Std RVA001 Pricing Procedure) - enter variant Red and Blue give the rates accordingly and create the sales order.






---------------------------------------------------------------------------------------

Variant Configuration in ERP SAP


---------------------------------------------------------------------------------------------------------------------------------------------------------------------

Wednesday, October 21, 2009

ALV REPORTING

REPORT ZREPORT .

TYPE-POOLS : slis.

DATA: fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE,
gd_tab_group TYPE slis_t_sp_group_alv,
gd_layout TYPE slis_layout_alv,
gd_repid LIKE sy-repid,
gt_events TYPE slis_t_event,
gd_prntparams TYPE slis_print_alv.

DATA: WA_fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE,
WA_gd_tab_group TYPE slis_t_sp_group_alv,
WA_gd_layout TYPE slis_layout_alv,
WA_gd_repid LIKE sy-repid,
WA_gt_events TYPE slis_t_event,
WA_gd_prntparams TYPE slis_print_alv.

TABLES:vbak,vbap,vbpa.

DATA:
BEGIN OF itab OCCURS 0,

vbeln LIKE vbak-vbeln,
erdat LIKE vbak-erdat,
erzet LIKE vbak-erzet,
ernam LIKE vbak-ernam ,




posnr LIKE vbap-posnr,
matnr LIKE vbap-matnr ,
ps_psp_pnr LIKE vbap-ps_psp_pnr,


kunnr LIKE vbpa-kunnr ,
pernr LIKE vbpa-pernr ,
parvw LIKE vbpa-parvw,
land1 LIKE vbpa-land1,


END OF itab.

DATA:
BEGIN OF A_itab OCCURS 0,

vbeln LIKE vbak-vbeln,
erdat LIKE vbak-erdat,
erzet LIKE vbak-erzet,
ernam LIKE vbak-ernam ,

END OF A_ITAB,

BEGIN OF B_ITAB OCCURS 0,

vbeln LIKE vbap-vbeln,
posnr LIKE vbap-posnr,
matnr LIKE vbap-matnr ,
ps_psp_pnr LIKE vbap-ps_psp_pnr,

END OF B_ITAB,

BEGIN OF C_ITAB OCCURS 0,
vbeln LIKE vbpa-vbeln,

kunnr LIKE vbpa-kunnr ,
pernr LIKE vbpa-pernr ,
parvw LIKE vbpa-parvw,
land1 LIKE vbpa-land1,


END OF C_itab.

DATA:WA_A_ITAB LIKE A_ITAB,
WA_B_ITAB LIKE B_ITAB,
WA_C_ITAB LIKE C_ITAB.



select-options: p_vbeln for vbak-vbeln OBLIGATORY.

*
START-OF-SELECTION.


*CODE 1---------
* SELECT A~VBELN
* A~ERDAT
* A~ERZET
* A~ERNAM
* B~POSNR
* B~MATNR
* B~PS_PSP_PNR
* C~KUNNR
* C~PERNR
* C~PARVW
* C~LAND1
* FROM VBAK as A
* JOIN VBAP AS B ON
* B~VBELN EQ A~VBELN
* JOIN VBPA AS C ON
* A~vbeln EQ c~vbeln
* into corresponding fields of table ITAB
* where A~vbeln IN p_vbeln.
*
*
***********CODE1*****************************


******************CODE2
SELECT A~VBELN
A~ERDAT
A~ERZET
A~ERNAM
FROM VBAK AS A
INTO CORRESPONDING FIELDS OF TABLE ITAB
where a~VBELN IN P_vbeln .

IF NOT ITAB[] IS INITIAL.


SELECT B~VBELN
B~POSNR
B~MATNR
B~PS_PSP_PNR
FROM VBAP AS B
INTO CORRESPONDING FIELDS OF TABLE B_ITAB
FOR ALL ENTRIES IN ITAB
where VBELN = ITAB-VBELN.


LOOP AT ITAB.

READ TABLE B_ITAB WITH KEY VBELN = ITAB-VBELN.

IF SY-SUBRC = 0.

ITAB-POSNR = B_ITAB-POSNR .
ITAB-MATNR = B_ITAB-MATNR .
ITAB-PS_PSP_PNR = B_ITAB-PS_PSP_PNR.
modify itab.

ENDIF.

ENDLOOP.

ENDIF .


IF NOT B_ITAB[] IS INITIAL.

SELECT C~VBELN
C~KUNNR
C~PERNR
C~PARVW
C~LAND1
FROM VBPA AS C
into corresponding fields of table C_ITAB
FOR ALL ENTRIES IN B_ITAB
where vbeln = B_ITAB-vbeln.

LOOP AT ITAB.

READ TABLE C_ITAB WITH KEY VBELN = B_ITAB-VBELN.

IF SY-SUBRC = 0.

ITAB-KUNNR = C_ITAB-KUNNR.
* ITAB-PERNR = C_ITAB-MATNR .
* ITAB-PS_PSP_PNR = B_ITAB-PS_PSP_PNR.
modify itab.

ENDIF.

ENDLOOP.

ENDIF .
************CODE2***************************************











PERFORM build_fieldcatalog.
PERFORM build_layout.
PERFORM build_events.

*ENDLOOP.


CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_interface_check = 'X '
* I_BYPASSING_BUFFER = I_BYPASSING_BUFFER
i_buffer_active = ' '
i_callback_program = sy-repid
i_callback_pf_status_set = ' '
* I_CALLBACK_USER_COMMAND = 'EXECUTE-COMMAND'
* I_STRUCTURE_NAME = I_STRUCTURE_NAME
is_layout = WA_gd_layout
it_fieldcat = fieldcatalog[]
* IT_EXCLUDING = IT_EXCLUDING
* IT_SPECIAL_GROUPS = IT_SPECIAL_GROUPS
* IT_SORT = IT_SORT
* IT_FILTER = IT_FILTER
* IS_SEL_HIDE = IS_SEL_HIDE
i_default = 'X'
i_save = 'A '
* IS_VARIANT = IS_VARIANT
* IT_EVENTS = IT_EVENTS
* IT_EVENT_EXIT = IT_EVENT_EXIT
* IS_PRINT = IS_PRINT
* IS_REPREP_ID = IS_REPREP_ID
* I_SCREEN_START_COLUMN = 0
* I_SCREEN_START_LINE = 0
* I_SCREEN_END_COLUMN = 0
* I_SCREEN_END_LINE = 0
* IR_SALV_LIST_ADAPTER = IR_SALV_LIST_ADAPTER
* IT_EXCEPT_QINFO = IT_EXCEPT_QINFO
* I_SUPPRESS_EMPTY_DATA = ABAP_FALSE
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER = E_EXIT_CAUSED_BY_CALLER
* ES_EXIT_CAUSED_BY_USER = ES_EXIT_CAUSED_BY_USER
TABLES
t_outtab = itab
* EXCEPTIONS
* PROGRAM_ERROR = 1
.
*&---------------------------------------------------------------------*
*& Form BUILD_FIELDCATALOG
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text *----------------------------------------------------------------------* FORM build_fieldcatalog . WA_fieldcatalog-fieldname = 'VBELN'. WA_fieldcatalog-seltext_l = 'SALESDOC'. WA_fieldcatalog-col_pos = 0. * fieldcatalog-outputlen = 20. WA_fieldcatalog-emphasize = 'X'. * fieldcatalog-key = 'X'. * fieldcatalog-do_sum = 'X'. * fieldcatalog-no_zero = 'X'. APPEND WA_fieldcatalog TO fieldcatalog. CLEAR WA_fieldcatalog. WA_fieldcatalog-fieldname = 'ERDAT'. WA_fieldcatalog-seltext_l = 'DATE'. WA_fieldcatalog-col_pos = 1. * fieldcatalog-outputlen = 20. APPEND WA_fieldcatalog TO fieldcatalog. CLEAR WA_fieldcatalog. WA_fieldcatalog-fieldname = 'ERZET'. WA_fieldcatalog-seltext_l = 'ERZET'. WA_fieldcatalog-col_pos = 2. * fieldcatalog-outputlen = 20. APPEND WA_fieldcatalog TO fieldcatalog. CLEAR WA_fieldcatalog. WA_fieldcatalog-fieldname = 'ERNAM'. WA_fieldcatalog-seltext_l = 'CREATED BY'. WA_fieldcatalog-col_pos = 3. * fieldcatalog-outputlen = 20. APPEND WA_fieldcatalog TO fieldcatalog. CLEAR WA_fieldcatalog. WA_fieldcatalog-fieldname = 'POSNR'. WA_fieldcatalog-seltext_l = 'POSITION'. WA_fieldcatalog-col_pos = 4. * fieldcatalog-outputlen = 20. APPEND WA_fieldcatalog TO fieldcatalog. CLEAR WA_fieldcatalog. WA_fieldcatalog-fieldname = 'MATNR'. WA_fieldcatalog-seltext_l = 'MAT NUMBER'. WA_fieldcatalog-col_pos = 5. * fieldcatalog-outputlen = 20. APPEND WA_fieldcatalog TO fieldcatalog. CLEAR WA_fieldcatalog. WA_fieldcatalog-fieldname = 'PS_PSP_PNR'. WA_fieldcatalog-seltext_l = 'PS_PSP_PNR'. WA_fieldcatalog-col_pos = 6. * fieldcatalog-outputlen = 20. APPEND WA_fieldcatalog TO fieldcatalog. CLEAR WA_fieldcatalog. * FIELDCATALOG-FIELDNAME = 'PROJ_PTNR'. * FIELDCATALOG-SELTEXT_L = 'Project Partner'. * FIELDCATALOG-COL_POS = 7. * APPEND FIELDCATALOG TO FIELDCATALOG. * CLEAR FIELDCATALOG. * WA_fieldcatalog-fieldname = 'KUNNR'. WA_fieldcatalog-seltext_l = 'CUSTOMER'. WA_fieldcatalog-col_pos = 8. APPEND WA_fieldcatalog TO fieldcatalog. CLEAR WA_fieldcatalog. WA_fieldcatalog-fieldname = 'PERNR'. WA_fieldcatalog-seltext_l = 'EMPLYEE NO '. WA_fieldcatalog-col_pos = 9. APPEND WA_fieldcatalog TO fieldcatalog. CLEAR WA_fieldcatalog. WA_fieldcatalog-fieldname = 'PARVW'. WA_fieldcatalog-seltext_l = 'PARTNER NUMBER'. WA_fieldcatalog-col_pos = 10. APPEND WA_fieldcatalog TO fieldcatalog. CLEAR WA_fieldcatalog. WA_fieldcatalog-fieldname = 'LAND1'. WA_fieldcatalog-seltext_l = 'LAND1 '. WA_fieldcatalog-col_pos = 11. APPEND WA_fieldcatalog TO fieldcatalog. CLEAR WA_fieldcatalog. ENDFORM. " BUILD_FIELDCATALOG *&---------------------------------------------------------------------* *& Form BUILD_LAYOUT *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text
* <-- p2 text *----------------------------------------------------------------------* FORM build_layout . gd_layout-no_input = 'X'. gd_layout-colwidth_optimize = 'X'. gd_layout-totals_text = 'Totals'. gd_layout-totals_only = 'X'. * gd_layout-f2code = 'DISP'. "Sets fcode for when double * "click(press f2) gd_layout-zebra = 'X'. * gd_layout-group_change_edit = 'X'. gd_layout-header_text = 'REPORT ON ALV GRID TO DISPLAY SALES DETAILS HEADER AND ITEM DETAILS WITH BREAK DOWN STRUCTURES'. ENDFORM. " BUILD_LAYOUT *&---------------------------------------------------------------------* *& Form BUILD_EVENTS *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text
* <-- p2 text *----------------------------------------------------------------------* FORM build_events . DATA: ls_event TYPE slis_alv_event. CALL FUNCTION 'REUSE_ALV_EVENTS_GET' EXPORTING i_list_type = 0 IMPORTING et_events = gt_events[]. READ TABLE gt_events WITH KEY name = slis_ev_end_of_page INTO ls_event. IF sy-subrc = 0. MOVE 'END_OF_PAGE' TO ls_event-form. APPEND ls_event TO gt_events. ENDIF. READ TABLE gt_events WITH KEY name = slis_ev_end_of_list INTO ls_event. IF sy-subrc = 0. MOVE 'END_OF_LIST' TO ls_event-form. APPEND ls_event TO gt_events. ENDIF. -------------------------------------------------- "Another way of writing the code " report ztest1a. type-pools : slis. data: fieldcatalog type slis_t_fieldcat_alv with header line, gd_tab_group type slis_t_sp_group_alv, gd_layout type slis_layout_alv, gd_repid like sy-repid, gt_events type slis_t_event, gd_prntparams type slis_print_alv. data: wa_fieldcatalog type slis_t_fieldcat_alv with header line, wa_gd_tab_group type slis_t_sp_group_alv, wa_gd_layout type slis_layout_alv, wa_gd_repid like sy-repid, wa_gt_events type slis_t_event, wa_gd_prntparams type slis_print_alv. tables:vbak,vbap,vbpa. types : begin of ty_itab, vbeln like vbak-vbeln, * erdat like vbak-erdat, * erzet like vbak-erzet, * ernam like vbak-ernam , posnr like vbap-posnr, matnr like vbap-matnr , ps_psp_pnr like vbap-ps_psp_pnr, kunnr like vbpa-kunnr , pernr like vbpa-pernr , parvw like vbpa-parvw, land1 like vbpa-land1, end of ty_itab. data : itab type table of ty_itab with header line, itab2 type table of ty_itab with header line. *********************88888 select-options: p_vbeln for vbak-vbeln obligatory. *************************************** start-of-selection. * * * select vbeln from vbak into table itab where vbeln in p_vbeln. if not itab[] is initial. select vbeln posnr matnr ps_psp_pnr from vbap into corresponding fields of table itab2 for all entries in itab where vbeln eq itab-vbeln. endif. refresh itab. if not itab2[] is initial. ***************** select vbeln kunnr pernr parvw land1 from vbpa into corresponding fields of table itab for all entries in itab2 where vbeln eq itab2-vbeln. endif. loop at itab. read table itab2 with key vbeln = itab-vbeln. if sy-subrc eq 0. move itab2-posnr to itab-posnr. move itab2-matnr to itab-matnr. move itab2-ps_psp_pnr to itab-ps_psp_pnr. modify itab. endif. endloop. * VBAP~POSNR * VBAP~MATNR * VBAP~PS_PSP_PNR * VBPA~KUNNR VBPA~PERNR * VBPA~PARVW VBPA~LAND1 * * INTO TABLE ITAB * FROM VBAK * INNER JOIN VBAP * ON VBAK~VBELN = VBAP~VBELN * * INNER JOIN VBPA * * ON VBAK~VBELN = VBPA~VBELN * * WHERE VBAK~VBELN = P_VBELN. perform build_fieldcatalog. perform build_layout. perform build_events. *ENDLOOP. call function 'REUSE_ALV_LIST_DISPLAY' exporting i_interface_check = 'X ' * I_BYPASSING_BUFFER = I_BYPASSING_BUFFER i_buffer_active = ' ' i_callback_program = sy-repid i_callback_pf_status_set = ' ' * I_CALLBACK_USER_COMMAND = 'EXECUTE-COMMAND' * I_STRUCTURE_NAME = I_STRUCTURE_NAME is_layout = wa_gd_layout it_fieldcat = fieldcatalog[] * IT_EXCLUDING = IT_EXCLUDING * IT_SPECIAL_GROUPS = IT_SPECIAL_GROUPS * IT_SORT = IT_SORT * IT_FILTER = IT_FILTER * IS_SEL_HIDE = IS_SEL_HIDE i_default = 'X' i_save = 'A ' * IS_VARIANT = IS_VARIANT * IT_EVENTS = IT_EVENTS * IT_EVENT_EXIT = IT_EVENT_EXIT * IS_PRINT = IS_PRINT * IS_REPREP_ID = IS_REPREP_ID * I_SCREEN_START_COLUMN = 0 * I_SCREEN_START_LINE = 0 * I_SCREEN_END_COLUMN = 0 * I_SCREEN_END_LINE = 0 * IR_SALV_LIST_ADAPTER = IR_SALV_LIST_ADAPTER * IT_EXCEPT_QINFO = IT_EXCEPT_QINFO * I_SUPPRESS_EMPTY_DATA = ABAP_FALSE * IMPORTING * E_EXIT_CAUSED_BY_CALLER = E_EXIT_CAUSED_BY_CALLER * ES_EXIT_CAUSED_BY_USER = ES_EXIT_CAUSED_BY_USER tables t_outtab = itab * EXCEPTIONS * PROGRAM_ERROR = 1 . *&---------------------------------------------------------------------* *& Form BUILD_FIELDCATALOG *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text
* <-- p2 text *----------------------------------------------------------------------* form build_fieldcatalog . wa_fieldcatalog-fieldname = 'VBELN'. wa_fieldcatalog-seltext_l = 'SALESDOC'. wa_fieldcatalog-col_pos = 0. * fieldcatalog-outputlen = 20. wa_fieldcatalog-emphasize = 'X'. * fieldcatalog-key = 'X'. * fieldcatalog-do_sum = 'X'. * fieldcatalog-no_zero = 'X'. append wa_fieldcatalog to fieldcatalog. clear wa_fieldcatalog. * wa_fieldcatalog-fieldname = 'ERDAT'. * wa_fieldcatalog-seltext_l = 'DATE'. * wa_fieldcatalog-col_pos = 1. ** fieldcatalog-outputlen = 20. * append wa_fieldcatalog to fieldcatalog. * clear wa_fieldcatalog. * * wa_fieldcatalog-fieldname = 'ERZET'. * wa_fieldcatalog-seltext_l = 'ERZET'. * wa_fieldcatalog-col_pos = 2. ** fieldcatalog-outputlen = 20. * append wa_fieldcatalog to fieldcatalog. * clear wa_fieldcatalog. * * wa_fieldcatalog-fieldname = 'ERNAM'. * wa_fieldcatalog-seltext_l = 'CREATED BY'. * wa_fieldcatalog-col_pos = 3. ** fieldcatalog-outputlen = 20. * append wa_fieldcatalog to fieldcatalog. clear wa_fieldcatalog. wa_fieldcatalog-fieldname = 'POSNR'. wa_fieldcatalog-seltext_l = 'POSITION'. wa_fieldcatalog-col_pos = 2. * fieldcatalog-outputlen = 20. append wa_fieldcatalog to fieldcatalog. clear wa_fieldcatalog. wa_fieldcatalog-fieldname = 'MATNR'. wa_fieldcatalog-seltext_l = 'MAT NUMBER'. wa_fieldcatalog-col_pos = 3. * fieldcatalog-outputlen = 20. append wa_fieldcatalog to fieldcatalog. clear wa_fieldcatalog. wa_fieldcatalog-fieldname = 'PS_PSP_PNR'. wa_fieldcatalog-seltext_l = 'PS_PSP_PNR'. wa_fieldcatalog-col_pos = 4. * fieldcatalog-outputlen = 20. append wa_fieldcatalog to fieldcatalog. clear wa_fieldcatalog. * FIELDCATALOG-FIELDNAME = 'PROJ_PTNR'. * FIELDCATALOG-SELTEXT_L = 'Project Partner'. * FIELDCATALOG-COL_POS = 7. * APPEND FIELDCATALOG TO FIELDCATALOG. * CLEAR FIELDCATALOG. * wa_fieldcatalog-fieldname = 'KUNNR'. wa_fieldcatalog-seltext_l = 'CUSTOMER'. wa_fieldcatalog-col_pos = 5. append wa_fieldcatalog to fieldcatalog. clear wa_fieldcatalog. wa_fieldcatalog-fieldname = 'PERNR'. wa_fieldcatalog-seltext_l = 'EMPLYEE NO '. wa_fieldcatalog-col_pos = 6. append wa_fieldcatalog to fieldcatalog. clear wa_fieldcatalog. wa_fieldcatalog-fieldname = 'PARVW'. wa_fieldcatalog-seltext_l = 'PARTNER NUMBER'. wa_fieldcatalog-col_pos = 7. append wa_fieldcatalog to fieldcatalog. clear wa_fieldcatalog. wa_fieldcatalog-fieldname = 'LAND1'. wa_fieldcatalog-seltext_l = 'LAND1 '. wa_fieldcatalog-col_pos = 8. append wa_fieldcatalog to fieldcatalog. clear wa_fieldcatalog. endform. " BUILD_FIELDCATALOG *&---------------------------------------------------------------------* *& Form BUILD_LAYOUT *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text
* <-- p2 text *----------------------------------------------------------------------* form build_layout . gd_layout-no_input = 'X'. gd_layout-colwidth_optimize = 'X'. gd_layout-totals_text = 'Totals'. gd_layout-totals_only = 'X'. * gd_layout-f2code = 'DISP'. "Sets fcode for when double * "click(press f2) gd_layout-zebra = 'X'. * gd_layout-group_change_edit = 'X'. gd_layout-header_text = 'REPORT ON ALV GRID TO DISPLAY SALES DETAILS HEADER AND ITEM DETAILS WITH BREAK DOWN STRUCTURES'. endform. " BUILD_LAYOUT *&---------------------------------------------------------------------* *& Form BUILD_EVENTS *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
form build_events .



data: ls_event type slis_alv_event.

call function 'REUSE_ALV_EVENTS_GET'
exporting
i_list_type = 0
importing
et_events = gt_events[].
read table gt_events with key name = slis_ev_end_of_page
into ls_event.
if sy-subrc = 0.
move 'END_OF_PAGE' to ls_event-form.
append ls_event to gt_events.
endif.

read table gt_events with key name = slis_ev_end_of_list
into ls_event.
if sy-subrc = 0.
move 'END_OF_LIST' to ls_event-form.
append ls_event to gt_events.
endif.

endform. " BUILD_EVENTS