‎2016 Sep 21 2:56 PM
Hello Gurus,
I would like to know if there is way to create a variant on the initial screen of VA02 transaction.
When I open this transaction, I would like the field "Order" to be opened with a Sales order number already filled.
And to go further, if I can link a SAP account with a variant.
For exemple I connect with account named "account1", if I open VA02, the sales order number field we be automatically filled with 1000
If I connect with "account2", and I open VA02, the sales order number field will be filled with 1001 automatically.
Maybe I can use a parameter in the account parameter in SU01 to link an account with a SO number ?
The field must stay modifiable to enter another order number.
Thank you for you help.
‎2016 Sep 21 4:40 PM
Hi Adrien,
You can make use of parameter in SU01 to default the value, also the value would be in editable mode and it can be changed.
The parameter Id 'AUN' would have to be used and maintained in User Settings -> Own Data -> Parameters with the default value.
However , please note doing this would make this default value appear at all the places where Order field is used and parameter Id 'AUN'. For instance the same order would be defaulted in VA03 as well.
~Tanmay
‎2016 Sep 21 4:40 PM
Hi Adrien,
You can make use of parameter in SU01 to default the value, also the value would be in editable mode and it can be changed.
The parameter Id 'AUN' would have to be used and maintained in User Settings -> Own Data -> Parameters with the default value.
However , please note doing this would make this default value appear at all the places where Order field is used and parameter Id 'AUN'. For instance the same order would be defaulted in VA03 as well.
~Tanmay
‎2016 Sep 21 4:58 PM
Hello Tanmay,
Thank you for your reply.
I have created the parameter AUN in SU01 with a sales order number.
But when I open another Sales order, this sales order number is saved and "Order" is filled with this last one. Even when I close the transaction.
The sales order number I have enter in the parameter AUN in SU01 is never put into the field...
Maybe I'm doing something wrong...?
‎2016 Sep 21 5:37 PM
Hi Adrien,
This is because as soon as we enter a new sales order number ,this number gets saved in the SAP Roll area.
As given in SAP Documentation
The statements SET PARAMETER and GET PARAMETER do not work directly with the SPA/GPA parameters of the SAP Memory, which means that they are only suitable for passing data within a single main session and not for passing data between two main sessions in parallel
If you log off from the system and login again , you would be able to see the value saved in SU01. Once it gets updated the new value is read from Roll area.
This can be verified by putting a break point in FORM VBAK-VBELN_GET_PARAMETER (Include FV45KF0V_VBAK-VBELN_GET_PARAME) which gets called when VA02 starts.
As a workaround you would have to look for an enhancement point to default the value from USR05 table for Parameter AUN everytime VA02 is called.
~Tanmay
‎2016 Sep 22 9:46 AM
Hello Tanmay,
Thank you again for your response. I have searched for an enhancement point and it seems that no one exists.
But with your help I'm now able to fill the "Order" field with a SO number in the parameter of the user account. It's a good thing.
Of course if someone knows an enhancement point that permits me to not save the new SO number when the user opens another SO, it could be really great...
Thank you again Tanmay
‎2016 Sep 22 10:55 AM
There is a BAdI executed at start of transaction, look at method TRANSACTION_INIT of BADI_SD_SALES.
Hint: There you could read and force the memory id AUN from default parameters values saved in table USR05, or better change value of VBELN in changing parameter VBAK of the method. But I suggest you also perform some check like 'don't do it in batch-input' as many program call VA02/VA03 with memory id to display a SO, and some undesirable behavior could occur.
Regards,
Raymond