Application Development 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: 

Variant and its protection

Former Member
0 Kudos

Dear all,

I am currently trying to acheive the folloings:

Goal:

Different users in different plant should be able to their own plant data.

Condition:

Add-on report program has been developed to extract necessary data. On its selection screen, there is a plant code field. Users should be able to change other fields in selection screen.

What I did:

Created variants for each plant group and set plant field control disabled. These variants are created by a system user and cannot be overwritten.

Problem:

Seemingly, it is not possible to change values but there is a [Save] button next to transaction code box and users can change variant settings and save it as a different name.

Question:

Is there any way to keep users from editing variant settings?

Any input is more than appreciated.

Regards,

Kazuya

6 REPLIES 6

Former Member
0 Kudos

Hi kazuya,

Creating variants may not be the solution to the problem.

You can validate the user against the Plant data in the AT SELECTION-SCREEN event instead of creating variant.

I dont think you can protect variants from being edited.

Regards,

Wenceslaus.

0 Kudos

Hi Karunya,

You can also try this.. leave the variants & the original report as is.. create a wrapper report with a selection screen that has radio button options for each plant group. Depnding on the Plant group selected by the user, SUBMIT the original report with the corresponding variant ie SUBMIT <report> using selection-set <varinat>. This way, the varinats remain in tact.

Regards,

Suresh Datti

Former Member
0 Kudos

kazuya,

Depending on the number of plants, this solution may work for you.

1. Create a transaction, report with selection screen, starting with a specified variant.

2. Create a second transaction, transaction with parameters, executing the first transaction and skipping the initial screen.

You would need to create these two transactions for every variant that exists for your program. Depending upon the number of plants you have this may or may not be a good solution. You can easily apply security to the parameter transaction.

Or

You could remove the plant from the selection screen and populate a working storage field dynamically in the program based upon what plant the user belongs to. The user/plant association could reside in a custom table or in some master data table that is part of SAP standard. I don't work with plant data so I'm not sure how this is set up in SAP. Perhaps table USRMM could be used.

Bruce

Former Member
0 Kudos

you can try with transaction variant : shd0

Clemenss
Active Contributor
0 Kudos

Hi,

the users have authority profiles. Authority objects will be restricted to plants. Do an Authority-Check on the plants selected and isssue an E-message if user is not authorized for the plant. Do this with AT SELECTION-SCREEN ON P_PLANT.

Or if there is SELECT-OPTIONS get all selected plants from T001W and do the authority-check.

Regards

Clemens