‎2007 Mar 02 1:42 PM
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'.
‎2007 Mar 02 1:44 PM
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
‎2007 Mar 02 1:46 PM
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
‎2007 Mar 02 1:48 PM
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
‎2007 Mar 02 1:52 PM
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.
‎2007 Mar 02 1:56 PM