cancel
Showing results for 
Search instead for 
Did you mean: 

userexit

Former Member
0 Kudos

dear gurs

Requirement in my project:material quantity has to fill automatically in sales order.

Based on sales document type, and customer, material number system has to pick order quantity fro imrg table.

For this any user exit we have,

Accepted Solutions (0)

Answers (3)

Answers (3)

Jelena
Active Contributor
0 Kudos

SD user exits are very well documented (there is a Wiki entry right here on SCN). What user exit to use depends on what exactly needs to happen. E.g. USEREXIT_SAVE_DOCUMENT_PREPARE is triggered only when a user saves the document. Changes that need to trigger other processes (ATP check, free goods determination, pricing, to name a few) need to be done much earlier.

Using a debugger, it is not difficult for an average ABAPer who knows at least something about SD to identify the most suitable user exit. This is rather an ABAP question than SD, so why not just leave it up to the ABAPer?

jignesh_mehta3
Active Contributor
0 Kudos

Hello,

IMRG is Table for Measurement Document.

Now, you will have to insert a ABAP Code in Program - MV45AFZZ - User Exit -

USEREXIT_FIELD_MODIFICATION or USEREXIT_MOVE_FIELD_TO_VBAP. Just speak to your ABAPer & he will do the needful.

Thanks,

Jignesh Mehta

former_member182378
Active Contributor
0 Kudos

Jignesh,

Why are you suggesting USEREXIT_FIELD_MODIFICATION?

Narra,

In my opinion, the best choice would be USEREXIT_MOVE_FIELD_TO_VBAP

jignesh_mehta3
Active Contributor
0 Kudos

Hello T W,

User Exit - USEREXIT_FIELD_MODIFICATION is processed for each Field in given Screen.

Now the requirement here is to Fill the Material Quantity automatically in Sales Order. Which means User should not Material Quantity & it should be determined from IMRG Table.

Thus by inserting a code in USEREXIT_FIELD_MODIFICATION we can make the Quantity Field in Sales Order in Grey (nnon-changeable mode). Thus the User would not be able to enter any Quantity here.

While if the ABAP code is written in USEREXIT_MOVE_FIELD_TO_VBAP then User will able to enter Material Quantity which will later be over-written by the User Exit.

Thanks,

Jignesh Mehta

former_member182378
Active Contributor
0 Kudos

Jignesh,

Thank you for your post!

One more question: If we use USEREXIT_FIELD_MODIFICATION could the requirement of automatic population of material quantity also be met "here"?

(i.e. field greyed-out & quantity automatically populated by using the above userexit?)

jignesh_mehta3
Active Contributor
0 Kudos

Hello T W,

Yes. Both requirements can be included in single ABAP Code in USEREXIT_FIELD_MODIFICATION.

Thanks,

Jignesh Mehta

Former Member
0 Kudos

The coding for inserting the Table-Field(IMRG-XXXX) can be done practically at  any of the forms of the include program MV45AFZZ. These forms are called at different time of the order processing. For example, if the purpose is to specify the order quantity no matter what the user enters manually, one can use FORM USEREXIT_SAVE_DOCUMENT or FORM USEREXIT_SAVE_DOCUMENT_PREPARE. Just before saving the document the codes in these forms are processed, thus the program will change the manually entered value with the value retrieved from the table-field (IMRG-XXXX) without giving the user a chance to change it in VA01 transaction. (However the input can be changed in VA02)

Message was edited by: Ashish Mohapatra

Former Member
0 Kudos

You can do the coding either at

FORM USEREXIT_SAVE_DOCUMENT_PREPARE.

or at

FORM USEREXIT_MOVE_FIELD_TO_VBAP.

of the include program MV45AFZZ.