You are on page 1of 2

module USER_COMMAND_0100 input.

data: ok_code like sy-ucomm.


ok_code = sy-ucomm.
case ok_code.
when 'SAVE'.
MOVE SY-MANDT TO ITAB-MANDT.
move wa_details-name to itab-name.
move wa_details-age to itab-age.
move wa_details-code to itab-code.
APPEND ITAB.
IF NOT ITAB[] IS INITIAL.
INSERT ZDEMOTABLE FROM TABLE ITAB ACCEPTING DUPLICATE KEYS.
ENDIF.

IF SY-SUBRC NE 0.
MESSAGE 'ERROR' TYPE 'E'.
ENDIF.

when 'CANCEL'.
leave program.
when 'RESET'.
clear wa_details-name.
clear wa_details-age.
clear wa_details-code.
LEAVE TO SCREEN 100.

endcase.
endmodule.
" USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------*
*&
Module USER_COMMAND_0200 INPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module USER_COMMAND_0200 input.
if sy-ucomm = 'BACK'.

LEAVE TO SCREEN 100.


ENDIF.

endmodule.

" USER_COMMAND_0200 INPUT

You might also like