cancel
Showing results for 
Search instead for 
Did you mean: 

User exit in sales order

Former Member
0 Kudos

Hi All,

I want to know if there is a way (user exit) that could look at the Sales Order Type , particular Item Pricing Condition and Ship-to party State and set the materialu2019s tax classification (VBAP/TAXM1) to u201C0u201D (Exempt) ?

Thanks in Advance!

Sonali.

Accepted Solutions (0)

Answers (4)

Answers (4)

Lakshmipathi
Active Contributor
0 Kudos

Dear Sonali

I dont think, this requirement will be a regular one. Only occasionally this will come. In such cases, you can very well change the tax classification in sale order itself at Header level "Billing Document" tab. For occasional requirement, it is not recommended to apply user exit.

thanks

G. Lakshmipathi

Former Member
0 Kudos

Thank You all for the replies!

Lakshmipathi -- This requirement is not a regular one right now but it may be once the business decides to consider for other states also. So, they want an automated process.

GSL -- I will try with the user exit. Instead of pricing condition I can use the Usage Code of Item also. So, hopefully the user exit works.

Thanks,

Sonali.

Former Member
0 Kudos

I am sure it will work because we are using the exit to change the tax classification but for different reasons than that of yours.

Regards,

GSL.

Former Member
0 Kudos

Hi GSL,

I have put the code in the user exit, and I am able to set the tax classification indicator but I have a problem... Before setting the indicator I need to check for the Usage code of the line item (This code I am using instead of checking the Pricing condition) . I am able to read all the values of line item in VBAP structure in the user exit except for the first time this user exit is hit as soon as a line item is entered it is not picking up the Usage code. That field is blank.

But if add another line item and go into the user exit I can see the previous line item Usage code in XVBPA table.

Do you have any idea why usage code is missing in VBAP structure in the user exit or is there any other table or structure where I can get the usage code?

Please let me know if any one have any ideas.

Thanks in Advance!

Sonali.

Former Member
0 Kudos

Probably the data of that particular field is not being sent to the exit when it is called and subsequenty filled.

Try other options:

1) You can use usage in header, if it is common for the entire document (from your post it doesnt seem so), which will be filled in VBAK structure and you can do the necessary validations based on that.

2) Instead of using usage field use material group 1 or 2 or...5. The value entered in the field MVGR1 to 5 will be filled when exit is called and you can do the validations based on the value in this field.

Regards,

GSL.

Former Member
0 Kudos

GSL,

Thanks for the reply.

I cannot use the usage code at the header becuase I need to determine the item level usage code for my validations and also I cannot use the Material group based on my business conditions.

So, I am thinking of ther way to uniquely identify the item.

I have another issue...

This user exit is triggered only when the material number changes other than that if we change any other field at item level it doesn't get trigger. Is there any other exit which gets triggered as soon as any value at item level changes?

Thanks in advance!

Sonali.

Former Member
0 Kudos

The exit will not be triggered when the line item is entered. You can check out FILL_VBEP as this will be called whenever the quantity changes.

We do face this kind of problems and in such cases the option is to write the code at both the places i.e. FILL_VBAP and SAVE_DOCUMENT_PREPARE.

Regards,

GSL.

Former Member
0 Kudos

Thank You All!

Issue resolved.

Former Member
0 Kudos

Hi Sonali.

All the parameters which you have specified can be accessed by Customer Master Records & Material Master Records. During the processing of sales order, system tries to retrieve the data / information from master records.

For this, User Exit is not necessary.

Warm Regards,

Kiran.S.

Former Member
0 Kudos

You can do it using exit USEREXIT_MOVE_FIELD_TO_VBAP in program MV45AFZZ. Write the code to compare the values of document type and customer state and then replace the defaulted tax classification to 0. Item pricing condition may be an issue because when the exit is called the item conditions may not be filled. Check with your abaper whether you can include item condition also.

Regards,

GSL.

Former Member
0 Kudos

This should be driven based off of the customer master and material master combination. Shouldn't need to use an exit. The customer master overrides the material master so make all the tax settings on the customer master exempt.