1130 Batch Oops Alv

Embed Size (px)

DESCRIPTION

oops alv

Citation preview

1130BATCHOOPSALV:PRGRAM1:REPORTZ1130ALV1.

data:lv_vbelntypevbak-vbeln.select-options:so_vbelnforlv_vbeln.

types:beginofty_vbak,vbelntypevbak-vbeln,erdattypevbak-erdat,erzettypevbak-erzet,ernamtypevbak-ernam,endofty_vbak.

data:lt_vbaktypestandardtableofty_vbak.

data:o_conttypereftocl_gui_custom_container,o_gridtypereftocl_gui_alv_grid.

initialization.so_vbeln-low='4970'.so_vbeln-high='4975'.appendso_vbeln.

start-of-selection.callscreen100.

MODULESTATUS_0100OUTPUT.SETPF-STATUS'ABC'.ifo_contisinitial.CREATEOBJECTO_CONTEXPORTINGCONTAINER_NAME='CST'.

CREATEOBJECTO_GRIDEXPORTINGI_PARENT=o_cont.

performgetdata.iflt_vbak[]isnotinitial.performdisplay.endif.

endif.ENDMODULE."STATUS_0100OUTPUT

MODULEUSER_COMMAND_0100INPUT.casesy-ucomm.when'BACK'.leaveprogram.endcase.ENDMODULE."USER_COMMAND_0100INPUT

FORMgetdata.selectvbelnerdaterzeternamfromvbakintotablelt_vbakwherevbelninso_vbeln.ENDFORM."getdata

FORMdisplay.CALLMETHODO_GRID->SET_TABLE_FOR_FIRST_DISPLAYCHANGINGIT_OUTTAB=lt_vbak[].

ENDFORM."displayPRGRAM2:REPORTZ1130ALV2.

data:lv_vbelntypevbak-vbeln.select-options:so_vbelnforlv_vbeln.

types:beginofty_vbak,vbelntypevbak-vbeln,erdattypevbak-erdat,erzettypevbak-erzet,ernamtypevbak-ernam,endofty_vbak.

data:lt_vbaktypestandardtableofty_vbak.

data:o_conttypereftocl_gui_custom_container,o_gridtypereftocl_gui_alv_grid.

initialization.so_vbeln-low='4970'.so_vbeln-high='4975'.appendso_vbeln.

start-of-selection.callscreen100.

MODULESTATUS_0100OUTPUT.SETPF-STATUS'ABC'.ifo_contisinitial.CREATEOBJECTO_CONTEXPORTINGCONTAINER_NAME='CST'.

CREATEOBJECTO_GRIDEXPORTINGI_PARENT=o_cont.

performgetdata.iflt_vbak[]isnotinitial.performdisplay.endif.

endif.ENDMODULE."STATUS_0100OUTPUT

MODULEUSER_COMMAND_0100INPUT.casesy-ucomm.when'BACK'.leaveprogram.endcase.ENDMODULE."USER_COMMAND_0100INPUT

FORMgetdata.selectvbelnerdaterzeternamfromvbakintotablelt_vbakwherevbelninso_vbeln.ENDFORM."getdata

FORMdisplay.CALLMETHODO_GRID->SET_TABLE_FOR_FIRST_DISPLAYEXPORTINGI_STRUCTURE_NAME='VBAK'CHANGINGIT_OUTTAB=lt_vbak[].

ENDFORM."displayZVPRGRAM3:REPORTZ1130ALV3.

data:lv_vbelntypevbak-vbeln.select-options:so_vbelnforlv_vbeln.

types:beginofty_vbak,vbelntypevbak-vbeln,erdattypevbak-erdat,erzettypevbak-erzet,ernamtypevbak-ernam,endofty_vbak.

data:lt_vbaktypestandardtableofty_vbak.

data:o_conttypereftocl_gui_custom_container,o_gridtypereftocl_gui_alv_grid.

initialization.so_vbeln-low='4970'.so_vbeln-high='4975'.appendso_vbeln.

start-of-selection.callscreen100.

MODULESTATUS_0100OUTPUT.SETPF-STATUS'ABC'.ifo_contisinitial.CREATEOBJECTO_CONTEXPORTINGCONTAINER_NAME='CST'.

CREATEOBJECTO_GRIDEXPORTINGI_PARENT=o_cont.

performgetdata.iflt_vbak[]isnotinitial.performdisplay.endif.

endif.ENDMODULE."STATUS_0100OUTPUT

MODULEUSER_COMMAND_0100INPUT.casesy-ucomm.when'BACK'.leaveprogram.endcase.ENDMODULE."USER_COMMAND_0100INPUT

FORMgetdata.selectvbelnerdaterzeternamfromvbakintotablelt_vbakwherevbelninso_vbeln.ENDFORM."getdata

FORMdisplay.CALLMETHODO_GRID->SET_TABLE_FOR_FIRST_DISPLAYEXPORTINGI_STRUCTURE_NAME='ZMYVBAK'CHANGINGIT_OUTTAB=lt_vbak[].

ENDFORM."displayPRGRAM4:REPORTZ1130ALV4.

data:lv_vbelntypevbak-vbeln.select-options:so_vbelnforlv_vbeln.

types:beginofty_vbak,vbelntypevbak-vbeln,erdattypevbak-erdat,erzettypevbak-erzet,ernamtypevbak-ernam,endofty_vbak.

data:lt_vbaktypestandardtableofty_vbak.

data:o_conttypereftocl_gui_custom_container,o_gridtypereftocl_gui_alv_grid.

initialization.so_vbeln-low='4970'.so_vbeln-high='4975'.appendso_vbeln.

start-of-selection.callscreen100.

MODULESTATUS_0100OUTPUT.SETPF-STATUS'ABC'.ifo_contisinitial.CREATEOBJECTO_CONTEXPORTINGCONTAINER_NAME='CST'.

CREATEOBJECTO_GRIDEXPORTINGI_PARENT=o_cont.

performgetdata.iflt_vbak[]isnotinitial.performdisplay.endif.

endif.ENDMODULE."STATUS_0100OUTPUT

MODULEUSER_COMMAND_0100INPUT.casesy-ucomm.when'BACK'.leaveprogram.endcase.ENDMODULE."USER_COMMAND_0100INPUT

FORMgetdata.selectvbelnerdaterzeternamfromvbakintotablelt_vbakwherevbelninso_vbeln.ENDFORM."getdata

FORMdisplay.CALLMETHODO_GRID->SET_TABLE_FOR_FIRST_DISPLAYEXPORTINGI_STRUCTURE_NAME='ZMYVBAK'CHANGINGIT_OUTTAB=lt_vbak[].

ENDFORM."displayPRGRAM5:REPORT Z1130ALV5.

data : lv_vbeln type vbak-vbeln.select-options : so_vbeln for lv_vbeln.

types : begin of ty_vbak, vbeln type vbak-vbeln, erdat type vbak-erdat, erzet type vbak-erzet, ernam type vbak-ernam, end of ty_vbak.

data : lt_vbak type standard table of ty_vbak.

data : o_cont type ref to cl_gui_custom_container, " INTERFACE o_grid type ref to cl_gui_alv_grid. " ALV GRID

data : lt_fcat type lvc_t_fcat, ls_fcat type lvc_s_fcat.

initialization. so_vbeln-low = '4970'. so_vbeln-high = '4975'. append so_vbeln.

start-of-selection. call screen 100.

MODULE STATUS_0100 OUTPUT. SET PF-STATUS 'ABC'.if o_cont is initial. CREATE OBJECT O_CONT EXPORTING CONTAINER_NAME = 'CST'.

CREATE OBJECT O_GRID EXPORTING I_PARENT = o_cont.

perform getdata. if lt_vbak[] is not initial. perform fldcat. perform display. endif.

endif.ENDMODULE. " STATUS_0100 OUTPUT

MODULE USER_COMMAND_0100 INPUT. case sy-ucomm. when 'BACK'. leave program. endcase.ENDMODULE. " USER_COMMAND_0100 INPUT

FORM getdata . select vbeln erdat erzet ernam from vbak into table lt_vbak where vbeln in so_vbeln.ENDFORM. " getdata

FORM display . CALL METHOD O_GRID->SET_TABLE_FOR_FIRST_DISPLAY CHANGING IT_FIELDCATALOG = lt_fcat[] IT_OUTTAB = lt_vbak[].

ENDFORM. " display

FORM fldcat . CALL FUNCTION 'LVC_FIELDCATALOG_MERGE' EXPORTING I_STRUCTURE_NAME = 'ZMYVBAK' CHANGING CT_FIELDCAT = lt_fcat[].

if lt_fcat[] is not initial. loop at lt_fcat into ls_fcat. if ls_fcat-fieldname = 'ERDAT'. ls_fcat-col_pos = 3. ls_fcat-coltext = 'Created Date'. modify lt_fcat from ls_fcat transporting col_pos coltext. elseif ls_fcat-fieldname = 'ERZET'. ls_fcat-col_pos = 2. ls_fcat-coltext = 'Created Time'. modify lt_fcat from ls_fcat transporting col_pos coltext. endif. endloop. endif.endform.PRGRAM6:REPORT Z1130ALV6.

data : lv_vbeln type vbak-vbeln.select-options : so_vbeln for lv_vbeln.

types : begin of ty_vbak, vbeln type vbak-vbeln, erdat type vbak-erdat, erzet type vbak-erzet, ernam type vbak-ernam, end of ty_vbak.

data : lt_vbak type standard table of ty_vbak.

data : o_cont type ref to cl_gui_custom_container, " INTERFACE o_grid type ref to cl_gui_alv_grid. " ALV GRID

data : lt_fcat type lvc_t_fcat.

field-symbols like line of lt_fcat. "field symbols work area

initialization. so_vbeln-low = '4970'. so_vbeln-high = '4975'. append so_vbeln.

start-of-selection. call screen 100.

MODULE STATUS_0100 OUTPUT. SET PF-STATUS 'ABC'.if o_cont is initial. CREATE OBJECT O_CONT EXPORTING CONTAINER_NAME = 'CST'.

CREATE OBJECT O_GRID EXPORTING I_PARENT = o_cont.

perform getdata. if lt_vbak[] is not initial. perform fldcat. perform display. endif.

endif.ENDMODULE. " STATUS_0100 OUTPUT

MODULE USER_COMMAND_0100 INPUT. case sy-ucomm. when 'BACK'. leave program. endcase.ENDMODULE. " USER_COMMAND_0100 INPUT

FORM getdata . select vbeln erdat erzet ernam from vbak into table lt_vbak where vbeln in so_vbeln.ENDFORM. " getdata

FORM display . CALL METHOD O_GRID->SET_TABLE_FOR_FIRST_DISPLAY CHANGING IT_FIELDCATALOG = lt_fcat[] IT_OUTTAB = lt_vbak[].

ENDFORM. " display

FORM fldcat . CALL FUNCTION 'LVC_FIELDCATALOG_MERGE' EXPORTING I_STRUCTURE_NAME = 'ZMYVBAK' CHANGING CT_FIELDCAT = lt_fcat[].

if lt_fcat[] is not initial. loop at lt_fcat assigning . if -fieldname = 'ERDAT'. -col_pos = 3. -coltext = 'Created Date'. elseif -fieldname = 'ERZET'. -col_pos = 2. -coltext = 'Created Time'. endif. endloop. endif.endform.PRGRAM7:REPORT Z1130ALV7.

data : lv_vbeln type vbak-vbeln.select-options : so_vbeln for lv_vbeln.

types : begin of ty_vbak, vbeln type vbak-vbeln, erdat type vbak-erdat, erzet type vbak-erzet, ernam type vbak-ernam, end of ty_vbak.

data : lt_vbak type standard table of ty_vbak.

data : o_cont type ref to cl_gui_custom_container, " INTERFACE o_grid type ref to cl_gui_alv_grid. " ALV GRID

data : lt_fcat type lvc_t_fcat, ls_fcat like line of lt_fcat.

initialization. so_vbeln-low = '4970'. so_vbeln-high = '4975'. append so_vbeln.

start-of-selection. call screen 100.

MODULE STATUS_0100 OUTPUT. SET PF-STATUS 'ABC'.if o_cont is initial. CREATE OBJECT O_CONT EXPORTING CONTAINER_NAME = 'CST'.

CREATE OBJECT O_GRID EXPORTING I_PARENT = o_cont.

perform getdata. if lt_vbak[] is not initial. perform fldcat. perform display. endif.

endif.ENDMODULE. " STATUS_0100 OUTPUT

MODULE USER_COMMAND_0100 INPUT. case sy-ucomm. when 'BACK'. leave program. endcase.ENDMODULE. " USER_COMMAND_0100 INPUT

FORM getdata . select vbeln erdat erzet ernam from vbak into table lt_vbak where vbeln in so_vbeln.ENDFORM. " getdata

FORM display . CALL METHOD O_GRID->SET_TABLE_FOR_FIRST_DISPLAY CHANGING IT_FIELDCATALOG = lt_fcat[] IT_OUTTAB = lt_vbak[].

ENDFORM. " display

FORM fldcat . clear ls_fcat. ls_fcat-fieldname = 'vbeln'. ls_fcat-col_pos = 1. ls_fcat-coltext = 'Sales Doc'. ls_fcat-outputlen = 12. append ls_fcat to lt_fcat.

clear ls_fcat. ls_fcat-fieldname = 'ERDAT'. ls_fcat-col_pos = 2. ls_fcat-coltext = 'Created Date'. ls_fcat-outputlen = 12. append ls_fcat to lt_fcat.

clear ls_fcat. ls_fcat-fieldname = 'ERZET'. ls_fcat-col_pos = 3. ls_fcat-coltext = 'Created on'. ls_fcat-outputlen = 12. append ls_fcat to lt_fcat.

clear ls_fcat. ls_fcat-fieldname = 'ERNAM'. ls_fcat-col_pos = 4. ls_fcat-coltext = 'Created by'. ls_fcat-outputlen = 12. ls_fcat-tooltip = 'Created user'. append ls_fcat to lt_fcat.

endform.PRGRAM8:REPORT Z1130ALV8.

data : lv_vbeln type vbak-vbeln.select-options : so_vbeln for lv_vbeln.

types : begin of ty_vbak, vbeln type vbak-vbeln, erdat type vbak-erdat, erzet type vbak-erzet, ernam type vbak-ernam, end of ty_vbak.

data : lt_vbak type standard table of ty_vbak.

data : o_cont type ref to cl_gui_custom_container, " INTERFACE o_grid type ref to cl_gui_alv_grid. " ALV GRID

data : lt_fcat type lvc_t_fcat, ls_fcat like line of lt_fcat.

initialization. so_vbeln-low = '4970'. so_vbeln-high = '4975'. append so_vbeln.

start-of-selection. call screen 100.

MODULE STATUS_0100 OUTPUT. SET PF-STATUS 'ABC'.if o_cont is initial. CREATE OBJECT O_CONT EXPORTING CONTAINER_NAME = 'CST'.

CREATE OBJECT O_GRID EXPORTING I_PARENT = o_cont.

perform getdata. if lt_vbak[] is not initial. perform fldcat. perform display. endif.

endif.ENDMODULE. " STATUS_0100 OUTPUT

MODULE USER_COMMAND_0100 INPUT. case sy-ucomm. when 'BACK'. leave program. endcase.ENDMODULE. " USER_COMMAND_0100 INPUT

FORM getdata . select vbeln erdat erzet ernam from vbak into table lt_vbak where vbeln in so_vbeln.ENDFORM. " getdata

FORM display . CALL METHOD O_GRID->SET_TABLE_FOR_FIRST_DISPLAY CHANGING IT_FIELDCATALOG = lt_fcat[] IT_OUTTAB = lt_vbak[].

ENDFORM. " display

FORM fldcat . clear ls_fcat. ls_fcat-fieldname = 'VBELN'. ls_fcat-col_pos = 1. ls_fcat-coltext = 'Sales Doc'. ls_fcat-outputlen = 12. append ls_fcat to lt_fcat.

clear ls_fcat. ls_fcat-fieldname = 'ERDAT'. ls_fcat-col_pos = 2. ls_fcat-coltext = 'Created Date'. ls_fcat-outputlen = 12. append ls_fcat to lt_fcat.

clear ls_fcat. ls_fcat-fieldname = 'ERZET'. ls_fcat-col_pos = 3. ls_fcat-coltext = 'Created on'. ls_fcat-outputlen = 12. append ls_fcat to lt_fcat.

clear ls_fcat. ls_fcat-fieldname = 'ERNAM'. ls_fcat-col_pos = 4. ls_fcat-coltext = 'Created by'. ls_fcat-outputlen = 12. ls_fcat-tooltip = 'Created user'. append ls_fcat to lt_fcat.endform.PRGRAM9:REPORT Z1130ALV9.

data : lv_vbeln type vbak-vbeln.select-options : so_vbeln for lv_vbeln.

types : begin of ty_vbak, vbeln type vbak-vbeln, erdat type vbak-erdat, erzet type vbak-erzet, ernam type vbak-ernam, end of ty_vbak.

data : lt_vbak type standard table of ty_vbak.

data : o_cont type ref to cl_gui_custom_container, " INTERFACE o_grid type ref to cl_gui_alv_grid. " ALV GRID

data : lt_fcat type lvc_t_fcat, ls_fcat like line of lt_fcat.

data : lt_functions type ui_functions, lv_function type ui_func.

initialization. so_vbeln-low = '4970'. so_vbeln-high = '4975'. append so_vbeln.

start-of-selection. call screen 100.

MODULE STATUS_0100 OUTPUT. SET PF-STATUS 'ABC'.if o_cont is initial. CREATE OBJECT O_CONT EXPORTING CONTAINER_NAME = 'CST'.

CREATE OBJECT O_GRID EXPORTING I_PARENT = o_cont.

perform getdata. if lt_vbak[] is not initial. perform fldcat. perform excludebuttons. perform display. endif.

endif.ENDMODULE. " STATUS_0100 OUTPUT

MODULE USER_COMMAND_0100 INPUT. case sy-ucomm. when 'BACK'. leave program. endcase.ENDMODULE. " USER_COMMAND_0100 INPUT

FORM getdata . select vbeln erdat erzet ernam from vbak into table lt_vbak where vbeln in so_vbeln.ENDFORM. " getdata

FORM display . CALL METHOD O_GRID->SET_TABLE_FOR_FIRST_DISPLAY EXPORTING IT_TOOLBAR_EXCLUDING = lt_functions[] CHANGING IT_FIELDCATALOG = lt_fcat[] IT_OUTTAB = lt_vbak[].

ENDFORM. " display

FORM fldcat . clear ls_fcat. ls_fcat-fieldname = 'VBELN'. ls_fcat-col_pos = 1. ls_fcat-coltext = 'Sales Doc'. ls_fcat-outputlen = 12. append ls_fcat to lt_fcat.

clear ls_fcat. ls_fcat-fieldname = 'ERDAT'. ls_fcat-col_pos = 2. ls_fcat-coltext = 'Created Date'. ls_fcat-outputlen = 12. append ls_fcat to lt_fcat.

clear ls_fcat. ls_fcat-fieldname = 'ERZET'. ls_fcat-col_pos = 3. ls_fcat-coltext = 'Created on'. ls_fcat-outputlen = 12. append ls_fcat to lt_fcat.

clear ls_fcat. ls_fcat-fieldname = 'ERNAM'. ls_fcat-col_pos = 4. ls_fcat-coltext = 'Created by'. ls_fcat-outputlen = 12. ls_fcat-tooltip = 'Created user'. append ls_fcat to lt_fcat.endform.

FORM excludebuttons . clear lv_function. lv_function = cl_gui_alv_grid=>mc_fc_find. append lv_function to lt_functions.

clear lv_function. lv_function = cl_gui_alv_grid=>mc_fc_print. append lv_function to lt_functions.

ENDFORM. " excludebuttonsPRGRAM10:REPORT Z1130ALV10.

data : lv_vbeln type vbak-vbeln.select-options : so_vbeln for lv_vbeln.

types : begin of ty_vbak, courses(10) type c, vbeln type vbak-vbeln, erdat type vbak-erdat, erzet type vbak-erzet, ernam type vbak-ernam, end of ty_vbak.

data : lt_vbak type standard table of ty_vbak.

data : o_cont type ref to cl_gui_custom_container, " INTERFACE o_grid type ref to cl_gui_alv_grid. " ALV GRID

data : lt_fcat type lvc_t_fcat, ls_fcat like line of lt_fcat.

*for drop downdata : lt_drop type lvc_t_drop, "internal table ls_drop type lvc_s_drop. "work area

initialization. so_vbeln-low = '4970'. so_vbeln-high = '4975'. append so_vbeln.

start-of-selection. call screen 100.

MODULE STATUS_0100 OUTPUT. SET PF-STATUS 'ABC'.if o_cont is initial. CREATE OBJECT O_CONT EXPORTING CONTAINER_NAME = 'CST'.

CREATE OBJECT O_GRID EXPORTING I_PARENT = o_cont.

perform getdata. if lt_vbak[] is not initial. perform fldcat. perform dropdown. perform display. endif.

endif.ENDMODULE. " STATUS_0100 OUTPUT

MODULE USER_COMMAND_0100 INPUT. case sy-ucomm. when 'BACK'. leave program. endcase.ENDMODULE. " USER_COMMAND_0100 INPUT

FORM getdata . select vbeln erdat erzet ernam from vbak into corresponding fields of table lt_vbak where vbeln in so_vbeln.ENDFORM. " getdata

FORM display . CALL METHOD O_GRID->SET_TABLE_FOR_FIRST_DISPLAY CHANGING IT_FIELDCATALOG = lt_fcat[] IT_OUTTAB = lt_vbak[].

ENDFORM. " display

FORM fldcat . clear ls_fcat. ls_fcat-fieldname = 'COURSES'. ls_fcat-col_pos = 1. ls_fcat-coltext = 'Courses'. ls_fcat-outputlen = 10. ls_fcat-drdn_hndl = 25. ls_fcat-edit = 'X'. append ls_fcat to lt_fcat.

clear ls_fcat. ls_fcat-fieldname = 'VBELN'. ls_fcat-col_pos = 2. ls_fcat-coltext = 'Sales Doc'. ls_fcat-outputlen = 12. append ls_fcat to lt_fcat.

clear ls_fcat. ls_fcat-fieldname = 'ERDAT'. ls_fcat-col_pos = 3. ls_fcat-coltext = 'Created Date'. ls_fcat-outputlen = 12. append ls_fcat to lt_fcat.

clear ls_fcat. ls_fcat-fieldname = 'ERZET'. ls_fcat-col_pos = 4. ls_fcat-coltext = 'Created on'. ls_fcat-outputlen = 12. append ls_fcat to lt_fcat.

clear ls_fcat. ls_fcat-fieldname = 'ERNAM'. ls_fcat-col_pos = 5. ls_fcat-coltext = 'Created by'. ls_fcat-outputlen = 12. ls_fcat-tooltip = 'Created user'. append ls_fcat to lt_fcat.endform.

FORM dropdown . clear ls_drop. ls_drop-handle = 25. ls_drop-value = 'CORE ABAP'. append ls_drop to lt_drop.

clear ls_drop. ls_drop-handle = 25. ls_drop-value = 'OOPS ABAP'. append ls_drop to lt_drop.

clear ls_drop. ls_drop-handle = 25. ls_drop-value = 'CROSS APPS'. append ls_drop to lt_drop.

CALL METHOD O_GRID->SET_DROP_DOWN_TABLE EXPORTING IT_DROP_DOWN = lt_drop[].

ENDFORM. " dropdownPRGRAM11:REPORT Z1130ALV11.

data : lv_vbeln type vbak-vbeln.select-options : so_vbeln for lv_vbeln.

types : begin of ty_vbak, lights type c, vbeln type vbak-vbeln, erdat type vbak-erdat, erzet type vbak-erzet, ernam type vbak-ernam, end of ty_vbak.

data : lt_vbak type standard table of ty_vbak, ls_vbak type ty_vbak.

data : o_cont type ref to cl_gui_custom_container, " INTERFACE o_grid type ref to cl_gui_alv_grid. " ALV GRID

data : lt_fcat type lvc_t_fcat, ls_fcat like line of lt_fcat.

data : ls_layo type lvc_s_layo.

initialization. so_vbeln-low = '4970'. so_vbeln-high = '4975'. append so_vbeln.

start-of-selection. call screen 100.

MODULE STATUS_0100 OUTPUT. SET PF-STATUS 'ABC'.if o_cont is initial. CREATE OBJECT O_CONT EXPORTING CONTAINER_NAME = 'CST'.

CREATE OBJECT O_GRID EXPORTING I_PARENT = o_cont.

perform getdata. if lt_vbak[] is not initial. perform fldcat. perform trafficlights. perform layout. perform display. endif.

endif.ENDMODULE. " STATUS_0100 OUTPUT

MODULE USER_COMMAND_0100 INPUT. case sy-ucomm. when 'BACK'. leave program. endcase.ENDMODULE. " USER_COMMAND_0100 INPUT

FORM getdata . select vbeln erdat erzet ernam from vbak into corresponding fields of table lt_vbak where vbeln in so_vbeln.ENDFORM. " getdata

FORM display . CALL METHOD O_GRID->SET_TABLE_FOR_FIRST_DISPLAY EXPORTING IS_LAYOUT = ls_layo CHANGING IT_FIELDCATALOG = lt_fcat[] IT_OUTTAB = lt_vbak[].

ENDFORM. " display

FORM fldcat . clear ls_fcat. ls_fcat-fieldname = 'VBELN'. ls_fcat-col_pos = 1. ls_fcat-coltext = 'Sales Doc'. ls_fcat-outputlen = 12. append ls_fcat to lt_fcat.

clear ls_fcat. ls_fcat-fieldname = 'ERDAT'. ls_fcat-col_pos = 2. ls_fcat-coltext = 'Created Date'. ls_fcat-outputlen = 12. append ls_fcat to lt_fcat.

clear ls_fcat. ls_fcat-fieldname = 'ERZET'. ls_fcat-col_pos = 3. ls_fcat-coltext = 'Created on'. ls_fcat-outputlen = 12. append ls_fcat to lt_fcat.

clear ls_fcat. ls_fcat-fieldname = 'ERNAM'. ls_fcat-col_pos = 4. ls_fcat-coltext = 'Created by'. ls_fcat-outputlen = 12. ls_fcat-tooltip = 'Created user'. append ls_fcat to lt_fcat.endform.

FORM trafficlights . loop at lt_vbak into ls_vbak. if ls_vbak-erdat = '19970103'. ls_vbak-lights = '1'. elseif ls_vbak-erdat = '19970107'. ls_vbak-lights = '2'. else. ls_vbak-lights = '3'. endif. modify lt_vbak from ls_vbak transporting lights. endloop.ENDFORM. " trafficlights

FORM layout . clear ls_layo. ls_layo-excp_fname = 'LIGHTS'.ENDFORM. " layoutPRGRAM12:REPORT Z1130ALV12.

data : lv_vbeln type vbak-vbeln.select-options : so_vbeln for lv_vbeln.

types : begin of ty_vbak, vbeln type vbak-vbeln, erdat type vbak-erdat, erzet type vbak-erzet, ernam type vbak-ernam, end of ty_vbak.

data : lt_vbak type standard table of ty_vbak, ls_vbak type ty_vbak.

data : o_cont type ref to cl_gui_custom_container, " INTERFACE o_grid type ref to cl_gui_alv_grid. " ALV GRID

data : lt_fcat type lvc_t_fcat, ls_fcat like line of lt_fcat.

initialization. so_vbeln-low = '4970'. so_vbeln-high = '4975'. append so_vbeln.

start-of-selection. call screen 100.

MODULE STATUS_0100 OUTPUT. SET PF-STATUS 'ABC'.if o_cont is initial. CREATE OBJECT O_CONT EXPORTING CONTAINER_NAME = 'CST'.

CREATE OBJECT O_GRID EXPORTING I_PARENT = o_cont.

perform getdata. if lt_vbak[] is not initial. perform fldcat. perform display. endif.

endif.ENDMODULE. " STATUS_0100 OUTPUT

MODULE USER_COMMAND_0100 INPUT. case sy-ucomm. when 'BACK'. leave program. endcase.ENDMODULE. " USER_COMMAND_0100 INPUT

FORM getdata . select vbeln erdat erzet ernam from vbak into table lt_vbak where vbeln in so_vbeln.ENDFORM. " getdata

FORM display . CALL METHOD O_GRID->SET_TABLE_FOR_FIRST_DISPLAY CHANGING IT_FIELDCATALOG = lt_fcat[] IT_OUTTAB = lt_vbak[].

ENDFORM. " display

FORM fldcat . clear ls_fcat. ls_fcat-fieldname = 'VBELN'. ls_fcat-col_pos = 1. ls_fcat-coltext = 'Sales Doc'. ls_fcat-outputlen = 12. ls_fcat-style = cl_gui_alv_grid=>MC_STYLE_BUTTON. append ls_fcat to lt_fcat.

clear ls_fcat. ls_fcat-fieldname = 'ERDAT'. ls_fcat-col_pos = 2. ls_fcat-coltext = 'Created Date'. ls_fcat-outputlen = 12. append ls_fcat to lt_fcat.

clear ls_fcat. ls_fcat-fieldname = 'ERZET'. ls_fcat-col_pos = 3. ls_fcat-coltext = 'Created on'. ls_fcat-outputlen = 12. append ls_fcat to lt_fcat.

clear ls_fcat. ls_fcat-fieldname = 'ERNAM'. ls_fcat-col_pos = 4. ls_fcat-coltext = 'Created by'. ls_fcat-outputlen = 12. ls_fcat-tooltip = 'Created user'. append ls_fcat to lt_fcat.endform.PRGRAM13:REPORTZ1130ALV13.

data:lv_vbelntypevbak-vbeln.select-options:so_vbelnforlv_vbeln.

types:beginofty_vbak,color(4)typec,vbelntypevbak-vbeln,erdattypevbak-erdat,erzettypevbak-erzet,ernamtypevbak-ernam,endofty_vbak.

data:lt_vbaktypestandardtableofty_vbak,ls_vbaktypety_vbak.

data:o_conttypereftocl_gui_custom_container,"INTERFACEo_gridtypereftocl_gui_alv_grid."ALVGRID

data:lt_fcattypelvc_t_fcat,ls_fcatlikelineoflt_fcat.

data:ls_layotypelvc_s_layo.

initialization.so_vbeln-low='4970'.so_vbeln-high='4975'.appendso_vbeln.

start-of-selection.callscreen100.

MODULESTATUS_0100OUTPUT.SETPF-STATUS'ABC'.ifo_contisinitial.CREATEOBJECTO_CONTEXPORTINGCONTAINER_NAME='CST'.

CREATEOBJECTO_GRIDEXPORTINGI_PARENT=o_cont.

performgetdata.iflt_vbak[]isnotinitial.performfldcat.performcolorrows.performlayout.performdisplay.endif.

endif.ENDMODULE."STATUS_0100OUTPUT

MODULEUSER_COMMAND_0100INPUT.casesy-ucomm.when'BACK'.leaveprogram.endcase.ENDMODULE."USER_COMMAND_0100INPUT

FORMgetdata.selectvbelnerdaterzeternamfromvbakintocorrespondingfieldsoftablelt_vbakwherevbelninso_vbeln.ENDFORM."getdata

FORMdisplay.CALLMETHODO_GRID->SET_TABLE_FOR_FIRST_DISPLAYEXPORTINGIS_LAYOUT=ls_layoCHANGINGIT_FIELDCATALOG=lt_fcat[]IT_OUTTAB=lt_vbak[].

ENDFORM."display

FORMfldcat.clearls_fcat.ls_fcat-fieldname='VBELN'.ls_fcat-col_pos=1.ls_fcat-coltext='SalesDoc'.ls_fcat-outputlen=12.appendls_fcattolt_fcat.

clearls_fcat.ls_fcat-fieldname='ERDAT'.ls_fcat-col_pos=2.ls_fcat-coltext='CreatedDate'.ls_fcat-outputlen=12.appendls_fcattolt_fcat.

clearls_fcat.ls_fcat-fieldname='ERZET'.ls_fcat-col_pos=3.ls_fcat-coltext='Createdon'.ls_fcat-outputlen=12.appendls_fcattolt_fcat.

clearls_fcat.ls_fcat-fieldname='ERNAM'.ls_fcat-col_pos=4.ls_fcat-coltext='Createdby'.ls_fcat-outputlen=12.ls_fcat-tooltip='Createduser'.appendls_fcattolt_fcat.endform.

FORMlayout.clearls_layo.ls_layo-info_fname='COLOR'.ENDFORM."layout

FORMcolorrows.loopatlt_vbakintols_vbak.ifls_vbak-erdat='19970103'.ls_vbak-color='C613'.elseifls_vbak-erdat='19970107'.ls_vbak-color='C410'.else.ls_vbak-color='C216'.endif.modifylt_vbakfromls_vbaktransportingcolor.endloop.ENDFORM."colorrowsPRGRAM14:REPORTZ1130ALV14.

data:lv_vbelntypevbak-vbeln.select-options:so_vbelnforlv_vbeln.

types:beginofty_vbak,vbelntypevbak-vbeln,erdattypevbak-erdat,erzettypevbak-erzet,ernamtypevbak-ernam,endofty_vbak.

data:lt_vbaktypestandardtableofty_vbak.

data:o_conttypereftocl_gui_custom_container,"INTERFACEo_gridtypereftocl_gui_alv_grid."ALVGRID

data:o_docktypereftocl_gui_docking_container.

data:lt_fcattypelvc_t_fcat,ls_fcatlikelineoflt_fcat.

datamodetypei.

initialization.so_vbeln-low='4970'.so_vbeln-high='4975'.appendso_vbeln.

start-of-selection.callscreen100.

MODULESTATUS_0100OUTPUT.SETPF-STATUS'ABC'.mode=cl_gui_alv_grid=>offline().ifmodeeq0.ifo_contisinitial.CREATEOBJECTO_CONTEXPORTINGCONTAINER_NAME='CST'.

CREATEOBJECTO_GRIDEXPORTINGI_PARENT=o_cont.endif.else.CREATEOBJECTO_GRIDEXPORTINGI_PARENT=o_dock.endif.

performgetdata.iflt_vbak[]isnotinitial.performfldcat.performdisplay.endif.ENDMODULE."STATUS_0100OUTPUT

MODULEUSER_COMMAND_0100INPUT.casesy-ucomm.when'BACK'.leaveprogram.endcase.ENDMODULE."USER_COMMAND_0100INPUT

FORMgetdata.selectvbelnerdaterzeternamfromvbakintotablelt_vbakwherevbelninso_vbeln.ENDFORM."getdata

FORMdisplay.CALLMETHODO_GRID->SET_TABLE_FOR_FIRST_DISPLAYCHANGINGIT_FIELDCATALOG=lt_fcat[]IT_OUTTAB=lt_vbak[].

ENDFORM."display

FORMfldcat.clearls_fcat.ls_fcat-fieldname='VBELN'.ls_fcat-col_pos=1.ls_fcat-coltext='SalesDoc'.ls_fcat-outputlen=12.appendls_fcattolt_fcat.

clearls_fcat.ls_fcat-fieldname='ERDAT'.ls_fcat-col_pos=2.ls_fcat-coltext='CreatedDate'.ls_fcat-outputlen=12.appendls_fcattolt_fcat.

clearls_fcat.ls_fcat-fieldname='ERZET'.ls_fcat-col_pos=3.ls_fcat-coltext='Createdon'.ls_fcat-outputlen=12.appendls_fcattolt_fcat.

clearls_fcat.ls_fcat-fieldname='ERNAM'.ls_fcat-col_pos=4.ls_fcat-coltext='Createdby'.ls_fcat-outputlen=12.ls_fcat-tooltip='Createduser'.appendls_fcattolt_fcat.endform.PROGRAM15:REPORTZ1130ALV15.

datalv_kunnrtypekna1-kunnr.data:cust_conttypereftocl_gui_custom_container,o_splittypereftocl_gui_splitter_container,o_cont1typereftocl_gui_container,o_cont2typereftocl_gui_container,o_cont3typereftocl_gui_container,kna1_gridtypereftocl_gui_alv_grid,vbak_gridtypereftocl_gui_alv_grid,vbap_gridtypereftocl_gui_alv_grid.

types:beginofty_kna1,kunnrtypekna1-kunnr,land1typekna1-land1,name1typekna1-name1,endofty_kna1.

data:lt_kna1typestandardtableofty_kna1,ls_kna1typety_kna1.

types:beginofty_vbak,cellstylestypelvc_t_styl,vbelntypevbak-vbeln,erdattypevbak-erdat,erzettypevbak-erzet,ernamtypevbak-ernam,kunnrtypevbak-kunnr,endofty_vbak.

data:lt_vbaktypestandardtableofty_vbak,ls_vbaktypety_vbak.

types:beginofty_vbap,vbelntypevbap-vbeln,posnrtypevbap-posnr,matnrtypevbap-matnr,endofty_vbap.

data:lt_vbaptypestandardtableofty_vbap,ls_vbaptypety_vbap.

datalv_vbelntypevbeln.data:lt_fcattypelvc_t_fcat,ls_fcatlikelineoflt_fcat.

datals_layotypelvc_s_layo.

classlcl_eventreceiverdefinition.publicsection.methodshandle_hotspot_clickforeventhotspot_clickofcl_gui_alv_gridimportinge_row_id.methodshandle_button_clickforeventbutton_clickofcl_gui_alv_gridimportinges_row_no.endclass.

classlcl_eventreceiverimplementation.methodhandle_hotspot_click.readtablelt_kna1intols_kna1indexe_row_id-index.ifsy-subrceq0.clearlv_kunnr.lv_kunnr=ls_kna1-kunnr.iflv_kunnrisnotinitial.performgetsales.performstyles.iflt_vbak[]isnotinitial.performfldcatvbak.performlayoutvbak.performdisplayvbak.else.message'Nosalesorders'type'I'.CALLMETHODVBAK_GRID->REFRESH_TABLE_DISPLAY.endif.endif.endif.endmethod.

methodhandle_button_click.readtablelt_vbakintols_vbakindexes_row_no-row_id.ifsy-subrceq0.lv_vbeln=ls_vbak-vbeln.iflv_vbelnisnotinitial.performgetitems.iflt_vbap[]isnotinitial.performfldcatvbap.performlayoutvbap.performdisplayvbap.else.message'Noitems'type'I'.CALLMETHODVBAP_GRID->REFRESH_TABLE_DISPLAY.endif.endif.endif.endmethod.endclass.

dataobtypereftolcl_eventreceiver.

select-options:so_kunnrforlv_kunnr.initialization.so_kunnr-low='1000'.so_kunnr-high='1200'.appendso_kunnr.

start-of-selection.callscreen100.

MODULESTATUS_0100OUTPUT.SETPF-STATUS'ABC'.ifcust_contisinitial.CREATEOBJECTCUST_CONTEXPORTINGCONTAINER_NAME='CST'.

CREATEOBJECTO_SPLITEXPORTINGPARENT=cust_contROWS=3COLUMNS=1.

CALLMETHODO_SPLIT->SET_ROW_HEIGHTEXPORTINGID=1HEIGHT=9.

CALLMETHODO_SPLIT->SET_ROW_HEIGHTEXPORTINGID=2HEIGHT=5.

CALLMETHODO_SPLIT->SET_ROW_HEIGHTEXPORTINGID=3HEIGHT=3.

CALLMETHODO_SPLIT->GET_CONTAINEREXPORTINGROW=1COLUMN=1RECEIVINGCONTAINER=o_cont1.

CALLMETHODO_SPLIT->GET_CONTAINEREXPORTINGROW=2COLUMN=1RECEIVINGCONTAINER=o_cont2.

CALLMETHODO_SPLIT->GET_CONTAINEREXPORTINGROW=3COLUMN=1RECEIVINGCONTAINER=o_cont3.

performgetcustomers.iflt_kna1[]isnotinitial.performfldcatkna1.performlayoutkna1.performdisplaykna1.endif.

endif.ENDMODULE."STATUS_0100OUTPUT

MODULEUSER_COMMAND_0100INPUT.casesy-ucomm.when'BACK'.leaveprogram.endcase.ENDMODULE."USER_COMMAND_0100INPUT

FORMgetcustomers.selectkunnrland1name1fromkna1intotablelt_kna1wherekunnrinso_kunnr.ENDFORM."getcustomers

FORMfldcatkna1.clearls_fcat.ls_fcat-fieldname='KUNNR'.ls_fcat-col_pos=1.ls_fcat-coltext='CustomerNo'.ls_fcat-outputlen=12.ls_fcat-hotspot='X'.appendls_fcattolt_fcat.

clearls_fcat.ls_fcat-fieldname='LAND1'.ls_fcat-col_pos=2.ls_fcat-coltext='Country'.ls_fcat-outputlen=5.appendls_fcattolt_fcat.

clearls_fcat.ls_fcat-fieldname='NAME1'.ls_fcat-col_pos=3.ls_fcat-coltext='CustomerName'.ls_fcat-outputlen=22.appendls_fcattolt_fcat.

ENDFORM."fldcatkna1

FORMlayoutkna1.clearls_layo.ls_layo-grid_title='CUSTOMERMASTERDATA'.ENDFORM."layoutkna1

FORMdisplaykna1.CREATEOBJECTKNA1_GRIDEXPORTINGI_PARENT=o_cont1.

createobjectob.sethandlerob->handle_hotspot_clickforkna1_grid.

CALLMETHODKNA1_GRID->SET_TABLE_FOR_FIRST_DISPLAYEXPORTINGIS_LAYOUT=ls_layoCHANGINGIT_OUTTAB=lt_kna1[]IT_FIELDCATALOG=lt_fcat[].

ENDFORM."displaykna1

FORMgetsales.selectvbelnerdaterzeternamkunnrfromvbakintocorrespondingfieldsoftablelt_vbakwherekunnr=lv_kunnr.

ENDFORM."getsales

FORMfldcatvbak.refreshlt_fcat.clearls_fcat.ls_fcat-fieldname='VBELN'.ls_fcat-col_pos=1.ls_fcat-coltext='SalesDoc'.ls_fcat-outputlen=12.appendls_fcattolt_fcat.

clearls_fcat.ls_fcat-fieldname='ERDAT'.ls_fcat-col_pos=2.ls_fcat-coltext='CreationDate'.ls_fcat-outputlen=12.appendls_fcattolt_fcat.

clearls_fcat.ls_fcat-fieldname='ERZET'.ls_fcat-col_pos=3.ls_fcat-coltext='Time'.ls_fcat-outputlen=12.appendls_fcattolt_fcat.

clearls_fcat.ls_fcat-fieldname='ERNAM'.ls_fcat-col_pos=4.ls_fcat-coltext='Createdby'.ls_fcat-outputlen=12.appendls_fcattolt_fcat.

clearls_fcat.ls_fcat-fieldname='KUNNR'.ls_fcat-col_pos=5.ls_fcat-coltext='Customer'.ls_fcat-outputlen=12.appendls_fcattolt_fcat.

ENDFORM."fldcatvbak

FORMlayoutvbak.clearls_layo.ls_layo-grid_title='SALESORDERS'.ls_layo-stylefname='CELLSTYLES'.ENDFORM."layoutvbak

FORMdisplayvbak.ifvbak_gridisinitial.CREATEOBJECTVBAK_GRIDEXPORTINGI_PARENT=o_cont2.

createobjectob.sethandlerob->handle_button_clickforvbak_grid.

CALLMETHODVBAK_GRID->SET_TABLE_FOR_FIRST_DISPLAYEXPORTINGIS_LAYOUT=ls_layoCHANGINGIT_OUTTAB=lt_vbak[]IT_FIELDCATALOG=lt_fcat[].else.CALLMETHODVBAK_GRID->REFRESH_TABLE_DISPLAY.endif.ENDFORM."displayvbak

FORMstyles.datalv_year(4)typec.datals_styltypelvc_s_styl.loopatlt_vbakintols_vbak.lv_year=ls_vbak-erdat+0(4).iflv_year>='2000'.ls_styl-fieldname='VBELN'.ls_styl-style=cl_gui_alv_grid=>mc_style_button.appendls_styltols_vbak-cellstyles.modifylt_vbakfromls_vbaktransportingcellstyles.endif.endloop.ENDFORM."styles

FORMgetitems.selectvbelnposnrmatnrfromvbapintotablelt_vbapwherevbeln=lv_vbeln.ENDFORM."getitems

FORMfldcatvbap.refreshlt_fcat.clearls_fcat.ls_fcat-fieldname='VBELN'.ls_fcat-col_pos=1.ls_fcat-coltext='Salesdoc'.ls_fcat-outputlen=10.appendls_fcattolt_fcat.

clearls_fcat.ls_fcat-fieldname='POSNR'.ls_fcat-col_pos=2.ls_fcat-coltext='ItemNo'.ls_fcat-outputlen=5.appendls_fcattolt_fcat.

clearls_fcat.ls_fcat-fieldname='MATNR'.ls_fcat-col_pos=3.ls_fcat-coltext='Material'.ls_fcat-outputlen=10.appendls_fcattolt_fcat.

ENDFORM."fldcatvbap

FORMlayoutvbap.clearls_layo.ls_layo-grid_title='MATERIALDATA'.ENDFORM."layoutvbap

FORMdisplayvbap.ifvbap_gridisinitial.CREATEOBJECTVBAP_GRIDEXPORTINGI_PARENT=o_cont3.

CALLMETHODVBAP_GRID->SET_TABLE_FOR_FIRST_DISPLAYEXPORTINGIS_LAYOUT=ls_layoCHANGINGIT_OUTTAB=lt_vbap[]IT_FIELDCATALOG=lt_fcat[].else.CALLMETHODVBAP_GRID->REFRESH_TABLE_DISPLAY.endif.ENDFORM."displayvbapModified PROGRAM15:REPORT Z1130ALV15.

type-pools cndp.data lv_kunnr type kna1-kunnr.data : cust_cont type ref to cl_gui_custom_container, o_split type ref to cl_gui_splitter_container, o_cont1 type ref to cl_gui_container, o_cont2 type ref to cl_gui_container, o_cont3 type ref to cl_gui_container, kna1_grid type ref to cl_gui_alv_grid, vbak_grid type ref to cl_gui_alv_grid, vbap_grid type ref to cl_gui_alv_grid.

* for screen 200data : cust_cont1 type ref to cl_gui_custom_container, o_split1 type ref to cl_gui_splitter_container, o_split2 type ref to cl_gui_splitter_container, o_cont4 type ref to cl_gui_container, o_cont5 type ref to cl_gui_container, o_cont6 type ref to cl_gui_container, o_cont7 type ref to cl_gui_container, marc_grid type ref to cl_gui_alv_grid, o_pic type ref to cl_gui_picture.

types : begin of ty_kna1, kunnr type kna1-kunnr, land1 type kna1-land1, name1 type kna1-name1, end of ty_kna1.

data : lt_kna1 type standard table of ty_kna1, ls_kna1 type ty_kna1.

types : begin of ty_vbak, cellstyles type lvc_t_styl, vbeln type vbak-vbeln, erdat type vbak-erdat, erzet type vbak-erzet, ernam type vbak-ernam, kunnr type vbak-kunnr, end of ty_vbak.

data : lt_vbak type standard table of ty_vbak, ls_vbak type ty_vbak.

types : begin of ty_vbap, vbeln type vbap-vbeln, posnr type vbap-posnr, matnr type vbap-matnr, end of ty_vbap.

data : lt_vbap type standard table of ty_vbap, ls_vbap type ty_vbap.

types : begin of ty_marc, matnr type marc-matnr, werks type marc-werks, pstat type marc-pstat, end of ty_marc.

data : lt_marc type standard table of ty_marc, ls_marc type ty_marc.

data lv_vbeln type vbeln.data lv_matnr type matnr.data : lt_fcat type lvc_t_fcat, ls_fcat like line of lt_fcat.

data ls_layo type lvc_s_layo.

class lcl_eventreceiver definition. public section. methods handle_hotspot_click for event hotspot_click of cl_gui_alv_grid importing e_row_id. methods handle_button_click for event button_click of cl_gui_alv_grid importing es_row_no. methods handle_double_click for event double_click of cl_gui_alv_grid importing e_row.endclass.

class lcl_eventreceiver implementation. method handle_hotspot_click. read table lt_kna1 into ls_kna1 index e_row_id-index. if sy-subrc eq 0. clear lv_kunnr. lv_kunnr = ls_kna1-kunnr. if lv_kunnr is not initial. perform getsales. perform styles. if lt_vbak[] is not initial. perform fldcatvbak. perform layoutvbak. perform displayvbak. else. message 'No sales orders' type 'I'. CALL METHOD VBAK_GRID->REFRESH_TABLE_DISPLAY. endif. endif. endif. endmethod.

method handle_button_click. read table lt_vbak into ls_vbak index es_row_no-row_id. if sy-subrc eq 0. lv_vbeln = ls_vbak-vbeln. if lv_vbeln is not initial. perform getitems. if lt_vbap[] is not initial. perform fldcatvbap. perform layoutvbap. perform displayvbap. else. message 'No items' type 'I'. CALL METHOD VBAP_GRID->REFRESH_TABLE_DISPLAY. endif. endif. endif. endmethod.

method handle_double_click. read table lt_vbap into ls_vbap index e_row-index. if sy-subrc eq 0. lv_matnr = ls_vbap-matnr. if lv_matnr is not initial. perform getplants. if lt_marc[] is not initial. call screen 200. else. message 'No plant data' type 'I'. endif. endif. endif. endmethod.endclass.

data ob type ref to lcl_eventreceiver.

select-options : so_kunnr for lv_kunnr.initialization. so_kunnr-low = '1000'. so_kunnr-high = '1200'. append so_kunnr.

start-of-selection. call screen 100.

MODULE STATUS_0100 OUTPUT. SET PF-STATUS 'ABC'.if cust_cont is initial. CREATE OBJECT CUST_CONT EXPORTING CONTAINER_NAME = 'CST'.

CREATE OBJECT O_SPLIT EXPORTING PARENT = cust_cont ROWS = 3 COLUMNS = 1.

CALL METHOD O_SPLIT->SET_ROW_HEIGHT EXPORTING ID = 1 HEIGHT = 6.

CALL METHOD O_SPLIT->SET_ROW_HEIGHT EXPORTING ID = 2 HEIGHT = 5.

CALL METHOD O_SPLIT->SET_ROW_HEIGHT EXPORTING ID = 3 HEIGHT = 6.

CALL METHOD O_SPLIT->GET_CONTAINER EXPORTING ROW = 1 COLUMN = 1 RECEIVING CONTAINER = o_cont1.

CALL METHOD O_SPLIT->GET_CONTAINER EXPORTING ROW = 2 COLUMN = 1 RECEIVING CONTAINER = o_cont2.

CALL METHOD O_SPLIT->GET_CONTAINER EXPORTING ROW = 3 COLUMN = 1 RECEIVING CONTAINER = o_cont3.

perform getcustomers. if lt_kna1[] is not initial. perform fldcatkna1. perform layoutkna1. perform displaykna1. endif.

endif.ENDMODULE. " STATUS_0100 OUTPUT

MODULE USER_COMMAND_0100 INPUT. case sy-ucomm. when 'BACK'. leave program. endcase.ENDMODULE. " USER_COMMAND_0100 INPUT

FORM getcustomers . select kunnr land1 name1 from kna1 into table lt_kna1 where kunnr in so_kunnr.ENDFORM. " getcustomers

FORM fldcatkna1 . clear ls_fcat. ls_fcat-fieldname = 'KUNNR'. ls_fcat-col_pos = 1. ls_fcat-coltext = 'Customer No'. ls_fcat-outputlen = 12. ls_fcat-hotspot = 'X'. append ls_fcat to lt_fcat.

clear ls_fcat. ls_fcat-fieldname = 'LAND1'. ls_fcat-col_pos = 2. ls_fcat-coltext = 'Country'. ls_fcat-outputlen = 5. append ls_fcat to lt_fcat.

clear ls_fcat. ls_fcat-fieldname = 'NAME1'. ls_fcat-col_pos = 3. ls_fcat-coltext = 'Customer Name'. ls_fcat-outputlen = 22. append ls_fcat to lt_fcat.

ENDFORM. " fldcatkna1

FORM layoutkna1 . clear ls_layo. ls_layo-grid_title = 'CUSTOMER MASTER DATA'.ENDFORM. " layoutkna1

FORM displaykna1 . CREATE OBJECT KNA1_GRID EXPORTING I_PARENT = o_cont1.

create object ob. set handler ob->handle_hotspot_click for kna1_grid.

CALL METHOD KNA1_GRID->SET_TABLE_FOR_FIRST_DISPLAY EXPORTING IS_LAYOUT = ls_layo CHANGING IT_OUTTAB = lt_kna1[] IT_FIELDCATALOG = lt_fcat[].

ENDFORM. " displaykna1

FORM getsales . select vbeln erdat erzet ernam kunnr from vbak into corresponding fields of table lt_vbak where kunnr = lv_kunnr.

ENDFORM. " getsales

FORM fldcatvbak . refresh lt_fcat. clear ls_fcat. ls_fcat-fieldname = 'VBELN'. ls_fcat-col_pos = 1. ls_fcat-coltext = 'Sales Doc'. ls_fcat-outputlen = 12. append ls_fcat to lt_fcat.

clear ls_fcat. ls_fcat-fieldname = 'ERDAT'. ls_fcat-col_pos = 2. ls_fcat-coltext = 'Creation Date'. ls_fcat-outputlen = 12. append ls_fcat to lt_fcat.

clear ls_fcat. ls_fcat-fieldname = 'ERZET'. ls_fcat-col_pos = 3. ls_fcat-coltext = 'Time'. ls_fcat-outputlen = 12. append ls_fcat to lt_fcat.

clear ls_fcat. ls_fcat-fieldname = 'ERNAM'. ls_fcat-col_pos = 4. ls_fcat-coltext = 'Created by'. ls_fcat-outputlen = 12. append ls_fcat to lt_fcat.

clear ls_fcat. ls_fcat-fieldname = 'KUNNR'. ls_fcat-col_pos = 5. ls_fcat-coltext = 'Customer'. ls_fcat-outputlen = 12. append ls_fcat to lt_fcat.

ENDFORM. " fldcatvbak

FORM layoutvbak . clear ls_layo. ls_layo-grid_title = 'SALES ORDERS'. ls_layo-stylefname = 'CELLSTYLES'.ENDFORM. " layoutvbak

FORM displayvbak . if vbak_grid is initial. CREATE OBJECT VBAK_GRID EXPORTING I_PARENT = o_cont2.

create object ob. set handler ob->handle_button_click for vbak_grid.

CALL METHOD VBAK_GRID->SET_TABLE_FOR_FIRST_DISPLAY EXPORTING IS_LAYOUT = ls_layo CHANGING IT_OUTTAB = lt_vbak[] IT_FIELDCATALOG = lt_fcat[].else. CALL METHOD VBAK_GRID->REFRESH_TABLE_DISPLAY.endif.ENDFORM. " displayvbak

FORM styles .data lv_year(4) type c.data ls_styl type lvc_s_styl. loop at lt_vbak into ls_vbak. lv_year = ls_vbak-erdat+0(4). if lv_year >= '2000'. ls_styl-fieldname = 'VBELN'. ls_styl-style = cl_gui_alv_grid=>mc_style_button. append ls_styl to ls_vbak-cellstyles. modify lt_vbak from ls_vbak transporting cellstyles. endif. endloop.ENDFORM. " styles

FORM getitems . select vbeln posnr matnr from vbap into table lt_vbap where vbeln = lv_vbeln.ENDFORM. " getitems

FORM fldcatvbap . refresh lt_fcat. clear ls_fcat. ls_fcat-fieldname = 'VBELN'. ls_fcat-col_pos = 1. ls_fcat-coltext = 'Sales doc'. ls_fcat-outputlen = 10. append ls_fcat to lt_fcat.

clear ls_fcat. ls_fcat-fieldname = 'POSNR'. ls_fcat-col_pos = 2. ls_fcat-coltext = 'Item No'. ls_fcat-outputlen = 5. append ls_fcat to lt_fcat.

clear ls_fcat. ls_fcat-fieldname = 'MATNR'. ls_fcat-col_pos = 3. ls_fcat-coltext = 'Material'. ls_fcat-outputlen = 10. append ls_fcat to lt_fcat.

ENDFORM. " fldcatvbap

FORM layoutvbap . clear ls_layo. ls_layo-grid_title = 'MATERIAL DATA'.ENDFORM. " layoutvbap

FORM displayvbap . if vbap_grid is initial. CREATE OBJECT VBAP_GRID EXPORTING I_PARENT = o_cont3.

create object ob. set handler ob->handle_double_click for vbap_grid.

CALL METHOD VBAP_GRID->SET_TABLE_FOR_FIRST_DISPLAY EXPORTING IS_LAYOUT = ls_layo CHANGING IT_OUTTAB = lt_vbap[] IT_FIELDCATALOG = lt_fcat[]. else. CALL METHOD VBAP_GRID->REFRESH_TABLE_DISPLAY.endif.ENDFORM. " displayvbap

FORM getplants . select matnr werks pstat from marc into table lt_marc where matnr = lv_matnr.ENDFORM. " getplants

MODULE STATUS_0200 OUTPUT. SET PF-STATUS 'PQR'.if cust_cont1 is initial. CREATE OBJECT CUST_CONT1 EXPORTING CONTAINER_NAME = 'CST1'.

CREATE OBJECT O_SPLIT1 EXPORTING PARENT = cust_cont1 ROWS = 1 COLUMNS = 2.

CALL METHOD O_SPLIT1->SET_COLUMN_WIDTH EXPORTING ID = 1 WIDTH = 10.

CALL METHOD O_SPLIT1->SET_COLUMN_WIDTH EXPORTING ID = 2 WIDTH = 5.

CALL METHOD O_SPLIT1->GET_CONTAINER EXPORTING ROW = 1 COLUMN = 1 RECEIVING CONTAINER = o_cont4.

CALL METHOD O_SPLIT1->GET_CONTAINER EXPORTING ROW = 1 COLUMN = 2 RECEIVING CONTAINER = o_cont5.

CREATE OBJECT O_SPLIT2 EXPORTING PARENT = o_cont4 ROWS = 2 COLUMNS = 1.

CALL METHOD O_SPLIT2->SET_ROW_HEIGHT EXPORTING ID = 1 HEIGHT = 4.

CALL METHOD O_SPLIT2->SET_ROW_HEIGHT EXPORTING ID = 2 HEIGHT = 9.

CALL METHOD O_SPLIT2->GET_CONTAINER EXPORTING ROW = 1 COLUMN = 1 RECEIVING CONTAINER = o_cont6.

CALL METHOD O_SPLIT2->GET_CONTAINER EXPORTING ROW = 2 COLUMN = 1 RECEIVING CONTAINER = o_cont7.

perform fldcatplant. perform layoutplant. perform displayplant. PERFORM PICTURE.else. CALL METHOD MARC_GRID->REFRESH_TABLE_DISPLAY.endif.

ENDMODULE. " STATUS_0200 OUTPUT

MODULE USER_COMMAND_0200 INPUT. case sy-ucomm. when 'BACK'. leave to screen 100. endcase.ENDMODULE. " USER_COMMAND_0200 INPUT

FORM fldcatplant . refresh lt_fcat. clear ls_fcat. ls_fcat-fieldname = 'MATNR'. ls_fcat-coltext = 'Material'. ls_fcat-col_pos = 1. ls_fcat-outputlen = 10. append ls_fcat to lt_fcat.

clear ls_fcat. ls_fcat-fieldname = 'WERKS'. ls_fcat-coltext = 'Plant'. ls_fcat-col_pos = 2. ls_fcat-outputlen = 8. append ls_fcat to lt_fcat.

clear ls_fcat. ls_fcat-fieldname = 'PSTAT'. ls_fcat-coltext = 'Status'. ls_fcat-col_pos = 3. ls_fcat-outputlen = 6. append ls_fcat to lt_fcat.

ENDFORM. " plantdata

FORM layoutplant . clear ls_layo. ls_layo-grid_title = 'PLANT DATA'.ENDFORM. " layoutplant

FORM displayplant . CREATE OBJECT MARC_GRID EXPORTING I_PARENT = o_cont7.

CALL METHOD MARC_GRID->SET_TABLE_FOR_FIRST_DISPLAY EXPORTING IS_LAYOUT = ls_layo CHANGING IT_OUTTAB = lt_marc[] IT_FIELDCATALOG = lt_fcat[].ENDFORM. " displayplant

FORM PICTURE . data : pic_url type cndp_url. CALL FUNCTION 'DP_PUBLISH_WWW_URL' EXPORTING OBJID = 'Z1130OOPS' LIFETIME = CNDP_LIFETIME_TRANSACTION IMPORTING URL = pic_url.

CREATE OBJECT O_PIC EXPORTING PARENT = o_cont5.

CALL METHOD O_PIC->LOAD_PICTURE_FROM_URL EXPORTING URL = pic_url.

ENDFORM. " PICTURE

PROGRAM16:REPORT Z1130ALV16.

data : lv_vbeln type vbak-vbeln.select-options : so_vbeln for lv_vbeln.

types : begin of ty_vbak, vbeln type vbak-vbeln, erdat type vbak-erdat, erzet type vbak-erzet, ernam type vbak-ernam, end of ty_vbak.

data : lt_vbak type standard table of ty_vbak.

data : o_cont type ref to cl_gui_custom_container, " INTERFACE o_grid type ref to cl_gui_alv_grid. " ALV GRID

data : lt_fcat type lvc_t_fcat, ls_fcat like line of lt_fcat.

data : ls_toolbar type stb_button.

data : ls_layo type lvc_s_layo.

class lcl_eventreceiver definition. public section. methods handle_toolbar for event toolbar of cl_gui_alv_grid importing e_object. methods handle_menu_button for event menu_button of cl_gui_alv_grid importing e_object e_ucomm. methods handle_user_command for event user_command of cl_gui_alv_grid importing e_ucomm.endclass.

class lcl_eventreceiver implementation. method handle_toolbar. loop at e_object->mt_toolbar into ls_toolbar. if ls_toolbar-function = cl_Gui_alv_grid=>mc_fc_find. ls_toolbar-disabled = 'X'. modify e_object->mt_toolbar from ls_toolbar transporting disabled. endif. endloop.

clear ls_toolbar. ls_toolbar-function = 'P1'. ls_toolbar-icon = '@15@'. ls_toolbar-quickinfo = 'Custom button1'. ls_toolbar-butn_type = 0. ls_toolbar-text = 'Button1'. append ls_toolbar to e_object->mt_toolbar.

clear ls_toolbar. ls_toolbar-function = 'P2'.* ls_toolbar-icon = '@15@'. ls_toolbar-quickinfo = 'Custom button1'. ls_toolbar-butn_type = 3.* ls_toolbar-text = 'Button1'. append ls_toolbar to e_object->mt_toolbar.

clear ls_toolbar. ls_toolbar-function = 'P3'. ls_toolbar-icon = '@16@'. ls_toolbar-quickinfo = 'Custom button3'. ls_toolbar-butn_type = 2. ls_toolbar-text = 'Button2'. append ls_toolbar to e_object->mt_toolbar. endmethod.

method handle_menu_button. case e_ucomm. when 'P3'. CALL METHOD E_OBJECT->ADD_FUNCTION EXPORTING FCODE = 'M1' TEXT = 'Menu item1'.

CALL METHOD E_OBJECT->ADD_FUNCTION EXPORTING FCODE = 'M2' TEXT = 'Menu item2'.

CALL METHOD E_OBJECT->ADD_FUNCTION EXPORTING FCODE = 'M3' TEXT = 'Menu item3'. endcase. endmethod.

method handle_user_command. case e_ucomm. when 'P1'. call transaction 'SE38'. when 'M1'. call transaction 'SE11'. endcase. endmethod.endclass.

data ob type ref to lcl_eventreceiver.initialization. so_vbeln-low = '4970'. so_vbeln-high = '4975'. append so_vbeln.

start-of-selection. call screen 100.

MODULE STATUS_0100 OUTPUT. SET PF-STATUS 'ABC'.if o_cont is initial. CREATE OBJECT O_CONT EXPORTING CONTAINER_NAME = 'CST'.

CREATE OBJECT O_GRID EXPORTING I_PARENT = o_cont.

perform getdata. if lt_vbak[] is not initial. perform fldcat. perform layout. perform display. endif.

endif.ENDMODULE. " STATUS_0100 OUTPUT

MODULE USER_COMMAND_0100 INPUT. case sy-ucomm. when 'BACK'. leave program. endcase.ENDMODULE. " USER_COMMAND_0100 INPUT

FORM getdata . select vbeln erdat erzet ernam from vbak into table lt_vbak where vbeln in so_vbeln.ENDFORM. " getdata

FORM display . create object ob. set handler ob->handle_toolbar for o_grid. set handler ob->handle_menu_button for o_grid. set handler ob->handle_user_command for o_grid.

CALL METHOD O_GRID->SET_TABLE_FOR_FIRST_DISPLAY EXPORTING IS_LAYOUT = ls_layo CHANGING IT_FIELDCATALOG = lt_fcat[] IT_OUTTAB = lt_vbak[].

ENDFORM. " display

FORM fldcat . clear ls_fcat. ls_fcat-fieldname = 'VBELN'. ls_fcat-col_pos = 1. ls_fcat-coltext = 'Sales Doc'. ls_fcat-outputlen = 12. append ls_fcat to lt_fcat.

clear ls_fcat. ls_fcat-fieldname = 'ERDAT'. ls_fcat-col_pos = 2. ls_fcat-coltext = 'Created Date'. ls_fcat-outputlen = 12. append ls_fcat to lt_fcat.

clear ls_fcat. ls_fcat-fieldname = 'ERZET'. ls_fcat-col_pos = 3. ls_fcat-coltext = 'Created on'. ls_fcat-outputlen = 12. append ls_fcat to lt_fcat.

clear ls_fcat. ls_fcat-fieldname = 'ERNAM'. ls_fcat-col_pos = 4. ls_fcat-coltext = 'Created by'. ls_fcat-outputlen = 12. ls_fcat-tooltip = 'Created user'. ls_fcat-emphasize = 'X'.* ls_fcat-edit = 'X'. append ls_fcat to lt_fcat.endform.

FORM layout . clear ls_layo.* ls_layo-sel_mode = 'A'.ENDFORM. " layoutMODIFIED PROGRAM16:REPORT Z1130ALV16.

data : lv_vbeln type vbak-vbeln.select-options : so_vbeln for lv_vbeln.

types : begin of ty_vbak, vbeln type vbak-vbeln, erdat type vbak-erdat, erzet type vbak-erzet, ernam type vbak-ernam, end of ty_vbak.

data : lt_vbak type standard table of ty_vbak, ls_vbak type ty_vbak.

data : o_cont type ref to cl_gui_custom_container, " INTERFACE o_grid type ref to cl_gui_alv_grid. " ALV GRID

data : lt_fcat type lvc_t_fcat, ls_fcat like line of lt_fcat.

data : ls_toolbar type stb_button.

data : ls_layo type lvc_s_layo.data ls_modi type lvc_s_modi.

class lcl_eventreceiver definition. public section. methods handle_toolbar for event toolbar of cl_gui_alv_grid importing e_object. methods handle_menu_button for event menu_button of cl_gui_alv_grid importing e_object e_ucomm. methods handle_user_command for event user_command of cl_gui_alv_grid importing e_ucomm. methods handle_data_changed for event data_changed of cl_gui_alv_grid importing ER_DATA_CHANGED. methods handle_onf1 for event onf1 of cl_gui_alv_grid importing e_fieldname ER_EVENT_DATA.endclass.

class lcl_eventreceiver implementation. method handle_toolbar. loop at e_object->mt_toolbar into ls_toolbar. if ls_toolbar-function = cl_Gui_alv_grid=>mc_fc_find. ls_toolbar-disabled = 'X'. modify e_object->mt_toolbar from ls_toolbar transporting disabled. endif. endloop.

clear ls_toolbar. ls_toolbar-function = 'P1'. ls_toolbar-icon = '@15@'. ls_toolbar-quickinfo = 'Custom button1'. ls_toolbar-butn_type = 0. ls_toolbar-text = 'Button1'. append ls_toolbar to e_object->mt_toolbar.

clear ls_toolbar. ls_toolbar-function = 'P2'.* ls_toolbar-icon = '@15@'. ls_toolbar-quickinfo = 'Custom button1'. ls_toolbar-butn_type = 3.* ls_toolbar-text = 'Button1'. append ls_toolbar to e_object->mt_toolbar.

clear ls_toolbar. ls_toolbar-function = 'P3'. ls_toolbar-icon = '@16@'. ls_toolbar-quickinfo = 'Custom button3'. ls_toolbar-butn_type = 2. ls_toolbar-text = 'Button2'. append ls_toolbar to e_object->mt_toolbar. endmethod.

method handle_menu_button. case e_ucomm. when 'P3'. CALL METHOD E_OBJECT->ADD_FUNCTION EXPORTING FCODE = 'M1' TEXT = 'Menu item1'.

CALL METHOD E_OBJECT->ADD_FUNCTION EXPORTING FCODE = 'M2' TEXT = 'Menu item2'.

CALL METHOD E_OBJECT->ADD_FUNCTION EXPORTING FCODE = 'M3' TEXT = 'Menu item3'. endcase. endmethod.

method handle_user_command. case e_ucomm. when 'P1'. call transaction 'SE38'. when 'M1'. call transaction 'SE11'. endcase. endmethod.

method handle_data_changed. read table er_data_changed->mt_mod_cells into ls_modi index 1. if sy-subrc eq 0. read table lt_vbak into ls_vbak index ls_modi-row_id. if sy-subrc eq 0. ls_vbak-ernam = ls_modi-value. modify lt_vbak from ls_vbak index ls_modi-row_id transporting ernam. update vbak set ernam = ls_modi-value where vbeln = ls_vbak-vbeln. endif. endif. endmethod.

method handle_onf1. case e_fieldname. when 'VBELN'. er_event_data->M_EVENT_HANDLED = 'X'. "suppress standard f1 help CALL FUNCTION 'POPUP_TO_INFORM' EXPORTING titel = 'Custom f1 help' txt1 = 'SALES ORDER HEADER TABLE' txt2 = 'Sales Document'. endcase. endmethod.endclass.

data ob type ref to lcl_eventreceiver.initialization. so_vbeln-low = '4970'. so_vbeln-high = '4975'. append so_vbeln.

start-of-selection. call screen 100.

MODULE STATUS_0100 OUTPUT. SET PF-STATUS 'ABC'.if o_cont is initial. CREATE OBJECT O_CONT EXPORTING CONTAINER_NAME = 'CST'.

CREATE OBJECT O_GRID EXPORTING I_PARENT = o_cont.

perform getdata. if lt_vbak[] is not initial. perform fldcat. perform layout. perform display. endif.

endif.ENDMODULE. " STATUS_0100 OUTPUT

MODULE USER_COMMAND_0100 INPUT. case sy-ucomm. when 'BACK'. leave program. endcase.ENDMODULE. " USER_COMMAND_0100 INPUT

FORM getdata . select vbeln erdat erzet ernam from vbak into table lt_vbak where vbeln in so_vbeln.ENDFORM. " getdata

FORM display . create object ob. set handler ob->handle_toolbar for o_grid. set handler ob->handle_menu_button for o_grid. set handler ob->handle_user_command for o_grid. set handler ob->handle_data_changed for o_grid. set handler ob->handle_onf1 for o_grid.

CALL METHOD o_grid->register_edit_event EXPORTING i_event_id = cl_gui_alv_grid=>MC_EVT_MODIFIED.

CALL METHOD O_GRID->SET_TABLE_FOR_FIRST_DISPLAY EXPORTING IS_LAYOUT = ls_layo CHANGING IT_FIELDCATALOG = lt_fcat[] IT_OUTTAB = lt_vbak[].

ENDFORM. " display

FORM fldcat . clear ls_fcat. ls_fcat-fieldname = 'VBELN'. ls_fcat-col_pos = 1. ls_fcat-coltext = 'Sales Doc'. ls_fcat-outputlen = 12. ls_fcat-ref_table = 'VBAK'. ls_fcat-ref_field = 'VBELN'. append ls_fcat to lt_fcat.

clear ls_fcat. ls_fcat-fieldname = 'ERDAT'. ls_fcat-col_pos = 2. ls_fcat-coltext = 'Created Date'. ls_fcat-outputlen = 12. append ls_fcat to lt_fcat.

clear ls_fcat. ls_fcat-fieldname = 'ERZET'. ls_fcat-col_pos = 3. ls_fcat-coltext = 'Created on'. ls_fcat-outputlen = 12. append ls_fcat to lt_fcat.

clear ls_fcat. ls_fcat-fieldname = 'ERNAM'. ls_fcat-col_pos = 4. ls_fcat-coltext = 'Created by'. ls_fcat-outputlen = 12. ls_fcat-tooltip = 'Created user'. ls_fcat-emphasize = 'X'. ls_fcat-edit = 'X'. append ls_fcat to lt_fcat.endform.

FORM layout . clear ls_layo.* ls_layo-sel_mode = 'A'.ENDFORM. " layout

PROGRAM17:REPORT Z1130ALV17.

type-pools cntl.

data : cust_cont type ref to cl_gui_custom_container, o_tree type ref to cl_gui_simple_tree.

types : begin of ty_nodes. include structure abdemonode.types end of ty_nodes.

data : lt_nodes type table of ty_nodes, ls_nodes type ty_nodes.

class lcl_eventreceiver definition. public section. methods : handle_node_double_click for event node_double_click of cl_gui_simple_tree importing node_key.endclass.

class lcl_eventreceiver implementation. method handle_node_double_click. case node_key. when 'CSO'. call transaction 'VA01'. when 'CHSO'. call transaction 'VA02'. when 'CPO'. call transaction 'ME21'. when 'CHPO'. call transaction 'ME22'. endcase.endmethod.endclass.

start-of-selection. call screen 100.

module STATUS_0100 output. SET PF-STATUS 'ABC'.if cust_cont is initial. CREATE OBJECT cust_cont EXPORTING container_name = 'CST'.

CREATE OBJECT o_tree EXPORTING parent = cust_cont node_selection_mode = cl_gui_simple_tree=>NODE_SEL_MODE_SINGLE.

perform addnodes. perform register.endif.

endmodule. " STATUS_0100 OUTPUT

module USER_COMMAND_0100 input. case sy-ucomm. when 'BACK'. leave program. endcase.endmodule. " USER_COMMAND_0100 INPUT

form addnodes . clear ls_nodes. ls_nodes-node_key = 'ROOT'. ls_nodes-isfolder = 'X'. ls_nodes-expander = 'X'. ls_nodes-text = 'Transactions'. append ls_nodes to lt_nodes.

clear ls_nodes. ls_nodes-node_key = 'SO'. ls_nodes-RELATKEY = 'ROOT'. ls_nodes-isfolder = 'X'. ls_nodes-expander = 'X'. ls_nodes-text = 'Sales order'. append ls_nodes to lt_nodes.

clear ls_nodes. ls_nodes-node_key = 'CSO'. ls_nodes-RELATKEY = 'SO'. ls_nodes-exp_image = '@15@'. ls_nodes-text = 'Create Sales order'. append ls_nodes to lt_nodes.

clear ls_nodes. ls_nodes-node_key = 'CHSO'. ls_nodes-RELATKEY = 'SO'. ls_nodes-exp_image = '@15@'. ls_nodes-text = 'Change Sales order'. append ls_nodes to lt_nodes.

clear ls_nodes. ls_nodes-node_key = 'PO'. ls_nodes-RELATKEY = 'ROOT'. ls_nodes-isfolder = 'X'. ls_nodes-expander = 'X'. ls_nodes-text = 'Purchase order'. append ls_nodes to lt_nodes.

clear ls_nodes. ls_nodes-node_key = 'CPO'. ls_nodes-RELATKEY = 'PO'. ls_nodes-exp_image = '@15@'. ls_nodes-text = 'Create Purchase order'. append ls_nodes to lt_nodes.

clear ls_nodes. ls_nodes-node_key = 'CHPO'. ls_nodes-RELATKEY = 'PO'. ls_nodes-exp_image = '@15@'. ls_nodes-text = 'Change Purchase order'. append ls_nodes to lt_nodes.

CALL METHOD o_tree->add_nodes EXPORTING table_structure_name = 'ABDEMONODE' node_table = lt_nodes[].endform. " addnodes

form register . data ob type ref to lcl_eventreceiver. create object ob.

set handler ob->handle_node_double_click for o_tree.

data : lt_events type table of cntl_simple_event, ls_events like line of lt_events.

clear ls_events. ls_events-eventid = cl_gui_simple_tree=>EVENTID_NODE_DOUBLE_CLICK. append ls_events to lt_events.

CALL METHOD o_tree->set_registered_events EXPORTING events = lt_events[].endform. " register

PROGRAM18:REPORT Z1130ALV18.

data : o_split type ref to cl_gui_splitter_container, cust_cont type ref to cl_gui_custom_container, o_cont1 type ref to cl_gui_container, o_cont2 type ref to cl_gui_container, o_grid type ref to cl_gui_alv_grid.

class lcl_eventreceiver definition. public section. methods handle_top_of_page for event top_of_page of cl_gui_alv_grid importing e_dyndoc_id.endclass.

class lcl_eventreceiver implementation. method handle_top_of_page. CALL METHOD e_dyndoc_id->add_text EXPORTING TEXT = text-001.

CALL METHOD e_dyndoc_id->add_gap EXPORTING WIDTH = 5.

CALL METHOD e_dyndoc_id->add_text EXPORTING TEXT = text-002.

CALL METHOD e_dyndoc_id->new_line EXPORTING REPEAT = 1.

CALL METHOD e_dyndoc_id->add_text EXPORTING TEXT = text-003.

CALL METHOD e_dyndoc_id->display_document EXPORTING PARENT = o_cont1. endmethod. endclass.

data ob type ref to lcl_eventreceiver.start-of-selection. call screen 100.

module STATUS_0100 output. SET PF-STATUS 'ABC'.if cust_cont is initial. CREATE OBJECT cust_cont EXPORTING container_name = 'CST'.

CREATE OBJECT o_split EXPORTING PARENT = cust_cont ROWS = 2 COLUMNS = 1.

CALL METHOD o_split->get_container EXPORTING row = 1 column = 1 receiving container = o_cont1.

CALL METHOD o_split->get_container EXPORTING row = 2 column = 1 receiving container = o_cont2.

CALL METHOD o_split->set_row_height EXPORTING id = 1 height = 4.

CALL METHOD o_split->set_row_height EXPORTING id = 2 height = 8.

CREATE OBJECT o_grid EXPORTING i_parent = o_cont2.

perform register.endif.endmodule. " STATUS_0100 OUTPUT

module USER_COMMAND_0100 input. case sy-ucomm. when 'BACK'. leave program. endcase.endmodule. " USER_COMMAND_0100 INPUT

form register .data k type ref to cl_dd_document.create object k.

create object ob. set handler ob->handle_top_of_page for o_grid.

CALL METHOD o_grid->list_processing_events EXPORTING i_event_name = 'TOP_OF_PAGE' I_DYNDOC_ID = k.endform. " registerPROGRAM17REPORT Z1130ALV17.

type-pools cntl.

data : cust_cont type ref to cl_gui_custom_container, o_tree type ref to cl_gui_simple_tree.

types : begin of ty_nodes. include structure abdemonode.types end of ty_nodes.

data : lt_nodes type table of ty_nodes, ls_nodes type ty_nodes.

class lcl_eventreceiver definition. public section. methods : handle_node_double_click for event node_double_click of cl_gui_simple_tree importing node_key.endclass.

class lcl_eventreceiver implementation. method handle_node_double_click. case node_key. when 'CSO'. call transaction 'VA01'. when 'CHSO'. call transaction 'VA02'. when 'CPO'. call transaction 'ME21'. when 'CHPO'. call transaction 'ME22'. endcase.endmethod.endclass.

start-of-selection. call screen 100.

module STATUS_0100 output. SET PF-STATUS 'ABC'.if cust_cont is initial. CREATE OBJECT cust_cont EXPORTING container_name = 'CST'.

CREATE OBJECT o_tree EXPORTING parent = cust_cont node_selection_mode = cl_gui_simple_tree=>NODE_SEL_MODE_SINGLE.

perform addnodes. perform register.endif.

endmodule. " STATUS_0100 OUTPUT

module USER_COMMAND_0100 input. case sy-ucomm. when 'BACK'. leave program. endcase.endmodule. " USER_COMMAND_0100 INPUT

form addnodes . clear ls_nodes. ls_nodes-node_key = 'ROOT'. ls_nodes-isfolder = 'X'. ls_nodes-expander = 'X'. ls_nodes-text = 'Transactions'. append ls_nodes to lt_nodes.

clear ls_nodes. ls_nodes-node_key = 'SO'. ls_nodes-RELATKEY = 'ROOT'. ls_nodes-isfolder = 'X'. ls_nodes-expander = 'X'. ls_nodes-text = 'Sales order'. append ls_nodes to lt_nodes.

clear ls_nodes. ls_nodes-node_key = 'CSO'. ls_nodes-RELATKEY = 'SO'. ls_nodes-exp_image = '@15@'. ls_nodes-text = 'Create Sales order'. append ls_nodes to lt_nodes.

clear ls_nodes. ls_nodes-node_key = 'CHSO'. ls_nodes-RELATKEY = 'SO'. ls_nodes-exp_image = '@15@'. ls_nodes-text = 'Change Sales order'. append ls_nodes to lt_nodes.

clear ls_nodes. ls_nodes-node_key = 'PO'. ls_nodes-RELATKEY = 'ROOT'. ls_nodes-isfolder = 'X'. ls_nodes-expander = 'X'. ls_nodes-text = 'Purchase order'. append ls_nodes to lt_nodes.

clear ls_nodes. ls_nodes-node_key = 'CPO'. ls_nodes-RELATKEY = 'PO'. ls_nodes-exp_image = '@15@'. ls_nodes-text = 'Create Purchase order'. append ls_nodes to lt_nodes.

clear ls_nodes. ls_nodes-node_key = 'CHPO'. ls_nodes-RELATKEY = 'PO'. ls_nodes-exp_image = '@15@'. ls_nodes-text = 'Change Purchase order'. append ls_nodes to lt_nodes.

CALL METHOD o_tree->add_nodes EXPORTING table_structure_name = 'ABDEMONODE' node_table = lt_nodes[].endform. " addnodes

form register . data ob type ref to lcl_eventreceiver. create object ob.

set handler ob->handle_node_double_click for o_tree.

data : lt_events type table of cntl_simple_event, ls_events like line of lt_events.

clear ls_events. ls_events-eventid = cl_gui_simple_tree=>EVENTID_NODE_DOUBLE_CLICK. append ls_events to lt_events.

CALL METHOD o_tree->set_registered_events EXPORTING events = lt_events[].endform. " registerPROGRAM18REPORT Z1130ALV18.

data : o_split type ref to cl_gui_splitter_container, cust_cont type ref to cl_gui_custom_container, o_cont1 type ref to cl_gui_container, o_cont2 type ref to cl_gui_container, o_grid type ref to cl_gui_alv_grid.

class lcl_eventreceiver definition. public section. methods handle_top_of_page for event top_of_page of cl_gui_alv_grid importing e_dyndoc_id.endclass.

class lcl_eventreceiver implementation. method handle_top_of_page. CALL METHOD e_dyndoc_id->add_text EXPORTING TEXT = text-001.

CALL METHOD e_dyndoc_id->add_gap EXPORTING WIDTH = 5.

CALL METHOD e_dyndoc_id->add_text EXPORTING TEXT = text-002.

CALL METHOD e_dyndoc_id->new_line EXPORTING REPEAT = 1.

CALL METHOD e_dyndoc_id->add_text EXPORTING TEXT = text-003.

CALL METHOD e_dyndoc_id->display_document EXPORTING PARENT = o_cont1. endmethod. endclass.

data ob type ref to lcl_eventreceiver.start-of-selection. call screen 100.

module STATUS_0100 output. SET PF-STATUS 'ABC'.if cust_cont is initial. CREATE OBJECT cust_cont EXPORTING container_name = 'CST'.

CREATE OBJECT o_split EXPORTING PARENT = cust_cont ROWS = 2 COLUMNS = 1.

CALL METHOD o_split->get_container EXPORTING row = 1 column = 1 receiving container = o_cont1.

CALL METHOD o_split->get_container EXPORTING row = 2 column = 1 receiving container = o_cont2.

CALL METHOD o_split->set_row_height EXPORTING id = 1 height = 4.

CALL METHOD o_split->set_row_height EXPORTING id = 2 height = 8.

CREATE OBJECT o_grid EXPORTING i_parent = o_cont2.

perform register.endif.endmodule. " STATUS_0100 OUTPUT

module USER_COMMAND_0100 input. case sy-ucomm. when 'BACK'. leave program. endcase.endmodule. " USER_COMMAND_0100 INPUT

form register .data k type ref to cl_dd_document.create object k.

create object ob. set handler ob->handle_top_of_page for o_grid.

CALL METHOD o_grid->list_processing_events EXPORTING i_event_name = 'TOP_OF_PAGE' I_DYNDOC_ID = k.endform. " register