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

Radio Buttons with Text fields

Former Member
0 Likes
1,884

Hi Experts,

I want to solve a problem.

I have 2 radio buttons in one group. If the second one of them will be selected, it has to be fill out a text field and one Datefield and from 3 others radio bottons in a second group one has to be selected.

How I have to code it?

Thanks.

Mike

Hi Experts,

I want to solve a problem.

I have 2 radio buttons in one group. If the second one of them will be selected, it has to be fill out a text field and one Datefield and from 3 others radio bottons in a second group one has to be selected.

How I have to code it?

Thanks.

Mike

2 REPLIES 2
Read only

Former Member
0 Likes
979

consider following lines of code

----


  • SELECT OPTIONS

----


SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.

PARAMETERS: r1 RADIOBUTTON GROUP rad1 MODIF ID sc7 USER-COMMAND cli

DEFAULT 'X',

r2 RADIOBUTTON GROUP rad1 MODIF ID sc6.

SELECTION-SCREEN END OF BLOCK b2.

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

PARAMETERS : s_werks TYPE ekpo-werks MODIF ID sc1, "Plant

s_lifnr TYPE ekko-lifnr MODIF ID sc2. "Vendor

SELECT-OPTIONS: s_matnr FOR mara-matnr MODIF ID sc3. "Material

SELECT-OPTIONS: s_date FOR sy-datum MODIF ID sc4

NO INTERVALS NO-EXTENSION. "Date

SELECT-OPTIONS: s_lifnr1 FOR ekko-lifnr MODIF ID sc8

NO INTERVALS NO-EXTENSION. "Delivery to

PARAMETERS: s_pri TYPE c MODIF ID sc5. "Priority

SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.

PARAMETERS: s_txt1 LIKE zmm_collection-txt01 MODIF ID sc9, "Plant

s_txt2 type zmm_collection-txt01 modif id s10, "Vendor

s_txt3 type zmm_collection-txt01 modif id s11. "Vendor

SELECTION-SCREEN END OF BLOCK b3.

*pushbutton

----


  • AT SELECTIONSCREEN OUTPUT

----


AT SELECTION-SCREEN OUTPUT.

IF r2 = 'X'.

LOOP AT SCREEN.

IF screen-group1 = 'SC2' OR screen-group1 = 'SC3' OR screen-group1

= 'SC5' OR screen-group1 = 'SC8' OR

screen-group1 = 'SC9' OR screen-group1 = 'S10' OR screen-group1 = 'S11'.

screen-input = '0'.

screen-active = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

here in AT SELECTION-SCREEN OUTPUT event.. you can code the desired output...

you can assign values to the text-fields or set values to the radio buttons...

Read only

prasanth_kasturi
Active Contributor
0 Likes
979

hi,

check this code,

It suits your requirement

SELECTION-SCREEN BEGIN OF BLOCK box1 WITH FRAME .

PARAMETERS : r1 RADIOBUTTON GROUP g1 DEFAULT 'X' USER-COMMAND ucomm,

r2 RADIOBUTTON GROUP g1 .

SELECTION-SCREEN END OF BLOCK box1.

SELECTION-SCREEN BEGIN OF BLOCK box2 WITH FRAME .

PARAMETERS : field type string,

date type sy-datum.

*

PARAMETERS : r3 RADIOBUTTON GROUP g2 USER-COMMAND ucomm1,

r4 RADIOBUTTON GROUP g2,

r5 RADIOBUTTON GROUP g2.

SELECTION-SCREEN END OF BLOCK box2.

AT SELECTION-SCREEN OUTPUT.

if r2 = 'X'.

field = 'ABCD'.

date = sy-datum.

r3 = 'Y'.

r4 = 'X'.

endif.

if r1 = 'X'.

field = ' '.

date = ' '.

r3 = 'X'.

r4 = 'Y'.

endif.

regards

prasanth