Application Development and Automation 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: 
Read only

SELECTION-SCREEN

ashok_kumar24
Contributor
0 Likes
1,116

Hi Experts,

In selection-Screen

I have declared 1 radio button

I have declared 4 parameters as texts with 'NO-DIsPLAY'

Now my requirement is that

Only when i click on the Radio Button I want the rest of the parameters(texts) to be displayed

Can anyone help me out in this

Thanks in advance

AK

1 ACCEPTED SOLUTION
Read only

aris_hidalgo
Contributor
0 Likes
1,078

Hi Ashok,

I would suggest in using a checkbox instead of a radiobutton. use the statement loop at screen and inside it when checkbox is clicked make your parameter active = '1'.

Regards!

P.S. Please award points for useful answers.

12 REPLIES 12
Read only

aris_hidalgo
Contributor
0 Likes
1,079

Hi Ashok,

I would suggest in using a checkbox instead of a radiobutton. use the statement loop at screen and inside it when checkbox is clicked make your parameter active = '1'.

Regards!

P.S. Please award points for useful answers.

Read only

Former Member
0 Likes
1,078

hi,

Check this Code




*----------------Option
*---Background
*---Summary Report
SELECTION-SCREEN : BEGIN OF BLOCK options WITH FRAME TITLE text-003,
                   BEGIN OF LINE.
PARAMETERS       : p_backgd RADIOBUTTON GROUP rad1
                   USER-COMMAND radio DEFAULT 'X'.
SELECTION-SCREEN : COMMENT 4(10) text-006,
                 : POSITION 35.
PARAMETERS       : p_sumrep RADIOBUTTON GROUP rad1 .
SELECTION-SCREEN : COMMENT 38(10) text-048,
                   END OF LINE.
SELECTION-SCREEN : END OF BLOCK options.

*----------------File
SELECTION-SCREEN : BEGIN OF BLOCK file WITH FRAME TITLE text-052.
PARAMETERS       : p_sumfl TYPE char255 modif id ABC  .
PARAMETERS       : p_detfl TYPE char255 modif id ABC.
SELECTION-SCREEN : END OF BLOCK file.

*---------------Activate & Deactivate Screen Fields--------------------*
AT SELECTION-SCREEN OUTPUT.

  LOOP AT SCREEN.
    IF p_sumrep = 'X'.
      IF screen-group1  = 'ABC'.
        screen-input  = '0'.
        MODIFY SCREEN.
      ENDIF.
    ENDIF.
  ENDLOOP.

Just copy paste code & run it.

will get the solution.

U have to use MODIF ID & AT SELECTION-SCREEN OUTPUT Event

Read only

dani_mn
Active Contributor
0 Likes
1,078

HI,

Use LOOP AT SCREEN to dynamically hide and show fields.


AT Selection-screen output.

If radio1 = 'X'.

LOOP at screen.
  if screen-name = 'field1'.
     screen-active = 1.
     modify screen.
  endif.
ENDLOOP.
ELSE.
LOOP at screen.
  if screen-name = 'field1'.
     screen-active = 0.
     modify screen.
  endif.
ENDLOOP.

ENDIF.

Regards,

Wasim Ahmed

Read only

Former Member
0 Likes
1,078

Instead of giving no-display first at the selection-screen output.

loop at screen.

and check whether the radio button is checked or not.

If it is checked make it screen-active = 1. Modify screen.

Otherwise screen-active = 0.

Modify screen.

Here for this radion button should be assigned with user command with modif id which triggers the selection-screen output event whenever u press that radio bottuon.

Read only

Former Member
0 Likes
1,078

Hi

Dont use NO-DISPLAY, instead use MODIF ID and USER COMMAND together and at the event

AT SELECTION-SCREEN OUTPUT.

use the screen internal table

loop at screen.

if group is 'MODIF ID" which u assigned

make visible/invisible

PARAMETERS: test1(10) OBLIGATORY MODIF ID sc1,test2(10) MODIF ID sc2.

AT SELECTION-SCREEN OUTPUT.
  LOOP AT SCREEN.
    IF screen-group1 EQ 'SC1'.
      screen-intensified = '1'.
      WRITE:/ screen-required.
      MODIFY SCREEN.
    ENDIF.
  ENDLOOP.

Read only

Former Member
0 Likes
1,078

Hello,

you have to look into the following program

RSDEMO_EVENT_ON_FIELD whcih wills solve your requirement .

Reward some points if helps.

Thanks,

krishnakumar

Read only

Former Member
0 Likes
1,078

Parameters: rd1 RADIOBUTTON group g1 default 'X' user-command ch ,

rd2 RADIOBUTTON group g1 ,

kishan1(10) type c modif id ID1,

kishan2(10) TYPE C modif id ID2,

kishan3(10) type c modif id ID3,

kishan4(10) type c modif id ID4.

AT SELECTION-SCREEN.

check sy-ucomm = 'CH'.

AT SELECTION-SCREEN output.

IF rd2 = 'X'.

LOOP AT SCREEN.

IF screen-group1 = 'ID2' or screen-group1 = 'ID3' or screen-group1 = 'ID4' .

screen-input = '0'.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ENDIF.

Read only

Former Member
0 Likes
1,078

Hello Ashok,

U can do this. Just check this code.

AT SELECTION-SCREEN OUTPUT.

if radio1 = 'X'.

loop at screen

if screen-name = 'P1' or

screen-name = 'P2' or

screen-name = 'P3' or

screen-name = 'P4'.

screen-active = '1'.

screen-Invisible = '0'.

screen-input = '1'.

modify screen.

endif.

endloop.

endif.

Reward if helps.

Vasanth

Read only

Former Member
0 Likes
1,078

Hi Ashok,

For this you have to give USER-COMMAND for the radio button group in the SELECTION SCREEN definition.

Then after that in AT SELECTION SCREEN check whether the radio button is selected( normally system will wont allow singel radio button, the radio button group should contain atleast to buttons) and LOOP AT SCREEN and modify the SCREEN table accordingly.

Thanks and Regards,

Bharat Kumar Reddy.V

Read only

Former Member
0 Likes
1,078

Hi,

Check this sample code..


REPORT  ZTEST12334.

parameters: p1(10)  modif id ABC,
            p2(10)  modif id ABC.

parameters: SHOW radiobutton group g1 user-command TEST,
            HIDE radiobutton group g1 default 'X'.


 at selection-screen output.

 if HIDE = 'X'.
 loop at screen.
 if screen-group1 = 'ABC'.
 screen-active = 0.
 modify screen.
 endif.
 endloop.
 endif.

Regards

vijay

Read only

Former Member
0 Likes
1,078

Hi,

My suggestion would be is to go for Check box.


AT Selection-screen output.
    LOOP at screen.
      if ( screen-name EQ 'PARAMETER1' OR screen-name EQ  
           PARAMETER2' OR 'screen-name EQ PARAMETER3'  
           OR screen-name EQ 'PARAMETER4' ) AND
           NOT check1 IS INITIAL. 
              screen-active = 1.
      else.
           screen-active = 0.
      endif.
      modify screen.

    ENDLOOP.

Regs,

Venkat Ramanan N

Read only

ashok_kumar24
Contributor
0 Likes
1,078

Thanks All !!