Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Module Pool Programming - MODULE USER_COMMAND_0100. !!

Former Member
0 Likes
1,764

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,064

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

6 REPLIES 6
Read only

Former Member
0 Likes
1,065

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

Read only

Former Member
0 Likes
1,064

I think all of them are similar.

Read only

0 Likes
1,064

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.

Read only

Former Member
0 Likes
1,064

This message was moderated.

Read only

Former Member
0 Likes
1,064

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.

Read only

Former Member
0 Likes
1,064

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.