matinal:SAP ABAP 汇率函数记录

2023-10-14 15:02:52 浏览数 (2)

直接上代码

代码语言:javascript复制
CALL FUNCTION 'CALCULATE_EXCHANGE_RATE'

EXPORTING

DATE = ITAB1-INVDT

FOREIGN_AMOUNT = ITAB1-AMT

FOREIGN_CURRENCY = ITAB1-CURR

LOCAL_AMOUNT = ITAB1-AMTNTD

LOCAL_CURRENCY = 'NTD'

TYPE_OF_RATE = 'M'

IMPORTING

EXCHANGE_RATE = ITAB1-EXRAT

* FOREIGN_FACTOR =

* LOCAL_FACTOR =

EXCEPTIONS

NO_RATE_COMPUTABLE = 1

NO_RATE_FOUND = 2

RATE_TOO_BIG = 3

* NO_FACTORS_FOUND = 4

NO_SPREAD_FOUND = 5

OTHERS = 6.

CALL FUNCTION 'READ_EXCHANGE_RATE'

EXPORTING

date = eket-eindt

foreign_currency = ekko-waers

local_currency = 'NTD'

type_of_rate = 'M'

IMPORTING

exchange_rate = zexchange_rate

FOREIGN_FACTOR =

LOCAL_FACTOR =

VALID_FROM_DATE =

EXCEPTIONS

no_rate_found = 1

no_factors_found = 2

no_spread_found = 3

OTHERS = 4.

0 人点赞