SAP Function BAPI_GOODSMVT_CANCEL - Reverse Goods Movements with MB_CANCEL_GOODS_MOVEMENT

Parameter Reference Type Length Default Optional Text
GOODSMVT_PR_UNAME BAPI2017_GM_HEAD_01-PR_UNAME C 12 X User Name for Printing Goods Receipt/Issue Slip
GOODSMVT_PSTNG_DATE BAPI2017_GM_HEAD_02-PSTNG_DATE D 8 X Posting Date
MATDOCUMENTYEAR BAPI2017_GM_HEAD_02-DOC_YEAR N 4 Material Document Year
MATERIALDOCUMENT BAPI2017_GM_HEAD_02-MAT_DOC C 10 Number of a Material Document

Parameter Reference Type Length Text
GOODSMVT_HEADRET BAPI2017_GM_HEAD_RET u 14 Material Document Number/Material Document Year

Parameter Reference Length Optional Text
GOODSMVT_MATDOCITEM BAPI2017_GM_ITEM_04 4 X Items That Are To be Reversed
RETURN BAPIRET2 548 Return Messages

Functionality
Using the Cancel method, material documents can be cancelled by callingup the function module MB_CANCEL_GOODS_MOVEMENT. You can only cancelone material document each time you call up the transaction. Note thatthe system does not delete the original document, but creates a newmaterial document (reversal document).

Notes
INCLUDE BAPI_BERECHTIGUNGEN
INCLUDE MMIM_BAPI_AUTHOR_GOODSMVT OBJECT DOKU ID TX LANGUAGE EN
Transfer
The key fields for the material document, MATERIALDOCUMENT andMATDOCUMENTYEAR have to be transferred to the method as importparameters.
The posting date with the field GOODSMVT_PSTNG_DATE und the user namewith the field GOODSMVT_PR_UNAME are also imported.
In table GOODSMVT_MATDOCITEM, you have the option of transferring thematerial document items that are to be cancelled. If no items aretransferred, all the items in the material document are cancelled.
Confirmations
Once the system has successfully cancelled a material document, itreturns the material document number and material document year keyfields in the GOODSMVT_HEADRET parameter to the initiator.
INCLUDE BAPI_RET

Further information
INCLUDE BAPI_INVENTUR_WEITERINF

Description
INCLUDE BAPI_KEYFIELD

Description
Specifies the name of the user.
The user name is required if you want the system to print a goodsreceipt/issue slip when the material document is posted.

Description
INCLUDE BAPI_DATAELEMENT
Posting date

Description
INCLUDE BAPI_KEYFIELD

Description
INCLUDE BAPI_KEYFIELD

Description
In this table, the material document items that are to be cancelled aretransferred.
INCLUDE BAPI_DATAELEMENT

Default
You can choose whether you want to fill the table or not. If no itemsare transferred here, the system cancels all the items in the materialdocument.

Description
INCLUDE BAPI_TABLE

Default
INCLUDE BAPI_WARENBEWEGUNG_RETURN

628705Dump MESSAGE_TYPE_X when canceling material document
369518Transfer stock not reached if posted with BAPI
457499No material document generated for BAPI BAPI_GOODSMVT_CREATE
365880MB_CREATE_GOODS_MOVEMENT: Field selection for movement type
213393MIGO: SD document flow update during cancelation