Application Development and Automation 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: 
Read only

MV45AFZZ

Former Member
0 Likes
2,086

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

1 ACCEPTED SOLUTION
Read only

naimesh_patel
Active Contributor
0 Likes
1,883

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

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

9 REPLIES 9
Read only

Former Member
0 Likes
1,883

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

Read only

0 Likes
1,883

Thanks for your quick reply. So which include gets called first? SAVE one or the PREPARE one?

Thanks

Reshma

Read only

0 Likes
1,883

Nimesh replied that already above

Read only

0 Likes
1,883

Hi Reshma,

SAVE_DOCUMENT_PREPARE will trigger first.

Regards

Sravan

Read only

0 Likes
1,883

Hi

PREPARE and then SAVE

Max

Read only

naimesh_patel
Active Contributor
0 Likes
1,884

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

Read only

ThomasZloch
Active Contributor
0 Likes
1,883

Both routines have an English comment next to them, what's the problem?

Thomas

Read only

0 Likes
1,883

Thanks for the answer. I thought those were in Latin.

Read only

viquar_iqbal
Active Contributor
0 Likes
1,883

Information about USEREXIT_SAVE_DOCUMENT_PREPARE

at [this|;