Skip to Content
0
Former Member
May 05, 2009 at 02:28 AM

Divide DMBTR by exchange rate ( SAp filed BAPI1093_0- EXCH_RATE)

75 Views

Hi

I would like the divede the value of DMBTR(Amount in Local currency) by EXCH_RATE(Direct Quoted Exchange Rate - SAP field BAPI1093_0- EXCH_RATE)

In my data, I have Exchnage rate as 3.25000 and amount as 310000.00

Exchange rate was stored in the field : V_EXCH_RATE, the data type is BAPI1093_0- EXCH_RATE

Amount was stored in the field : Amount_dmbtr, the data type is BSID-DMBTR.

Result have to stored in Result_dmbtr, the data type is BSID-DMBTR.

That is

Result_dmbtr = amount_dmbtr / v_exch_rate.

Result_dmbtr = 310000.00 / 3.25000

expected result is : 9538.461538

But I am getting value as : 0.10.

If I multiply amount_dmbtr by 1000 then this will become 31000000.

If I do calculation as 31000000 / 3.25 getting result as 95.38. Again I am muliplying this by 100 and got result as 9538. I would like to know the logic behind this.

see the piece of code

data : gv_fx_rate_EUR_DUE type UKURSP , "(BAPI1093_0-EXCH_RATE, Direct Quoted Exch Rate)

gv_from_factor type FFACT_CURR, "BAPI1093_0-FROM_FACTOR(From Factor)

gv_to_factor type TFACT_CURR, "BAPI1093_0-TO_FACTOR(To factor)

Amount_dmbtr type dmbtr.

Start-of-selection

gv_fx_rate_eur_due = 325.00000

gv_from_factor = 100

gv_to_factor type = 1

AMOUNT_DMBTR = 31000.00

GV_XCH_F_EUR = GV_FX_RATE_EUR_DUE * gv_to_factor.

GV_XCH_F_EUR_DUE_01 = ( GV_XCH_F_EUR / gv_from_factor ).

Result_dmbtr = amount_dmbtr / GV_XCH_F_EUR_DUE_01

final output :

result_dmbtr = 0.10.

But expected output is : 9538.46.

Regards

Vijay