06-23-2005 4:31 PM
Hello SAP Developers,
My bapi creation of sales orders with pricing is failing.
The Pricing conditions I pass in to the bapi BAPI_SALESORDER_CREATEFROMDAT2 are not picked up for my item.
I'm filling in the
ITM_NUMBER
COND_TYPE
COND_VALUE
and
CURRENCY
fields of the ORDER_CONDITIONS_IN table. But the pricing analysis of the items don't seem to reflect the value passed.
I'd appreciate any suggestions.
Regards,
Jeff
08-19-2005 5:01 PM
Hi Jeff,
I don't understand: I did the same thing and it works for me.
You must make sure that the ITM_NUMBER in the condition table is the same as in the item and itemX tables and that the condition type is valid for the order type.
I have another issue with the conditions: First, I did not fill the currency field with the result that values where divided by 10. Now it's OK for currency values but still for percentage values it's unsolved: Percentage values appear in the order divided by 10; i.e. a value of '10.0' goes to the item condition as 1.000 %.
Until now, I am not willing to multiply all my percentage values by 10 hoping that there is a better way.
regards,
Clemens Li
08-19-2005 6:02 PM
Are you filling in the ORDER_CONDITIONS_INX table?
I had trouble working with this BAPI until I got a handle on the INX tables.
I've created a program called Z_BAPI_ORDER_SIM2 that creates orders using this BAPI. I'd be happy to share it with you.
08-19-2005 7:54 PM
Hi Ed,
if you used function module BAPI_SALESORDER_CREATEFROMDAT2, you may have noticed that there is a table parameter ORDER_CONDITIONS_IN of structure BAPICOND but no ORDER_CONDITIONS_INX table, at least not for (this company) release 46C.
Wherever I have X tables (as for items and schedules) I use a little form routine passing value fieldname an both parameter and corresponding X table. In my subroutine I assign field symbols dynamically to the fields in both tables - the value goes to the params table, 'X' goes to x table.
But still I don't know how to pass a percentage conditions value correctly all the more after I found this coding in the subsequently called function SD_SALESDOCUMENT_CREATE:
ex_konvkom-kbetr = conditions_in-cond_value / 10.
ex_konvkom-kbetr = conditions_in-cond_value * 10.
Still, if I put in a value of 10.00 [%], the value in the order will be 1 [%].
After I found the above coding (FORM MOVE_CONDITIONS_IN), I'll multiply my value by 10 beforehand and hope that after a release change everything will be the same
regards,
Clemens