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

default delivery block

Former Member
0 Likes
578

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

3 REPLIES 3
Read only

Former Member
0 Likes
530

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

Read only

0 Likes
530

this did not help. When i manually remove the block and save, the block comes back again.

any other ideas

Read only

0 Likes
530

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