ABAP:BAPI_ACC_DOCUMENT_POST擴充套件欄位
阿新 • • 發佈:2019-01-07
READ TABLE lt_alv INDEX 1.
IF sy-subrc = 0.
documentheader-comp_code = lt_alv-bukrs.
documentheader-fisc_year = lv_endda+0(4)..
documentheader-fis_period = lv_endda+4(2).
documentheader-doc_date = lv_endda.
documentheader-pstng_date = lv_endda.
documentheader-doc_type = 'SA'.
documentheader-header_txt = '計提存貨跌價準備'.
documentheader-username = sy-uname.
LOOP AT lt_alv.
item = item + 1.
accountgl-itemno_acc = item.
accountgl-comp_code = lt_alv-bukrs.
accountgl-doc_type = 'SA'.
accountgl-plant = lt_alv-werks.
accountgl-gl_account = '1471000010'.
accountgl-material = lt_alv-matnr.
APPEND accountgl.
currencyamount-itemno_acc = item.
currencyamount-currency = 'CNY'.
currencyamount-amt_doccur = lt_alv-zytje * ( -1 ).
APPEND currencyamount.
CLEAR extension2.
CLEAR wa_zsfi040.
wa_zsfi040-posnr = item.
wa_zsfi040-bschl = '50'. "記賬程式碼 增強欄位
extension2-structure = 'ZSFI040'.
extension2-valuepart1 = wa_zsfi040.
APPEND extension2.
CLEAR:accountgl,currencyamount.
IF sy-subrc = 0.
documentheader-comp_code = lt_alv-bukrs.
documentheader-fisc_year = lv_endda+0(4)..
documentheader-fis_period = lv_endda+4(2).
documentheader-doc_date = lv_endda.
documentheader-pstng_date = lv_endda.
documentheader-doc_type =
documentheader-header_txt = '計提存貨跌價準備'.
documentheader-username = sy-uname.
LOOP AT lt_alv.
item = item + 1.
accountgl-itemno_acc = item.
accountgl-comp_code = lt_alv-bukrs.
accountgl-doc_type = 'SA'.
accountgl-plant = lt_alv-werks.
accountgl-gl_account = '1471000010'.
accountgl-material = lt_alv-matnr.
APPEND accountgl.
currencyamount-itemno_acc = item.
currencyamount-currency = 'CNY'.
currencyamount-amt_doccur = lt_alv-zytje * ( -1 ).
APPEND currencyamount.
CLEAR
CLEAR wa_zsfi040.
wa_zsfi040-posnr = item.
wa_zsfi040-bschl = '50'. "記賬程式碼 增強欄位
extension2-structure = 'ZSFI040'.
extension2-valuepart1 = wa_zsfi040.
APPEND extension2.
CLEAR:accountgl,currencyamount.