REPORT YJ_OOPS_ALV_CUSTOMER_CONTAINER.
DATA : o_cust TYPE REF TO cl_gui_custom_container,
o_alv TYPE REF TO cl_gui_alv_grid,
it_mara TYPE TABLE OF mara,
wa_mara TYPE mara,
ok_code TYPE sy-ucomm.
PARAMETERS : p_matnr like mara-matnr.
START-OF-SELECTION.
PERFORM data_fetch.
CALL SCREEN 100.
FORM data_fetch .
SELECT * FROM mara INTO TABLE it_mara WHERE matnr = p_matnr.
ENDFORM. " DATA_FETCH
MODULE status_0100 OUTPUT.
SET PF-STATUS 'STATUS'.
SET TITLEBAR 'TITLE'.
ENDMODULE. " STATUS_0100 OUTPUT
MODULE user_command_0100 INPUT.
CASE ok_code.
WHEN 'BACK' .
LEAVE TO SCREEN 0.
WHEN 'EXIT'.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
MODULE display_alv OUTPUT.
CREATE OBJECT o_cust
EXPORTING
container_name = 'CUSTOM'.
CREATE OBJECT o_alv
EXPORTING
i_parent = O_CUST.
CALL METHOD o_alv->set_table_for_first_display
EXPORTING
i_structure_name = 'MARA'
CHANGING
it_outtab = IT_mara.
ENDMODULE. " DISPLAY_ALV OUTPUT
DATA : o_cust TYPE REF TO cl_gui_custom_container,
o_alv TYPE REF TO cl_gui_alv_grid,
it_mara TYPE TABLE OF mara,
wa_mara TYPE mara,
ok_code TYPE sy-ucomm.
PARAMETERS : p_matnr like mara-matnr.
START-OF-SELECTION.
PERFORM data_fetch.
CALL SCREEN 100.
FORM data_fetch .
SELECT * FROM mara INTO TABLE it_mara WHERE matnr = p_matnr.
ENDFORM. " DATA_FETCH
MODULE status_0100 OUTPUT.
SET PF-STATUS 'STATUS'.
SET TITLEBAR 'TITLE'.
ENDMODULE. " STATUS_0100 OUTPUT
MODULE user_command_0100 INPUT.
CASE ok_code.
WHEN 'BACK' .
LEAVE TO SCREEN 0.
WHEN 'EXIT'.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
MODULE display_alv OUTPUT.
CREATE OBJECT o_cust
EXPORTING
container_name = 'CUSTOM'.
CREATE OBJECT o_alv
EXPORTING
i_parent = O_CUST.
CALL METHOD o_alv->set_table_for_first_display
EXPORTING
i_structure_name = 'MARA'
CHANGING
it_outtab = IT_mara.
ENDMODULE. " DISPLAY_ALV OUTPUT
No comments:
Post a Comment