2008 Jan 14 7:58 AM
Hi All
I want to know which statement we give in the MODULE USER_COMMAND_0100. so as to provide the functionality of cancel and back to the icon.
eg.
MODULE USER_COMMAND_0100 INPUT.
CASE OK_CODE.
WHEN 'EXIT'.
LEAVE PROGRAM.
ENDMODULE.
so what to do if we want to have the functionality BACK and Cancel as well ??
MODULE USER_COMMAND_0100 INPUT.
CASE OK_CODE.
WHEN 'cancel'.
??
WHEN 'back'.
??
WHEN 'EXIT'.
LEAVE PROGRAM.
ENDMODULE.
2008 Jan 14 7:59 AM
Hi,
Use the below code
MODULE USER_COMMAND_0100 INPUT.
CASE OK_CODE.
WHEN 'EXIT'.
LEAVE PROGRAM.
ENDMODULE.
so what to do if we want to have the functionality BACK and Cancel as well ??
MODULE USER_COMMAND_0100 INPUT.
CASE OK_CODE.
WHEN 'cancel'.
SET SCREEN (CURRENT SCREEN NUMBER).
WHEN 'back'.
SET SCREE 0. or SET SCREEN (PREVIOUS SCREEN NUMBER).
WHEN 'EXIT'.
LEAVE PROGRAM.
ENDMODULE.
Regarda,
Chandru
2008 Jan 14 7:59 AM
Hi,
Use the below code
MODULE USER_COMMAND_0100 INPUT.
CASE OK_CODE.
WHEN 'EXIT'.
LEAVE PROGRAM.
ENDMODULE.
so what to do if we want to have the functionality BACK and Cancel as well ??
MODULE USER_COMMAND_0100 INPUT.
CASE OK_CODE.
WHEN 'cancel'.
SET SCREEN (CURRENT SCREEN NUMBER).
WHEN 'back'.
SET SCREE 0. or SET SCREEN (PREVIOUS SCREEN NUMBER).
WHEN 'EXIT'.
LEAVE PROGRAM.
ENDMODULE.
Regarda,
Chandru
2008 Jan 14 8:02 AM
2008 Jan 14 8:23 AM
Hi,
The above given answer is good. Also for EXITing from the program you ahave to use module on Exit-Command.
This event is triggered if the user has called one of the functions Back, Exit or Cancel. In the event block, possible clean-up actions can be executed.
Pls refer the link for more information:
http://help.sap.com/saphelp_nw70/helpdata/en/9f/dbaa9535c111d1829f0000e829fbfe/content.htm
Regards,
Renjith Michael.
2008 Jan 14 8:13 AM
2008 Jan 14 8:26 AM
HI gavrav,
the program clearly depends on your requirement,
SET SCREEN is used to dynamically override the NEXT SCREEN attribute of the screen.
CALL SCREEN is used to insert a set of screen sequences dynamically. Processing will return to the current screen.
LEAVE SCREEN will leave the processing of the current screen immediately and leave to the processing of the next screen which is defined either statically or dynamically. Processing will not return to the current screen.
LEAVE TO SCREEN behaves like set screen + leave screen together.
so in place of question mark you can use the above ones as per your requirement.
CASE OK_CODE.
WHEN 'EXIT'.
LEAVE PROGRAM.
WHEN 'cancel'.
??
WHEN 'back'.
??
ENDMODULE.
its also useful to include to include yes or no to save and discard respectively for cancel button.
plz reward if this is helpful,
thanks and regards,
srikanth tulasi.
2008 Jan 14 8:39 AM
CASE OK_CODE.
WHEN 'EXIT'.
LEAVE PROGRAM.
ENDMODULE.
so what to do if we want to have the functionality BACK and Cancel as well ??
MODULE USER_COMMAND_0100 INPUT.
CASE OK_CODE.
WHEN 'cancel'.
LEAVE TO SCREEN 'xxx' "xxx is your screen number
WHEN 'back'.
LEAVE TO SCREEN '0'.
WHEN 'EXIT'.
LEAVE PROGRAM.
ENDMODULE.