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

Userexit_Save_Document

Former Member
0 Likes
1,155

Hi ,

I have created a field ZZHDDATE in VBEP table using Append Structure.

While VA01 or VA02 based on logic I have to update ZZHDDATE in VBEP table. Updation works fine in USEREXIT_SAVE_DOCUMENT_PREPARE. Since credit check is not done at

USEREXIT_SAVE_DOCUMENT_PREPARE I have to code at USEREXIT_SAVE_DOCUMENT.

In USEREXIT_SAVE_DOCUMENT, updation of ZZHDDATE is not working.

Anyone to help.

Thanks.

With Regards,

Gandhi Subramani

Hi ,

I have created a field ZZHDDATE in VBEP table using Append Structure.

While VA01 or VA02 based on logic I have to update ZZHDDATE in VBEP table. Updation works fine in USEREXIT_SAVE_DOCUMENT_PREPARE. Since credit check is not done at

USEREXIT_SAVE_DOCUMENT_PREPARE I have to code at USEREXIT_SAVE_DOCUMENT.

In USEREXIT_SAVE_DOCUMENT, updation of ZZHDDATE is not working.

Anyone to help.

Thanks.

With Regards,

Gandhi Subramani

4 REPLIES 4
Read only

Former Member
0 Likes
897

Hi ,

It won't work there .

The reason is after userexit_save_document_prepare userexit there is update Function called

RV_SALES_DOCUMENT_ADD - To create a sales order with all the table related to order( VBAK,VBAP,VBEP)

RV_SALES_DOCUMENT_UPDATE FOR updating the order .

This executes in the separate LUW .

After this userexit save_document_save is called where you get the order number so till that if you can change in any tables it won't the above function modules So new data which is changed in this userexit won't reflect .

Do coding in userexit_save_document_prepare.I think for credit check there is some userexit

Please reward if useful.

Read only

0 Likes
897

Hi Dinesh ,

Is it posiible to add line item to sales order within the exits USEREXIT_SAVE_DOCUMENT

or USEREXIT_SAVE_DOCUMENT_PREPARE or in any other way ...

thanks

Read only

0 Likes
897

Yes, it is possible as long as you populate all the mandatory fields. You most probably have to add at least one corresponding schedule line as well.

The easiest way would be to copy an existing xvbap/xvbep line and make the necessary adjustments.

You should also make sure that there is no entry with the same item number in the xvbap table that has an delete update flag (updkz). In this case you have to select a different item number. You also need to read the number steps from customizing because that can be changed.

e.g.

item 010, 020, 030

or 001,002,003

or 005,010,015

Hope that helps,

Michael

Read only

Former Member
0 Likes
897

If you look at the standard coding you'll find that between the save_prepare and the save userexit all order data is sent to the db in update task hence any changes you make to the data in the save userexit will not have any effect of the order data that have already been sent into update task.

You have three options:

- save prepare (which obviously won't work because credit check is not yet done which you need)

- make a modification after the credit check is executed and before the data is sent into update task

- write an own update function module that you call in the save userexit which will update the vbep field. To make sure that it is executed after all the other update modules you should send it to the V2 update.

Hope that helps,

Michael