cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_GOODSMVT_CREATE problem for goods return

Former Member
0 Kudos

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?

Accepted Solutions (1)

Accepted Solutions (1)

PollyGan
Advisor
Advisor

Hi,

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.

Answer:
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.

Fill fields GOODSMVT_ITEM-REF_DOC_YR, GOODSMVT_ITEM-REF_DOC and
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,

Polly

Former Member
0 Kudos

Hi Polly,

I tried and it works. thanks.

By the way, are you from SAP company? Consulting? Any SAP hot line I can contact if there is urgent problem? Thanks.

PollyGan
Advisor
Advisor
0 Kudos

Hi,

Yes, I'm from SAP support. You can contact our hot line mentioned in note 560499.

Thanks and regards,

polly

Answers (0)