2009 Feb 19 4:48 PM
Hi all,
Can anyone tell me the difference between USEREXIT_SAVE_DOCUMENT and USEREXIT_SAVE_DOCUMENT_PREPARE in the include MV45AFZZ.
Thanks in advance.
Reshma
2009 Feb 19 4:56 PM
USEREXIT_SAVE_DOCUMENT_PREPARE is being called before system actually saves the document. In the userexit, you can actually change the document content like XVBAK for header, XVBAP for line item etc.
USEREXIT_SAVE_DOCUMENT is being called after the System call the FM RV_SALES_DOCUMENT_ADD to create / RV_SALES_DOCUMENT_UPDATE to modify document. This can be used to update the Z tables which are based on the sales document.
So the flow would be:
USEREXIT_SAVE_DOCUMENT_PREPARE
.
.
.
FM RV_SALES_DOCUMENT_ADD or RV_SALES_DOCUMENT_UPDATE
.
.
.
USEREXIT_SAVE_DOCUMENT
Regards,
Naimesh Patel
2009 Feb 19 4:55 PM
Hi
USEREXIT_SAVE_DOCUMENT_PREPARE is to change the data of sales order before saving it
USEREXIT_SAVE_DOCUMENT is to store some additional data into own Z-table: so here it shouldn't change the data of sales order.
Max
2009 Feb 19 5:01 PM
Thanks for your quick reply. So which include gets called first? SAVE one or the PREPARE one?
Thanks
Reshma
2009 Feb 19 5:03 PM
2009 Feb 19 5:04 PM
Hi Reshma,
SAVE_DOCUMENT_PREPARE will trigger first.
Regards
Sravan
2009 Feb 19 5:06 PM
2009 Feb 19 4:56 PM
USEREXIT_SAVE_DOCUMENT_PREPARE is being called before system actually saves the document. In the userexit, you can actually change the document content like XVBAK for header, XVBAP for line item etc.
USEREXIT_SAVE_DOCUMENT is being called after the System call the FM RV_SALES_DOCUMENT_ADD to create / RV_SALES_DOCUMENT_UPDATE to modify document. This can be used to update the Z tables which are based on the sales document.
So the flow would be:
USEREXIT_SAVE_DOCUMENT_PREPARE
.
.
.
FM RV_SALES_DOCUMENT_ADD or RV_SALES_DOCUMENT_UPDATE
.
.
.
USEREXIT_SAVE_DOCUMENT
Regards,
Naimesh Patel
2009 Feb 19 4:56 PM
Both routines have an English comment next to them, what's the problem?
Thomas
2009 Feb 19 5:03 PM
2009 Feb 19 5:07 PM