loopat it_vbap.
header_ch_inx-updateflag = 'U'.
item_ch-itm_number = it_vbap-POSNR.
APPEND item_ch. " <<<<<<
item_ch_inx-ITM_NUMBER = it_vbap-POSNR .
item_ch_inx-UPDATEFLAG = 'D'.
APPEND item_ch_inx.
ENDLOOP.
at the end you should call the function
BAPI_TRANSACTION_COMMIT