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

Undo function call 'MB_CREATE_GOODS_MOVEMENT'

hubert_heitzer
Contributor
0 Likes
972

Hello,

in my programm I have to do some stock transfers.

So I have a call of function 'MB_CREATE_GOODS_MOVEMENT'. Before calling function 'MB_POST_GOODS_MOVEMENT' I have to do some actions. If one of these action does not succeed I dont want to finish the transfer but continue with the next transfer position. Now the next call of 'MB_CREATE_GOODS_MOVEMENT' results in EMKPF-SUBRC = 5.

This behaviour is like described in documentation of both functions.

How can I manage to have more than one valid call of 'MB_CREATE_GOODS_MOVEMENT'?

Is there a possibility to undo a call of 'MB_CREATE_GOODS_MOVEMENT'?

Regards, Hubert

1 ACCEPTED SOLUTION
Read only

Dominik_Tylczynski
SAP Champion
SAP Champion
741

MB_CREATE_GOODS_MOVEMENT is of MBWL function group.

The function group contains function MB_MOVEMENTS_REFRESH. Most probably the function would do the trick, clear MBWL global data and allow subsequent call of MB_CREATE_GOODS_MOVEMENT. That's my educated guess, though. No guarantees here.

Why don't you use BAPI_GOODSMVT_CREATE?

HTH, best regards

Dominik Tylczyński

2 REPLIES 2
Read only

glenndv85
Explorer
0 Likes
741

If you want to do a call without anything in memory, you could create a wrapper functionmodule that is RFC enabled, executing these 2 functionalities and call it in destination 'NONE'.

Read only

Dominik_Tylczynski
SAP Champion
SAP Champion
742

MB_CREATE_GOODS_MOVEMENT is of MBWL function group.

The function group contains function MB_MOVEMENTS_REFRESH. Most probably the function would do the trick, clear MBWL global data and allow subsequent call of MB_CREATE_GOODS_MOVEMENT. That's my educated guess, though. No guarantees here.

Why don't you use BAPI_GOODSMVT_CREATE?

HTH, best regards

Dominik Tylczyński