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: 

SD Overwrite condition type value of subitem with value of mainitem

Former Member
0 Kudos

Hi,

Suppose we have a sales order with a material and a submaterial. On the head material a condition record for according a reduction is found. On the submaterial also but it's different.

Our requirement is that if there is a submaterial, the reduction on the submaterial should always be equal to the head material. I.o.w the reduction of the submaterial must be overwritten with the value of the head material.

I've tried messing around with duplicate condition records and also in some user exits but can't find anything.

Any ideas on this ?

with regards

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi, I had a problem somewhat similar to yours, it was with the conditions of the main item not appearing on the subitems, I put a case in OSS and they told me that once the sales order was created, I had to put the conditions for the subitems, I used the FM bapi_sales_order_change.

5 REPLIES 5

Former Member
0 Kudos

Hi, I had a problem somewhat similar to yours, it was with the conditions of the main item not appearing on the subitems, I put a case in OSS and they told me that once the sales order was created, I had to put the conditions for the subitems, I used the FM bapi_sales_order_change.

0 Kudos

Hi,

Which user-exit did you use to achieve this ? I don't find anything that can be ran after saving the sales order ?

with regards

Erik

Former Member
0 Kudos

I didn't use any exit, after creating the sales order, I check if there were substitute materials on the table vbap.

If you use substitution with subitems you have to do it this way, if you use substitution without subitems you have to do nothing.

example:

you enter material A, quantity 10, with subitems you end with a SO

pos material quantity

10 A 10 (blocked)

11 B 10 (subposition)

Without subitems you end with a SO like this

os material quantity

10 B 10 (all the values you entered in the bapi_sales_order_create are applied to this position)

Former Member
0 Kudos

Made a new requirement that checks if a higher level item exists. If it exists sy-subrc = 4 so that the condition search isn't executed. Works fine for me. Thanks for your info.

0 Kudos

hi i face the same problem and i built code like this.

using bapi_salesorder_change

just read a line from vbap table and pass the same values in bapi.

pass the submaterial reduction amt in shedule line item of head material.

shedule line confirm qty = reduction_amt.

shedule line confirm qty x = 'X'.

This can solve ur problem.