04-17-2010 4:34 AM
Hi,
I want to cancel the outbound delivery,goods movements status is C; then modify delivery
quantity; then re-PGI.Those steps are executed in one Z-program.
After cancelling delivery by FM 'WS_REVERSE_GOODS_ISSUE',I change the delivery item qty
by using BAPI 'BAPI_OUTB_DELIVERY_CHANGE' without leaving the current Z-program.BAPI
return error message VL216 'Item & does not exist' ,but the item is existent.
Between the FM(VL09) and BAPI(VL02N),if I exit the Z-program,this is no problem.
Can someone tell me what the matter is?
Thanks and Regards
Binary
04-17-2010 6:22 AM
I think while executing the bapi, the delivery is currently locked. Use "commit and wait " before executing the BAPI
Regards
Vinod
04-17-2010 6:35 AM
hi Vinod,
I have 'commit and wait' before executing BAPI, it doesn't work.
IF I use BDC to cancel delivery instead of FM 'WS_REVERSE_GOODS_ISSUE',then execute BAPI, this is no problem.
04-17-2010 6:58 AM
I still think there is a problem with locking, can u try the bapi "BAPI_GOODSMVT_CANCEL" instead of "'WS_REVERSE_GOODS_ISSUE'
After COMMIT WORK AND WAIT , check what is the value of SY-SUBRC.
Regards
Vinod
04-17-2010 7:46 AM
hi Vinod, BAPI 'BAPI_GOODSMVT_CANCEL' cann't be used to cancel delivery, it throw error message M7 130 'Material document cannot be processed'.
04-17-2010 9:39 AM
Hi try the below code. This worked correctly for me.
PARAMETERS : del_num TYPE likp-vbeln.
MOVE del_num TO header_data-deliv_numb.
MOVE del_num TO header_control-deliv_numb.
MOVE del_num TO item_dt_wa-deliv_numb.
MOVE '000010' TO item_dt_wa-deliv_item.
MOVE 2 TO item_dt_wa-dlv_qty.
APPEND item_dt_wa TO item_data.
MOVE del_num TO item_cnt_wa-deliv_numb.
MOVE '000010' TO item_cnt_wa-deliv_item.
MOVE 'X' TO item_cnt_wa-chg_delqty.
APPEND item_cnt_wa TO item_control.
CALL FUNCTION 'WS_REVERSE_GOODS_ISSUE'
EXPORTING
i_vbeln = del_num
i_budat = '20100331'
i_count = 01
i_mblnr = ''
i_tcode = 'VL09'
i_vbtyp = 'J'
TABLES
t_mesg = xmesg
EXCEPTIONS
error_reverse_goods_issue = 1
OTHERS = 2.
IF sy-subrc EQ 0.
COMMIT WORK AND WAIT.
write 😕 sy-subrc.
ENDIF.
CALL FUNCTION 'BAPI_OUTB_DELIVERY_CHANGE'
EXPORTING
header_data = header_data
header_control = header_control
delivery = del_num
TABLES
item_data = item_data
item_control = item_control
return = return
.
IF sy-subrc EQ 0.
COMMIT work.
ENDIF.
04-21-2010 3:36 AM
Hi i run your code in my system,but it doesn't work.
There are tow questions:
1. If i don't set value to field bapiobdlvitemcon-fact_unit_nom, bapiobdlvitemcon-sales_unit and bapiobdlvitemcon-fact_unit_denom, BAPI 'BAPI_OUTB_DELIVERY_CHANGE' will throw a error message VLBAPI 004 'Error in document &1 item &2 (quantity consistency check)'.
2. I have set value to the above field,the error message VL216 is existent still.
09-14-2010 1:45 PM
10-21-2010 8:41 AM
01-19-2011 9:18 AM
Please let me know how this error "Item 00010 doesnot exist" got resolved.
Thanks,
Phani.
02-13-2012 1:42 PM
You need to use BAPI for change delivery as foolows:
call function 'BAPI_OUTB_DELIVERY_CHANGE' destination 'NONE'
EXPORTING
header_data = ls_header_data
header_control = ls_header_control
delivery = lv_delivery
TABLES
item_data = lt_item_data
item_control = lt_item_control
return = return.
Good luck.
03-09-2012 9:22 PM
Hi,
Please let me know how it solved ?
I am facing the same problem exactly.
Regards
Pinaki Mukherjee
12-18-2013 10:57 AM
Hi,
Me, too
I'm facing the same issue.
let me know how to solve it.
Thanks,
yuki
12-18-2013 11:09 AM
Hi,
Run the BAPI,Put the break point on the below FM SHP_UPDATE_MOVEMENT_STATUS and check the reason .
loop at it_upd_items assigning <ls_upd_items>.
read table ilips with key posnr = <ls_upd_items>-item
binary search.
if sy-subrc ne 0.
message a216 with <ls_upd_items>-item.
endif.
read table xlips index ilips-tabix.
if sy-subrc ne 0.
message a216 with <ls_upd_items>-item.
endif.
slips-tabix = ilips-tabix.
perform lips_bearbeiten_vorbereiten(sapfv50p).
12-20-2013 4:10 AM
Hi,
Thank you for your reply.
However they don't stop at the debug point which you mentioned.
Now I'm developing the function module which includes 'WS_REVERSE_GOODS_ISSUE' and 'BAPI_OUTB_DELIVERY_CHANGE'.
Procedure is as below.
If they execute Call Function 'BAPI_OUTB_DELIVERY_CHANGE' after cancelling PGI manually, it's success.
But if they execute at one time, it's failed with error message VL 216.
Do you have any advice regarding this situation?
Call Function 'WS_REVERSE_GOODS_ISSUE'.
Exporting
i_vbeln = Delivery No.
i_budat = Sy-datum
i_tcode = VL09
i_vbtyp = 'J'
Tables
t_mesg
IF Sy-subrc = 0.
Call Function 'BAPI_TRANSACTION_COMMIT'.
ENDIF.
Call Function 'BAPI_OUTB_DELIVERY_CHANGE'
Exporting
header_data
header_control
delivery
Tables
item_data
item_control
return.
Thanks,
yuki
07-22-2016 6:03 PM
Hey bro... how did u solve this issue ... i m having the same issue..
Asif