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 for Sales order text

Former Member
0 Kudos

Hi friends,

I am doing one user exit. could you please guide me . I have a requirement like this.

When a sales order is saved (either during creation mode VA01 or change mode (VA02), and the sales order is not en ECOM order (EDI/WEB/XML), a new system message must be processed in case a sales hold code was applied at one of the sales order items or at sales order header level.

The system message itself will be set up in SAP with the following text:

Sales Order i.e Order number has been saved. Holds exist. Please check.

For this requirement i found exit by name Userexit_Save_Document_Prepare.

In this exit how we are going to the code. please guide me.

With Regards,

B.Raghu.

2 REPLIES 2

Former Member
0 Kudos

Hi,

you can put it either in Userexit_Save_Document_Prepare and in Userexit_Save_Document (located in the same include MV45AFZZ) , just before the first you nominated.

I would use the second better than the first, because in the preapare you won't be certain the document will be effectively saved, while the second is triggered when all controls have been passed.

Former Member
0 Kudos

How do you know "ECOM Order"?

What constitutes a "HOLD"?

I'd do something like:

In USEREXIT_SAVE_DOCUMENT_PREPARE (SAVE has been pressed at this point and SAVE_DOCUMENT is to fire off other processes, etc).

...

IF sy-tcode eq 'VA01' or sy-tcode eq 'VA02'.
  if vbak-something (identify your ECOM order)
    loop at vbap transporting no fields (Think it's back to VBAP at this point) 
    where... (look for your hold indicator in every row) 
  endloop.
if sy-subrc eq 0. "found the hold
 message innn(class) display like 'E'.
endif.
endif.
endif.

Be VERY careful with ANYTHING that you put into SAVE_DOCUMENT exit form.