‎2010 Jan 27 11:33 AM
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
‎2010 Jan 27 11:36 AM
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
‎2010 Jan 27 11:44 AM
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.
‎2010 Jan 27 11:44 AM
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
‎2010 Apr 01 11:30 AM
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
‎2010 Apr 01 9:13 PM
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.
‎2011 Oct 26 5:13 PM
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.
‎2011 Oct 26 5:25 PM
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.
‎2011 Oct 26 6:56 PM
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
‎2011 Oct 26 7:30 PM