Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI to create batch/Classify and make GR

Former Member
0 Kudos

We have a interface from an external PP system that has to make a GR into SAP.

Today in 4.0B we do a batch input on MB31. After a upgrade to ERP2005 I have changed the interface to do a number of BAPI calls. I call the following BAPI's :

BAPI_BATCH_CREATE - to create a new batch

BAPI_OBJCL_GETCLASSES - to get the classes assigned to the batch

BAPI_OBJCL_GET_KEY_OF_OBJECT - get a INOB/AUSP key

BAPI_OBJCL_CREATE_KEY - classify batch

BAPI_GOODSMVT_CREATE - create GR

BAPI_TRANSACTION_COMMIT - Commit.

As you can se we have to classify the batch.

The problem is that the characteristics that I have updated are cleared by BAPI_GOODSMVT_CREATE if I don't do a commit before calling BAPI_GOODSMVT_CREATE. Possibly because the expiry date are copied into classification by the BAPI.

I would like to avoid making a commit before the GR has retunr with a OK.

Has anybody expirience with this ?

A solution could be to classify the batch as the last step.

PS. is it possible to call BAPI_GOODSMVT_CREATE 2 times before commiting ? In some cases I would like to do a GR and afterwards a Transfere posting.

2 REPLIES 2

former_member480923
Active Contributor
0 Kudos

Hi,

As per the BAPI rule if you are calling BAPI(1) first and then BAPI(2) after that and your BAPI(1) depends on BAPI(2), you have to call the COMMIT work before the second BAPI call for the LUW ro complete and the Database to hold the changed values for the 2nd BAPI to work on.

Hope That Helps

Anirban

0 Kudos

There is no problem when calling BAPI_BATCH_CREATE and BAPI_GOODSMVT_CREATE without doing a commit. And the GR depends on the batch.