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: 

User exit to update VBEP (XVBEP) records while changing VBAP-MVGR2

Former Member
0 Kudos

Hi experts,

I have a requirement below in the sales order user exits . please help.

During Sales order change (VA02), If I change the material group 2 (from additional data 1) vbap-mvgr2 field value from blank to '06', the delivery date of the sales order item needs to be redermined (i.e. vbep-edatu).

However, the change of field VBAP-MVGR2 doesn't trigger the user exits (USEREXIT_MOVE_FIELD_TO_VBAP, USEREXIT_MOVE_FIELD_TO_VBEP and USEREXIT_CHECK_VBEP). The only user exit I know that is getting called during this change is USEREXIT_CHECK_VBAP. If we write the code in USEREXIT_CHECK_VBAP for updating the delivery date (VBEP-EDATU), it is not updating the delivery dates. (I tried updating XVBEP, IVBEP1 tables also in this user exit, but once after saving the sales order and comeback to display/change mode the previous values in delivery dates still exist).

Can somebody suggest if there is any other user exit available which will update the VBEP, XVBEP tables after processing them.

Best regards,

Siva

5 REPLIES 5

Former Member
0 Kudos

Form routines USEREXIT_MOVE_FIELD_TO_VBAP & VBEP is not called when you change this field. You can use the form-routine USEREXIT_MOVE_FIELD_TO_VBAK by reading the corresponding records from XVBEP and modifying the internal table row with updated values. In addition to the changes in other fields you need to update the internal table structure field XVBEP-UPDKZ with 'U'.

0 Kudos

Hi Vinod,

Thank you very much for the answer. Somehow, I forgot to update the UPDKZ indicator. The VBEP table is getting updated with the new dates..I am writing this code in USEREXIT_CHECK_VBAP as someother checks also are required to made this.

With the change I haved done, for one sales order before applying the new date, the schedule line date are as follows

Delivery date|ordered qty|rounded qty|Confirmed Qty

-


01/05/2011 |30 |30 |0

02/02/2011 |0 |0 |30

after the changes with the new delivery date for xvbep table, the sales order now showing

Delivery date|ordered qty|rounded qty|Confirmed Qty

-


01/07/2011 |30 |30 |0

01/07/2011 |0 |0 |30

Is this resultant values practically correct. I think when we consider standard sap it should contain the values like below I believe. Do you have inputs on this..

Delivery date|ordered qty|rounded qty|Confirmed Qty

-


01/07/2011 |30 |30 |30

If we want to achieve this what could be done.

Best regards,

Siva

0 Kudos

Just by changing the Scheduled Delivery Date, you cannot achieve the SAP standard Functionality. For that "ATP Check" is to be carried out for the Line item with new Delivery Date. Furthermore, consistency in the Delivery date is to be ensured while updating the date through the user exit. (In your case two Schdeule Lines with Same delivery Date doesn't make any sense).

0 Kudos

hi vinod,

thanks for the reply. yes..I know ATP check will not be performed in this case..however..in this specific case, the business doesn't want to go through ATP check and they wanted to have the delviery date (VBEP-EDATU) to be updated by a date provided in a custom table when the VBAP-MVGR2 is changed manually to 06 (i.e. LAUNCH in out business terms).

how can we handle this in case of having two lines (to make it to one line) with same delivery date?

Best regards,

Siva

0 Kudos

Closing the thread