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: 

BAPI Condition value multiplying by 10?

Former Member

Hi Experts,

I am using BAPI “BAPI_SALESDOCU_CREATEFROMDATA” to create sales order. Every thing fine except issues with condition value (COND_VALUE).

If I pass $5.10 to BAPIITEMIN-COND_VALUE in sales order value saved as 51.00. To fix this issue I divided by 10 to fix, so I am use to pass 0.51. But when condition value $5.12 I divide by 10, so value will be 0.51. So I am loosing the 2nd decimal place.

Can anyone tell me what’s the work around or am I doing right?

Thanks in advance, any help definitely rewarded.

Regards,

Trim

Code Sample

DATA: GL_MATNR_O(18) TYPE C,

GL_AMOUNT TYPE KWERT,

  • GL_AMOUNT TYPE MINLF,

  • GL_AMOUNT TYPE LABST,

GL_AMOUNT_C(13) TYPE C,

GL_KSCHL TYPE KSCHL.

      • Condition and condition value

IF P_GS_P01-AMOUNT NE 0.

GL_AMOUNT = P_GS_P01-AMOUNT.

GL_AMOUNT = GL_AMOUNT / 10.

GL_AMOUNT_C = GL_AMOUNT.

GT_ITEMS_P01-COND_TYPE = GL_KSCHL.

  • GT_ITEMS_P01-COND_VALUE = P_GS_P01-AMOUNT.

GT_ITEMS_P01-COND_VALUE = GL_AMOUNT_C.

  • GT_ITEMS_P01-COND_VALUE = P_GS_P01-AMOUNT.

ENDIF.

5 REPLIES 5

Former Member

Pass BAPIITEMIN-CURRENCY.

Thanks any way.

0 Kudos

pass the same currency field in conditions_in & condition_inx

manoranjan

0 Kudos

Thanks, this was the correct solution in my case!

GauthamV
Active Contributor
0 Kudos

Did you check in debug mode why $5.1 is changed to 51 ?

0 Kudos

Hi,

In my case, I needed to pass the value in the structure:


ORDER_CONDITIONS_IN-CURRENCY = 'BRL'
ORDER_CONDITIONS_INX-CURRENCY = 'X'

Regards!