以下代码用户在程序中做汇率转化,请斧正。
代码语言:javascript复制 LV_LOCAL_WAERS = 'CNY'.
CLEAR LV_LOCAL_DMBTR.
CLEAR LV_DATE.
IF LS_EKBE-WAERS NE LV_LOCAL_WAERS.
LV_DATE = LS_EKBE-BUDAT.
CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'
EXPORTING
DATE = LV_DATE
FOREIGN_AMOUNT = LS_EKBE-DMBTR
FOREIGN_CURRENCY = LS_EKBE-WAERS
LOCAL_CURRENCY = LV_LOCAL_WAERS
IMPORTING
LOCAL_AMOUNT = LV_LOCAL_DMBTR
EXCEPTIONS
NO_RATE_FOUND = 1
OVERFLOW = 2
NO_FACTORS_FOUND = 3
NO_SPREAD_FOUND = 4
DERIVED_2_TIMES = 5
OTHERS = 6.
IF SY-SUBRC <> 0.
ENDIF.
ELSE.
LV_LOCAL_WAERS = LS_EKBE-WAERS.
LV_LOCAL_DMBTR = LS_EKBE-DMBTR.
ENDIF.