‎2007 Jul 02 9:43 AM
my question is : In dialog programming when we click on any push button the PAI will be triggered . But i need a EXIT button on the screen .And when I clicked at first time there canot be any action . But for the second click it should exit .
what is the solution for this
‎2007 Jul 02 9:45 AM
Hello,
Check this sample.
REPORT ZV_SDN_DIALOG .
DATA: FLAG.
CALL SCREEN 100.
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE USER_COMMAND_0100 INPUT.
IF SY-UCOMM = 'GOTO'.
CALL SCREEN 200.
ELSEIF SY-UCOMM = 'EXIT'.
IF FLAG IS INITIAL.
FLAG = 'X'.
ELSE.
LEAVE PROGRAM.
ENDIF.
ENDIF.
ENDMODULE. " USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_0200 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE USER_COMMAND_0200 INPUT.
IF SY-UCOMM = 'EXIT'.
* CALL SCREEN 200.
LEAVE TO SCREEN 100.
ENDIF.
ENDMODULE. " USER_COMMAND_0200 INPUT
Regards,
VAsanth
‎2007 Jul 02 9:47 AM
Hi
U need to use a variable to store when the EXIT button is pushed for the next time.
PROCESS PAI.
MODULE USER_COMMAND.
MODULE USER_COMMAND.
CASE OK_CODE.
WHEN 'EXIT'.
EXIT_COUNTER = EXIT_COUNTER + 1.
IF EXIT_COUNTER > 1.
<DO SOMETHING>.
ENDIF.Max
‎2007 Jul 02 10:56 AM
In PAI, in user_command module write,
if ok_code = 'exit'.
Flag = flag + 1.
if flag > 1.
leave program (or) Leave to screen 'xxxx'.
endif.
endif.
Note: Initially, flag flag should be 0.