cancel
Showing results for 
Search instead for 
Did you mean: 

need help in 'loop at screen' ?!!

Former Member
0 Kudos

Req is: In a screen, there are 2 radio buttons. Each radio button is associated with the separate selection screen.

At a time, in the screen, we should view only one selection screen after selecting the radio button.

By default, first radio button is selected and respective selscrn is displayed in the bottom part of screen. When the user clicks 2nd radio button, the fist selection screen should be replace the 2nd selscrn.

i hav writtn the foll code. and it works fine also! but the thing is,

after selecting the 2nd radiobutton, i should click F8, then only, my pgm replaces the selection screen. BUT i want it to dynamically replace the selscrn as soon as the user selects the 2nd radiobutton without clicking F8.!

what modifications need to be done in the foolowing code?

code:

selection-screen begin of block b1 with frame title text-001.

PARAMETERS: RG1 RADIOBUTTON GROUP GR1 DEFAULT 'X',

RG2 RADIOBUTTON GROUP GR1.

selection-screen end of block b1.

at selection-screen output.

if rg2 eq 'X'.

loop at screen.

if screen-group1 eq 'GP1'.

SCREEN-INVISIBLE = 1.

SCREEN-OUTPUT = 0.

SCREEN-INPUT = 0.

MODIFY SCREEN .

ENDIF.

endloop.

elseif rg1 eq 'X'.

loop at screen.

if screen-group1 eq 'GP2'.

SCREEN-INVISIBLE = 1.

SCREEN-OUTPUT = 0.

SCREEN-INPUT = 0.

MODIFY SCREEN .

ENDIF.

endloop.

endif.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

add USER-COMMAND fcode.

PARAMETERS: RG1 RADIOBUTTON GROUP GR1 DEFAULT 'X' USER-COMMAND 'CM1'.

... RADIOBUTTON GROUP group [USER-COMMAND fcode]

Effect:

This addition specifies that the input field is displayed as a radio button in the first position on the selection screen, and the output field is displayed next to it on the right. The radio button is selected if the value of para is "X" or "x". Otherwise, it is not selected.

group is used to define the radio button group for the parameter. The name group is entered directly as a character string with a maximum of 4 characters. Within a selection screen, there must be a minimum of two parameters in the same radio button group. There cannot be more than one radio button group with the same name in one program, even if they are defined in different selection screens.

The parameter must be specified with the type c and length 1. Explicit length specification using len is not permitted. If the addition TYPE is used, it can only be followed by the generic type c or a non-generic data type of type

In a radio button group, only one parameter can be defined with the addition DEFAULT, and the specified value must be "X". By default, the first parameter in a radio button group is set to the value "X", and the rest are set to " ".

The addition USER-COMMAND can be used to assign a function code fcode to the first parameter in a radio button group. The function code fcode must be specified directly, and have a maximum length of 20 characters. To evaluate the function code, an interface work area of the structure SSCRFIELDS from the ABAP Dictionary must be declared using the statement TABLES. When the user selects any radio button of the radio button group on the selection screen, the runtime environment triggers the event AT SELECTION-SCREEN and transfers the function code fcode to the component ucomm of the interface work area sscrfields. If a function code used in the GUI status of the selection screen is specified for fcode, the selection screen processing is affected accordingly.

Edited by: S.r.v.r.Kumar on Jun 17, 2008 2:24 PM

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Try this.

*Display screen based on selection of radio button

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF rb_mat = 'X'.

IF screen-group1 = 'ID2'.

screen-active = 0.

ENDIF.

ELSEIF rb_comp = 'X'.

IF screen-group1 = 'ID1'.

screen-active = 0.

ENDIF.

ENDIF.

MODIFY SCREEN.

ENDLOOP.