‎2008 Aug 14 7:47 PM
Hi,
I want to put a defaullt Delivery block in sales order if the material is changed.
if sy-tcode = 'VA02'.
if xvbap-matnr ne yvbap-matnr.
vbak-lifsk = '40'. '40 is a Delivery block
endif.
endif.
with this, the block is placed when the material is changed. but if someone manually checks and removes the block, while saving the order it puts back the block again.
What can i do to prevent that. I am a functional guy and trying to manage w/o a developer.
if anyone can provide the code. <REMOVED BY MODERATOR - REQUEST OR OFFER POINTS ARE FORBIDDEN>
Thanks
Edited by: Alvaro Tejada Galindo on Aug 15, 2008 4:45 PM
‎2008 Aug 14 7:57 PM
Hi,
look for user-exit 'USEREXIT_SAVE_DOCUMENT_PREPARE' in the program SAPMV45A.
Here you can implement your logic depending on your transaction type.
check the field t180-trtyp.
If this field is equal to 'H' then it is the create mode.
Since in your case you only want to remove the delivery block when it is edited, your logic should be
IF T180-TRTYP NE 'H'.
....... your logic....
ENDIF.
Hope this helps
thanks,
KD
‎2008 Aug 14 9:47 PM
this did not help. When i manually remove the block and save, the block comes back again.
any other ideas
‎2008 Aug 15 1:30 PM
can you tell me what is the code you used in there.
Because that is exactly where I am using it and it is working.
Some time s another user-exit is invoked 'USEREXIT_MOVE_FIELD_TO_VBAK '
Please debug the program to check if this is being invoked.
Let me know if you have any questions
Thanks,
KD