Application Development and Automation 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: 
Read only

Running BAPI_GOODSMVT_CREATE twice in a program

Former Member
1,968

Hi all,

I have a requirement where I have to do material issue using BAPI_GOODSMVT_CREATE

once for Movement type 923 and 924 in the same program serially.

First I am trying to create a material doc for 923 mvmt type and When I am trying to create the second material doc with mvmt type 924 ,It was showing an error like "Function module MB_CREATE_GOODS_MOVEMENT cannot be Executed"...

When I tried in a different way like first creating for 924 and then 923,it was able to create for the first one and it is again faling for the second time...

Why it was failing?

Should we not use the same BAPI for two defferent materila movemtns in the same program?

Kindly suggest the possible approach...

Thanks,

Lakshmi Prasanna Gandham...

9 REPLIES 9
Read only

Former Member
1,249

Use BAPI_TRANSACTION_COMMIT after calling first BAPI.

Wait for Commit to happen and then procceed .. You can use parameter WAIT = 'X' for this purpose

Edited by: Mohaiyuddin Soniwala on Oct 22, 2008 4:15 PM

Read only

Former Member
1,249

Hi,

Did you call BAPI_TRANSACTION_COMMIT after the call of first BAPI.

Thanks & Regards,

Navneeth K.

Read only

0 Likes
1,249

I am using

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = 'X'.

WAIT UP TO 1 SECONDS.

Read only

UweFetzer_se38
Active Contributor
1,249

Hi Lakshmi,

the BAPI may lock the material master data. Please try to call the FM BAPI_TRANSACTION_COMMIT with the parameter "wait = 'X'" after each call of the BAPI.

Hope this solves the problem

Uwe

grrr, was too slow

Read only

Former Member
1,249

Hello

Try to use


CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
      EXPORTING wait = 'X'. 

after each call 'BAPI_GOODSMVT_CREATE'.

Read only

Former Member
0 Likes
1,249

I am commiting the BAPI still it is runnig only for the first movement type only.........

Read only

0 Likes
1,249

Try increasing the wait time

WAIT UP TO 8 SECONDS.

Read only

0 Likes
1,249

Do you have cleared all the tables before you call the BAPI the 2nd time (e.g. the RETURN table) ?

Uwe

Read only

Former Member
0 Likes
1,249

The problem is solved by running the BAPI in another program and calling the program each time ,

whenever the BAPI has to be executed....