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: 

Issue in BAPI_SALESORDER_CREATEFROMDAT2

Former Member
0 Kudos

Hi All,

I am using the BAPI : BAPI_SALESORDER_CREATEFROMDAT2 for creating the sale order. It works as expected. But the condition value which I pass through the parameter: ORDER_CONDITIONS_IN gets multiplied by 10. Please note that I am not passing the currency value. I have debugged the code and I have found that if we dont pass a currency value, then SAP automatically multiplies the condition value by 10.  Could you please tell me why SAP has introduced this logic? If I need to resolve this issue, do I need to pass my condition value as (condition value / 10). ?

Thanks,

Selva.

5 REPLIES 5

former_member458055
Participant
0 Kudos

Hi,

Yes you should pass the value/10 in your logic.

You can observe the same in KONV table.

Divide the value and proceed.

Regards-

Makarand

0 Kudos

Any reasons for this SAP logic? Why do they implement it ?

The BAPI has this in its documentation for that parameter:

When you complete the COND_VALUE and CURRENCY fields, you must decide which of the following applies:

  • The condition calculation type is expressed in percentage (the T685A-KRECH field contains AHI)
    In this case you should leave the CURRENCY field blank and enter the percentage value with a comma
    Example:
    Enter percentage rate 20% as 20,0000 in the COND_VALUE field.
  • The condition calculation type is not expressed in percentage
    In this case the COND_VALUE field is a currency quantity field. You must enter the CURRENCY or CURRENCY_ISO field so that the correct conversion takes place. Again, you must enter the amount kommagerecht.

If neither the CURRENCY or the CURRENCY_ISO fields are completed, the entry is issued as a percentage value. This could lead to an incomplete entry if the condition type is not in percentages.

I think (based on the 2nd bullet) for non-percentages, you pass CURRENCY as well. (or manually do the division...but then watch out for rounding issues).

Jeremy H.

Former Member
0 Kudos

If you don't pass currency information, system assumes that it is not a currency but % rate .  While storing '%' in DB table ,  SAP replaces '%' with '0'  . That means 10% is stored as 100.

To get the correct value, the rate amount is divided by 10.  I believe, standard SAP does not divide by 10 directly but uses some FM's like  "BAPI_CURRENCY_CONV_TO_EXTERNAL" & "BAPI_CURRENCY_CONV_TO_INTERNAL" to arrive at the correct figure.

Also check the following external link on how SAP stores currency information

Handling Currencies having Zero Decimals in SAP ABAP ~ New To SAP  ( external link ).

former_member196157
Active Participant
0 Kudos

hiii,

Divide Value By 10 and then pass it to BAPI

This the Solution