The topics related to transaction and screen variants have been discussed many times in this forum. We still find many discussion threads and questions regarding how can we make a screen field invisible or how can we provide a field to a certain group of users in display mode. This is another attempt to discuss transaction and screen variants in a detailed manner with an example of CS02 (change material BOM) transaction code.

Introduction:

Transaction Variants are very important for the following key features:

  • Restrict access to unnecessary data fields to the users. In an integrated ERP like SAP, data flows from one module to another and sometimes it is required to hide few specific data fields to a corresponding group of users.
  • Optimized data access and screen access: for example, a group of users are responsible to update few specific fields, and they are not interested in other fields irrelevant to them.
  • Reducing the risk and restricting users to actions: for example, you do not want a group of users to change the quantities inside a production order, or change quantities inside BOM, or delete a component inside BOM etc.

As the name suggests, it is a ‘variant’ of the standard transaction inside SAP.

Scope:

The knowledge:

  • How to create a transaction and screen variant, and attach it to a custom transaction code.
  • What are the options available during creation and change?

This is very important to all the functional/ technical/ techno-functional consultants working in SAP.

Process:

The step by step procedure of creating screen variants, transaction variants and variant transaction codes is discussed in this section with an example in IDES with EhP 4.

Here we take the case of changing a material BOM (CS02) with the following constraints attached:

  • The user is authorized to change only the consumption storage location.
  • The user cannot delete any item, or change any other fields, or delete the BOM itself.

The transaction variant should be created in the development system, and then transported to quality and production system after prior testing.

Transaction variants are created in SHD0 transaction code:

1.JPG

1.JPG

After providing the name of the transaction variant you are going to create, click on the create button or press ‘F5’ to create the transaction variant. This will take you to the original transaction, and record the screen fields to the screen variants which are going to be created in this process.

1.JPG

Press Enter. You will see a pop-up appearing to ‘confirm screen entries’, you can make the necessary changes during recording, or record all the screen entries and making decision at the end. We will follow the second option in this example.

There may be an option for ‘menu functions’ in that pop-up screen. It is used to deactivate any menu functions (as in this case, we are not allowing the user to delete any components or the BOM, so we will think of deactivating the ‘Delete’ pushbutton (a function key), and you can control what are the menu options you want to be unavailable to the user.)

This process also shares a great knowledge regarding the flow of the actual standard transactions; you get to know what are the ‘function key’s already deactivated in a specific screen.

1.JPG

For example, in standard CS02, the option of deleting BOM is deactivated in the initial screen. In standard CS02:

1.JPG

So, if we try to deactivate it over here, system should let me know that it is already deactivated. Click on the ‘menu functions’ button to call the interface variant:

1.JPG

Click on the folder with a ‘+’ sign to expand:

1.JPG

1.JPG

I think the concept of ‘interface variant’ is now clear. We press Enter to continue to the BOM components screen (General Item Overview).

1.JPG

Press Enter, system will again show up a pop-up screen to indicate the screen fields are being recorded in the screen variant.

1.JPG

The interface variant for this screen will be required, since we do not want to allow the users to delete a component (or other function keys or menu options). Click on the ‘Menu functions’ button:

1.JPG

1.JPG

1.JPG

Press Enter.

Continue pressing Enter until you reach the General Item Overview screen again.

In this process we record all the screens inside BOM. The person creating the transaction variant must have a fair idea of the ways the user can make changes, all the menu options that he may follow; otherwise it will not be full-proof and safe.

For example, in this recording we also capture screens from the component details screens, BOM header screen, all the tabs, and deactivate menu functions whenever necessary.

After capturing the screens, press the exit key (Shift + F3):

1.JPG

You will reach to the Change transaction variant screen. All thescreen recordings are now complete and you are going to decide:

  • Which fields will be ‘display only’
  • Which fields will be ‘invisible’
  • Which menu functions will be deactivated during this variant transaction

1.JPG

Use ‘page down’ and ‘page up’ keys to navigate through all the screen variants.

1.JPG

1.JPG

Since the user was responsible to change the consumption location, we allow entry in this filed.

1.JPG

Make the settings for deactivated buttons as shown:

1.JPG

The process is complete. We will now save the screen variants and the transaction variant.

Click on the ‘save’ button:

System will ask for a package during save. Provide suitable package to which you are saving.

1.JPG

Press Enter.

System will show a pop-up for a workbench request, so that this can later be transported to quality and production system.

Continue pressing enter to save all the screen variants to this single workbench request and with the same package, until you reach the transaction variant screen again.

1.JPG

So, now the transaction variant is saved and we are ready to test the same.

Press the back button (F3).

1.JPG

Press F8 or click on the test button to test this transaction variant:

1.JPG

1.JPG

1.JPG

So, this has successfully been tested now.

Now we will create a custom transaction code (variant transaction), that uses this transaction variant.

From the transaction variant screen, press Shift + F6 or follow the menu path:

1.JPG

1.JPG

Press Enter.

1.JPG

Save the custom transaction code. During save, provide the same package and the workbench request number that we have used.

1.JPG

Now we are ready to use this variant transaction.

Authorizations:

The specific group for which we have created this variant transaction ‘ZCS02’ will now be authorized to this transaction code by BASIS with proper roles and authorizations.

The following section has been included in version 2 and this section is inspired by the feedback provided by expert Jeevan Sagar:

Requirement:

We take here an example case where the ‘material memo’ pushbutton for long text should be made invisible from MD04 screen for all the users.

Please find the below SCN thread and let us extend this case for all the users:

http://scn.sap.com/thread/3417424

In this case, we are not going to create a variant transaction. Instead we will activate this transaction variant to the standard MD04.

Go to the Standard variants tab as shown below.

3.JPG

After entering the transaction variant, click on the Activate button. System will show an information message: ‘Standard variant also set at beginning of transaction without variant!’

Press Enter. Now you will see that the ‘deactivate’ button becomes active. This can be used anytime to deactivate the usage of the transaction variant to the standard transaction.

You can now test the MD04 transaction, it will use the transaction variant that has been activated.

Thanks for viewing the document. Please do share your valuable feedback.

Rajen

To report this post you need to login first.

69 Comments

You must be Logged on to comment or reply to a post.

  1. Krishna Chandra

    Hi Rajen,

         Very nice document and detailed explanation. If possible please share the authorization part also as i am not aware of it.

    Regards,

    Krishna Chandra

    (0) 
      1. Kamal Kumar

        The created Z transaction variant can be activated for the SAP standard transaction.

        Does the standard transaction always is executed via the activated transaction variant? Can all of the users using standard transaction be able to activate as well as deactivate it? Some of them might not even have access to the transaction SHD0 to activate & deactivate the assignment of Z transaction variant to the standard transaction code.

        Is my question appropriate? Please suggest. Thanks.

        (0) 
  2. swapnil rajane

    Hi Rajen,

    Its really very nice and useful documents.After reading this now I realize that we can create tcode for variants and we can grey out fields from menu options also.Its really new thing for me to learn.Before,I was aware of assigning user id to variant group and field mandatory,hiding and all.Its really helpful for me from future point of you!!!.Once again thanks a lot….

    But still one problem most of the time I am facing while creating variants is that the name of the screen variant i.e ZZZCS02_0100 is not coming automatic.I have to enter this manually with screen number.

    Could you please let me know how come we come out of this.

    Regards.

    (0) 
    1. Rajen Madan Post author

      Hi Swapnil,

      Are you entering a transaction variant name that has been used before? I faced the same thing when I was not satisfied with the earlier recording and tried a new one with the name I used earlier. I would suggest, start afresh in SHD0, give the transaction variant name totally new, say, YCS02 or YYCS02. Please check if this is the case.

      Thanks a lot for your positive feedback and I am happy that this document could be helpful to you.

      Best Regards,

      Rajen

      (0) 
      1. Deepak Jharkharia

        Hello Rajen,

        The effort you put to prepare this document is visible 🙂 .You explained it nicely and covered all issues people generally face in variants.Thanks for this Great share.This is really commonly asked question in forum and i think many requirements conclude to variant part only.

                  keep sharing.

        Best Regards,

        (0) 
        1. Rajen Madan Post author

          Hi dee joy,

          Thank you for your kind words. Yes, it was the main intention to gather the concepts together and prepare a detailed documentation.

          I would surely like to create and share such documents in future. 🙂

          Thanks again and Regards,

          Rajen

          (0) 
  3. Jeevan Sagar

    I’d like to add one little thing, in case you do not want to create a separate transaction code ZCS02 but you want to assign this transaction variant to the standard tcode CS02 itself, all you have to do is click “Standard Variants” tab underneath that there is another “Standard Variants” tab, in the field enter the name of your transaction variant ZZZCS02 and click the activate button. From now on CS02 will start with transaction variant ZZZCS02.

    (0) 
    1. Rajen Madan Post author

      Thanks Jeevan for your input. As I have mentioned in the document, the case was to impose those restrictions to a specific group of users without changing the way the standard transaction executes.

      I will surely modify the document with the valuable input that you have provided.

      Thanks again and Regards,

      Rajen

      (0) 
  4. levies lee

    so thanks for u , i need read it carefully,

    if there anyone try to use SHD0 assign the specially control for some special users,

    such as only provide a few persons use CO02 to change the componment,and others only can see this view.

    (0) 
  5. Srinathan H

    Dear Rajen,

    Thanks for the document, it will help us to great extent.

    Some help is required,

    I was trying the same example, but while saving the screen variants and the transaction variant I stuck with “Package”.

    What is Package?, Which Package to select?, How to create it?

    Thanks,

    Srinathan.

    (0) 
    1. Rajen Madan Post author

      Hi Srinathan,

      This is part of the transport layer in R/3 structure. When system asks for package, check the F1 help on the package, and sit with a technical person (ABAP/BASIS or both) to understand the architecture properly.

      Generally we create package starting with Z or Y to move/transport our own workbench requests. You can do the same in SE80 / SE21 transaction. Generally the ABAP guy does that.

      Kindly read the F1 documentation thoroughly.

      Best Regards,

      Rajen

      (0) 
          1. swapnil rajane

            Dear Rajen,

            Sorry to interrupt you once again.Could you please give us all one more favour by sharing the documents of creating Direct Input method of LSMW for bom and routing.Any documents for reference.It will be a great help.

            Regards.

            (0) 
            1. Rajen Madan Post author

              Hi Swapnil,

              Thanks for your reply. I will check whether appropriate detailed resources are already available here in SCN, since in that case it will be redundant.

              Thanks again,

              Rajen

              (0) 
      1. levies lee

        dear

          i have a try as you act, but i can`t control some one can see the view, others can`t see!

        as CO02, i want control only some of the users can see the operations view,

        with ZCO02,but if i active it ,CO02 and ZCO02 as the same

        (0) 
        1. Rajen Madan Post author

          Hi Levies,

          When you activate the transaction variant as discussed in the last part, the transaction variant is activated throughout the system, i.e., the standard transaction CO02 and ZCO02 will work same. It is working as expected.

          The controlling process is to create the Z-transaction and assign the Z-transaction to the restricted users.

          Best Regards,

          Rajen

          (0) 
  6. Tina Teng

    Good sharing!  I just test this function throughly in my IDES system. It turns out ok.But I found that creating a new package should be necessary,since I wanna to choose the existing one in the system before at  begining, it’s not allowed. Then, I use the transaction SE21 to create one named with ZBOM.

    Thanks for sharing again.

    Tina

    (0) 
    1. Rajen Madan Post author

      Thanks Tina Teng !

      Yes, you will have to define your Y- or Z- package in SE21, I have mentioned the same in one of my earlier comments. Sometimes it is also a practice that at the start of the implementation, we define custom packages according to modules, e.g., ZPP, ZSD like that so that we can have our own workbench requests in a more organized manner.

      Best Regards,

      Rajen

      (0) 
    1. Rajen Madan Post author

      Hi Sreekanth,

      Glad that you have found it helpful. I would request you to test in your test system and report if you face any issues regarding the same. That will be very helpful so that I can keep the document updated.

      Best Regards,

      Rajen

      (0) 
  7. Ramagiri Srinivas Rao

    Hi Rajen,

    There are many documents on Transaction Variants. The way you explained considering many issues faced while creating transaction variants is excellent.

    Regards,

    Ramagiri

    (0) 
  8. akanksha chouhan

    Hi,I want to disable the deletion flag in IB02 at header level.How can i do that?i have found the enhancement point for that but not able to do it.

    (0) 
    1. Rajen Madan Post author

      Akanksha,

      If you follow the method shared here, you should not face any difficulties.

      Here is the final output with transaction variant enabled:

      1.JPG

      In SHD0, you will have to make this field invisible to have this output:

      1.JPG

      Follow the document, and let me know if you face any problem.

      Best Regards,

      Rajen

      (0) 
  9. Madhusudan R Patil

    Transaction variant doesn’t seems to be controlled by R&A. If I have two transactions FB02 and ZFB02, I want to give access of FB02 to certain users and ZFB02 to certain users. However whatever I do, if ZFB02 access is given, users can access FB02 also. is it because system also calls for standard transaction as it is just a transaction variant?

    does only assigning users to the user group is only an option to control?

    (0) 

Leave a Reply