Home > ABAP, API > BAPI_GOODSMVT_CREATE for goods movements

BAPI_GOODSMVT_CREATE for goods movements

April 17th, 2010 Leave a comment Go to comments

SAP Note 520813 – FAQ: BAPIs for goods movements contains frequently asked questions/answers regarding ‘BAPIs for goods movements’. I just picked out some questions for your reference. For detail information, please visit SAP service marketplace.

Question:
Which function modules must be called after the BAPI is called to complete the posting once the material document has been created successfully? What should I do if there is an error?

Answer:
The BAPI returns a return table for the error handling, that is, if the posting is incorrect, this table contains an entry describing the cause of the error. The ‘caller’ is responsible for evaluating this table and for triggering the update that is dependent on this.

If the posting is correct (return table is initial), a ‘Commit Work’ must be carried out in order to complete the posting. To do this, call BAPI_TRANSACTION_COMMIT.

The Commit or rollback always applies to the current LUW (Logical Unit of Work). Therefore, you must make sure that it is carried out at the correct point in the source code. More information about this is available in the documentation for BAPI_TRANSACTION_COMMIT or …_ROLLBACK.

A detailed description is available in Note 457499.

Question:
When I call BAPI_GOODSMVT_CREATE, the system issues one of the following error messages:
- M7 096: “Goods movement not possible with mvmt type &”
-’Incorrect update control of the movement type
(Entry 101 X X)’.
Which fields do I have to fill when calling the BAPI to avoid this error?

Answer:
The system checks the combination movement type – allowed transactions. Make sure that you assign a GM_CODE to the BAPI for the required transaction.

Question:
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 verification is active, and the item in the purchase order may have already been cancelled once.
Which fields do I have to fill when calling the BAPI to avoid this error?

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.

Question:
Which fields do I have to fill when posting a goods issue for a goods delivery (with reference to a stock transport order) to ensure that the system updates the purchase order and the delivery correctly?

Answer:
For detailed information about this, see Note 424014.

Question:
If I want to use the BAPI to post a goods issue and the corresponding goods receipt for a stock transfer in the same roll area, the system issues error message M7 022 ‘Stock in transfer exceeded by & & &’.
How can this error be corrected?

Answer:
See Note 369518 for more information about the cause and solution of this problem.

Question:
Which goods movements should I not post using the BAPI_GOODSMVT_CREATE BAPI?

Answer:
You should not post the goods receipt for the inbound delivery using BAPI_GOODSMVT_CREATE BAPI because the document base and the status of the inbound delivery are not updated. See Note 199703.

  1. Tania
    January 20th, 2011 at 12:51 | #1

    When I try to post a goods receipt for the purchase order using a BAPI, the system displays error message – Error in function
    No goods receipt possible for purchase order 2100000002 00100.

    Please explain what is the problem.

  2. Arun
    May 30th, 2011 at 17:57 | #2

    I’m getting an error like ” Account 400000 requires an assignment to a CO object ” when i tried calling the bapi BAPI_GOODSMVT_CREATE…..I have used mvmt type 201,202 and the gm_code = ’03′….So please clarify me in fixing this issue………

    Thanks in advance,
    Arunmozhi

  1. No trackbacks yet.