BAPI_GOODSMVT_CANCEL is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.
See here to view full function module documentation and code listing, simply by entering the name BAPI_GOODSMVT_CANCEL into the relevant SAP transaction such as SE37 or SE80.
Associated Function Group:
MB_BUS2017
Released Date:
23.07.1998
Processing type: Remote-Enabled
CALL FUNCTION 'BAPI_GOODSMVT_CANCEL' "Reverse Goods Movements with MB_CANCEL_GOODS_MOVEMENT
EXPORTING
materialdocument = " bapi2017_gm_head_02-mat_doc Number of a Material Document
matdocumentyear = " bapi2017_gm_head_02-doc_year Material Document Year
* goodsmvt_pstng_date = " bapi2017_gm_head_02-pstng_date Posting Date
* goodsmvt_pr_uname = " bapi2017_gm_head_01-pr_uname User Name for Printing Goods Receipt/Issue Slip
IMPORTING
goodsmvt_headret = " bapi2017_gm_head_ret Material Document Number/Material Document Year
TABLES
return = " bapiret2 Return Messages
* goodsmvt_matdocitem = " bapi2017_gm_item_04 Items That Are To be Reversed
. " BAPI_GOODSMVT_CANCEL
The ABAP code below is a full code listing to execute function module BAPI_GOODSMVT_CANCEL including all data declarations. The code uses the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the original method of declaring data variables up front. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8).
| ld_goodsmvt_headret | TYPE BAPI2017_GM_HEAD_RET , |
| it_return | TYPE STANDARD TABLE OF BAPIRET2,"TABLES PARAM |
| wa_return | LIKE LINE OF it_return , |
| it_goodsmvt_matdocitem | TYPE STANDARD TABLE OF BAPI2017_GM_ITEM_04,"TABLES PARAM |
| wa_goodsmvt_matdocitem | LIKE LINE OF it_goodsmvt_matdocitem . |
The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.
DATA:
| ld_goodsmvt_headret | TYPE BAPI2017_GM_HEAD_RET , |
| ld_materialdocument | TYPE BAPI2017_GM_HEAD_02-MAT_DOC , |
| it_return | TYPE STANDARD TABLE OF BAPIRET2 , |
| wa_return | LIKE LINE OF it_return, |
| ld_matdocumentyear | TYPE BAPI2017_GM_HEAD_02-DOC_YEAR , |
| it_goodsmvt_matdocitem | TYPE STANDARD TABLE OF BAPI2017_GM_ITEM_04 , |
| wa_goodsmvt_matdocitem | LIKE LINE OF it_goodsmvt_matdocitem, |
| ld_goodsmvt_pstng_date | TYPE BAPI2017_GM_HEAD_02-PSTNG_DATE , |
| ld_goodsmvt_pr_uname | TYPE BAPI2017_GM_HEAD_01-PR_UNAME . |
Using the Cancel method, material documents can be cancelled by calling
up the function module MB_CANCEL_GOODS_MOVEMENT. You can only cancel
...See here for full SAP fm documentation
Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name BAPI_GOODSMVT_CANCEL or its description.
BAPI_GOODSMVT_CANCEL - Reverse Goods Movements with MB_CANCEL_GOODS_MOVEMENT BAPI_GMBUDGET_EXISTENCECHECK - Check Existence of a grant BAPI_GL_GETGLACCPERIODBALANCES - Posting period balances for each G/L account BAPI_GL_GETGLACCCURRENTBALANCE - Closing balance of G/L account for current year BAPI_GL_GETGLACCBALANCE - Closing balance of G/L account for chosen year BAPI_GL_ACC_GETPERIODBALANCES - Posting period balances for each G/L account