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

Display data based on Radio Button selection

Former Member
0 Likes
4,736

Hi All,

How to display the data in text field based on the user selection from radio button. Thank you!

1) If user select

- radio 1, P_Name = ' BDC_HIBE'.

- radio 2, P_Name = ' BDC_HERS'.

<b><u>Parameters: -</u></b>

<u>Radio Button:</u>

1. HIBE Material

2. HERS Material

<u>Text Field:</u>

P_Name

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,826

Hi

Hi Define ur selection screen like...

PARAMETER: radio_1 RADIOBUTTON GROUP dtyp MODIF ID typ,

radio_2 RADIOBUTTON GROUP dtyp MODIF ID typ.

In At selection-screen Output event write the below code..

At Selection-screen output.

Loop at screen.

LOOP AT SCREEN.

IF screen-group1 = 'TYP'.

IF radio_1 = 'X'.

P_name = 'Ravi'.

MODIFY SCREEN.

ENDIF.

If radio_2 = 'X'

P_name = 'XXXXX'.

MODIFY SCREEN.

ENDIF.

ENDIF.

I hope this will solve ur problem

Reward me if its helpful.

Regards

Ravi

8 REPLIES 8
Read only

Former Member
0 Likes
2,826

hi,

try using

loop at screen.

if p_button1 = 'X'.

p_name = 'abc'.

else.

p_name = 'xyz'.

endloop.

regards,

Navneeth K.

Read only

0 Likes
2,826

hi place the above code in at selection-screen event

Read only

kiran_k8
Active Contributor
0 Likes
2,826

Sweety,

parameters: r1 radiobutton group g1,

r2 radiobutton group g1.

data: text1(10) type c value 'Sweety',

text2(10) type c value 'Garden'.

if r1 = 'X'.

write:/ text1.

else.

write:/ text2.

endif.

K.Kiran.

Message was edited by:

Kiran K

Read only

Former Member
0 Likes
2,826

Hi,

Welcome to SDN.

Use two perform statement as

IF r_HIBE = 'X'.
PERFORM BDC_HIBE. "In this perform write all your code pertaining to your selection
ENDIF

IF r_HIERS = 'X'.
PERFORM BDC_HIERS.
ENDIF.

Regards

Aneesh.

Read only

Former Member
0 Likes
2,826

hi

try this example,

select-options : s_matnr for mara-matnr modif id aa,

s_matnr1 for marc-matnr modif id bb.

parameters : a radiobutton group grp1 user-command ucomm default 'X',

b radiobutton group grp1.

if a = 'X'.

loop at screen.

if screen-group1 = 'BB'.

screen-input = 0.

modify screen.

endif.

endloop.

endif.

if b = 'X'.

loop at screen.

if screen-group1 = 'AA'.

screen-input = 0.

modify screen.

endif.

endloop.

endif.

Read only

Former Member
0 Likes
2,826

hi,

To define the input field of a parameter as a radio button, you use the following syntax:

<b>PARAMETERS <p> ...... RADIOBUTTON GROUP <radi>......</b>

Parameter <p> is created with type C and length 1, and is assigned to group <radi>. The maximum length of string <radi> is 4. You can use additions TYPE and LIKE, but you must refer to a field of type C with length 1. You must assign at least two parameters to each <radi> group. Only one parameter per group can have a default value assigned using the DEFAULT addition. The default value must be 'X'. If you do not use the DEFAULT addition, the first parameter of each group ist set to 'X'.

<b>follow this logic.</b>

PARAMETERS: HIBE RADIOBUTTON GROUP RAD1 DEFAULT 'X',

HERS RADIOBUTTON GROUP RAD1.

  • define text field P_Name as per your need.

DATA : P_Name(10) type c. " length depends on your need

AT SELECTION-SCREEN ON RADIOBUTTON GROUP RAD1.

IF HIBE = 'X'.

P_Name = ' BDC_HIBE'

ELSEIF HERS = 'X'.

P_Name = ' BDC_HERS'.

ENDIF.

<b>OR</b>

AT SELECTION-SCREEN.

IF HIBE = 'X'.

P_Name = ' BDC_HIBE'

ELSEIF HERS = 'X'.

P_Name = ' BDC_HERS'.

ENDIF.

regards,

Ashok Reddy

Message was edited by:

Ashok Reddy

Read only

0 Likes
2,826

Hi Ashok,

If there any way to direct display the data in text field while choose one of the radio button without perform execute yet?

PARAMETERS: HIBE RADIOBUTTON GROUP RAD1 DEFAULT 'X',

HERS RADIOBUTTON GROUP RAD1.

PARAMETERS: p_name(12).

AT SELECTION-SCREEN.

IF HIBE = 'X'.

P_Name = ' BDC_HIBE' .

ELSEIF HERS = 'X'.

P_Name = ' BDC_HERS'.

ENDIF.

Read only

Former Member
0 Likes
2,827

Hi

Hi Define ur selection screen like...

PARAMETER: radio_1 RADIOBUTTON GROUP dtyp MODIF ID typ,

radio_2 RADIOBUTTON GROUP dtyp MODIF ID typ.

In At selection-screen Output event write the below code..

At Selection-screen output.

Loop at screen.

LOOP AT SCREEN.

IF screen-group1 = 'TYP'.

IF radio_1 = 'X'.

P_name = 'Ravi'.

MODIFY SCREEN.

ENDIF.

If radio_2 = 'X'

P_name = 'XXXXX'.

MODIFY SCREEN.

ENDIF.

ENDIF.

I hope this will solve ur problem

Reward me if its helpful.

Regards

Ravi