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

Former Member
0 Likes
582

hello all,

i have a selection screen with 4 radio button.

when i click on the second radio button i have to show a text box that the user need to fill.(in the selection screen).

is anyone know how to do this?

thanks,

dana.

6 REPLIES 6
Read only

Former Member
0 Likes
553

if you do it in dialog you can use

screen attribute to do so .

loop at screen

endloop .

Read only

Former Member
0 Likes
553

Hello,

U can try like this.

In AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF SCREEN-NAME = 'TEXT1'.

SCREEN-INVISIBLE = '1'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

<b>AT SELECTION-SCREEN ON RADIOBUTTON GROUP radi.

IF R2 = 'X'.

LOOP AT SCREEN.

IF SCREEN-NAME = 'TEXT1'.

SCREEN-INVISIBLE = '0'.

SCREEN-INPUT = '1'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.</b>

ENDIF.

If useful reward.

Vasanth

Read only

former_member195698
Active Contributor
0 Likes
553

Attach User Command to the radio buttons.

Then in at selection-screen output. display the text field based on the radio button selected.

in the at selection-screen, do the validation for the text fields for not initial if the radio button is selected.

Read only

Former Member
0 Likes
553

you can do something like this

selection-screen begin of block b1

paramters : r1 radiobutton group r1 user-command ucom,

r2 radiobuuton groupr1,

p1(10) type c.

at selection-screen output.

if r1 = 'X'.

loop at screem.

if screen-name = 'p1'.

screen-input = '0'.

modify screen.

endif.

endloop.

else.

loop at screem.

if screen-name = 'p1'.

screen-input = '1'.

modify screen.

endif.

endloop.

endif.

Read only

Former Member
0 Likes
553

Check this code

PARAMETERS: P_RAD1 RADIOBUTTON GROUP RAD1 DEFAULT 'X'
                   USER-COMMAND P_SEL.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: P_RAD2 RADIOBUTTON GROUP RAD1,
            P_TEXT(20) TYPE C.
SELECTION-SCREEN END OF LINE.
PARAMETERS: P_RAD3 RADIOBUTTON GROUP RAD1,
            P_RAD4 RADIOBUTTON GROUP RAD1.

AT SELECTION-SCREEN OUTPUT.

 LOOP AT SCREEN.
      CHECK SCREEN-NAME CP '*P_TEXT*'.
      IF NOT P_RAD2 IS INITIAL.
         SCREEN-ACTIVE = 1.
         MODIFY SCREEN.
      ELSE.
         SCREEN-ACTIVE = 0.
         MODIFY SCREEN.
      ENDIF.
 ENDLOOP.

Kind Regards

Eswar

Read only

Former Member
0 Likes
553

Hi.

Consider using pushbuttons instead of radiobuttons.

The program fragment below is for a related situation. The user is offered the choice of 3 select-options (initially hidden). There is a pushbutton for each select-option. Clicking on one of the buttons immediately makes the select-option appear, and hides the other 2 select-options. The variable selby indicates the last-clicked-on pushbutton.

See what you think,

John

REPORT YJNM_DYNAMIC_SELSCR2.

data:

posid_active like screen-active,

kostl_active like screen-active,

aufnr_active like screen-active,

ucomm like sscrfields-ucomm,

selby like sscrfields-ucomm.

tables:

sscrfields,

prps,

csks,

aufk.

selection-screen begin of line.

selection-screen pushbutton (24) t_posid user-command POSID.

select-options: s_posid for prps-posid.

selection-screen end of line.

selection-screen skip.

selection-screen begin of line.

selection-screen pushbutton (24) t_kostl user-command KOSTL.

select-options: s_kostl for csks-kostl.

selection-screen end of line.

selection-screen skip.

selection-screen begin of line.

selection-screen pushbutton (24) t_aufnr user-command AUFNR.

select-options: s_aufnr for aufk-aufnr.

selection-screen end of line.

----


at selection-screen.

ucomm = sscrfields-ucomm.

----


at selection-screen output.

move '0' to:

posid_active,

kostl_active,

aufnr_active.

case ucomm.

when 'POSID'.

selby = ucomm.

posid_active = '1'.

when 'KOSTL'.

selby = ucomm.

kostl_active = '1'.

when 'AUFNR'.

selby = ucomm.

aufnr_active = '1'.

when others.

endcase.

loop at screen.

if screen-name cp 'S_POSID'.

screen-active = posid_active.

modify screen.

elseif screen-name cp 'S_KOSTL'.

screen-active = kostl_active.

modify screen.

elseif screen-name cp 'S_AUFNR'.

screen-active = aufnr_active.

modify screen.

endif.

endloop.

----


initialization.

t_posid = text-001. "pushbutton text

t_kostl = text-002. "pushbutton text

t_aufnr = text-003. "pushbutton text

----


start-of-selection.

write: / selby.