当用BAPI_ACC_DOCUMENT_POST做凭证期初导入时,会导入外币,在这里有两种做法。
1,直接指定汇率(会存在尾差)。
2,直接输入本地和外币金额(不会存在尾差)
IF WA_POST-WAERS <> 'CNY'.
L_CURRENCYAMOUNT-AMT_DOCCUR = L_DMBTR. "金额
L_CURRENCYAMOUNT-CURR_TYPE = '10'.
L_CURRENCYAMOUNT-CURRENCY = 'CNY'.
APPEND L_CURRENCYAMOUNT TO LI_CURRENCYAMOUNT.
L_CURRENCYAMOUNT-AMT_DOCCUR = L_WRBTR. "金额
L_CURRENCYAMOUNT-CURR_TYPE = '00'.
L_CURRENCYAMOUNT-CURRENCY = WA_POST-WAERS.
APPEND L_CURRENCYAMOUNT TO LI_CURRENCYAMOUNT.
ELSE.
L_CURRENCYAMOUNT-AMT_DOCCUR = L_WRBTR. "金额
L_CURRENCYAMOUNT-CURRENCY = WA_POST-WAERS.
APPEND L_CURRENCYAMOUNT TO LI_CURRENCYAMOUNT.
* L_CURRENCYAMOUNT-EXCH_RATE = ( WA_POST-DMBTR ) / WA_POST-WRBTR. "汇率
ENDIF.