Hi ;
I am working on the BAPI_SALEDOCUMENT_CHANGE trying to delete line item with type 'ZTDC' from sales order.
For this purpose, I am writing a program bellow and I am calling BAP_TRANSACTION_COMMIT FM.
Unfotunately, nothing is changed with no return error. can you help me to understand what's wrong in my program!
header_ch_inx-UPDATEFLAG = 'U'.
select * from vbap INTO CORRESPONDING FIELDSOFTABLE it_vbap
WHERE vbeln eq v_vbeln and PSTYV eq'ZTDC'.
loopat it_vbap.
header_ch_inx-updateflag = 'U'.
item_ch-itm_number = it_vbap-POSNR.
item_ch_inx-ITM_NUMBER = it_vbap-POSNR .
item_ch_inx-UPDATEFLAG = 'D'.
APPEND item_ch_inx.
ENDLOOP.
CALL FUNCTION'BAPI_SALESDOCUMENT_CHANGE'"BAPI Change Sales Document
EXPORTING
salesdocument = v_vbeln " bapivbeln-vbeln Sales and Distribution Document Number
order_header_in = header_ch " bapisdhead1 Sales Document Header
order_header_inx = header_ch_inx " bapisdhead1x Sales Document Header Checkbox
* simulation = SPACE " bapiflag-bapiflag Simulation Mode
TABLES
return = return_ch " bapiret2 Return Code
item_in = item_ch " bapisditem Sales and Distribution Document Item
item_inx = item_ch_inx " bapisditemx Sales Document Item Checkbox