cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in BAPI_SALESORDER_CREATEFROMDAT2 AMOUNT INCONSISTENCY

Former Member
0 Kudos

Hi there.. I'm creating SO using BAPI_SALESORDER_CREATEFROMDAT2. I successfully created SO in by checking VA03 but the amount is 2000.00 and the value should be 200.00. As I debug inside the program i can see that in order condition type ZPRO the condition value is 200. Is there any field that I forgot to fill?

Please help me. Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi There,

The BAPI would multiply the 'COND_VALUE' by 10. You can observe this in the debug mode. Hence the resolution for this is to divide the amount by 10 before passing it to the BAPI Conditions structure.

Naveen.

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

If you are passing amount to COND_VALUE, then you need to specify the currency in 'CURRENCY' or 'CURR_ISO' fields. If you are passing percentage value to COND_VALUE, then you need to specify the value with a comma (eg. 10.0% as 10,0000) and leave CURRENCY field balnk.

Cheers,

Satyanarayana.

Former Member
0 Kudos

Hi!

Check you specify currency code for amount. Should help.

Regards,

Maxim.

Former Member
0 Kudos

Hi divide the amount by 10 and then pass to the BAPI.

Satish

Former Member
0 Kudos

Hi Isagani,

I too faced this scenario when I used FM BAPI_SALESORDER_CREATEFROMDAT1 to create Sales Order.

The solution is to modify the population of pricing data as follows: For eg:

*- Call FM to get new qty based on SAP UOM

CLEAR: l_meins, l_qty, l_in_qty.

l_in_qty = it_data-qty.

CALL FUNCTION 'Z_GET_QTY_FROM_UOM'

EXPORTING

matnr = it_item-material

in_meins = it_data-uom

in_qty = l_in_qty

IMPORTING

out_meins = l_meins

quantity = l_qty.

IF sy-subrc = 0.

it_data-qty = l_qty.

it_data-uom = l_meins.

ENDIF.

it_data-qty = it_data-qty * 1000.

it_item-req_qty = it_data-qty.

it_item-sales_unit = it_data-uom.

it_item-req_date = it_data-date.

*- Pricing data

it_item-cond_type = it_data-kschl. "Pricing condition

CLEAR l_kbetr.

<b>l_kbetr = it_data-kbetr / 10. "Price (Rate)

it_item-cond_value = l_kbetr.</b>

APPEND it_item.

CLEAR it_item.

Regards,

Raj