2013 Nov 13 12:50 PM
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 FIELDS OF TABLE it_vbap
WHERE vbeln eq v_vbeln and PSTYV eq 'ZTDC'.
loop at 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
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 FIELDS OF TABLE it_vbap
WHERE vbeln eq v_vbeln and PSTYV eq 'ZTDC'.
loop at 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
2015 Aug 27 3:20 PM
2015 Aug 31 1:26 AM
Anouar
After invoking the BAPI
BAPI_SALESDOCUMENT_CHANGE
You must call the BAPI
BAPI_TRANSACTION_COMMIT
always that the execution of the BAPI BAPI_SALESDOCUMENT_CHANGE was successful
regards
Pedro
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |