‎2007 Apr 16 5:40 AM
hi in reports if i select one radio button the second should be in disable mode ..how to do this ? what is the code for this?
‎2007 Apr 16 5:54 AM
Hi Balu,
If you are talking simply about radiobuttons, then if you create two or three radiobuttons in your report and desire that they should behave in a mutually exclusive way, then you can assign them all to one group, which will make only one radiobutton to be selected at a time.
eg.
parameters: r1 radiobutton group g1 default 'X',
r2 radiobutton group g1,
r3 radiobutton group g1.
However if you want a block (of fields) to be disabled when another radiobutton has been enabled, you can go in this way :
At selection-screen output.
if r1 = 'X'. "checking which radiobutton is selected
loop at screen.
if screen-name = 'AGE'. "checking the name of the field which has
"to be disabled
screen-input = '0'. "disabling the field
modify screen.
endif.
endloop.
else.
loop at screen.
if screen-name = 'NAME'.
screen-input = '0'.
modify screen.
endif.
endloop.
endif.
Hope, this helps you.
‎2007 Apr 16 5:46 AM
Hi Balu,
If u want to disable a block plz go through this code u can understand.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'RAF'.
IF VAL = 1.
SCREEN-INPUT = 0.
SCREEN-INVISIBLE = 1.
MODIFY SCREEN.
ELSE.
VAL = 2.
*SCREEN-INPUT = 1.
SCREEN-INVISIBLE = 0.
MODIFY SCREEN.
ENDIF.
ENDIF.
ENDLOOP.
AT SELECTION-SCREEN ON CUST.
SELECT SINGLE * FROM KNA1 WHERE KUNNR = CUST.
IF SY-SUBRC <> 0.
MESSAGE E000(0) WITH 'ENTER CURRECT INPUT'.
EXIT.
ELSE.
VAL = 2.
ENDIF.
START-OF-SELECTION.
SELECT VBELN ERDAT NETWR FROM VBAK INTO TABLE ITAB WHERE KUNNR =
CUST OR VKORG = SALES OR VTWEG = DCH .
LOOP AT ITAB.
WRITE : / ITAB-VBELN, ITAB-ERDAT, ITAB-NETWR.
ENDLOOP.
Rewards some points.
Rgds,
P.Nag
‎2007 Apr 16 5:47 AM
Hi,
For a radio button, second button is always disabled when u select the first one. But make sure that both the radio buttons are under same group.
eg: PARAMETERS: rb_typ RADIOBUTTON GROUP g1 DEFAULT 'X'.
PARAMETERS: rb_grp RADIOBUTTON GROUP g1.
regards,
Sekhar.
‎2007 Apr 16 5:50 AM
‎2007 Apr 16 5:51 AM
hi Balu,
try this code
parameters: p_check4 as checkbox user-command ucom,
p_check5 as checkbox user-command ucom,
p_check1 as checkbox default 'X' modif id ABC,
p_check2 as checkbox modif id BCD,
p_check3 as checkbox modif id CDE,
p_check6 as checkbox user-command ucom.
parameters: p_matnr like mara-matnr modif id ABC.
parameters: p_werks like marc-werks modif id BCD.
at selection-screen output.
if not p_check1 is initial.
loop at screen.
if screen-group1 <> 'ABC' and screen-group1 <> ' '.
screen-input = '0'.
modify screen.
endif.
endloop.
endif.
at selection-screen.
if p_check1 is initial.
loop at screen.
if screen-group1 <> 'ABC'.
screen-input = '1'.
modify screen.
endif.
endloop.
endif.
if this helps u reward points
ravi
‎2007 Apr 16 5:54 AM
Hi Balu,
If you are talking simply about radiobuttons, then if you create two or three radiobuttons in your report and desire that they should behave in a mutually exclusive way, then you can assign them all to one group, which will make only one radiobutton to be selected at a time.
eg.
parameters: r1 radiobutton group g1 default 'X',
r2 radiobutton group g1,
r3 radiobutton group g1.
However if you want a block (of fields) to be disabled when another radiobutton has been enabled, you can go in this way :
At selection-screen output.
if r1 = 'X'. "checking which radiobutton is selected
loop at screen.
if screen-name = 'AGE'. "checking the name of the field which has
"to be disabled
screen-input = '0'. "disabling the field
modify screen.
endif.
endloop.
else.
loop at screen.
if screen-name = 'NAME'.
screen-input = '0'.
modify screen.
endif.
endloop.
endif.
Hope, this helps you.
‎2007 Apr 16 6:12 AM
hi Balu..
Paste this code..
parameters:
p_r1 radiobutton group g1 modif id SCR <b>user-command</b> RAM,
p_r2 radiobutton group g1 modif id SCB default 'X'.
<b>at selection-screen output.</b>
<b> if p_r1 = 'X'.
loop at screen.
if screen-group1 = 'SCB'.
screen-INPUT = '0'.
modify screen.
endif.
endloop.
ENDIF.</b>