REPORT zr_crud_operations_mp NO STANDARD PAGE HEADING.
*** --- Data Declarations
DATA:it TYPE TABLE OF zmara_table1,
wa TYPE zmara_table1.
*** --- Start Of Selection
START-OF-SELECTION.
CALL SCREEN '100'.
*&---------------------------------------------------------------------*
*& Module STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE status_0100 OUTPUT.
SET PF-STATUS 'FUNCTION KEYS'.
SET TITLEBAR 'TITLE1'.
ENDMODULE.
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE user_command_0100 INPUT.
CASE sy-ucomm .
WHEN 'SAVE' OR 'BACK'.
LEAVE PROGRAM.
ENDCASE.
CASE sy-ucomm.
WHEN 'GET'.
CALL SCREEN '101'.
ENDCASE.
ENDMODULE.
PROCESS BEFORE OUTPUT.
MODULE STATUS_0101.
PROCESS AFTER INPUT.
MODULE USER_COMMAND_0101.
CHAIN.
FIELD:WA-MATNR.
MODULE INPUT_VALIDATION.
ENDCHAIN.
MODULE user_command_0101.
MODULE status_0101 OUTPUT.
SET PF-STATUS 'FUNCTION KEYS'.
SET TITLEBAR 'TITLE2'.
DATA(cust_container) = NEW cl_gui_custom_container(
container_name = 'CC_ALV1'
).
DATA(lv_grid) = NEW cl_gui_alv_grid(
i_parent = cust_container
).
SELECT * FROM zmara_table1 INTO TABLE it.
CALL METHOD lv_grid->set_table_for_first_display
EXPORTING
i_structure_name = 'ZMARA_TABLE1' " Internal Output Table Structure Name
CHANGING
it_outtab = it " Output Table
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
ENDMODULE.
MODULE user_command_0101 INPUT.
CASE sy-ucomm.
WHEN 'GET'.
SELECT SINGLE * FROM zmara_table1 INTO wa WHERE matnr = wa-matnr .
WHEN 'BACK'.
LEAVE TO SCREEN 100.
ENDCASE.
ENDMODULE.
MODULE user_command_0100 INPUT.
CASE sy-ucomm .
WHEN 'SAVE' OR 'BACK'.
LEAVE PROGRAM.
ENDCASE.
CASE sy-ucomm.
WHEN 'GET'.
CALL SCREEN '101'.
WHEN 'CREATE'.
CALL SCREEN '102'.
ENDCASE.
ENDMODULE.
MODULE status_0102 OUTPUT.
SET PF-STATUS 'FUNCTION KEYS'.
SET TITLEBAR 'TITLE3'.
ENDMODULE.
MODULE user_command_0102 INPUT.
CASE sy-ucomm.
WHEN 'BACK'.
LEAVE TO SCREEN 100.
CLEAR it.
WHEN 'SAVE'.
MODIFY zmara_table1 FROM wa.
IF sy-subrc EQ 0.
COMMIT WORK.
MESSAGE TEXT-001 TYPE 'S'.
ENDIF.
DATA(cust_container1) = NEW cl_gui_custom_container(
container_name = 'CC_ALV1'
).
DATA(lv_grid1) = NEW cl_gui_alv_grid(
i_parent = cust_container1
).
SELECT * FROM zmara_table1 INTO TABLE it.
CALL METHOD lv_grid1->set_table_for_first_display
EXPORTING
i_structure_name = 'ZMARA_TABLE1' " Internal Output Table Structure Name
CHANGING
it_outtab = it " Output Table
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
ENDCASE.
ENDMODULE.
MODULE user_command_0100 INPUT.
CASE sy-ucomm .
WHEN 'SAVE' OR 'BACK'.
LEAVE PROGRAM.
ENDCASE.
CASE sy-ucomm.
WHEN 'GET'.
CALL SCREEN '101'.
WHEN 'CREATE'.
CALL SCREEN '102'.
WHEN 'UPDATE'.
CALL SCREEN '103'.
ENDCASE.
ENDMODULE.
MODULE status_0103 OUTPUT.
SET PF-STATUS 'FUNCTION KEYS'.
SET TITLEBAR 'TITLE4'.
ENDMODULE.
MODULE user_command_0103 INPUT.
CASE sy-ucomm.
WHEN 'BACK'.
LEAVE TO SCREEN 100.
WHEN 'GET'.
SELECT SINGLE * FROM zmara_table1 INTO wa WHERE matnr = wa-matnr.
WHEN 'UPDATE'.
UPDATE zmara_table1 FROM wa.
IF sy-subrc EQ 0.
MESSAGE TEXT-002 TYPE 'S'.
ENDIF.
DATA(custom_contaner2) = NEW cl_gui_custom_container(
container_name = 'CC_ALV1'
).
DATA(lv_grid2) = NEW cl_gui_alv_grid(
i_parent = custom_contaner2
).
SELECT * FROM zmara_table1 INTO TABLE it.
CALL METHOD lv_grid2->set_table_for_first_display
EXPORTING
i_structure_name = 'ZMARA_TABLE1' " Internal Output Table Structure Name
CHANGING
it_outtab = it " Output Table
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
ENDCASE.
ENDMODULE.
MODULE user_command_0100 INPUT.
CASE sy-ucomm .
WHEN 'SAVE' OR 'BACK'.
LEAVE PROGRAM.
ENDCASE.
CASE sy-ucomm.
WHEN 'GET'.
CALL SCREEN '101'.
WHEN 'CREATE'.
CALL SCREEN '102'.
WHEN 'UPDATE'.
CALL SCREEN '103'.
WHEN 'DELETE'.
CALL SCREEN '104'.
ENDCASE.
ENDMODULE.
MODULE status_0104 OUTPUT.
SET PF-STATUS 'FUNCTION KEYS'.
SET TITLEBAR 'TITLE5'.
ENDMODULE.
MODULE user_command_0104 INPUT.
CASE sy-ucomm.
WHEN 'GET'.
SELECT SINGLE * FROM zmara_table1 INTO wa WHERE matnr = wa-matnr.
WHEN 'DELETE'.
DELETE zmara_table1 FROM wa.
IF sy-subrc EQ 0.
MESSAGE TEXT-003 TYPE 'S'.
ENDIF.
DATA(cust_container3) = NEW cl_gui_custom_container(
container_name = 'CC_ALV1'
).
DATA(lv_grid3) = NEW cl_gui_alv_grid(
i_parent = cust_container3
).
SELECT * FROM zmara_table1 INTO TABLE it.
CALL METHOD lv_grid3->set_table_for_first_display
EXPORTING
i_structure_name = 'ZMARA_TABLE1' " Internal Output Table Structure Name
CHANGING
it_outtab = it " Output Table
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
WHEN 'BACK'.
LEAVE TO SCREEN 100.
ENDCASE.
ENDMODULE.
REPORT zr_crud_operations_mp NO STANDARD PAGE HEADING.
*** --- Data Declarations
DATA:it TYPE TABLE OF zmara_table1,
wa TYPE zmara_table1.
*** --- Start Of Selection
START-OF-SELECTION.
CALL SCREEN '100'.
*&---------------------------------------------------------------------*
*& Module STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE status_0100 OUTPUT.
SET PF-STATUS 'FUNCTION KEYS'.
SET TITLEBAR 'TITLE1'.
ENDMODULE.
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE user_command_0100 INPUT.
CASE sy-ucomm .
WHEN 'SAVE' OR 'BACK'.
LEAVE PROGRAM.
ENDCASE.
CASE sy-ucomm.
WHEN 'GET'.
CALL SCREEN '101'.
WHEN 'CREATE'.
CALL SCREEN '102'.
WHEN 'UPDATE'.
CALL SCREEN '103'.
WHEN 'DELETE'.
CALL SCREEN '104'.
ENDCASE.
ENDMODULE.
*&---------------------------------------------------------------------*
*& Module STATUS_0101 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE status_0101 OUTPUT.
SET PF-STATUS 'FUNCTION KEYS'.
SET TITLEBAR 'TITLE2'.
DATA(cust_container) = NEW cl_gui_custom_container(
container_name = 'CC_ALV1'
).
DATA(lv_grid) = NEW cl_gui_alv_grid(
i_parent = cust_container
).
SELECT * FROM zmara_table1 INTO TABLE it.
CALL METHOD lv_grid->set_table_for_first_display
EXPORTING
i_structure_name = 'ZMARA_TABLE1' " Internal Output Table Structure Name
CHANGING
it_outtab = it " Output Table
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
ENDMODULE.
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_0101 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE user_command_0101 INPUT.
CASE sy-ucomm.
WHEN 'GET'.
SELECT SINGLE * FROM zmara_table1 INTO wa WHERE matnr = wa-matnr .
WHEN 'BACK'.
LEAVE TO SCREEN 100.
ENDCASE.
ENDMODULE.
*&---------------------------------------------------------------------*
*& Module STATUS_0102 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE status_0102 OUTPUT.
SET PF-STATUS 'FUNCTION KEYS'.
SET TITLEBAR 'TITLE3'.
ENDMODULE.
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_0102 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE user_command_0102 INPUT.
CASE sy-ucomm.
WHEN 'BACK'.
LEAVE TO SCREEN 100.
CLEAR it.
WHEN 'SAVE'.
MODIFY zmara_table1 FROM wa.
IF sy-subrc EQ 0.
COMMIT WORK.
MESSAGE TEXT-001 TYPE 'S'.
ENDIF.
DATA(cust_container1) = NEW cl_gui_custom_container(
container_name = 'CC_ALV1'
).
DATA(lv_grid1) = NEW cl_gui_alv_grid(
i_parent = cust_container1
).
SELECT * FROM zmara_table1 INTO TABLE it.
CALL METHOD lv_grid1->set_table_for_first_display
EXPORTING
i_structure_name = 'ZMARA_TABLE1' " Internal Output Table Structure Name
CHANGING
it_outtab = it " Output Table
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
ENDCASE.
ENDMODULE.
*&---------------------------------------------------------------------*
*& Module STATUS_0103 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE status_0103 OUTPUT.
SET PF-STATUS 'FUNCTION KEYS'.
SET TITLEBAR 'TITLE4'.
ENDMODULE.
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_0103 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE user_command_0103 INPUT.
CASE sy-ucomm.
WHEN 'BACK'.
LEAVE TO SCREEN 100.
WHEN 'GET'.
SELECT SINGLE * FROM zmara_table1 INTO wa WHERE matnr = wa-matnr.
WHEN 'UPDATE'.
UPDATE zmara_table1 FROM wa.
IF sy-subrc EQ 0.
MESSAGE TEXT-002 TYPE 'S'.
ENDIF.
DATA(custom_contaner2) = NEW cl_gui_custom_container(
container_name = 'CC_ALV1'
).
DATA(lv_grid2) = NEW cl_gui_alv_grid(
i_parent = custom_contaner2
).
SELECT * FROM zmara_table1 INTO TABLE it.
CALL METHOD lv_grid2->set_table_for_first_display
EXPORTING
i_structure_name = 'ZMARA_TABLE1' " Internal Output Table Structure Name
CHANGING
it_outtab = it " Output Table
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
ENDCASE.
ENDMODULE.
*&---------------------------------------------------------------------*
*& Module STATUS_0104 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE status_0104 OUTPUT.
SET PF-STATUS 'FUNCTION KEYS'.
SET TITLEBAR 'TITLE5'.
ENDMODULE.
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_0104 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE user_command_0104 INPUT.
CASE sy-ucomm.
WHEN 'GET'.
SELECT SINGLE * FROM zmara_table1 INTO wa WHERE matnr = wa-matnr.
WHEN 'DELETE'.
DELETE zmara_table1 FROM wa.
IF sy-subrc EQ 0.
MESSAGE TEXT-003 TYPE 'S'.
ENDIF.
DATA(cust_container3) = NEW cl_gui_custom_container(
container_name = 'CC_ALV1'
).
DATA(lv_grid3) = NEW cl_gui_alv_grid(
i_parent = cust_container3
).
SELECT * FROM zmara_table1 INTO TABLE it.
CALL METHOD lv_grid3->set_table_for_first_display
EXPORTING
i_structure_name = 'ZMARA_TABLE1' " Internal Output Table Structure Name
CHANGING
it_outtab = it " Output Table
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
WHEN 'BACK'.
LEAVE TO SCREEN 100.
ENDCASE.
ENDMODULE.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
4 | |
3 | |
3 | |
2 | |
2 | |
2 | |
2 | |
1 | |
1 |