Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Selection screen scenario

Former Member
0 Likes
641

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
586

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

3 REPLIES 3
Read only

mnicolai_77
Active Participant
0 Likes
586

hi,

change your parameter C1 declaration

from

>PARAMETERS: C1 AS CHECKBOX MODIF ID SC2,

to

>PARAMETERS: c1 AS CHECKBOX USER-COMMAND aaa,

bye,

marco

Read only

Former Member
0 Likes
587

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

Read only

0 Likes
586

Hi Sanjeev,

it worked !!!!

thank u .

Regards,

Hari Kiran