Skip to Content
Author's profile photo Rajen Madan

Transaction and Screen variants with an Example

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

Assigned Tags

      73 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Krishna Chandra
      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

      Author's profile photo Rajen Madan
      Rajen Madan
      Blog Post Author

      Dear Krishna,

      The authorization part is generally handled by the BASIS person. Roles will be created in PFCG transaction for the variant transaction you have created, and then the role will be assigned to the user in SU01 (user maintenance). You can explore more regarding Roles and Authorizations here:

      https://help.sap.com/saphelp_46c/helpdata/en/52/6714b6439b11d1896f0000e8322d00/content.htm

      Thanks,

      Rajen

      Author's profile photo Former Member
      Former Member

      Well documentation.

      Regards,

      Akber Husain

      Author's profile photo Rajen Madan
      Rajen Madan
      Blog Post Author

      Thanks a lot Akber for your feedback.

      Regards,

      Rajen

      Author's profile photo Anupam Sharma
      Anupam Sharma

      Hi Rajesh,

      Nice detailed document, Great effort.

      Keep sharing.

      Regards,

      Anupam Sharma

      Author's profile photo Rajen Madan
      Rajen Madan
      Blog Post Author

      Dear Anupam,

      Thanks a lot for the feedback.

      Best Regards,

      Rajen

      Author's profile photo Kamal K
      Kamal K

      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.

      Author's profile photo Mohd Tallha Sonalkar
      Mohd Tallha Sonalkar

      Hi Rajen,

      Excellent document

      Keep on updating the entire SAP team , with your valuable efforts,

      Regard's

      Tallha

      Author's profile photo Rajen Madan
      Rajen Madan
      Blog Post Author

      Hi Tallha,

      I remember your thread regarding SHD0 if I am not mistaken. 🙂

      Thanks a lot for the feedback.

      Best Regards,

      Rajen

      Author's profile photo swapnil rajane
      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.

      Author's profile photo Rajen Madan
      Rajen Madan
      Blog 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

      Author's profile photo Former Member
      Former Member

      Useful One...Many Thanks.

      Best Regards,

      Naresh K.

      Author's profile photo Rajen Madan
      Rajen Madan
      Blog Post Author

      Thanks a lot for your positive feedback and support.

      Best Regards,

      Rajen

      Author's profile photo Deepak Jharkharia
      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,

      Author's profile photo Rajen Madan
      Rajen Madan
      Blog 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

      Author's profile photo Arturo Senosain
      Arturo Senosain

      Very Nice!

      Author's profile photo Rajen Madan
      Rajen Madan
      Blog Post Author

      Hi Arturo,

      Thanks a lot for your feedback!

      Best Regards,

      Rajen

      Author's profile photo Former Member
      Former Member

      Hi Rajen,

      Nice document.

      Thanks for sharing.

      Regards,

      Senthil

      Author's profile photo Rajen Madan
      Rajen Madan
      Blog Post Author

      Hello Senthil,

      Thanks a lot. 🙂

      Best Regards,

      Rajen

      Author's profile photo Jeevan Sagar
      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.

      Author's profile photo Rajen Madan
      Rajen Madan
      Blog 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

      Author's profile photo Former Member
      Former Member

      Dear Rajen,

      Good, very useful and simplified document.

      Thanks for sharing.

      Regards,

      Naresh

      Author's profile photo Rajen Madan
      Rajen Madan
      Blog Post Author

      Thanks a lot Naresh.

      Best Regards,

      Rajen

      Author's profile photo Former Member
      Former Member

      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.

      Author's profile photo Rajen Madan
      Rajen Madan
      Blog Post Author

      Many thanks for you feedback, Levies lee.

      Best Regards,

      Rajen

      Author's profile photo sandeep praharaj
      sandeep praharaj

      nice document  🙂   rajen if u can share any such type of document for capacity planning.

      Thanks & Regards

      Sandeep Kumar Praharaj

      Author's profile photo Rajen Madan
      Rajen Madan
      Blog Post Author

      Thanks a lot Sandeep. I'll try to do the same.

      Best Regards,

      Rajne

      Author's profile photo Former Member
      Former Member

      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.

      Author's profile photo Rajen Madan
      Rajen Madan
      Blog 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

      Author's profile photo Former Member
      Former Member

      Dear Rajen,

      Thanks for quick reply,

      I will consult with ABAPer for the same.

      Regards,

      Srinathan.

      Author's profile photo Rajen Madan
      Rajen Madan
      Blog Post Author

      Thanks Srinathan,

      Hope you have found the F1 documentation I was referring to.

      Best Regards,

      Rajen

      Author's profile photo swapnil rajane
      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.

      Author's profile photo Rajen Madan
      Rajen Madan
      Blog 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

      Author's profile photo Former Member
      Former Member

      Hi Rajen,

      Nice document.

      Thanks

      Rijil

      Author's profile photo Rajen Madan
      Rajen Madan
      Blog Post Author

      Hi Rijil,

      Many thanks for your feedback.

      Best Regards,

      Rajen

      Author's profile photo Former Member
      Former Member

      Dear Rajesh,

      Good efforts keep it ON..

      Regards

      Krishna kant Sharma

      Author's profile photo Rajen Madan
      Rajen Madan
      Blog Post Author

      Hi,

      Many thanks for your feedback.

      BR,

      Rajen

      Author's profile photo Former Member
      Former Member

      Thnxx a lottt...keep it up!!!

      Author's profile photo Rajen Madan
      Rajen Madan
      Blog Post Author

      Thank you Amit.

      Best Regards,
      Rajen

      Author's profile photo Former Member
      Former Member

      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

      Author's profile photo Rajen Madan
      Rajen Madan
      Blog 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

      Author's profile photo Former Member
      Former Member

      Hi Rajen ,

      Thanks for sharing this material.

      Regards

      Prashanth

      Author's profile photo Rajen Madan
      Rajen Madan
      Blog Post Author

      Thanks Prashanth.

      BR,

      Rajen

      Author's profile photo Former Member
      Former Member

      Dear Rajen


          Thanks for the Document, Its been very useful for me in my implementation project.

      Thanks n Regards

      Vamsi

      Author's profile photo Rajen Madan
      Rajen Madan
      Blog Post Author

      Hi Vamsi,

      Thanks for your positive feedback. I am glad that you have found it useful.

      Best Regards,

      Rajen

      Author's profile photo Former Member
      Former Member

      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

      Author's profile photo Rajen Madan
      Rajen Madan
      Blog 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

      Author's profile photo Former Member
      Former Member

      Hi,

      Very Helpful Doc.

      Regards,

      Sreekanth

      Author's profile photo Rajen Madan
      Rajen Madan
      Blog 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

      Author's profile photo Suhaib Bin Aziz
      Suhaib Bin Aziz

      Very well explained 🙂 Good effort.

      Best regards,

      Suhaib Bin Aziz

      Author's profile photo Former Member
      Former Member

      Very good document. Transaction variants are a MUST with difficult users.

      Author's profile photo Former Member
      Former Member

      Thanks Rajen for this Informative Document on SHD0.

      Using Below Document you can Harness the utility of SHD0 without creating ZTCODE 🙂

      http://scn.sap.com/docs/DOC-39667

      Author's profile photo Former Member
      Former Member

      Hi Rajen

      Very well explained document . Clear explanation of concepts with example screenshots .

      Thanks for sharing the document.

      Author's profile photo Former Member
      Former Member

      HI Rajen,

      This is very informative.

      Thanks for sharing this detailed document.

      Regards,

      Narender

      Author's profile photo Nitin Jinagal
      Nitin Jinagal

      Im gonna give it a try Rajen. Thanks for sharing this useful info 🙂

      ntn

      Author's profile photo Srini Ravindra Kumar Pandi Gurusamy
      Srini Ravindra Kumar Pandi Gurusamy

      Very good one Rajen. Keep it up.

      Author's profile photo Ramagiri Srinivas Rao
      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

      Author's profile photo akanksha chouhan
      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.

      Author's profile photo Rajen Madan
      Rajen Madan
      Blog 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

      Author's profile photo Erwin Leitner
      Erwin Leitner

      Hello,

      Thank you very much.

      all the best Erwin

      Author's profile photo Abhay Parekh
      Abhay Parekh

      Hey Rajan sir... awesome document helped it alot...thankss for the awesome document 🙂

      Regards,

      Abhay

      Author's profile photo Raghava S
      Raghava S

      Hi Rajen,

      Nice document...Thanks a lot for sharing...

      Regards,

      Hari

      Author's profile photo Eric Chen
      Eric Chen

      Thanks for sharing, nice document.

      Author's profile photo Former Member
      Former Member

      Very nice document. Thank you.

      Author's profile photo Former Member
      Former Member

      Thanks for sharing!

      Author's profile photo Former Member
      Former Member

      Thanks and Nice document

      Author's profile photo Madhusudan R Patil
      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?

      Author's profile photo Mohammed Suheel
      Mohammed Suheel

      Excellent document and thanks for sharing. keep sharing documents like this .

      Regards

      Suheel

      Author's profile photo c u roy
      c u roy

      Thankyou and very good document,thankyou for your effort

       

      Author's profile photo Former Member
      Former Member

      Very well constructed, easy to follow. Great Work!!!!

      Author's profile photo kumar semmalai
      kumar semmalai

      Thanks a lot !. Wonderful Document.

       

      Author's profile photo Sriny M
      Sriny M

      Thanks Rajen. Very useful document.

      Can you please advise if transaction variants can be created for Custom Report's to restrict the usage of the selection screen fields...?

      Author's profile photo Dinesh Sharma
      Dinesh Sharma

      Hello Rajen,

      This post is very old but very good document. I have a small query.

      I explain step wise.

      Step 1 : create process order & click on BOM material list.

      Step 2 : select one BOM material & right click button pressed.

      Step 3 : We chose the delete option. After selecting the delete option, the option of yes and no came on the screen. We have already disabled the yes button.

      Step 4 : But if you right click on no button then yes option is allowed. Pressing the F5 button on the keyboard also deletes the line.

      How to Disable Step 4 in Screen Variants.

      Thanks & regards,

      Dinesh Sharma