Monday, June 29, 2009

WRBTR value or external value

Amount that SAP stored in Database, is not in real value.
Example : you have 1000 JPY.
this amount will convert to 10 in SAP database.


how do i know database value of amount
if you have an amount, for example 1000 in your variable, what is database value ?

you can use function BAPI_CURRENCY_CONV_TO_INTERNAL to get database value or internal value of an amount, (in this case, this function will return 10).


how do i know real value of amount ?
if you select an amount from database, and you get 40, what is external value or real value ?
You can use : WRITE var_amount TO CURRENCY currency
this will format the result with user setting (decimal places and thousand separator)
example :

LV_AMOUNT = 40.
WRITE LV_AMOUNT TO CURRENCY 'JPY'.
the output will be 4000

Or you can call function
BAPI_CURRENCY_CONV_TO_EXTERNAL
You will get real value in decimal data type.

good luck... :)


1 comment: