Application Development 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: 

how to handle this scenario in selection screen?

Former Member
0 Kudos

hi friends...i have 2 radio-buttons (2 parameter fields below each) in one group..the need when one radio button is checked, i need two parameter fields below it to be input enabled and the other to be disabled, if another radio button is checked, then the former two will be disabled and the other two parameter fields to be input enabled..no problems with this..i have written this functionality in at selection-screen output..i want to make each 1 parameter in the two groups to be mandatory..as using obligatory gives problems during at selection-screen output event, i want to achieve this functionality in some other event...i have tried the same in At selection screen on para_1 and at selection screen on para_2 fields, but am not able to achieve the desired functionality..by default the first radio button is checked, if the user wants to click the second radio button, At selection screen on para_1 event gets triggered and it throws the error msg. for the first one & vice versa...can't handle this in start-of-selection event also, as it gives the error msg. in a blank new screen..how to achieve it??

i have checked quite a few SDN threads, but doesn't answer my question

regards,

Sathish R

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

I think you cannot proceed with obligatory statement as it will be triggered before theselection screen events.

You may check the code below.

PARAMETERS: r1 RADIOBUTTON GROUP rad1 USER-COMMAND abc.

PARAMETERS p1(5). ( maintained as obligatory)

PARAMETERS p2(5).

PARAMETERS r2 RADIOBUTTON GROUP rad1.

PARAMETERS p3(5). ( maintained as obligatory)

PARAMETERS p4(5).

INITIALIZATION.

r1 = 'X'.

AT SELECTION-SCREEN OUTPUT.

IF r1 = 'X'.

LOOP AT SCREEN.

IF screen-name = 'P4'.

screen-active = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ELSEIF r2 = 'X'.

LOOP AT SCREEN.

IF screen-name = 'P2'.

screen-active = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

AT SELECTION-SCREEN .

IF p1 IS INITIAL AND sy-ucomm NE 'ABC'.

MESSAGE 'Enter the obligatory value' TYPE 'S' DISPLAY LIKE 'E'.

ENDIF.

IF p3 IS INITIAL AND sy-ucomm NE 'ABC'.

MESSAGE 'Enter the obligatory value' TYPE 'S' DISPLAY LIKE 'E'.

ENDIF.

Hope this will help you.

Regards,

Smart Varghese

2 REPLIES 2

Former Member
0 Kudos

Hi,

I think you cannot proceed with obligatory statement as it will be triggered before theselection screen events.

You may check the code below.

PARAMETERS: r1 RADIOBUTTON GROUP rad1 USER-COMMAND abc.

PARAMETERS p1(5). ( maintained as obligatory)

PARAMETERS p2(5).

PARAMETERS r2 RADIOBUTTON GROUP rad1.

PARAMETERS p3(5). ( maintained as obligatory)

PARAMETERS p4(5).

INITIALIZATION.

r1 = 'X'.

AT SELECTION-SCREEN OUTPUT.

IF r1 = 'X'.

LOOP AT SCREEN.

IF screen-name = 'P4'.

screen-active = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ELSEIF r2 = 'X'.

LOOP AT SCREEN.

IF screen-name = 'P2'.

screen-active = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

AT SELECTION-SCREEN .

IF p1 IS INITIAL AND sy-ucomm NE 'ABC'.

MESSAGE 'Enter the obligatory value' TYPE 'S' DISPLAY LIKE 'E'.

ENDIF.

IF p3 IS INITIAL AND sy-ucomm NE 'ABC'.

MESSAGE 'Enter the obligatory value' TYPE 'S' DISPLAY LIKE 'E'.

ENDIF.

Hope this will help you.

Regards,

Smart Varghese

Former Member
0 Kudos

I missed the check to sy-ucomm NE

thanks

Sathish R