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: 

How to create a radio button in SAP Query SQ01/SQ02.

Former Member
0 Kudos

Hi all,

I have created on Query for table RESB.

I want to add one radio button in selection screen of the query called "Pending only".

What i want to do based on this is, i will filter data based on this.

If i select this radio button then system should remove line item with

RESB-KZEAR and RESB-WLOEK = blank.

and if i don't select radio button then it will show all lines.

I don't know how to create radio button at all.

Please help me.

1 ACCEPTED SOLUTION

jogeswararao_kavala
Active Contributor
0 Kudos

Hi Jigar,

Your requirement is not  radio button.

It is a checkbox.

This can be done in Infoset itself (SQ02).

Select the pushbutton labeled Extras
Select the tab labeled Selections, then click on Create icon. 
On Create Selection popup, enter the name of the field say 'test' and select radiobutton Parameter.
On next popup, enter description and selection text.  For the format option, enter type C and length 1For Extras enter "AS CHECKBOX"

See this image:
Now the code you need to write inthe 'Record Processing' section of the Code tab.

Save the code.

Generate Infoset.

Run transacction SQ01.

Execute with the query made on this infoset.

You will find the checkbox in the selection-screen.

Check this and execute for desired result.

Jogeswara Rao K


4 REPLIES 4

Former Member
0 Kudos

hello,

Try this in SQ02.

You have to use at selection-screen output event for this purpose here is a sample code try it and you will get the logic.


PARAMETERS :
   p_flight RADIOBUTTON GROUP r1 ,
   p_book RADIOBUTTON GROUP r1 .

PARAMETERS :
  w_temp1 RADIOBUTTON GROUP r2 MODIF ID sc1 ,
  w_temp2 RADIOBUTTON GROUP r2 MODIF ID sc1 .

SELECT-OPTIONS s_carrid FOR sflight-carrid MODIF ID sc1 .
                                       " Airline Code

PARAMETERS :
w_temp01 RADIOBUTTON GROUP r3 MODIF ID sc2 ,
w_temp02 RADIOBUTTON GROUP r3 MODIF ID sc2 .

SELECT-OPTIONS s_bookid FOR sbook-bookid MODIF ID sc2 .
                                       " Airline Code

*"--------------------------------------------------------------------*
*                       AT SELECTION-SCREEN OUTPUT                    *
*"--------------------------------------------------------------------*
AT SELECTION-SCREEN OUTPUT .


  IF p_flight = 'X'  .

    fl_flag = 1 .
    LOOP AT SCREEN.
      IF screen-group1 = 'SC2'.
        screen-active = 0 .
        MODIFY SCREEN .
      ENDIF.                           " IF SCREEN-GROUP1 = 'SC2'
    ENDLOOP.                           " LOOP AT SCREEN

  ELSEIF p_book = 'X' .

    fl_flag = 2 .
    LOOP AT SCREEN.
      IF screen-group1 = 'SC1'.
        screen-active = 0 .
        MODIFY SCREEN .
      ENDIF.                           " IF SCREEN-GROUP1 = 'SC1'
    ENDLOOP.                           " LOOP AT SCREEN
  ENDIF .                                " IF P_FLIGHT = 'X' .

Here in this case, There are 2 radio buttons and 2 select options. On clicking the first radio button one of the select option is hidden. If you you just have a single radio button then you can avoid using at selection-screen output and just write your code start-of-selection.

best regards,

swanand

jogeswararao_kavala
Active Contributor
0 Kudos

Hi Jigar,

Your requirement is not  radio button.

It is a checkbox.

This can be done in Infoset itself (SQ02).

Select the pushbutton labeled Extras
Select the tab labeled Selections, then click on Create icon. 
On Create Selection popup, enter the name of the field say 'test' and select radiobutton Parameter.
On next popup, enter description and selection text.  For the format option, enter type C and length 1For Extras enter "AS CHECKBOX"

See this image:
Now the code you need to write inthe 'Record Processing' section of the Code tab.

Save the code.

Generate Infoset.

Run transacction SQ01.

Execute with the query made on this infoset.

You will find the checkbox in the selection-screen.

Check this and execute for desired result.

Jogeswara Rao K


0 Kudos

Thanks a Lot friends.

It was a great help to me.

Jigar

0 Kudos

This message was moderated.