‎2008 Jan 04 5:56 PM
Hi friends,
here is my scenario....
i have a parameter p1.
and then i have a selection screen block
with a checkbox c1 and a parameter p2 in it.
the requirement is ......when i select the checkbox,
the cursor has to be placed in the parameter p2.
by default the parameter is placed in p1.
please run the code i have written.
i ran my code and selected the checkbox......nothing happened...
however, when i clicked on the 'execute ' button the cursor did get placed in parameter p2.
my requirement is ..the cursor has to be placed in p2 the moment i select the checkbox c1.
please let me know where i am wrong...
thanking u all in advance,
Hari Kiran
here is the code i wrote.......
code
*****
REPORT ZSELESCREEN .
PARAMETER: P1(10) MODIF ID SC1.
selection-screen BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETERS: C1 AS CHECKBOX MODIF ID SC2,
P2(10) MODIF ID SC2.
SELECTION-SCREEN END OF BLOCK B1.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF SCREEN-GROUP1 ='SC2'.
IF C1 = 'X'.
SET CURSOR FIELD 'P2' .
ENDIF.
ENDIF.
ENDLOOP.
‎2008 Jan 04 6:38 PM
Hi Hari,
You need to trigger PAI for calling the selection screen again to take advantage of AT SELECTION-SCREEN OUTPUT event (PBO of selection screen). This is done here by adding a function code to the checkbox which triggers PAI whenever it is checked or unchecked. After the PAI, selection screen is called again and in the PBO of selection screen, the cursor is set in P2. See below:
PARAMETER: P1(10)." MODIF ID SC1.
selection-screen BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETERS: C1 AS CHECKBOX USER-COMMAND COM1,
P2(10)." MODIF ID SC2.
SELECTION-SCREEN END OF BLOCK B1.
AT SELECTION-SCREEN OUTPUT.
IF C1 eq 'X'.
SET CURSOR FIELD 'P2'.
else.
SET CURSOR FIELD 'P1'.
ENDIF.
This one works, I have checked.
Hope this helps.
Thanks
Sanjeev
‎2008 Jan 04 6:02 PM
hi,
change your parameter C1 declaration
from
>PARAMETERS: C1 AS CHECKBOX MODIF ID SC2,
to
>PARAMETERS: c1 AS CHECKBOX USER-COMMAND aaa,
bye,
marco
‎2008 Jan 04 6:38 PM
Hi Hari,
You need to trigger PAI for calling the selection screen again to take advantage of AT SELECTION-SCREEN OUTPUT event (PBO of selection screen). This is done here by adding a function code to the checkbox which triggers PAI whenever it is checked or unchecked. After the PAI, selection screen is called again and in the PBO of selection screen, the cursor is set in P2. See below:
PARAMETER: P1(10)." MODIF ID SC1.
selection-screen BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETERS: C1 AS CHECKBOX USER-COMMAND COM1,
P2(10)." MODIF ID SC2.
SELECTION-SCREEN END OF BLOCK B1.
AT SELECTION-SCREEN OUTPUT.
IF C1 eq 'X'.
SET CURSOR FIELD 'P2'.
else.
SET CURSOR FIELD 'P1'.
ENDIF.
This one works, I have checked.
Hope this helps.
Thanks
Sanjeev
‎2008 Jan 04 7:42 PM