03-06-2009 9:55 AM
Hi Experts,
In Selection screen, i have one input field for project. Now my requirement is that
When i enter the project and press enter and if it belongs to a particluar company code , for e.g. '1000'
then i should see two radio buttons below it. But if the project does not
belong to this CCode, then the radiobuttons should not be displayed.
03-06-2009 10:02 AM
Hi,
Use :-
parameters : p_rb1 radiobutton group1 modif if abc,
p_rb2 radiobutton group1 modif if abc.
AT SELECTION-SCREEN OUTPUT.
"select query
if sy-subrc ne 0. "no record found
loop at screen.
if screen-group1 = 'ABC'.
screen-invisible = 1. "hide radiobuttons
endif.
modify screen.
endloop.
else.
loop at screen.
if screen-group1 = 'ABC'.
screen-invisible = 0. "display radiobuttons
endif.
modify screen.
endloop.
endif.
Regards,
Tarun
03-06-2009 9:59 AM
Hi,
Make use of LOOP AT screen.
If the project meets ur criterion then screen-name = 'Radi_1' and rad_2
screen-invisible = 0.
MODIFY screen.
ENDLOOP.
Initially keep the radiobuttons hidden.
You can code this in selection-screen output.
03-06-2009 10:02 AM
Hi,
Use :-
parameters : p_rb1 radiobutton group1 modif if abc,
p_rb2 radiobutton group1 modif if abc.
AT SELECTION-SCREEN OUTPUT.
"select query
if sy-subrc ne 0. "no record found
loop at screen.
if screen-group1 = 'ABC'.
screen-invisible = 1. "hide radiobuttons
endif.
modify screen.
endloop.
else.
loop at screen.
if screen-group1 = 'ABC'.
screen-invisible = 0. "display radiobuttons
endif.
modify screen.
endloop.
endif.
Regards,
Tarun
03-06-2009 10:09 AM
hi,
i have put the following code but yet when i execute i can see both the radiobuttons.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME.
parameters : rb1 radiobutton group g2 modif id abc,
rb2 radiobutton group g2 modif id abc.
SELECTION-SCREEN END OF BLOCK b2.
AT SELECTION-SCREEN OUTPUT.
SELECT SINGLE * FROM PROJ WHERE
PSPNR IN S_PSPNR.
if proj-vbukr = '5800'.
loop at screen.
if screen-group1 = 'ABC'.
screen-invisible = 1. "hide radiobuttons
endif.
modify screen.
endloop.
else.
loop at screen.
if screen-group1 = 'ABC'.
screen-invisible = 0. "display radiobuttons
endif.
modify screen.
endloop.
endif.
03-06-2009 10:12 AM
03-06-2009 10:13 AM
Hi Priti,
if proj-vbukr = '5800'.
loop at screen.
if screen-group1 = 'ABC'.
screen-invisible = 1. "hide radiobuttons "Just check if this is even getting executed.
modify screen.
endif.
endloop.
else.
loop at screen.
if screen-group1 = 'ABC'.
screen-invisible = 0. "display radiobuttons
modify screen.
endif.
endloop.
endif.
03-06-2009 10:02 AM
Hi Priti,
You can achieve it by using LOOP AT SCREEN,
check its syntax for that.
Regrds
Mansi
03-06-2009 10:11 AM
hi,
Try with the below code...
PARAMETERS : p_proj(4),
r1 RADIOBUTTON GROUP g1 USER-COMMAND x modif id mod,
r2 RADIOBUTTON GROUP g1 modif id mod.
AT SELECTION-SCREEN OUTPUT.
IF p_proj ='1000'.
LOOP AT SCREEN.
IF screen-group1 = 'MOD'.
screen-invisible = 0.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ELSE.
LOOP AT SCREEN.
IF screen-group1 = 'MOD'.
screen-invisible = 1.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
Thanks & Regards
03-06-2009 10:13 AM
hi
use following code .
parameters : p_rb1 radiobutton group grp1 modif id abc,
p_rb2 radiobutton group grp1 modif id abc.
data : i_var like mara-matnr value '0001'.
AT SELECTION-SCREEN OUTPUT.
select matnr from mara
into i_var WHERE matnr = i_var.
endselect.
if sy-subrc ne 0. "no record found
loop at screen.
if screen-group1 = 'ABC'.
screen-invisible = 1.
endif.
modify screen.
endloop.
else.
loop at screen.
if screen-group1 = 'ABC'.
screen-invisible = 0.
endif.
modify screen.
endloop.
endif.
03-07-2009 5:12 AM
Hi experts,
But it is not working the other way. The condition is that if company code is '1000' then it should not display the radiobuttons else for all other company codes it should display
03-07-2009 5:32 AM
Hi,
>
> Hi experts,
> But it is not working the other way. The condition is that if company code is '1000' then it should not display the radiobuttons else for all other company codes it should display
As your requirement, if company code is 1000, then it should not display those radiobuttons, else the radiobuttons need to be displayed.
So use code:-
parameters : p_rb1 radiobutton group gp1 modif id abc,
p_rb2 radiobutton group gp1 modif id abc.
data : v_bukrs type bukrs.
AT SELECTION-SCREEN OUTPUT.
"select query (select sinlge bukrs into v_bukrs where <condition>.)
if sy-subrc = 0. "if company code found
if v_bukrs = '1000'. "if company code is 1000
loop at screen.
if screen-group1 = 'ABC'.
screen-invisible = 1. "hide radiobuttons
endif.
modify screen.
endloop.
else. "if company code is not 1000
loop at screen.
if screen-group1 = 'ABC'.
screen-invisible = 0. "display radiobuttons
endif.
modify screen.
endloop.
endif.
else. "if no company code found
loop at screen.
if screen-group1 = 'ABC'.
screen-invisible = 0. "display radiobuttons
endif.
modify screen.
endloop.
endif.
Hope this helps you.
Regards,
Tarun
03-07-2009 5:38 AM