Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling Transaction VA02 from USEREXIT_SAVE_DOCUMENT

Former Member
0 Kudos

Hi All,

I am calling Custom Transaction in USEREXIT_SAVE_DOCUMENT for cash payment process. In this screen I do have one button called "RETURN TO ORDER", is press this button Should call the Transaction VA02. It's calling transaction VA02 & also Populating SALESORDER number ,but when i press enter it's giving error as <b>" SALES ORDER NUMBER IS NOT AVAILABLE IN DATABASE"</b>.

Any ideas how can i overcome this? Is there is any BAPI's i should use? Please give me your Good ideas & Guidance?

Thanks

6 REPLIES 6

Former Member
0 Kudos

Hi,

When you say you are calling a custom transaction in the userexit_save_document does that mean you are calling your custom transaction from within VA01? If yes then the exit only gets triggered before saving the order. Hence the order has not been yet created in the system. When you call a custom transdaction from within a user exit the control goes to the transaction and the process of order compeletion is not yet done.

Check if there is any exit after saving the exit.

Cheers

VJ

0 Kudos

I am also having same scenario, i need to display the custom screen when i press save button in VA01. Is there is anyother way you guys can think ?

Thanks.

Message was edited by: Subha

0 Kudos

Hi

I believe there are exists after a order is saved. Coz in our org we are sending IDOCs as soon as a order is saved and this is triggered only after the order is saved in the system.

So i bet there should be some exists which are triggered after the order is saved. If you are trying to trigger the custom screen before the order is even saved in the system then it might not be a good solution even if you can capture the order number mid-way.

Hope this helps

Cheers

VJ

0 Kudos

I need to Call custom screen before order saved, B'cos if user enter payment method example like CASH CHECK then need to get data from them & should save Ztables for Cash Process. In this screen suppose if user wants to change anything in order then should able to go to Va02 from the custom screen by clicking the button.???

Thanks,

ferry_lianto
Active Contributor
0 Kudos

Hi Jayaprakash,

You need to call custom transaction in <b>USEREXIT_REFRESH_DOCUMENT</b> instead of USEREXIT_SAVE_DOCUMENT.

In this user exits, the sales order has been saved in database.

Please find below detail information about USEREXIT_REFRESH_DOCUMENT.

* It is always necessary to refresh user-specific data 
* before the next document will be processed. 
* This can be done in this userexit.                     
* This userexit can be used to refresh user-specific  data       
* when the processing of a sales document is finished           
* - after the document is saved
* - when you leave the document processing with F3 or F15
* It may be necessary to refresh user-specific data before the next document will be processed. 
*
* This form is called in dialog at the end of form
* BELEG_INITIALISIEREN  

Hope this will help.

Regards,

Ferry Lianto

0 Kudos

I feel particularly depressed… I want to use userexit_refresh_document to call “VA01” to copy the SO I just saved.I think it's a great way to do that. But my clients don't want me to use userexit_refresh_document, because they think 'refresh' is used for emptying. They want to do it with badi…