Verkaufsbüro und andere Felder in VA01 obligatorisch machen

Today one of the member of our telegram group aked how to set sales office as required in transaction VA01. Ater analyzing the User Exits and BADIs of VA01 I realized that this is not way how to solve it. Then another group member came with the idea using transaction variant. So I focused on this.

Question and decision how to implement:

  1. Can it be solved using standard functions?
    • Yes, by recording a transaction variant and assign this to sales order type.
  2. Must be developed here?
    • No.

Implementation steps

Recording transaction variant

Start transaction SHD0 enter transaction code VA01 and a name for the transaction variant and hit the create button.
Transaction VA01 will start then and you need to hit enter key to continue.
In the upcoming popup we can see every field of screen 101. For every field we can change the attributes (With content, output only, invisible and required). So here you can set sales office as required. Then confirm evrything with Exit and Save to return back to SHD0.
I assign the transaction variant to package $tmp, because I don’t wish to transport to further systems.

Assigning the transaction variant to sales order type

Start transaction spro and navigate to Sales and Distribution->Sales->Sales Documents->Sales Document Header->Define Sales Document Types
Navigate to the document type where you wish to assign the transaction variant and assign the transaction variant.
Due to customizing needs to be transported we have to assignt the changes to a customizing request.

Testing the implementation

After recording and assigning the transaction variant we can test if everything is workig now.

Now we can start transaction VA01 and we can see that sales office is required for the doument type where we have assigned the transaction variant.
But wait, what is that? When we leave transaction VA01 when document type is not equal the document type where we assigned the transaction variant an reenter VA01 then sales office is not required anymore. Even after changing document type back to the other document type sales office still is not required. So when we hit enter we will jump straight into the sales order without having sales office required.

Again we have to record transaction variant

After realizing that the user has the possibilty to create a sales order without entering the sales office we can set sales office in the head of sales order as required. so we have to go back to transaction SHD0 and there we will change our transaction variant. The first steps are the same like described under 1, but instead of confirming with Exit and Save we need to press the ok key so that we continue with creating the sales order and navigating to the head of the sales order.

When ever we raise PAI now we will get a popup for every subscreen in the screen. But we don’t wish to have all these screens in our transaction variant so we disable the checkbox Copy settings and continue by pressing enter key. When the popups of all screens have finished, we need to hit enter key one more time to get the popup for screen 4301.
Here will set sales office as required too and confirm with Exit and Save again.
Now we get a summary of all screens that will be in our transaction variant.

Second test

Now we can give it a try again to check our changes,

Now everything looks as we expected. Additional we have the sales office required in the head data of the sales order.