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

AT SELECTION-SCREEN

Former Member
0 Likes
905

Hi all,

I have two radio buttons and three parameters. if the user chooses radio button1 i would like all the fields to be enabled for input. if the user chooses radio button2 I would like only the first field to be enabled for input.

please let me know what's wrong in this code. If I use

"AT selection-screen output". this code is working properly.

please let me know if this is possible with just

"At selection-screen".

SELECTION-SCREEN BEGIN OF BLOCK BLK1 WITH FRAME.

PARAMETERS: R1 RADIOBUTTON GROUP GR1 DEFAULT 'X',

R2 RADIOBUTTON GROUP GR1.

SELECTION-SCREEN SKIP 1.

PARAMETERS: P1 LIKE LIKP-VBELN MODIF ID BL1,

P2 TYPE I DEFAULT 1 MODIF ID BL5,

P3 LIKE T001W-WERKS MODIF ID BL5.

SELECTION-SCREEN END OF BLOCK BLK1.

AT SELECTION-SCREEN.

IF R1 = 'X'.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'BL1' OR SCREEN-GROUP1 = 'BL5'.

SCREEN-INPUT = '1'.

SCREEN-INTENSIFIED = '1'.

MODIFY SCREEN.

CONTINUE.

ENDIF.

ENDLOOP.

ELSEIF R2 = 'X'.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'BL1'.

SCREEN-INPUT = '1'.

SCREEN-INTENSIFIED = '1'.

MODIFY SCREEN.

CONTINUE.

ELSEIF SCREEN-GROUP1 = 'BL5'.

SCREEN-INPUT = '0'.

SCREEN-INTENSIFIED = '0'.

MODIFY SCREEN.

CONTINUE.

ENDIF.

ENDLOOP.

ENDIF.

Thanks,

Ganesh.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
853

Hi,

Check your modified code..The changes are marked in bold..

SELECTION-SCREEN BEGIN OF BLOCK BLK1 WITH FRAME.

PARAMETERS: R1 RADIOBUTTON GROUP GR1 DEFAULT 'X' <b>USER-COMMAND UCOMM,</b>

R2 RADIOBUTTON GROUP GR1.

SELECTION-SCREEN SKIP 1.

PARAMETERS: P1 LIKE LIKP-VBELN MODIF ID BL1,

P2 TYPE I DEFAULT 1 MODIF ID BL5,

P3 LIKE T001W-WERKS MODIF ID BL5.

SELECTION-SCREEN END OF BLOCK BLK1.

<b>AT SELECTION-SCREEN OUTPUT.

IF R2 = 'X'.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'BL5'.

screen-input = '0'.

MODIFY SCREEN.

endif.

ENDLOOP.

endif.</b>

Thanks,

Naren

Message was edited by: Narendran Muthukumaran

9 REPLIES 9
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
853

The AT selection-screen output event is the PBO(process before output) and the AT selection-screen event is like the PAI(process after input) this is where you do the validations. When modifing the screen, you should always do this in the AT selection-screen OUTPUT event.

So.... change it back to the AT SELECTION-SCREEN OUTPUT

<b>AT SELECTION-SCREEN OUTPUT.</b>

IF R1 = 'X'.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'BL1' OR SCREEN-GROUP1 = 'BL5'.
SCREEN-INPUT = '1'.
SCREEN-INTENSIFIED = '1'.
MODIFY SCREEN.
CONTINUE.
ENDIF.
ENDLOOP.

.....

Regards,

Rich Heilman

Read only

Former Member
0 Likes
853

Hi,

Check the similar forum for reference,

Regards,

Azaz.

Read only

Former Member
0 Likes
854

Hi,

Check your modified code..The changes are marked in bold..

SELECTION-SCREEN BEGIN OF BLOCK BLK1 WITH FRAME.

PARAMETERS: R1 RADIOBUTTON GROUP GR1 DEFAULT 'X' <b>USER-COMMAND UCOMM,</b>

R2 RADIOBUTTON GROUP GR1.

SELECTION-SCREEN SKIP 1.

PARAMETERS: P1 LIKE LIKP-VBELN MODIF ID BL1,

P2 TYPE I DEFAULT 1 MODIF ID BL5,

P3 LIKE T001W-WERKS MODIF ID BL5.

SELECTION-SCREEN END OF BLOCK BLK1.

<b>AT SELECTION-SCREEN OUTPUT.

IF R2 = 'X'.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'BL5'.

screen-input = '0'.

MODIFY SCREEN.

endif.

ENDLOOP.

endif.</b>

Thanks,

Naren

Message was edited by: Narendran Muthukumaran

Read only

0 Likes
853

Hi,

If I use At selection-screen output to do this. once the uer enters some values in these fields Where do i write my code that processes these values.

Do i use At selection-screen for processing ?

Thanks,

Ganesh.

Read only

0 Likes
853

That's right, use the At selection-screen event to to any validations to the fields which the user has entered values.

Regards,

Rich Heilman

Read only

0 Likes
853

Hi,

In this code If i choose R2 and then R1 again I am not getting the second and third fields displayed.

How do i do that ?

SELECTION-SCREEN BEGIN OF BLOCK BLK1 WITH FRAME.

PARAMETERS: R1 RADIOBUTTON GROUP GR1 DEFAULT 'X' USER-COMMAND UCOMM,

R2 RADIOBUTTON GROUP GR1.

SELECTION-SCREEN SKIP 1.

PARAMETERS: P1 LIKE LIKP-VBELN MODIF ID BL1,

P2 TYPE I DEFAULT 1 MODIF ID BL5,

P3 LIKE T001W-WERKS MODIF ID BL5.

SELECTION-SCREEN END OF BLOCK BLK1.

AT SELECTION-SCREEN OUTPUT.

IF R2 = 'X'.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'BL5'.

screen-input = '0'.

MODIFY SCREEN.

endif.

ENDLOOP.

endif.

AT SELECTION-SCREEN.

IF R1 = 'X'.

IF P1 IS INITIAL OR P2 IS INITIAL OR P3 IS INITIAL.

MESSAGE ' PLEASE ENTER VALUES FOR ALL THE FIELDS ' TYPE 'W'.

ENDIF.

ENDIF.

Thanks,

Ganesh.

Message was edited by: mg s

Read only

0 Likes
853

You need to check the sy-ucomm so that you validation does not happen when selecting radiobuttons.



at selection-screen.

<b>check sy-ucomm <> 'UCOMM'.</b>

  if r1 = 'X'.
    if p1 is initial or p2 is initial or p3 is initial.
      message ' PLEASE ENTER VALUES FOR ALL THE FIELDS ' type 'W'.
    endif.
  endif.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
853

Hi,

Add the changes that are marked in bold..

IF R1 = 'X' <b>AND SY-UCOMM <> 'UCOMM'</b>.

IF P1 IS INITIAL OR P2 IS INITIAL OR P3 IS INITIAL.

Thanks,

Naren

Read only

0 Likes
853

Thanks a lot guyz. I got my answer.