最近有個案子碰到在Create Billing Doc時,很彈性的給定匯率
找了一下,有一支程式RV60AFZC裡面的EXIT可以自行加入程式碼直接將匯率寫入
以下是範例:
FORM USEREXIT_FILL_VBRK_VBRP.
DATA: L_UKURS LIKE TCURR-UKURS.
IF VBRK-WAERK NE 'TWD'.
CALL FUNCTION 'READ_EXCHANGE_RATE'
EXPORTING
CLIENT = SY-MANDT
DATE = SY-DATUM
FOREIGN_CURRENCY = VBRK-WAERK
LOCAL_CURRENCY = VBRK-STWAE
TYPE_OF_RATE = VBRK-KURST
IMPORTING
EXCHANGE_RATE = L_UKURS .
IF SY-SUBRC = 0.
VBRK-KURRF = L_UKURS.
ENDIF.
ENDIF.
ENDFORM.