Skip to Content
-1
Jun 06, 2018 at 02:12 PM

I need to extend the bapi_acc_document_post to HZUON field

335 Views

Do the following but it does not work<br>

data: begin of ti_zsample occurs 0,

posnr type bseg-buzei,
hzuon type bseg-hzuon.
data: end of ti_zsample.

clear lt_bapiparex.
refresh lt_bapiparex.
if ls_header-document_type = 'Z1' and
( lt_item-sglindicator eq '1' or lt_item-sglindicator eq '4' ).
lt_bapiparex-structure = 'TI_ZSAMPLE'.
lt_bapiparex-valuepart1 = lv_posnr. "posicion
lt_bapiparex-valuepart2 = '0001'. "hzuon
append lt_bapiparex.
endif.

CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
EXPORTING
documentheader = ls_documentheader
customercpd = ls_customercpd
TABLES
accountgl = lt_accountgl
accountreceivable = lt_accountrec
accountpayable = lt_accountpay
accounttax = lt_accounttax
currencyamount = lt_curramount
extension1 = lt_extension1
extension2 = lt_bapiparex
return = lt_return.