10-11-2005 5:43 PM
Hi,
I have a field in the selection screen and currently i am disabling in the code like:
loop at screen.
if screen-name = 'V_GROUP'.
screen-input = 0.
modify screen.
endif.
endloop.
my problem is that if i choose a variant and if it has a value for group then it
overwrites it.
is there any way where i can avoid it?
10-11-2005 5:44 PM
Yes, I believe that you can check for the variant, then clear it out. Check against sy-slset. This will hold the variant name if one is being used.
report zrich_0003 .
parameters: p_check type c.
parameters: p_group type c.
at selection-screen output.
loop at screen.
if screen-name = 'P_GROUP'.
screen-input = '0'.
modify screen.
endif.
endloop.
start-of-selection.
if sy-slset <> space.
clear p_group.
endif.
Regards,
Rich Heilman
10-11-2005 5:44 PM
Yes, I believe that you can check for the variant, then clear it out. Check against sy-slset. This will hold the variant name if one is being used.
report zrich_0003 .
parameters: p_check type c.
parameters: p_group type c.
at selection-screen output.
loop at screen.
if screen-name = 'P_GROUP'.
screen-input = '0'.
modify screen.
endif.
endloop.
start-of-selection.
if sy-slset <> space.
clear p_group.
endif.
Regards,
Rich Heilman
10-11-2005 5:51 PM
Hi Rich,
But i might have some multiples of Variants.They can create any variants .
10-11-2005 5:53 PM
Yea, you problem is that you never want V_GROUP to have a value when a variant is chosen, right? So, if not, then you can clear it out if a variant is chosen. I am a little confused as to your requirement, since the field is output only and you don't want a variant to overwrite it, then what is the point in having it as a parameters. Please explain further so that we can help you.
Regards,
Rich Heilman
10-11-2005 5:50 PM
If you don't want to enter anything into this parameter, but you still want it, then why don't you use the option 'NO-DISPLAY' ?
Srinivas
10-11-2005 6:00 PM
Seems your variant were existing and later you changed the program as you cannot put a value in a variant in an input disabled field.
The solution is to recreate the variant or first change the variant and then change the program.
Cheers
10-11-2005 6:14 PM
Hi Rich,
Thanks for the solution. I did use at selection screen output. It works now.
Thanks to Srinivas and Sanjay also.
I did award the points.
Thanks.