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 code

Former Member
0 Kudos

hi,

my requirement is as follows:

When the sales order is saved, i have to check each of the line item data and in that check shipping point country and shipto country(some conditions which i will take care).

Then i need to insert the sales order relevant data into the custom table. data such as SD doc number, item number, customer number etc.

So what I did was, in MV45AFZZ , in the FORM USEREXIT_SAVE_DOCUMENT, implemented the implicit enhancement (code enhancement). There I have to write the code to access all the line items and manipulate as states above. Hope I am clear. Any help with the code ? I am not able to find the correct field names and getting syntax errors. as well i dont know how i loop thru the line items ?

thks

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi

use this User Exit

USEREXIT_SAVE_DOCUMENT_PREPARE.

the User exit that u r using will get triggered after cata is geting saved not before .

Cheers

Snehi

4 REPLIES 4

Former Member
0 Kudos

hi

use this User Exit

USEREXIT_SAVE_DOCUMENT_PREPARE.

the User exit that u r using will get triggered after cata is geting saved not before .

Cheers

Snehi

0 Kudos

thanks. When will i get the SD document number ??VBELN ?? After save or before save ?

Also won't all the other data entered in the transaction be available in this user exit ??

0 Kudos

hi

The SD document number will be popuilated when this

USEREXIT_SAVE_DOCUMENT_PREPARE triggers

also u will get all this field here

like

SD doc number, item number, customer number .

Cheers

Snehi

vinod_vemuru2
Active Contributor
0 Kudos

Hi,

U r correct. In the user exit MV45AFZZ and in the FORM USEREXIT_SAVE_DOCUMENT u have item level data in internal table xvbap.

Loop at this table and and do ur validations. But it will not have the new sales order number that will be created(Since it is not created yet).

Thanks,

Vinod.