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: 

Radio Button on selection screen

Former Member
0 Kudos

Hi All,

I got 3 radiobutton on the selection screen.

Now my requirement is, Usually we Execute the program by using F8 function key but i should also Execute the program when i click on one of the radio button.

thanks & regards

NSK

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi.

Use the following code.

for example if rad1, rad2 are your radiobuttons then:

parameters: rad1 radiobutton group gp1 user-command ONLI,

rad2 radiobutton group gp1.

here user-command ONLI is the pharse which will tigger the execution of the program. Since ONLI is the function code for the execute function(F8) so when u will click the radio button this code will be called which will trigger the execution.

reward points please.

Regards,

Khusro Habib

7 REPLIES 7

Former Member
0 Kudos

Hi.

Use the following code.

for example if rad1, rad2 are your radiobuttons then:

parameters: rad1 radiobutton group gp1 user-command ONLI,

rad2 radiobutton group gp1.

here user-command ONLI is the pharse which will tigger the execution of the program. Since ONLI is the function code for the execute function(F8) so when u will click the radio button this code will be called which will trigger the execution.

reward points please.

Regards,

Khusro Habib

Former Member
0 Kudos

Hi,

Use the USER-COMMAND along with the radiobutton declaration, and in the at selection-screen event write stmts to check the user-command.

If sy-ucomm = 'BUT1'.

stmts.....

elseif sy-ucomm = 'BUT2'.

stmts....

elseif sy-ucomm = 'BUT3'.

stmts....

endif.

Regards,

Subramanian

Former Member
0 Kudos

Hi,

As per your requirement you need to use the USER-COMMAND 'onli' in your delcaration part.

As you have 3 radio buttons you must have declared them in a group. So, just add the following code in your delcaration.

PARAMETERS: rb_1 TYPE /sapapo/radio_lo RADIOBUTTON GROUP r1 USER-COMMAND onli DEFAULT 'X'.

Here, onli is the value that field sy-ucomm contains when you press F8 on screen. If you delcare the radiobutton group like this, then you can execute your program on the click of the radiobutton.

Please reward points if helpful.

Former Member
0 Kudos

Hi,

DATA : _ok_code TYPE sy-ucomm.

PARAMETERS: RAD1 radiobutton group gp1 user-command ONLI,
RAD2 radiobutton group gp1  .


MODULE user_command_9000 INPUT.

 if RAD1 EQ 'X'.  

   ......
     CALL SCREEN ........... 

   If RAD2 EQ 'X'.
  .....
      CALL SCREEN ........ 
       ........
       .....
  
  endif.
ENDMODULE.                 " USER_COMMAND_9000  INPUT

Hope this helps you.

thanks,

dhanashri.

Edited by: Dhanashri Pawar on Jul 7, 2008 6:25 AM

Edited by: Dhanashri Pawar on Jul 7, 2008 8:12 AM

Edited by: Dhanashri Pawar on Aug 1, 2008 2:10 PM

former_member387317
Active Contributor
0 Kudos

Hi

U can achive it in Module Pool Program...

Check Out the report below....

DEMO_DYNPRO_CHECK_RADIO

And in Executable report use At selection-screen output event

u can refer below threads...

Hope it will solve your problem..

Thanks & Regards

ilesh 24x7

Former Member
0 Kudos

Hi,

Below i attached sample code for your requirement. It will be more useful.

SELECTION-SCREEN : BEGIN OF BLOCK b1.

PARAMETERS : TEXT RADIOBUTTON GROUP GRP1 user-command uc.

parameters : file_txt type localfile modif id txt.

PARAMETERS : CSV RADIOBUTTON GROUP GRP1.

parameters : file_csv type localfile modif id csv.

PARAMETERS : XLS RADIOBUTTON GROUP GRP1.

parameters : file_xls type localfile modif id xls.

at selection-screen output.

if csv = 'X' .

loop at screen.

if screen-group1 = 'CSV'.

screen-input = '1'.

modify screen.

endif.

if screen-group1 = 'TXT'.

screen-input = '0'.

modify screen.

endif.

if screen-group1 = 'XLS'.

screen-input = '0'.

modify screen.

endif.

endloop.

elseif text = 'X'.

loop at screen.

if screen-group1 = 'TXT'.

screen-input = '1'.

modify screen.

endif.

if screen-group1 = 'CSV'.

screen-input = '0'.

modify screen.

endif.

if screen-group1 = 'XLS'.

screen-input = '0'.

modify screen.

endif.

endloop.

else.

loop at screen.

if screen-group1 = 'XLS'.

screen-input = '1'.

modify screen.

endif.

if screen-group1 = 'TXT'.

screen-input = '0'.

modify screen.

endif.

if screen-group1 = 'CSV'.

screen-input = '0'.

modify screen.

endif.

endloop.

endif.

Please reward points if helpful.

Former Member
0 Kudos

try this code

PARAMETERS:

P_SYS RADIOBUTTON GROUP RAD " System generated materials

USER-COMMAND ONLI,

P_NOSYS RADIOBUTTON GROUP RAD. " Non-System generated materials