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: 

Radiobutton event

Former Member
0 Kudos

Hi all!

In my selection-screen I have 2 radiobutton groups:

SELECTION-SCREEN BEGIN OF BLOCK BLOCK2 WITH FRAME TITLE TEXT-TA1.

PARAMETERS: R_ALV RADIOBUTTON GROUP OUTP,

R_DB RADIOBUTTON GROUP OUTP.

SELECTION-SCREEN BEGIN OF BLOCK SUB_BLOCK2 WITH FRAME TITLE TEXT-TA2.

PARAMETERS: R_RUN RADIOBUTTON GROUP OUT2,

R_TEST RADIOBUTTON GROUP OUT2 DEFAULT 'X'.

SELECTION-SCREEN END OF BLOCK SUB_BLOCK2.

PARAMETERS: P_FVERS TYPE TKVS-VERSI OBLIGATORY ,

P_FYEAR TYPE GJAHR OBLIGATORY ,

P_FMONTH(2) TYPE C .

SELECTION-SCREEN END OF BLOCK BLOCK2.

I would like to deactivate the second group when user set the first group on R_ALV, and reactivate it when user set the first group on R_DB.

I can't create a AT SELECTION-SCREEN section, because it is already declared in a INCLUDE that I can't modify.

I tried to put this code:

LOOP AT SCREEN.

IF R_DB = ' '.

IF SCREEN-NAME = 'R_RUN'.

SCREEN-INPUT = '0'.

ELSEIF SCREEN-NAME = 'R_TEST'.

SCREEN-INPUT = '0'.

ENDIF.

ELSE.

IF SCREEN-NAME = 'R_RUN'.

SCREEN-INPUT = '1'.

ELSEIF SCREEN-NAME = 'R_TEST'.

SCREEN-INPUT = '1'.

ENDIF.

ENDIF.

ENDLOOP.

in the AT SELECTION-SCREEN OUTPUT, but seem this section run only one time.

I tried also to create a AT SELECTION-SCREEN ON RADIOBUTTON GROUP OUTP with the same loop, but it seem that it never run.

How can I implement this feature? Thanks for any suggestion.

Marco

4 REPLIES 4

Former Member
0 Kudos

Define your radio button using:


PARAMETERS R_ALV RADIOBUTTON GROUP OUTP USER-COMMAND ZOUTP. 

Then clicking on it will trigger at selection-screen event where you can check SSCRFIELDS-ucomm for the value 'ZOUTP', processing if required. Selection-screen output event will then run as selection screen is re-displayed and you can use loop at screen etc to set how you want.

Andrew

0 Kudos

There is a problem: I can't modify (neither add) code in AT SELECTION-SCREEN event, because it is implemented in an INCLUDE that I can't modify. There is any other event I can trigger?

Marco

0 Kudos

You need to use AT SELECTION-SCREEN to check the value of the UCOMM if you are doing extra processing based on it.

for your requirement, putting your loop at screen code in the AT SELECTION-SCREEN OUTPUT event may be enough. The user-command addition on the radio button will trigger AT SELECTION-SCREEN, but because you will have no processing for your UCOMM value, it will be treated as if the user pressed enter. If there is no other special processing that occurs, then the selection screen should re-display which will trigger your code in AT SELECTION-SCREEN OUTPUT event again.

If this does not work you may have to either change the include, or take a copy of it and modify for your requirements.

Andrew

Andrew

vallamuthu_madheswaran2
Active Contributor
0 Kudos

Hi,

this is your same coding so copy and paste it and try.

but you should change the AT SELECTION-SCREEN and create new request.

after u select the button r_db then give the value for mandatory(obligatory) fields

then only the AT Selection-screen is work.(press enter button)

SELECTION-SCREEN BEGIN OF BLOCK block2 WITH FRAME TITLE text-ta1.

SELECTION-SCREEN BEGIN OF BLOCK block3 WITH FRAME.

PARAMETERS: r_alv RADIOBUTTON GROUP outp,

r_db RADIOBUTTON GROUP outp.

SELECTION-SCREEN END OF BLOCK block3." WITH FRAME.

SELECTION-SCREEN BEGIN OF BLOCK sub_block2 WITH FRAME TITLE text-ta2.

PARAMETERS: r_run RADIOBUTTON GROUP out2,

r_test RADIOBUTTON GROUP out2 DEFAULT 'X'.

SELECTION-SCREEN END OF BLOCK sub_block2.

PARAMETERS: p_fvers TYPE tkvs-versi OBLIGATORY ,

p_fyear TYPE gjahr OBLIGATORY ,

p_fmonth(2) TYPE c .

SELECTION-SCREEN END OF BLOCK block2.

AT SELECTION-SCREEN OUTPUT." ON RADIOBUTTON GROUP outp.

LOOP AT SCREEN .

IF screen-name = 'R_RUN' OR

screen-name = 'R_TEST'.

IF r_db = 'X'.

screen-input = '0'.

ENDIF.

ELSE."IF r_alv = 'X'.

screen-input = '1'.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

AT SELECTION-SCREEN.

LOOP AT SCREEN .

IF screen-name = 'R_RUN' OR

screen-name = 'R_TEST'.

IF r_db = 'X'.

screen-input = '0'.

ENDIF.

ELSEIF r_alv = 'X'.

screen-input = '1'.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

Good regards.