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: 

Date change problem in UserExit (mv45afzz)

Former Member
0 Kudos

Hi,

Here is one scenario which i have to write coding....If any body knows, where to start my coding that would be great...

This is a UserExit , writing code in USEREXIT_SAVE_DOCUMENT_PREPARE in mv45afzz.

Loading date(VBEP-LDDAT) will be Read Only field at any time in the order life cycle.

User can manipulate the Loading date only by changing the requested delivery date in the header.

If Sales Order is Open:( delivery not yet created )

Allow the system to calculate the loading date based on the Ship To, Requested Delivery Date of the document and Plant(VBAP-WERKS). Once the Loading date is defaulted, check if Loading Date is Saturday or Sunday.If yes, change the calculated Loading date to preceding Friday.

If Sales Order is Closed: ( delivery is created )

If User changes the Requested Delivery Date of the document, then find the new Requested Delivery Date and the Requested Delivery Date on the corresponding delivery document matches.If yes allow the user to change the Requested Delivery Date of the document,If no, Flag error message and prevent from Saving the new Requested Delivery Date of the document.

Thanks in advance,

fractal.

4 REPLIES 4

Former Member
0 Kudos

Fractal,

I think you already have a form USEREXIT_SAVE_DOCUMENT_PREPARE to begin with. What exactly are you looking for?

Cheers,

Bipin

0 Kudos

Hi,

I want the code....

Thanks,

fractal

0 Kudos

Hi Fractal

Did you try changing xvbep in form userexit_save_document_prepare?

Thanks,

Anand

Message was edited by: Anand Nanjundaiah

Former Member
0 Kudos

Hi in User EXIT SAVE_DOCUMENT_PREPARE

First check if RV45A-KETDAT <> XVBEP-LDDAT.

Means Requested Delivery date changed at header level.

Then Cheak Delivery created for this order line item from VBFA(Flowtabe). Use VBELV = XVBEP-VBELN and POSNR = XVBEP-POSNR and VBTYP_N = 'J'. (DELIVERY).

IF any entry fond in VBFA means Delivery created for this Order.

Then add your logic to change XVBEP-LDDAT at each line item level by using SHIP to and PLANT.

Try this.