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

at exit-command

Former Member
0 Likes
1,125

I am writing the following code in pai of a screen

PROCESS AFTER INPUT.

module leave_dynpro at exit-command.

chain.

field :zmkt-field3, zmkt-field1 , zmkt-field2,zemp-id,zemp-name.

module check on chain-input.

endchain.

MODULE USER_COMMAND_9000.

In side module leave_dynpro I have written the following code.

MODULE leave_dynpro INPUT.

CASE ok_code.

WHEN 'BACK' .

LEAVE to screen 0.

LEAVE PROGRAM.

WHEN 'EXIT'.

LEAVE SCREEN.

LEAVE PROGRAM.

message i398(00) with 'aaa'.

ENDCASE.

ENDMODULE.

But when I am pressing exit button it is not leaving the screen.

Please suggest what to do. I have changed the function type of exit to 'E'.

5 REPLIES 5
Read only

Former Member
0 Likes
713

Hello,


Makke this change

PROCESS AFTER INPUT.
module leave_dynpro at exit-command.

chain.
field :zmkt-field3, zmkt-field1 , zmkt-field2,zemp-id,zemp-name.
module check on chain-input.
endchain.

MODULE USER_COMMAND_9000.

In side module leave_dynpro I have written the following code.
MODULE leave_dynpro INPUT.
*CASE ok_code.
*WHEN 'BACK' .
*LEAVE to screen 0.
*LEAVE PROGRAM.
*WHEN 'EXIT'.
*LEAVE PROGRAM.
*message i398(00) with 'aaa'.
*ENDCASE.

" Add this line alone
LEAVE SCREEN.
" Add this line alone

ENDMODULE. 

If useful reward.

Vasanth

Read only

ferry_lianto
Active Contributor
0 Likes
713

Hi,

In the GUI definition, for this function code, set the function type to 'E' (exit command).

If the user chooses a function whose function code does not have type E, the MODULE <mod> AT EXIT-COMMAND statement is not executed.

sample code:

This exit-command module looks like below.

Module exitscreen input.

Case v_okcode_100.

When ‘EXIT’.

Leave to screen 0.

when ‘BACK’.

Leave to screen 0.

when ‘CANCEL’.

Leave to screen 0.

Endcase.

Endmodule

Please check this link for more info.

http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbaa9535c111d1829f0000e829fbfe/content.htm

Hope this will help.

Regards,

Ferry Lianto

Read only

Former Member
0 Likes
713

Put a break point and check out if you are getting the correct OK_CODE

also enable the EXIT button in PF-STATUS if not done

Read only

messier31
Active Contributor
0 Likes
713

Hi Sucheta,

Change your leave_dynpro as below:-

MODULE leave_dynpro INPUT.

CASE ok_code.

WHEN 'BACK' .

set screen 0.

Leave screen.

WHEN 'EXIT'.

set screen 0.

Leave screen.

ENDCASE.

ENDMODULE.

Read only

Former Member
0 Likes
713

also chk this program

<b>DEMO_DYNPRO_AT_EXIT_COMMAND</b>