‎2006 Dec 08 11:40 AM
Hi,
I am able to disable the check box in the selection screen.The reqiurement is,
After entering the selection screen values user has excuted the report.It displays the report.When the user press the Back button (F3) it will display the selection screen again now I want to enable the checkbox dynamically. How?
Thanks & Regards,
KS
‎2006 Dec 08 11:45 AM
WHEN 'BACK'.
LOOP AT SCREEN.
IF SCREEN-NAME = 'C1'. " C1 is ur checkbox name
SCREEN-INPUT = '1'.
MODIFY SCREEN.
ENDI.
ENDLOOP.
‎2006 Dec 08 11:51 AM
Hi Siva,
Use one flag for the report execution and check that value when disableing the check box.
I means to say... I think you might be written some code in at selection-screen output event to disable the check box, here you jest check whether this flag is initial or not. if initial then disable the checkbox, and if not do not disable.
Regards,
Satya.
‎2006 Dec 08 12:25 PM
Hello,
Declare one global variable flag of type c with default value space.
In your code somewhere u will check whether the check box is checkec or not. In that place set this variable flag to 'X'. Now in the SELECTION-SCREEN OUTPUT event code like this,
LOOP AT SCREEN.
IF SCREEN-NAME = 'CH'.
if <global_var> eq 'X'.
screen-input = 1.
else.
screen-input = 0.
endif.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
Regs,
Venkat Ramanan N
‎2006 Dec 08 5:03 PM
Hi,
parameter P1 as checkbox .
at selection-screen output .
LOOP AT SCREEN.
if P1 eq 'X'.
screen-input = 1.
else.
screen-input = 0.
endif.
MODIFY SCREEN.
ENDLOOP.
if sy-tabix eq 5 .
LOOP AT SCREEN.
screen-input = 0.
MODIFY SCREEN.
ENDLOOP.
Message was edited by:
Lakshminarayanan rohini
‎2006 Dec 08 6:41 PM
Hi,
You want to have a switch, which you can query after execution has ended. For that you will have to either use memory, or a static in a function call.
In this example, I used memory.
...
DATA: ATFIRST TYPE BOOLE_D.
AT SELECTION-SCREEN OUTPUT.
IMPORT ATFIRST FROM MEMORY ID ANYID.
LOOP AT SCREEN.
CHECK SCREEN-GROUP1 = '999'.
IF ATFIRST IS INITIAL.
SCREEN-INPUT = '0'.
ELSE.
SCREEN-INPUT = '1'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
START-OF-SELECTION.
ATFIRST = 'X'.
EXPORT ATFIRST TO MEMORY ID ANYID.
...
Be aware, that after first execution, the switch will remain set for as long as you stay in the same session. If this is not what you want, be sure to put something like:
DELETE FROM MEMORY ID ANYID.
after second execution.
regards