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

BAPI_GOODSMVT_CREATE problem for goods return

Hi There,

We are now implementing BAPI_GOODSMVT_CREATE. A strange thing is that we met error M7021 when doing a normal goods return.

We use BAPI to GR and reverse GR. We can do it for twice and get error above. For example, GR -> reverse GR -> GR -> reverse GR -> error. If we do the GR with MIGO, then there is no error. Is there anyone has the same experience?

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on Dec 12, 2012 at 02:46 AM


    Seems system could not find the correct reference document information.

    Can you please check note 520813-7:

    7. When I try to post a goods receipt for the purchase order using a

    BAPI, the system displays error message M7 021 'Deficit of & & & &'.

    The goods-receipt based invoice verification is active, and the item

    in the purchase order may have already been cancelled once.

    In this case, you must also transfer fields LFBJA, LFBNR and LFPOS
    from the purchase order history (table EKBE); otherwise, the system
    cannot find the correct document. For more information, see Note
    109396. Even though this note refers to an IDoc processing, the same
    logic also applies to BAPI_GOODSMVT_CREATE.

    GOODSMVT_ITEM-REF_DOC_IT in the BAPI interface and test the system
    behavior again.

    Can you please try the suggested solution as above?

    Thanks and regards,


    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.