02-24-2011 4:04 PM
Hello All,
There is a field called Material Availability date in VBAK (VBAK-FMBDAT ). During Sales Order Creation system internally copies the date from the line item level to this field. I have written in a code in "userexit_save_document" (MV45AFZZ) to override this date, but still the update isn't happening, though i see the new value in debugging till the commit.
Any light thrown on this would be greatly appreciated.
Thanks!!!
02-24-2011 4:09 PM
It is generally not a recommended practice to change SALES Order data in USEREXIT_SAVE_DOCUMENT... Try SAVE_DOCUMENT_PREPARE user exit...
02-24-2011 4:17 PM
Changing in SAVE_DOC_PREPARE and MOVE_FIELDS_VBAK will not work as standard code redetermines the FMBDAT after these exits.
02-24-2011 5:17 PM
USEREXIT_SAVE_DOCUMENT_PREPARE in MV50AFZ1 will work.
I remember i had done something like this to change the field value in VBAK
FIELD-SYMBOLS: <fs> TYPE vbak.
ASSIGN ('(SAPMV45A)VBAK') TO <fs>.
if <fs> is assigned.
<F_VBAK>-FMBDAT = sy-datum.
endif.
02-25-2011 9:43 AM
I saw that MV50AFZ1 is called during Sales Order creation only if an automatic delivery creation is set. For SO, only MV45AFZZ DOC_PREPARE is called. We dont want auto deliv creation.
Thanks for your inputs so far!!!