‎2008 Apr 14 10:34 AM
Hi,
In the selection screen I want to default some values like company code,
profit center which the user shouldn't change.
Can I make a program variant and give that to the user?
Will this work? What authorization object will I use?
Thank you,
Kesav
‎2008 Apr 14 10:40 AM
Hi ,
what you can do is just code your selection-screen like below
tables:
mard.
select-options: s_matnr for mard-matnr default '000000000000000012' modif id xyz.
at selection-screen output.
loop at screen.
if screen-group1 = 'XYZ'.
screen-input = 0.
modify screen.
endif.
endloop.
<REMOVED BY MODERATOR>
Edited by: Alvaro Tejada Galindo on Apr 14, 2008 4:09 PM
‎2008 Apr 14 10:41 AM
Hi,
You can populate the default values from the Program in the initialization event or AT SELECTION-SCREEN OUTPUT event.
To disable the field do like this
Parameters: param1 like mara-matnr.
AT SELECTION-SCREEN OUTPUT.
loop at screen.
if screen-name eq 'PARAM1'.
screen-input = 0.
modify screen.
endif.
endloop.
Regards,
Satish
‎2008 Apr 14 10:42 AM
Hi,
Declare it as DEFAULT in selection screen.
And in AT SELECTION-SCREEN event, give screen-input = 0.
hope this helps.
Regards,
Ramya
‎2008 Apr 14 10:44 AM
Hi keshu,
See below sample example program..
Parameters: a1 type c.
AT SELECTION-SCREEN OUTPUT.
loop at screen.
if screen-name = 'a1'.
screen-input = 0.
endif.
modify screen.
endloop.
<REMOVED BY MODERATOR>
Thx,
S.Suresh.
Edited by: Alvaro Tejada Galindo on Apr 14, 2008 4:10 PM
‎2008 Apr 14 11:32 AM
Dear all,
this wasnt my question..
when i create a variant in selection screen
some users can change it and some cannot...
Or else Disable the SAVE button in the selection screen.
‎2008 Apr 14 12:04 PM
In this case you can do like below :
tables:
mard.
select-options: s_matnr for mard-matnr default '000000000000000012' .
at selection-screen output.
loop at screen.
if sy-uname = 'DEVELOPER' and sy-slset = 'TRY'.
screen-input = 0.
modify screen.
endif.
endloop.
<REMOVED BY MODERATOR>
Edited by: Alvaro Tejada Galindo on Apr 14, 2008 4:11 PM
‎2008 Apr 14 11:48 AM
Hi,
Create two variants for the below program say VAR1 and VAR2.
For the variant VAR1 take the default values say 12 and 3.
and for VAR2 take the values 10 and 5.
Now execute the program by selecting the variants VAR1 and VAR2. You can see the difference.
when you select VAR1 the parameters can be seen in disable mode.
parameters: p_num1 type i default 12,
p_num2 type i default 3.
at selection-screen output.
if sy-slset = 'VAR1'.
loop at screen.
if screen-name = 'P_NUM1' or
screen-name = 'P_NUM2'.
screen-input = 0.
endif.
modify screen.
endloop.
endif.
write:/5 p_num1, 35 p_num2.
Edited by: Velangini Showry Maria Kumar Bandanadham on Apr 14, 2008 12:52 PM
‎2008 Apr 14 12:08 PM
While creating the variant ... i.e when U save
Check 'Protect Field' check box against the fields which
should not be changed...
‎2008 Apr 14 12:23 PM
hi,
dissable the screen input,
like screen-input = 0.
regards,
chandu.