2014 Jan 17 7:53 AM
I am using the BAPI BAPI_SALESORDER_CREATEFROMDAT2 to create sales order in our SAP system. I am passing condition type ZABC along with its value in the table ORDER_CONDITIONS_IN. We have some materials in our system for which condition records are maintained and for some no records exists.
A value for condition type will always be passed to the BAPI at every call.
What the requirement is that if the condition record exists for that material, the sales order should be created using the price from the condition record or else if no condition record exists the price which we are passing to the BAPI should be updated.
If i am using
LOGIC_SWITCH-PRICING = 'B'.
the condition record value is being overwritten.
IF
LOGIC_SWITCH-PRICING is not being used and a condition record exists, BAPI is throwing an error message ZABC cannot be entered manually. If no condition record exists, sales order is getting generated with the value being passed to the BAPI.
How to proceed??
2014 Jan 17 8:12 AM
Hi Rohit,
I think this thread might be useful to you, http://scn.sap.com/message/8969882#8969882
for those records for which condition records doesn't exist you can follow the procedure in that thread
I think there can be two ways.
1. Create SAles order as you are creating without pasing any value for this condition type. and then change this condition value ( which is being determined automatically) by using BAPI_SALESORDER_CHANGE wher you can use Update flag as 'X' In parameter CONDITIONS_INX of this BAPI.
<b>OR</b>
2. If you want to happen this chage at the time of sales order creation, then I think , this particual condition type should be "manual" and not "Automatic" One.
change the configuration for the condition type to "Manual entry has priority"
IF you've changed manual entry has priority don't pass PRICING parameters BAPISDLS at all. just pass the condition type in the conditions_in. that should be it
Just don't pass the BAPISDLS make sure that you're passing kschl, kbetr kmein kwert in the conditions_in parameter to the bapi. That should do it
Hope this helps.
Happy Coding,
Santhosh Yadav
2014 Jan 17 9:15 AM
Hi Santhosh
Thanks for your reply.
How to determine before calling the bapi that some condition record exists for this material. There can be various key combinations.
I dont want to change the pricing condition type in case the value is being picked from the condition record.
Only in case no condition record exists the value I am passing through BAPI should be updated against the condition type ZABC in the sales order.
2014 Jan 17 9:30 AM
Hi Rohit,
Check tables A004 and A005.
Was that helpful?
Happy Coding,
Santhosh Yadav
2014 Jan 17 9:48 AM
Currently we have 9 key combinations which might increase in future as per requirement, I guess there will be different tables for each key combination.
So you are suggesting that I should check for values in each of the key combination tables and if there exists a record in any of the table then I should not send the value against ZABC cond. type in the table ORDER_CONDITIONS_IN ?
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |