2007 Jul 03 11:16 AM
hi,
here iam an requirement that
i have two radiobuttons,and two input fields.
if i select one radiobutton the concerned input field will be used for the input and the remaining field will have to grayed out.
if i select another radiobutton the concerned input field will be used for the input and the second field will have to grayed out.
please send me code for that.,
it is urgent.................
thanks in advance.
hi,
here iam an requirement that
i have two radiobuttons,and two input fields.
if i select one radiobutton the concerned input field will be used for the input and the remaining field will have to grayed out.
if i select another radiobutton the concerned input field will be used for the input and the second field will have to grayed out.
please send me code for that.,
it is urgent.................
thanks in advance.
2007 Jul 03 11:19 AM
Hi,
When one radio button is selected, PAI will be triggered. In the PAI write code to disable the other input field.
****in PAI********
loop at screen.
if screen-name = 'input field name'.
screen-input = 0.
modify screen.
endif.
endloop.
Regards,
Vinodh
2007 Jul 03 11:20 AM
declare r1 radiobutton group g1 user-command flag.
Then use at selection-screen output event, with concerned modif id.
loop at screen.
with screen-input = '0'.
modify screen.
endloop.
2007 Jul 03 11:20 AM
Hi,
at selection screen output.
loop at screen.
if radio1 = 'X' and screen-name = 'input1'.
sceen-input = 0.
else.
screen-input = 1.
else.
if radio1 = 'X' and screen-name = 'input1'.
same as above.
endif.
Modify sceen.
endloop.
2007 Jul 03 11:24 AM
Hi Sudarsan,
You need to write this at "AT SELECTION SCREEN OUTPUT."
LOOP at screen.
if radio1 = 'X' and screen-name = 'P1'.
sceen-input = 0.
else.
screen-input = 1.
else.
if radio1 = 'X' and screen-name = 'P1'.
sceen-input = 0.
else.
screen-input = 1.
endif.
Modify sceen.
ENDLOOP.
Whenever we use the selection screen, the screen values are also held in an internal table with the name "Screen", so we manipulate that internal table inorder to suit our requirements.
<b>Saying thanx in SDN is by awarding points.</b>
Kiran
2007 Jul 03 11:24 AM
Hi,
Write this code at AT SELECTION-SCREEN ON RADIOBUTTON GROUP
loop at screen.
if rb1 = 'X'
if screen-name = 'field1'.
screen-input = 0.
endif
elseif rb2 = 'X'
if screen-name = 'field2'.
screen-input = 0.
endif
endif.
modify screen.
endif.
reward if useful.
2007 Jul 03 11:25 AM
Hello sudharsan,
<u>For graying the input files, please go through the following code:</u>
For Application/Presentation Server Radio button.
SELECTION-SCREEN: BEGIN OF BLOCK block1 WITH FRAME TITLE text-001,
SKIP 1.
PARAMETERS: app_ser RADIOBUTTON GROUP g1 "Radio button for a.s.
DEFAULT 'X'
USER-COMMAND off,
pre_ser RADIOBUTTON GROUP g1. "Radio button for p.s.
SELECTION-SCREEN END OF BLOCK block1.
For selection-criteria to input file from App/Pre Server
SELECTION-SCREEN: BEGIN OF BLOCK block2 WITH FRAME TITLE text-002,
SKIP 1.
PARAMETERS: p_apfile LIKE rlgrap-filename "File name for a.s.
MODIF ID g2,
p_ap_arc LIKE rlgrap-filename "Store Worked-Document
MODIF ID g2.
SELECTION-SCREEN SKIP 2.
PARAMETERS: p_prfile LIKE rlgrap-filename "File name for p.s.
MODIF ID g1,
p_pr_arc LIKE rlgrap-filename "Store Worked-Document
MODIF ID g1.
SELECTION-SCREEN SKIP 2.
SELECTION-SCREEN END OF BLOCK block2.
AT SELECTION-SCREEN OUTPUT.
To modify selection-screen(enable/disable selection-screen parameters)
PERFORM modif_screen.
FORM modif_screen.
LOOP AT SCREEN.
IF screen-group1 = 'G1' AND
app_ser = gc_x.
screen-input = 0.
MODIFY SCREEN.
ELSEIF screen-group1 = 'G2' AND
pre_ser = gc_x.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
IF app_ser EQ gc_x.
g_server = 'Application Server'(057).
ELSEIF pre_ser EQ gc_x.
g_server = 'Presentation Server'(058).
ENDIF.
ENDFORM. " MODIF_SCREEN
<b>Reward points if it is useful.....
cheers !
Moqeeth.</b>
2007 Jul 03 11:26 AM
Parameters : rb_1 RADIOBUTTON GROUP rb1 <b>user-command ABC</b> default 'X',
rb_2 RADIOBUTTON GROUP rb1 .
Parameters : fld1(10),
fld2(10).
AT SELECTION-SCREEN OUTPUT.
Loop at screen.
If RB_1 is initial.
If screen-name = 'FLD2'.
screen-input = '0'.
clear FLD2.
Endif.
Else.
If screen-name = 'FLD1'.
screen-input = '0'.
clear FLD2.
Endif.
Endif.
Modify screen.
Endloop.
Hope this helps
Regards
Nishant
Please see the important information here.
The PAI is not automatically triggered .
If you miss the CODE in BOLD.
Message was edited by:
Nishant Rustagi
2007 Jul 03 11:33 AM
hi,
parameters: p1 type i,
p2 type i,
r1 as radiobuttton group g1 default 'X',
r2 as radiobutton group g1.
in selection screen output event .
loop at screen.
if radio1 = 'X' and screen-name = 'p1'.
sceen-input = 1.
elseif .
screen-output = 0.
modify sreen.
elseif.
if radio2 = 'X' and screen-name = 'p2'.
screen-input = 1.
else.
screen-input = 0.
if useful reward some points.
with regards,
Suresh.A
2007 Jul 03 12:29 PM
Try this
Hope this will help u out.
INITIALIZATION .
repid = sy-repid .
SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE text-t03 .
PARAMETERS: rad_blk1 RADIOBUTTON GROUP rad1 USER-COMMAND rad DEFAULT 'X' .
PARAMETERS: rad_blk2 RADIOBUTTON GROUP rad1.
SELECTION-SCREEN: END OF BLOCK b1.
SELECTION-SCREEN: BEGIN OF BLOCK b2 WITH FRAME TITLE text-t01.
PARAMETERS: chk_blk1 AS CHECKBOX MODIF ID ms2 USER-COMMAND chk .
PARAMETERS: chk_blk2 AS CHECKBOX MODIF ID ms5 USER-COMMAND chk1 .
SELECT-OPTIONS: s_matnr FOR eban-matnr MODIF ID ms1.
SELECT-OPTIONS :s_lgort FOR eban-lgort MODIF ID ms4 .
SELECTION-SCREEN: END OF BLOCK b2.
SELECTION-SCREEN: BEGIN OF BLOCK b3 WITH FRAME TITLE text-t02.
SELECT-OPTIONS : s_banfn FOR eban-banfn MODIF ID ms3 .
SELECTION-SCREEN: END OF BLOCK b3.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-group1 = 'MS1' .
IF rad_blk1 EQ 'X' .
screen-active = 1.
ELSE.
screen-active = 0 .
ENDIF.
ENDIF .
MODIFY SCREEN.
ENDLOOP.
LOOP AT SCREEN.
IF screen-group1 = 'MS4' .
IF rad_blk1 EQ 'X' .
screen-active = 1.
ELSE.
screen-active = 0 .
ENDIF.
ENDIF .
MODIFY SCREEN.
ENDLOOP.
LOOP AT SCREEN.
IF screen-group1 = 'MS5' .
IF rad_blk1 EQ 'X' .
screen-active = 1.
ELSE.
screen-active = 0 .
ENDIF.
ENDIF .
MODIFY SCREEN.
ENDLOOP.
LOOP AT SCREEN.
IF screen-group1 = 'MS3' .
IF rad_blk2 EQ 'X' .
screen-active = 1.
ELSE.
screen-active = 0 .
ENDIF.
ENDIF .
MODIFY SCREEN.
ENDLOOP.
LOOP AT SCREEN.
IF screen-group1 = 'MS2' .
IF rad_blk1 EQ 'X' .
screen-active = 1.
ELSE.
screen-active = 0 .
ENDIF.
ENDIF .
MODIFY SCREEN.
ENDLOOP.
LOOP AT SCREEN.
IF screen-group1 = 'MS1' .
IF chk_blk1 EQ 'X' .
screen-input = 1.
ELSE.
screen-input = 0 .
ENDIF.
ENDIF .
MODIFY SCREEN.
ENDLOOP.
LOOP AT SCREEN.
IF screen-group1 = 'MS4' .
IF chk_blk2 EQ 'X' .
screen-input = 1.
ELSE.
screen-input = 0 .
ENDIF.
ENDIF .
MODIFY SCREEN.
ENDLOOP.
IF t_comm = 'CHK' .
LOOP AT SCREEN.
IF screen-group1 = 'MS2' .
IF chk_blk1 EQ 'X' .
screen-input = 1.
ELSE.
screen-input = 0 .
ENDIF.
ENDIF .
MODIFY SCREEN.
ENDLOOP.
CLEAR t_comm .
ENDIF .
IF t_comm = 'CHK1' .
LOOP AT SCREEN.
IF screen-group1 = 'MS5' .
IF chk_blk2 EQ 'X' .
screen-input = 1.
ELSE.
screen-input = 0 .
ENDIF.
ENDIF .
MODIFY SCREEN.
ENDLOOP.
CLEAR t_comm .
ENDIF .
Thanks
2007 Jul 03 12:33 PM
hi
try this example.
tables : mara,marc.
select-options : s_matnr for mara-matnr modif id aa,
s_matnr1 for marc-matnr modif id bb.
parameters : a radiobutton group grp1 user-command ucomm default 'X',
b radiobutton group grp1.
At selection-screen output.
if a = 'X'.
loop at screen.
if screen-group1 = 'BB'.
screen-input = 0.
modify screen.
endif.
endloop.
endif.
if b = 'X'.
loop at screen.
if screen-group1 = 'AA'.
screen-input = 0.
modify screen.
endif.
endloop.
endif.
2007 Jul 03 12:39 PM
Hi
Try This
SELECTION-SCREEN:BEGIN OF BLOCK blk2 WITH FRAME TITLE text-002.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS : rad_but1 RADIOBUTTON GROUP one DEFAULT 'X' USER-COMMAND ucom.
SELECTION-SCREEN COMMENT 3(15) text-003.
SELECT-OPTIONS : kunnr FOR bseg-kunnr..
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS : rad_but2 RADIOBUTTON GROUP one.
SELECTION-SCREEN COMMENT 3(15) text-004.
SELECT-OPTIONS : budat FOR bkpf-budat.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN:END OF BLOCK blk2.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF rad_but1 = 'X'.
IF screen-name = 'KUNNR-LOW' OR screen-name = 'KUNNR-HIGH'.
screen-input = 1.
ENDIF.
IF screen-name = 'BUDAT-LOW' OR screen-name = 'BUDAT-HIGH'.
screen-input = 0.
ENDIF.
REFRESH budat.
MODIFY SCREEN.
ENDIF.
IF rad_but2 = 'X'.
IF screen-name = 'KUNNR-LOW' OR screen-name = 'KUNNR-HIGH'.
REFRESH kunnr..
screen-input = 0.
ENDIF.
IF screen-name = 'BUDAT-LOW' OR screen-name = 'BUDAT-HIGH'.
screen-input = 1.
ENDIF.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
here in text-003 and text-004 u can give ur radio button name
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |