- SAP Community
- Groups
- Interest Groups
- Application Development
- Discussions
- Divide DMBTR by exchange rate ( SAp filed BAPI1093...

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.

Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

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

Former Member

Options

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

05-05-2009 3:28 AM

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

- SAP Managed Tags:
- ABAP Development

1 ACCEPTED SOLUTION

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

05-05-2009 6:47 AM

Check this output.

```
data : gv_fx_rate_EUR_DUE type UKURSP , "(BAPI1093_0-EXCH_RATE, Direct Quoted Exch Rate)
gv_fx_rate_EUR_DUE1 type UKURSP ,
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.
data:GV_XCH_F_EUR type p decimals 2,
GV_XCH_F_EUR_due1 type p decimals 2,
result_dmbtr type p decimals 2.
Start-of-selection.
gv_fx_rate_eur_due = '325.00000'.
gv_from_factor = 100.
gv_to_factor = 1.
AMOUNT_DMBTR = '31000.00'.
GV_XCH_F_EUR = GV_FX_RATE_EUR_DUE * gv_to_factor.
GV_XCH_F_EUR_DUE1 = ( GV_XCH_F_EUR / gv_from_factor ).
RESULT_DMBTR = amount_dmbtr / GV_XCH_F_EUR_DUE1 .
end-of-selection.
write: RESULT_DMBTR.
```

- SAP Managed Tags:
- ABAP Development

1 REPLY 1

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

05-05-2009 6:47 AM

Check this output.

```
data : gv_fx_rate_EUR_DUE type UKURSP , "(BAPI1093_0-EXCH_RATE, Direct Quoted Exch Rate)
gv_fx_rate_EUR_DUE1 type UKURSP ,
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.
data:GV_XCH_F_EUR type p decimals 2,
GV_XCH_F_EUR_due1 type p decimals 2,
result_dmbtr type p decimals 2.
Start-of-selection.
gv_fx_rate_eur_due = '325.00000'.
gv_from_factor = 100.
gv_to_factor = 1.
AMOUNT_DMBTR = '31000.00'.
GV_XCH_F_EUR = GV_FX_RATE_EUR_DUE * gv_to_factor.
GV_XCH_F_EUR_DUE1 = ( GV_XCH_F_EUR / gv_from_factor ).
RESULT_DMBTR = amount_dmbtr / GV_XCH_F_EUR_DUE1 .
end-of-selection.
write: RESULT_DMBTR.
```

- SAP Managed Tags:
- ABAP Development