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: 

Disabling screen elements on a selection screen

Former Member
0 Kudos

Hello all!

How can one disbale/enable radio buttons on a standard selection screen, like the one created for a report?

The screen looks like:

Radio buttons 1,2, and 3 are in the same group G1.

Radio button 1

Radio button 2

Radio button 3

There is another radio button group G2, that has 3 other radio buttons.

I want to enable the user to be able to select radio buttons from G2 only if they have selected radio button 3.

I have tried the available AT SELECTION-SCREEN statements but with no luck.

Thanks for all your help.

Ahmed

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

You can always use the SCREEN table to modify the elements on the screen.

Loop at SCREEN.

Endloop.

Regards,

Pramod

5 REPLIES 5

Former Member
0 Kudos

Hi,

You can always use the SCREEN table to modify the elements on the screen.

Loop at SCREEN.

Endloop.

Regards,

Pramod

0 Kudos

Use the code at "AT SELECTION-SCREEN OUTPUT" and assign a Modify Id of what all needed to be visible & hided on Radio button select.

Example code:

LOOP AT SCREEN.

IF radio button one

IF screen-group1 = 'MD3' OR

screen-group1 = 'MD4' OR

screen-group1 = 'MD2'.

screen-active = '0'.

ENDIF.

ELSEIF radio button two

IF screen-group1 = 'MD3' OR

screen-group1 = 'MD4' OR

screen-group1 = 'MD5'.

screen-active = '0'.

ENDIF.

ELSEIF radio button three

IF screen-group1 = 'MD2' OR

screen-group1 = 'MD5'.

screen-active = '0'.

ENDIF.

ENDIF.

MODIFY SCREEN.

IF screen-group1 = 'MD2' OR

screen-group1 = 'MD3'.

screen-input = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

Let us know, if anything else required.

0 Kudos

Pramod,

Thanks for the answer.

As I understand you can only use the ability to modify the screen elements when you are processing it (before or after - pbo/pai), not when the screen has been displayed.

In my scenario, the selection screen is displayed and the user is then choosing different radio button selections, and based on the user response, I am trying to see if the selection screen can be dynamically changed.

Hope that helps to understand the scenario I am trying to work with,

Mujtaba

0 Kudos

Hi,

Let me clarify something here.

When you define 2 radiobutton groups with some radiobuttons by default any one of the radiobuttons will be checked I am not sure whether we can uncheck it or not. Even if you do not define a default check value for a variable, in both the groups one of the variables will be checked. Now when the user changes the value of one of the screen radio button groups you 'at selection-screen on' statement is triggered. I think what you can do is.

at selection-screen on radiobutton group G1.

Disable Group2.

at selection-screen on radiobutton group G2.

Disable Group1.

I cant think of any better answer as of now

Regards,

Pramod

0 Kudos

Hi

Just the guys said to you, u need to change the attribute of selection-screen in the event AT SELECTION-SCREEN OUTPUT, but u need to assign an OK-CODE to the radiobutton of group1, in this way after pressing a radiobutton the event will be triggered automatically.

So your modification should be like following code:

PARAMETERS: r1 RADIOBUTTON GROUP g1 default 'X' USER-COMMAND AAA,
            r2 RADIOBUTTON GROUP g1,
            r3 RADIOBUTTON GROUP g1.

PARAMETERS: r4 RADIOBUTTON GROUP g2 DEFAULT 'X' MODIF ID 001,
            r5 RADIOBUTTON GROUP g2             MODIF ID 001,
            r6 RADIOBUTTON GROUP g2             MODIF ID 001.

AT SELECTION-SCREEN OUTPUT.

  case 'X'.
    when r3.
    when r1 or r2.
      loop at screen.
        if screen-group1 = '001'.
          screen-active = 0.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.
  endcase.

Max