function 求汇率

但使用SAP系统中提供了的对话框函数将减少许多开发工作。

 求汇率

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.

 

 

一、单位换算

call function 'Z_FICO_DWHS'

EXPORTING

a_matnr = tab01-ymatnr "物料号码

a_unit_from = 'PNL' "基本计量单位meins

a_unit_to = 'PC' "itab_fp-vrkme "销售单位

IMPORTING

a_rate = tybrgew.

 

posted @ 2017-11-02 17:28  以成Ronny  阅读(219)  评论(0编辑  收藏  举报