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

Disable modify display variant

Former Member
0 Likes
2,187

Hello everybody,

One question about the display variants. I am in charge of BC administration and my collegues from other modules ( PP, FL, SD etc..) have created transactions. They have created one display variant for each transaction which they have called /default

Simply users, when they launch the transaction, can select this variant, change the information and when they save, they modify this variant.

Is there a way to disable the possibility for users to modify this variant? I only want my collegues (key users) to be able to modify this variant.

Many thanks for your help.

1 ACCEPTED SOLUTION
Read only

MarcinPciak
Active Contributor
0 Likes
1,554

When saving the variant check the field Protect variant . Now only the user who created it will be able to amend it.

Regards

Marcin

8 REPLIES 8
Read only

MarcinPciak
Active Contributor
0 Likes
1,555

When saving the variant check the field Protect variant . Now only the user who created it will be able to amend it.

Regards

Marcin

Read only

0 Likes
1,554

Many thanks for your answer Marcin. I will told them to try this.

And another "last" question.

I have my variant /default and now I want users to create a new one but not to modify /default. When they save, a new one is created like /default2 for example.

Is there a way for this?

Many thanks again.

Read only

0 Likes
1,554

This should be feasible. This blog might help you to achieve this [Save a variant from a Dynpro screen|http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/6618%3Fpage%3Dlast%26x-order%3Ddate%26x-maxdepth%3D0] [original link is broken] [original link is broken] [original link is broken];

Regards

Marcin

Read only

0 Likes
1,554

Many Thanks for everything Marcin. I am gonna check your link.

Read only

0 Likes
1,554

Hello everybody,

I reopen this topic because what I said is wrong

Here is what I want to do

- The Key user create a display variant (/ default).

- A user launch the transaction, and use the variant /default because It's the only one on the system.

He can create a new variant but can't save on the /default variant (I think we should use the option "protect variant" like Marcin says).

- When the user has saved his variant, this variant wo'nt be by default for the next connection. I want the default variant always be /default and not the one the user has created.

Hope you can help me.

Thanks a lot.

Read only

0 Likes
1,554

Hi David,

If you want to start the report each time with default variant /DEFALUT you can:

- create another report (which will be starting point for this one)

- in this new report call your original report with the variant /DEFAULT - so the user will automatically have it set when report will show the selection screen. If the user later want to change it (on the screen) - no problem, but the defualt which the program will be running with is /DEFAULT

Simply use below logic


Report z_starting_point.
 SUBMIT 'Z_ORIGINAL' USING SELECTION-SET '/DEFAULT'. "start the original report with /DEFAULT variant

Hope this is what you need

Marcin

Read only

0 Likes
1,554

Many thanks again Marcin. What you explain to me is perfect for selection screen variant. What I need is the same thing for ALV's layout.

Is there any parameters to initialize when calling MF REUSE_ALV_GRID_DISPLAY?

Read only

0 Likes
1,554

For classical ALV you are using I think you should:

- when saving variant you have the option default setting for setting is as a default one

- get this default variant at the beginnign


DATA: GD_REPID     LIKE SY-REPID,
           G_SAVE TYPE C VALUE 'X',
          G_VARIANT TYPE DISVARIANT,
          GX_VARIANT TYPE DISVARIANT.

INITIALIZATION.
  GX_VARIANT-REPORT = SY-REPID.
  CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
    EXPORTING
      I_SAVE     = G_SAVE
    CHANGING
      CS_VARIANT = GX_VARIANT
    EXCEPTIONS
      NOT_FOUND  = 2.
  IF SY-SUBRC = 0.
    G_VARIANT = GX_VARIANT-VARIANT.
  ENDIF.

- later you set this one


GD_REPID = SY-REPID.

  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_CALLBACK_PROGRAM      = GD_REPID
      I_SAVE                  = 'X'   
      IS_VARIANT              = G_VARIANT
...

You migt however encounter some problems with using protection on the variant in this way, what I told you before applies to selection screen variant.

Regards

Marcin