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: 

Query regarding Radio Button

Former Member
0 Kudos

Hi Guys,

In my selection screen I am giving 2 radio buttons.

My requirement is I need a sy-date field beside one radio button.

Is there any way to do this.

Thanks in Advance,

Prasad.

1 ACCEPTED SOLUTION

former_member156446
Active Contributor
0 Kudos

Hi..use this code:

SELECTION-SCREEN BEGIN OF LINE.
PARAMETER : ra_1 RADIOBUTTON GROUP g1 DEFAULT 'X' USER-COMMAND abc,
            ra_2 RADIOBUTTON GROUP g1.
SELECTION-SCREEN COMMENT 7(10) display.
*SELECTION-SCREEN COMMENT 7(10) display MODIF ID def.
SELECTION-SCREEN END OF LINE.

AT SELECTION-SCREEN OUTPUT.

  IF ra_1 = 'X'.
    display = sy-datum.  " you can modify the format of the date
  ELSE.
    display = sy-datum.
  ENDIF.
  MODIFY SCREEN.

7 REPLIES 7

Former Member
0 Kudos

You can achieve by using SELECTION-SCREEN BEGIN OF LINE and SELECTION-SCREEN END OF LINE.

Thanks.

former_member156446
Active Contributor
0 Kudos

Hi..use this code:

SELECTION-SCREEN BEGIN OF LINE.
PARAMETER : ra_1 RADIOBUTTON GROUP g1 DEFAULT 'X' USER-COMMAND abc,
            ra_2 RADIOBUTTON GROUP g1.
SELECTION-SCREEN COMMENT 7(10) display.
*SELECTION-SCREEN COMMENT 7(10) display MODIF ID def.
SELECTION-SCREEN END OF LINE.

AT SELECTION-SCREEN OUTPUT.

  IF ra_1 = 'X'.
    display = sy-datum.  " you can modify the format of the date
  ELSE.
    display = sy-datum.
  ENDIF.
  MODIFY SCREEN.

0 Kudos

Hi Jay,

My selection screen is as below.


selection-screen: begin of block b6
                        with frame title text-b06.
selection-screen: begin of line,
                        position 1.
parameters: atp1 radiobutton group atp.
selection-screen: comment 4(25) text-t06."After this I need to get sy-datum field for selecting date
selection-screen: end of line.
selection-screen: begin of line,
                        position 1.
parameters: atp2 radiobutton group atp default 'X'.
selection-screen: comment 4(25) text-t07.
selection-screen: end of line.
selection-screen: end of block b6.

Thanks,

Prasad.

awin_prabhu
Active Contributor
0 Kudos

Hi

Try below code.

REPORT zdemo.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS : r RADIOBUTTON GROUP rad.

SELECTION-SCREEN COMMENT 20(20) s

FOR FIELD r.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS: r1 RADIOBUTTON GROUP rad.

SELECTION-SCREEN COMMENT 20(20) s1

FOR FIELD r.

SELECTION-SCREEN END OF LINE.

INITIALIZATION.

s = sy-datum.

s1 = 'RADIO'.

prince_isaac
Active Participant
0 Kudos

Hie Dheeru,

do u wish to have the radio button and the date field in the same line on your selection screen?

if so:


selection-screen begin of line.
selection-screen comment (15) text-001. "radiobutton 1 text
parameters : radio_btn1  radiobutton group gp1,
                          xdate      type sy-datum.
parameters : radio_btn  radiobutton group gp1,
                          ydate      type sy-datum.
selection-screen end of line.

regards

Prince Isaac

0 Kudos

No Isaac,

I need to get after my text.


selection-screen: comment 4(25) text-t06.

Former Member
0 Kudos

Hi Guys Thanks for ur response.I have resolved it my self.