Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Selection screen variants

kesavadas_thekkillath
Active Contributor
0 Likes
1,857

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

9 REPLIES 9
Read only

Former Member
1,116

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

Read only

Former Member
0 Likes
1,116

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

Read only

Former Member
0 Likes
1,116

Hi,

Declare it as DEFAULT in selection screen.

And in AT SELECTION-SCREEN event, give screen-input = 0.

hope this helps.

Regards,

Ramya

Read only

Former Member
0 Likes
1,116

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

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,116

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.

Read only

0 Likes
1,116

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

Read only

Former Member
0 Likes
1,116

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

Read only

Former Member
0 Likes
1,116

While creating the variant ... i.e when U save

Check 'Protect Field' check box against the fields which

should not be changed...

Read only

Former Member
0 Likes
1,116

hi,

dissable the screen input,

like screen-input = 0.

regards,

chandu.