REPORT ztest_xk18.
DATA: lv_cny TYPE wrbtr,
lv_jpy TYPE wrbtr.
DATA: ret TYPE bapireturn.
CALL FUNCTION 'BAPI_CURRENCY_CONV_TO_INTERNAL'
EXPORTING
currency = 'JPY'
amount_external = '100000'
max_number_of_digits = 23
IMPORTING
amount_internal = lv_jpy
return = ret.
IF ret IS NOT INITIAL.
MESSAGE ID ret-code(2) TYPE ret-type NUMBER ret-code+2(3)
WITH ret-message_v1 ret-message_v2 ret-message_v3 ret-message_v4.
ENDIF.
CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'
EXPORTING
date = sy-datum
foreign_amount = lv_jpy
foreign_currency = 'JPY'
local_currency = 'CNY'
IMPORTING
local_amount = lv_cny.
WRITE: lv_jpy,lv_cny.
网友评论