2006 Sep 14 9:17 AM
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.
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.
2006 Sep 14 9:21 AM
if you do it in dialog you can use
screen attribute to do so .
loop at screen
endloop .
2006 Sep 14 9:22 AM
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
2006 Sep 14 9:23 AM
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.
2006 Sep 14 9:25 AM
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.
2006 Sep 14 9:30 AM
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
2006 Sep 15 9:46 AM
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.
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |