05-08-2009 12:36 PM
Hi all,
While I am using MODULE EXIT AT EXIT-COMMAND
its not working properly in module pool in PAI for the main screen.
code tht i m using for it is as follows.
DATA : l_ans TYPE c.
CLEAR ok_code.
*ok_code = sy-ucomm.
CASE ok_code.
WHEN 'BACK' OR 'CANCEL' OR 'EXIT'.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
text_question = 'Would you like to Quit ?'(004)
text_button_1 = 'Yes'(005)
text_button_2 = 'No'(006)
IMPORTING
answer = l_ans
EXCEPTIONS
text_not_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CHECK l_ans = '1'.
LEAVE PROGRAM.
05-08-2009 12:44 PM
Hi,
I guess u r having a button which is used for exit command.
If so then u have the assign a property in the status.
Goto to the status, then double click on your custom button, U will be shown a popup,
then u have to give E in Function type.
then the code will be working fine.
also check the value for l_an in the run time.
after the pop up u can use
set screen 0.
leave screen.
or leave to screen 0.
regards,
Venkatesh
05-08-2009 1:10 PM
05-08-2009 12:44 PM
Hello Amit,
Have you made the appropriate settings at the function keys, against the icons 'EXIT' CANCEL and BACK. The function type needs to be set as 'E' in the GUI status - function keys.
Thanks,
Uma
05-08-2009 1:06 PM
Hello Amit,
Please check whether you have assigned Exit Command Type to your buttons or not; in order to do that, go to the specific screen->PF-Status->Choose any standard button(you have assigned)->double-click->Set FUNCTIONAL TYPE.
E Exit Command (MODULE xxx AT EXIT-COMMAND)
S System Function
T Call a Transaction
Normal Application Function
P Local GUI Functions
H Internal Use
Moreover, Module set for this exit-command with screen, should be;
In PAI;
MODULE exit_scr100 AT EXIT-COMMAND.
MODULE exit_scr100 INPUT.
CASE ok_code.
WHEN 'CANCEL'.
LEAVE TO SCREEN 0.
WHEN 'EXIT'.
LEAVE PROGRAM.
ENDCASE. " CASE OK_CODE
ENDMODULE.
We use AT EXIT-COMMAND, when we want to cancel out the screen or exit the screen, despite errors. Otherwise, screen would hang-up asking for correcting errors.
Hope it helps you,
Zahack.
05-08-2009 1:11 PM
11-03-2009 5:37 AM