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:
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.
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.
For example, in standard CS02, the option of deleting BOM is deactivated in the initial screen. In standard CS02:
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:
Click on the folder with a ‘+’ sign to expand:
I think the concept of ‘interface variant’ is now clear. We press Enter to continue to the BOM components screen (General Item Overview).
Press Enter, system will again show up a pop-up screen to indicate the screen fields are being recorded in the screen variant.
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:
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):
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
Use ‘page down’ and ‘page up’ keys to navigate through all the screen variants.
Since the user was responsible to change the consumption location, we allow entry in this filed.
Make the settings for deactivated buttons as shown:
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.
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.
So, now the transaction variant is saved and we are ready to test the same.
Press the back button (F3).
Press F8 or click on the test button to test this transaction variant:
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:
Press Enter.
Save the custom transaction code. During save, provide the same package and the workbench request number that we have used.
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.
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
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
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
Well documentation.
Regards,
Akber Husain
Thanks a lot Akber for your feedback.
Regards,
Rajen
Hi Rajesh,
Nice detailed document, Great effort.
Keep sharing.
Regards,
Anupam Sharma
Dear Anupam,
Thanks a lot for the feedback.
Best Regards,
Rajen
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.
Hi Rajen,
Excellent document
Keep on updating the entire SAP team , with your valuable efforts,
Regard's
Tallha
Hi Tallha,
I remember your thread regarding SHD0 if I am not mistaken. 🙂
Thanks a lot for the feedback.
Best Regards,
Rajen
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.
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
Useful One...Many Thanks.
Best Regards,
Naresh K.
Thanks a lot for your positive feedback and support.
Best Regards,
Rajen
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,
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
Very Nice!
Hi Arturo,
Thanks a lot for your feedback!
Best Regards,
Rajen
Hi Rajen,
Nice document.
Thanks for sharing.
Regards,
Senthil
Hello Senthil,
Thanks a lot. 🙂
Best Regards,
Rajen
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.
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
Dear Rajen,
Good, very useful and simplified document.
Thanks for sharing.
Regards,
Naresh
Thanks a lot Naresh.
Best Regards,
Rajen
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.
Many thanks for you feedback, Levies lee.
Best Regards,
Rajen
nice document 🙂 rajen if u can share any such type of document for capacity planning.
Thanks & Regards
Sandeep Kumar Praharaj
Thanks a lot Sandeep. I'll try to do the same.
Best Regards,
Rajne
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.
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
Dear Rajen,
Thanks for quick reply,
I will consult with ABAPer for the same.
Regards,
Srinathan.
Thanks Srinathan,
Hope you have found the F1 documentation I was referring to.
Best Regards,
Rajen
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.
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
Hi Rajen,
Nice document.
Thanks
Rijil
Hi Rijil,
Many thanks for your feedback.
Best Regards,
Rajen
Dear Rajesh,
Good efforts keep it ON..
Regards
Krishna kant Sharma
Hi,
Many thanks for your feedback.
BR,
Rajen
Thnxx a lottt...keep it up!!!
Thank you Amit.
Best Regards,
Rajen
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
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
Hi Rajen ,
Thanks for sharing this material.
Regards
Prashanth
Thanks Prashanth.
BR,
Rajen
Dear Rajen
Thanks for the Document, Its been very useful for me in my implementation project.
Thanks n Regards
Vamsi
Hi Vamsi,
Thanks for your positive feedback. I am glad that you have found it useful.
Best Regards,
Rajen
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
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
Hi,
Very Helpful Doc.
Regards,
Sreekanth
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
Very well explained 🙂 Good effort.
Best regards,
Suhaib Bin Aziz
Very good document. Transaction variants are a MUST with difficult users.
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
Hi Rajen
Very well explained document . Clear explanation of concepts with example screenshots .
Thanks for sharing the document.
HI Rajen,
This is very informative.
Thanks for sharing this detailed document.
Regards,
Narender
Im gonna give it a try Rajen. Thanks for sharing this useful info 🙂
ntn
Very good one Rajen. Keep it up.
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
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.
Akanksha,
If you follow the method shared here, you should not face any difficulties.
Here is the final output with transaction variant enabled:
In SHD0, you will have to make this field invisible to have this output:
Follow the document, and let me know if you face any problem.
Best Regards,
Rajen
Hello,
Thank you very much.
all the best Erwin
Hey Rajan sir... awesome document helped it alot...thankss for the awesome document 🙂
Regards,
Abhay
Hi Rajen,
Nice document...Thanks a lot for sharing...
Regards,
Hari
Thanks for sharing, nice document.
Very nice document. Thank you.
Thanks for sharing!
Thanks and Nice document
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?
Excellent document and thanks for sharing. keep sharing documents like this .
Regards
Suheel
Thankyou and very good document,thankyou for your effort
Very well constructed, easy to follow. Great Work!!!!
Thanks a lot !. Wonderful Document.
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...?
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