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: 

currency conversion help reqd

Former Member
0 Kudos

Hi Folks,

When I check for an entry in the table BSEG, it displays the value of the field PSWBT as 200.00, but when I double click the row and check the value it was 20000. the local currency was USD and the foreign currency(field PSWSL) was JPY. In the select statement I was able to fetch the value 200 only. Could you pls tell me how to fetch the exact value 20000 .

regards,

nani

9 REPLIES 9

Former Member
0 Kudos

Hello,

The currency JPY will not have a decimal value. Thats why the system internally multiplies the value by 100. So you have to do the same thing after fetching the value after the select. If the curreny is JPY, then multiply the value by 100.

Vikranth

Former Member
0 Kudos

System follows some conversion factors for couple of currencies.

For JPY,HUF,KRW.... it multiplies by 100 , for 'ITL' by 1000 and so on

You can multiply 100 with JPY currencies to get with your requirement.

Manas M.

SuhaSaha
Advisor
Advisor
0 Kudos

Hello Nani,

If you use the addition CURRENCY while displaying the amount, SAP will auto-format this & mutliply by 100.

Make sure you use this addition while displaying any amount field.

Else you can use this code to get the correction factor :

DATA:
 v_curr TYPE waers,
 l_corr_factor TYPE i,
 lf_bapi1090_1 TYPE bapi1090_1.
CALL FUNCTION 'BAPI_CURRENCY_GETDECIMALS'
  EXPORTING
    currency          = v_curr
  IMPORTING
    currency_decimals = lf_bapi1090_1.
IF lf_bapi1090_1-curdecimals EQ 2.
  l_corr_factor = 1.
ELSE.
  l_corr_factor = 10 ** ( 2 - lf_bapi1090_1-curdecimals ).
ENDIF.

BR,

Suhas

Former Member
0 Kudos

Dear,

Could you write to me where I can turn off this function in SAP?

Thank you in advance for your help.

Anka

Edited by: Anka on Apr 1, 2010 12:49 PM

Former Member
0 Kudos

When trying this BAPI under SE37 I get this for CTRLSHIFTF3 (Where used)

Function Module BAPI_CURRENCY_GETDECIMALS not found in Programs (possibly dynamic calls!)

Message no. ES200

which makes me think it cannot be deactivated on demand.

Former Member
0 Kudos

Check out function: CURRENCY_AMOUNT_SAP_TO_DISPLAY

It looks at table TCURX. I'm not sure if this is the best function to use. I was looking for a FM where you plug in info from BKPF and/or BSEG, the from currency and the to currency, reads the conversion factor from table TCURF, does whatever logic is necessary, and returns the result.

Former Member
0 Kudos

I'm going to add another note here. I noticed the currency KRW had a factor of 1 in the TCURF table (not 100 like JPY), yet when I display data in transaction FS10N, it is multiplying by 100. It is using the TCURX table. So, for my purposes, I think I will stick with FM CURRENCY_AMOUNT_SAP_TO_DISPLAY.

Former Member
0 Kudos

CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'

EXPORTING

CLIENT = SY-MANDT

date = SY-DATUM

foreign_amount = V_FA " Foreign Amount

foreign_currency = 'USD' " Foreign Currency Key

local_currency = 'EUR' " Local Currency Key

RATE = Rate " Exchange Rate

IMPORTING

LOCAL_AMOUNT = V_LA " Local Amount

0 Kudos

Bear in mind the date of the OP.

Rob