Skip to Content

Here I will not write about the details of using BAPI_GOODSMVT_CREATE, has already
been written about this many times, and SCN including.

I propose to focus on one small detail, without which multiple call BAPI_GOODSMVT_CREATE will not work correctly.


Why BAPI_GOODSMVT_CREATE called repeatedly in his Z program? For example, you specify parameters for moving material,
but BAPI returned an error.
You change something and press the button again, causing BAPI.


So, if the call looks CALL FUNCTION ‘BAPI_GOODSMVT_CREATE’ again you’ll get an error, despite the correct parameters.

But if you specify the addition CALL FUNCTION ‘BAPI_GOODSMVT_CREATE’ DESTINATION ‘NONE’ – the document will be created!

Thus, using DESTINATION ‘NONE’, you can be sure that the data buffer previous calls have no impact!

P.S. It is also necessary to specify DESTINATION ‘NONE’  in calling COMMIT or ROLLBACK like below

IF p_matdoc IS INITIAL .

  CALL FUNCTION ‘BAPI_TRANSACTION_ROLLBACK’ DESTINATION ‘NONE’.

ELSE .

  CALL FUNCTION ‘BAPI_TRANSACTION_COMMIT’ DESTINATION ‘NONE’.

ENDIF .

CALL FUNCTION ‘RFC_CONNECTION_CLOSE’    EXPORTING      destination = ‘NONE’.

To report this post you need to login first.

1 Comment

You must be Logged on to comment or reply to a post.

  1. sakshi sawhney

    Hi Maxim ,

    Tried adding destination , however i get a dump ‘ CALL_FUNCTION_REMOTE_ERROR’.

    The Short Text states : Function module MB_CREATE_GOODS_MOVEMENT cannot be executed.

    Any specific reason.

    Also would like to confirm on a point :

    In case i need to do 2 posting back to back and commit changes only if both are successful. Can i use the approach mentioned above ?

    Please could you confirm/correct my understanding.

    Thanks

    (0) 

Leave a Reply