06-15-2006 11:11 AM
Hi guys,
I'm creating a sales order with function module BAPI_SALESORDER_CREATEFROMDAT2.
The problem I'm having is that I want to change one of the rates on a percentage based condition type when I create the sales order.
I pass the data in the parameter ORDER_CONDITIONS_IN and set the COND_UPDAT field to 'X'. When the sales order gets created though, two condition records are created for this condition type. One is created with the determined rate (from pricing) and another one with the rate that I passed to the BAPI.
I am aware that there is a ORDER_CONDITIONS_INX parameter in 4.7 (and an UPDATEFLAG field) however we are on version 4.6c here and that parameter is not available.
Has anybody managed to do something similar in version 4.6C?
Many thanks
Fuad
06-15-2006 2:47 PM
<i>you don't have to pass the bapisdls at all. 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.</i>
Hi Vijay,
I copied your answer here that you posted in a new thread so that others can have a background to the problem.
06-15-2006 11:30 AM
I believe you follow this pattern for condions in your FM. If so it should work properly. It's not need for COND_UPDAT,I believe.
* header condition
bapicond-itm_number = '000000'.
bapicond-cond_type = 'CON1'.
bapicond-cond_value = zval1.
APPEND bapicond.
*condition is for any position
bapicond-itm_number = cont_pos_item.
bapicond-cond_type = 'CON2'.
bapicond-cond_value = zval1.
bapicond-currency = curr.
APPEND bapicond.
I believe this is helpful for you.
rgds,
Thomas.
06-15-2006 11:38 AM
Hi Thomas,
This is the pattern that I am following and it creates manually entered conditions okay.
However when I pass a condition record with a rate to the BAPI, and if this condition type (and rate) is automatically determined from pricing, then it creates two condition records when the sales order gets created
06-15-2006 11:48 AM
Hi,
Try this....
update the BAPISDLS structure(Logical Switch) with the following and pass to BAPI.
BAPISDLS-PRICING = 'C'.
if 'C' doesnt work, try all the options, to know all the options go to the value range of domain KNPRS.
Sreedhar
06-15-2006 12:29 PM
Hi,
It doesn't mean its creating duplicate condition records.
Condition records are the ones that you're maintaining in pricing using VK11/VK12. What you're facing is duplicate entries present in sales order conditions tab, one entry determined from the condition record in pricing, and another entry which you've passed in your BAPI. Try passing F in your bapisdls pricing structure.
Else, you'll need to do a slight change in configuration. The condition type setting maintain 'B' for manual entries, saying - manual entry has priority. I think that should solve your problem. Award points if these things help.
Regards,
Vijay
06-15-2006 12:44 PM
Vijay hi,
I have changed the configuration for the condition type to "Manual entry has priority". However the BAPI does not allow me to use pricing type "F" for the logic switch.
It returns the error "F is not allowed for LOGIC_SWITCH-PRICING".
Could this be part of the problem?
06-15-2006 12:49 PM
since you've maintained manual entries. don't pass the logic switch at all. just pass the condition type parameters in the conditions_in table. That should be it.
06-15-2006 12:54 PM
you don't have to pass the bapisdls at all since u've done manual entry has priority in the condition type.
06-15-2006 12:06 PM
Hi Fuad,
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.
Hope this helps.
Regds,
Akshay Bhagwat
Note: Pls mark helpful answers.
06-15-2006 12:32 PM
Hi,
The LOGIC_SWITCH doesn't seem to work, the only ones it allows me to use are "B" and "C" and neither of these have fixed the problem.
Akshay, I'm hoping I can avoid having to call the change BAPI again to update the rate on the condition type. I will have a look at the possibility of changing the condition type to manual first.
Thanks to all for your input so far.
Regards
Fuad
06-15-2006 2:47 PM
<i>you don't have to pass the bapisdls at all. 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.</i>
Hi Vijay,
I copied your answer here that you posted in a new thread so that others can have a background to the problem.
06-15-2006 7:09 PM
07-03-2006 2:55 PM
Hi Vijay,
Apologies for only replying now, but just to let you and others know, I managed to fix my problem by using pricing type "G" with parameter LOGIC_SWITCH.
Thank you
Regards
Fuad
03-05-2008 1:01 PM
I still having the duplicate problem, Allready tried with the Logic Switch (All pricing values 'A' to'K').
If I set a 'G' in Logic_Switch-pricing, some conditions still duplicating with amount 0(Zero).
12-22-2011 12:32 PM
Hello,
I am not sure if the problem is still alive.
I faced the same problem and found some useful information in oss notes, by which I found the solution.
Please check notes 574088, 593246 + related notes
Rgds,
Viktor Bojtos
Hungary
04-08-2015 4:03 PM
I have faced this Same issue lately ..
and the Solution was:
the SD Consultant Changed the Type of the Condition type to Manual Pricing instead of Automatic Pricing