Skip to Content
author's profile photo Former Member
Former Member

VL216 error message when delivery is cancelled and changed

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Apr 17, 2010 at 05:22 AM

    I think while executing the bapi, the delivery is currently locked. Use "commit and wait " before executing the BAPI

    Regards

    Vinod

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Vinod Kumar

      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.

  • author's profile photo Former Member
    Former Member
    Posted on Sep 14, 2010 at 12:45 PM

    Solved

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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

  • author's profile photo Former Member
    Former Member
    Posted on Jul 22, 2016 at 05:03 PM

    Hey bro... how did u solve this issue ... i m having the same issue..

    Asif

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.