Skip to Content
author's profile photo Former Member
Former Member

Radio Button on selection screen

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

7 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jul 07, 2008 at 04:12 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 07, 2008 at 04:18 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 07, 2008 at 05:05 AM

    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...

    at-selection-screen-on-radio-button

    at-selection-screen-radio-button-change-screen

    selecting-a-radio-button-in-selection-screen-shoul

    Hope it will solve your problem..

    Thanks & Regards

    ilesh 24x7

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 07, 2008 at 06:06 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 07, 2008 at 04:13 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 07, 2008 at 04:25 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 07, 2008 at 06:12 AM

    try this code

    PARAMETERS:

    P_SYS RADIOBUTTON GROUP RAD " System generated materials

    USER-COMMAND ONLI,

    P_NOSYS RADIOBUTTON GROUP RAD. " Non-System generated materials

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.