11-24-2009 2:32 PM
Hi,
Not able to delete line items of a delivery using BAPI 'BAPI_OUTB_DELIVERY_CHANGE', with thte below code and even return parameter has zero messages.
I have even checked existing below posting.
Below is the code that i am using.........
*wa1-deliv_numb = wa_lips-vbeln.
wa1-deliv_item = wa_lips-posnr.
APPEND wa1 to item_data.
wa-deliv_numb = vbeln_so .
wa-deliv_item = l_item.
wa-del_item = 'X'.
APPEND wa TO item_control.
w_header_data-deliv_numb = vbeln_so .
w_header_control-deliv_numb = vbeln_so .
w_delivery = vbeln_so .
*w_header_control-dlv_del = 'X'. "Delete whole Delivery
CALL FUNCTION 'BAPI_OUTB_DELIVERY_CHANGE'
EXPORTING
header_data = w_header_data
header_control = w_header_control
delivery = w_delivery
TABLES
item_data = item_data
item_control = item_control
return = return.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
I have even tried uncommenting item_data parameter but not able to delete line item.....i am able to delete whole delivery but not line items .........can any one of u help me in resolving this issiue plz ???
Regards,
M, Manohar
11-24-2009 3:08 PM
wa-deliv_item = l_item.
Can you please check if the item number is passed with the correct format .same number of leading zeroes. Just for testing hard code the item number and then check.
11-24-2009 3:35 PM
yes i am converting deliveryno, line item into internal format using below code.......
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = l_item
IMPORTING
output = l_item.
11-26-2009 9:00 AM
11-26-2009 9:32 AM
11-26-2009 1:18 PM
below posting is for deleting entire delivery document, that i am able to do, but here my requirement is to delete one or more line items, not the whole document
Regards,
M, Manohar
08-01-2013 9:32 AM
Hi Manohar,
Please pass following fields to delete line item from Delivery
1. deliv_numb = vbeln
2. deliv_item = posnr
3. material = matnr
4. dlv_qty = lfimg
5. dlv_qty_imunit = lfimg
6. fact_unit_nom = umvkz
7. fact_unit_denom = umvkn
8. batch = charg
append above data to line item table.
please reward points if usefull,
Regards
Vikas
08-01-2013 11:11 AM
Kindly use WS_DELIVERY_UPDATE to delete the items
Sample code:
L_VBKOK-VBELN_VL = vbeln_so.
clear l_vbpok.
refresh l_vbpok.
l_vbpok-vbeln_vl = vbeln_so
l_vbpok-posnr_vl = wa_deliv_item.
l_vbpok-lips_del = c_x.
append l_vbpok.
set update task local.
call function 'WS_DELIVERY_UPDATE'
exporting
vbkok_wa = l_vbkok
commit = ' '
delivery = lv_delivery
tables
vbpok_tab = l_vbpok
exceptions
others = 0.
commit work and wait.