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: 

abt select options

Former Member
0 Kudos

Hi all,

I am using select options and radio buttons in a selection screen. My requirement is if the user has given inout in select-option then all the radio buttons should be disabled or if the user is going to select radio button then one select-option should be disabled.Pls help me.

Best Reagrds,

praveena.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

your pbo i.e. at selection-screen output only trigger before showing the screen. in your case if you press enter you will see the changes because after pressing enter at selection-screen <pai> will trigger and as it is showing the selection screen again so again the pbo <at selection-screen output> will trigger. But if you are pressing F8 then it is processing the other screen and there is no need of triggering the pbo of selection screen so you can not see that.

after pressing F8 is that necessary to see the selection screen then it is not possible just press enter to check whether the screen change or not.

regards

shiba dutta

13 REPLIES 13

Former Member
0 Kudos

Hi,

Check this example.

TABLES: mara.

PARAMETERS: p_rad1 RADIOBUTTON GROUP g1

USER-COMMAND usr

DEFAULT 'X' ,

p_rad2 RADIOBUTTON GROUP g1.

SELECT-OPTIONS: so_matnr FOR mara-matnr MODIF ID m1.

AT SELECTION-SCREEN OUTPUT.

IF NOT p_rad1 IS INITIAL.

LOOP AT SCREEN.

IF screen-group1 = 'M1'.

screen-input = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

Thanks,

Naren

0 Kudos

Hi Narendran,

If i am writing the logic in At-Selection-screen-output it is not working.What is happening is, after executing the screen only that event is triggering thats why not able to see the screen again. pls help me.

Thanks,

praveena.

Former Member
0 Kudos

Hi

Declare a modif id for selection option and also for radio button.

In the event at selection-screen output .

Code

Loop at screen.

check for modif id or check radiobutton is checked or not .

modify screen.

endloop.

Please reward if useful.

0 Kudos

Hi Dinesh,

If i am writing the logic in At-Selection-screen-output it is not working.What is happening is, after executing the screen only that event is triggering thats why not able to see the screen again. pls help me.

Thanks,

praveena.

anversha_s
Active Contributor
0 Kudos

hi,

chk this sample code.

report xradio.


*-------------------------------------------
PARAMETERS : R1 RADIOBUTTON GROUP RG USER-COMMAND R DEFAULT 'X'.
PARAMETERS : R2 RADIOBUTTON GROUP RG .


*-------------------------------------------
selection-screen begin of block b1 with frame.
parameters : a(10) type c modif id abc.
parameters : b(10) type c modif id abc.
selection-screen end of block b1.


selection-screen begin of block b2 with frame.
parameters : c(20) type c modif id def.
parameters : d(20) type c modif id def.
selection-screen end of block b2.

*-------------------------------------------
at selection-screen output.


IF R1 = 'X'.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'DEF'.
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.

IF R2 = 'X'.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'ABC'.
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.

Rgds

Anver

0 Kudos

Hi Anversha,

If i am writing the logic in At-Selection-screen-output it is not working.What is happening is, after executing the screen only that event is triggering thats why not able to see the screen again. pls help me.

Thanks,

praveena.

Former Member
0 Kudos

Hi,

Check the following code:

parameters: p_erdat like zirpactivity-erdat modif id SC1 ,

r1 radiobutton group RAD1 user-command ABC default 'X',

r2 radiobutton group RAD1.

AT SELECTION-SCREEN.

check sy-ucomm = 'ABC'.

check sy-ucomm = 'F8'.

AT SELECTION-SCREEN OUTPUT.

loop at screen.

if r1 = 'X' and screen-group1 = 'SC1' .

screen-input = 0.

ENDIF.

Hope this helps.

Reward if helpful.

Regards,

Sipra

0 Kudos

Hi Sipra Jain,

If i am writing the logic in At-Selection-screen-output it is not working.What is happening is, after executing the screen only that event is triggering thats why not able to see the screen again. pls help me.

Thanks,

praveena.

Former Member
0 Kudos

Hi all,

I am using select options and radio buttons in a selection screen. My requirement is if the user has given input in select-option then all the radio buttons should be disabled or if the user is going to select radio button then one select-option should be disabled.I tried writing code like Loop at screen in " At selection-screen output " but it is not working. Whenever the focus is lost from the select-option then all radio buttons of the same group should be disabled .Pls help me.

Best Reagrds,

praveena.

Former Member
0 Kudos

your pbo i.e. at selection-screen output only trigger before showing the screen. in your case if you press enter you will see the changes because after pressing enter at selection-screen <pai> will trigger and as it is showing the selection screen again so again the pbo <at selection-screen output> will trigger. But if you are pressing F8 then it is processing the other screen and there is no need of triggering the pbo of selection screen so you can not see that.

after pressing F8 is that necessary to see the selection screen then it is not possible just press enter to check whether the screen change or not.

regards

shiba dutta

0 Kudos

Hi ,

Thank you for clearing my doubt. yes if i press enter it is working but i want the output if F8 is pressed. I think there is no solution for this one.

Thank you very much,

praveena.

Former Member
0 Kudos

Praveena,

When you click on the radio buttons the AT SELECTION-SCREEN is triggered instantly, you might have observed this. So my suggestion is to Create two radio buttons say R1 and R2. The default selection would be on R1. For R1 selection we will show the SELECT-OPTION field on the screen and nothing else would be shown on the screen (i.e. rest all field we will hide in the at selection screen event). If the user clicks on the R2 button, we will hide the SELECT-OPTION field and will display the set of Radio buttons (say) RB1 RB2...

I hope you understand this.

Please look at the below code as sample:

SELECTION-SCREEN BEGIN OF BLOCK block6 WITH FRAME TITLE text-ext.

PARAMETERS: p_rdwox TYPE c RADIOBUTTON GROUP ex1 USER-COMMAND zzex,

p_rdsvx TYPE c RADIOBUTTON GROUP ex1.

  • Criteria Block for Saving Extracts

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN COMMENT 3(50) text-fs1 MODIF ID svx.

PARAMETERS: p_fsumm LIKE ltex-exname MODIF ID svx,

p_fsummx LIKE ltex-text MODIF ID svx.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN COMMENT 3(50) text-fs2 MODIF ID svx.

PARAMETERS: p_fdet LIKE ltex-exname MODIF ID svx,

p_fdetx LIKE ltex-text MODIF ID svx.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN COMMENT 3(50) text-fs5 MODIF ID svx.

PARAMETERS: p_fsum1 LIKE ltex-exname MODIF ID svx,

p_fsumx1 LIKE ltex-text MODIF ID svx.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN COMMENT 3(50) text-fs3 MODIF ID svx.

PARAMETERS: p_mdet LIKE ltex-exname MODIF ID svx,

p_mdetx LIKE ltex-text MODIF ID svx.

SELECTION-SCREEN END OF LINE.

PARAMETERS: p_rdrdx TYPE c RADIOBUTTON GROUP ex1.

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN COMMENT 3(29) text-fs4 MODIF ID rdx.

PARAMETERS: p_read LIKE ltex-exname MODIF ID rdx,

p_readx LIKE ltex-text MODIF ID rdx.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN SKIP.

PARAMETERS: p_cbexp TYPE c AS CHECKBOX MODIF ID rdx,

p_file(1024) TYPE c MODIF ID rdx,

p_cbdbf TYPE c AS CHECKBOX MODIF ID rdx.

AT SELECTION-SCREEN OUTPUT.

  • Hide Standard Extract Info

PERFORM modify_screen.

  • Process the displayed options for report

LOOP AT SCREEN.

IF p_rdsvx IS INITIAL.

IF p_radmm EQ 'X'.

IF screen-group1 EQ 'MM1'.

screen-active = 1.

ELSEIF screen-group1 EQ 'FI1'.

screen-active = 0.

ENDIF.

ENDIF.

IF p_radfi EQ 'X'.

IF screen-group1 EQ 'FI1'.

screen-active = 1.

ELSEIF screen-group1 EQ 'MM1'.

screen-active = 0.

ENDIF.

ENDIF.

ELSE.

IF screen-group1 EQ 'MM1' OR screen-group1 EQ 'FI1' OR

screen-group1 EQ 'RP1'.

IF p_rdsvx EQ 'X'.

screen-active = 0.

ELSE.

screen-active = 1.

ENDIF.

ENDIF.

ENDIF.

  • Extract Output

IF screen-group1 EQ 'SVX'.

IF p_rdsvx EQ 'X'.

screen-active = 1.

ELSE.

screen-active = 0.

ENDIF.

ENDIF.

IF screen-group1 EQ 'RDX'.

IF p_rdrdx EQ 'X'.

screen-active = 1.

ELSE.

screen-active = 0.

ENDIF.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

Former Member
0 Kudos

Hi Praveena,

<b>Run the below code when a radio button is clicked select-options will be disabled.

when u enter any value in select-options then radio buttons will be disabled.

</b>

REPORT zex23 .

TABLES : vbak.

SELECT-OPTIONS : s_vbeln FOR vbak-vbeln MODIF ID md1.

PARAMETERS : r1 RADIOBUTTON GROUP rg USER-COMMAND r DEFAULT 'X'

MODIF ID md2,

r2 RADIOBUTTON GROUP rg MODIF ID md2,

r3 RADIOBUTTON GROUP rg MODIF ID md2 .

DATA : c TYPE i.

AT SELECTION-SCREEN OUTPUT.

IF r2 = 'X' OR r3 = 'X'.

LOOP AT SCREEN.

IF screen-group1 = 'MD1'.

screen-input = '0'.

MODIFY SCREEN.

CONTINUE.

ENDIF.

ENDLOOP.

c = 1.

ELSEIF NOT s_vbeln[] IS INITIAL.

LOOP AT SCREEN.

IF screen-group1 = 'MD2'.

screen-input = '0'.

MODIFY SCREEN.

CONTINUE.

ENDIF.

ENDLOOP.

ELSEIF c EQ 1.

LOOP AT SCREEN.

IF screen-group1 = 'MD1'.

screen-input = '0'.

MODIFY SCREEN.

CONTINUE.

ENDIF.

ENDLOOP.

ENDIF.

START-OF-SELECTION.