1. 程式人生 > >更新會計憑證行專案BSEG-SGTXT函式

更新會計憑證行專案BSEG-SGTXT函式

DATA : W_BSEG LIKE BSEG,
LT_FLDTAB TYPE TPIT_T_FNAME WITH HEADER LINE,
LW_FLDTAB TYPE TPIT_T_FNAME,
LW_BUZTAB TYPE TPIT_T_BUZTAB,
LT_BUZTAB TYPE TPIT_T_BUZTAB WITH HEADER LINE,
LW_ERRTAB TYPE TPIT_T_ERRDOC.

W_BSEG-SGTXT = ‘更新的憑證資料’
LT_FLDTAB-FNAME = ‘SGTXT’.
APPEND LT_FLDTAB.
WAIT UP TO ‘0.2’ SECONDS.
CALL FUNCTION ‘FI_ITEMS_MASS_CHANGE’
EXPORTING
S_BSEG = W_BSEG
IMPORTING
ERRTAB = LW_ERRTAB
TABLES
IT_BUZTAB = LT_BUZTAB
IT_FLDTAB = LT_FLDTAB
EXCEPTIONS
BDC_ERRORS = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
T_RETURN-TYPE = ‘E’.
T_RETURN-MESSAGE = ‘金稅號回寫到憑證更新出錯!’.
APPEND T_RETURN.
ENDIF.