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: 

Select options

Former Member
0 Kudos

Hi Friends,

In reports i defined a selection screen.in that based on particular radiobutton i need to display particular fields. all the other fields is not displayed on screen.i did taht by using loop at screen.but here my problem is

if i select r1 then i need to display parameter1 as input field.

when i select r2 i need to display parameter2 as input field. here the parameter1 box is not displaying but also i want to delete the text symbol of the parameter1.

can any one send ur valuable suggestions.

Thanks,

Srinivas.

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

See this example. Notice that the P_RAD1 parameter has a USER-COMMAND, this will fire a round trip when the user clicks the radibuttons.



REPORT zrich_001.

PARAMETERS: p_rad1 RADIOBUTTON GROUP grp1 DEFAULT 'X'
                        user-command chk,
            p_rad2 RADIOBUTTON GROUP grp1.
SELECT-OPTIONS: s_datum1 FOR sy-datum MODIF ID d1,
                s_datum2 FOR sy-datum MODIF ID d2.

AT SELECTION-SCREEN OUTPUT.
  LOOP AT SCREEN.
    IF p_rad1 = 'X'
      AND screen-group1 = 'D2'.
      screen-active = '0'.
    ENDIF.
    IF p_rad2 = 'X'
     AND screen-group1 = 'D1'.
      screen-active = '0'.
    ENDIF.
    MODIFY SCREEN.
  ENDLOOP.

Regards,

RIch Heilman

4 REPLIES 4

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

See this example. Notice that the P_RAD1 parameter has a USER-COMMAND, this will fire a round trip when the user clicks the radibuttons.



REPORT zrich_001.

PARAMETERS: p_rad1 RADIOBUTTON GROUP grp1 DEFAULT 'X'
                        user-command chk,
            p_rad2 RADIOBUTTON GROUP grp1.
SELECT-OPTIONS: s_datum1 FOR sy-datum MODIF ID d1,
                s_datum2 FOR sy-datum MODIF ID d2.

AT SELECTION-SCREEN OUTPUT.
  LOOP AT SCREEN.
    IF p_rad1 = 'X'
      AND screen-group1 = 'D2'.
      screen-active = '0'.
    ENDIF.
    IF p_rad2 = 'X'
     AND screen-group1 = 'D1'.
      screen-active = '0'.
    ENDIF.
    MODIFY SCREEN.
  ENDLOOP.

Regards,

RIch Heilman

Former Member
0 Kudos

Hi,

But if you don't want to see the text symbol, then my question is for first time when somebody excutes this program he will see two radibuttons with one radiobutton having a parameter which is input enabled and other radiobutton just there with nothing( user will not see anything but just the radiobutton).

So just wondering whether removing the text symbol is really a good approach.

Thanks,

Babu

Former Member
0 Kudos

Post your selection screen definition here. I think you are writing the parameter text using SELECTION-SCREEN COMMENT. You should add the addition MODIF ID to it as well as the parameter that goes with it. See below.


SELECTION-SCREEN BEGIN OF BLOCK  b1 WITH FRAME TITLE text-037.
PARAMETERS: p_rad1 RADIOBUTTON GROUP rd1 DEFAULT 'X' USER-COMMAND rad,
            p_rad2 RADIOBUTTON GROUP rd1.

SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(20) v_text1 MODIF ID rd1.
PARAMETER: p_param1 LIKE vbak-vbeln MODIF ID rd1.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(20) v_text2 MODIF ID rd2.
PARAMETER: p_param2 LIKE ekko-ebeln MODIF ID rd2.
SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK b1.

INITIALIZATION.
  v_text1 = 'Select Using Sales Order'.
  v_text2 = 'Select Using PO'.

AT SELECTION-SCREEN OUTPUT.

  IF p_rad1 = 'X'.
    LOOP AT SCREEN.
      CHECK screen-group1 = 'RD2'.
      screen-active = 0.
      MODIFY SCREEN.
    ENDLOOP.
  ELSEIF p_rad2 = 'X'.
    LOOP AT SCREEN.
      CHECK screen-group1 = 'RD1'.
      screen-active = 0.
      MODIFY SCREEN.
    ENDLOOP.
  ENDIF.

Former Member
0 Kudos

Hi All,

Richi, babu and srinivas thanks for ur quick reply.it's working fine.

Thanks,

Srinivas