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

selection screen

Former Member
0 Likes
846

Hi,

I have one query regarding selection screen.

Based on radiobutton my selection screen will become enable & disable mode.

i.e. suppose the selection screen having two button B1 & B2.

the input fields are F1 & F2.

if i select B1 radiobutton the field F1 should become enable mode while if I select B2 radiobutton the then only F2 should

become in enable mode.

Anybody will tell me the optimized logic.

11 REPLIES 11
Read only

Former Member
0 Likes
827

do this way..

AT selection-screen on radiobutton.

loop at screen.
case 'X'.
when 'R1'.
if screen-name = 'P_YEAR'.
screen-input = '0'.
screen-output = '1'.
modify screen
ENDif.
When 'R2'.
if screen-name = 'P_PERIOD'.
screen-input = '0'.
screen-output = '1'.
modify screen
ENDif.

endcase.
endloop.

Read only

Former Member
0 Likes
827

Hi,,

write like this...

loop at screen.

If r1 eq 'X'.

screen-fieldname = field2.

screen-input = 0.

endif.

endloop.

may be it is helpfull to you....

Regards,

kishore.

Read only

0 Likes
827

Hi Neha...

Santosh has given the appropriate answer...

Regards,

Kishore.

Read only

Former Member
0 Likes
827

Refer this link:

Regards,

Ravi

Read only

Former Member
0 Likes
827

In addition to teh above reply

Initiate the 'AT selection-screen' EVENT from radiobuttons.

In-order for the Radiobutton selection process to initiate the 'AT selection-screen' event you need to

add the 'USER_COMMAND' option to the parameter declaration. See code below.

*Code used to Initiate the 'AT selection-screen' EVENT from radiobuttons.

selection-screen begin of block group with frame title text-s04.
parameters: p_sel1 type c radiobutton group sel

<b>user-command upd.</b>

parameters: p_sel2 type c radiobutton group sel.
selection-screen end of block group.

Read only

Former Member
0 Likes
827

Try this:

Use the event AT SELECTION-SCREEN ON B1.

Check if B1 is checked .

use Loop at screen and dynamically set the status of F1/ F2 active / inactive.

Read only

Former Member
0 Likes
827

PARAMETERS: p_b1 RADIOBUTTON GROUP mod USER-COMMAND com.

PARAMETERS: p_b2 RADIOBUTTON GROUP mod .

parameters: p_field type bukrs.

At selection-screen output.

loop at screen.

if screen-name eq 'P_FIELD'.

if p_b1 eq 'X'.

screen-input = '0'.

screen-output = '1'.

MODIFY SCREEN.

elseif p_b2 eq 'X'.

screen-input = '1'.

screen-output = '1'.

MODIFY SCREEN.

endif.

endif.

endloop.

Read only

Former Member
0 Likes
827

hi

this can be done with one of the <b>selection-screen output</b> event and the <b>LOOP AT SCREEN.....MODIFY SCREEN.</b>

Like the following code:

At selection-screen output.

loop at screen.

if screen-name = 'fieldname1'.

if readiobutton1 = 'X'.

screen-input = '0'.

screen-output = '1'.

MODIFY SCREEN.

endif.

endif.

if screen-name = 'fieldname2'.

if radiobutton2 = 'X'.

screen-input = '1'.

screen-output = '1'.

MODIFY SCREEN.

endif.

endif.

endloop.

regards,

shamim.

Read only

Former Member
0 Likes
827

Execute the code .

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 def.
selection-screen end of block b1.

at selection-screen output. "here do the coding.

IF R1 = 'X'.
LOOP AT SCREEN.
IF screen-group1 = 'ABC'.
screen-input = '1'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.

LOOP AT SCREEN.
IF screen-group1 = 'DEF'.
screen-input = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.

ENDIF.

IF R2 = 'X'.
LOOP AT SCREEN.
IF screen-group1 = 'DEF'.
screen-INPUT = '1'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.

LOOP AT SCREEN.
IF screen-group1 = 'ABC'.
screen-input = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.

Please close the thread if ur query is resolved .

Regards,

vijay.

Read only

Former Member
0 Likes
827

Thanks very much.

I have the same problem.

I made several test,and failed.

I am failed at parameter input enable or disable when I change the radio button.

Anyone can provide a complete,clear solution?

Read only

0 Likes
827

Hi,

Please try this code. Reward points if helpful

----


  • PARAMETERS , SELECTION SCREEN

----


SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

PARAMETERS: p_app RADIOBUTTON GROUP g1 DEFAULT 'X' USER-COMMAND uc1,

p_file TYPE rlgrap-filename,

p_pre RADIOBUTTON GROUP g1,

p_file1 TYPE rlgrap-filename.

SELECTION-SCREEN END OF BLOCK b1.

AT SELECTION-SCREEN OUTPUT.

IF p_app = 'X'.

LOOP AT SCREEN.

IF screen-name = 'P_FILE1'.

screen-input = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ELSE.

LOOP AT SCREEN.

IF screen-name = 'P_FILE'.

screen-input = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.