Fonction SAP BAPI_GOODSMVT_CREATE - Post goods movements with MB_CREATE_GOODS_MOVEMENT

Paramètre Reférence Type Long. Valeur par déf. Facultatif Description
GOODSMVT_CODE BAPI2017_GM_CODE u 2 Assign Code to Transaction for Goods Movement
GOODSMVT_HEADER BAPI2017_GM_HEAD_01 u 208 Material Document Header Data
GOODSMVT_REF_EWM /SPE/BAPI2017_GM_REF_EWM u 61 X BAPI Communication Structure: Material Document EWM Ref.
TESTRUN BAPI2017_GM_GEN-TESTRUN C 1 SPACE X Simulate Goods Movement

Paramètre Reférence Type Long. Description
GOODSMVT_HEADRET BAPI2017_GM_HEAD_RET u 14 Material Document Number/Material Document Year
MATDOCUMENTYEAR BAPI2017_GM_HEAD_RET-DOC_YEAR N 4 Material Document Year
MATERIALDOCUMENT BAPI2017_GM_HEAD_RET-MAT_DOC C 10 Number of Material Document

Paramètre Reférence Long. Facultatif Description
EXTENSIONIN BAPIPAREX 990 X Reference Structure for BAPI Parameters EXTENSIONIN/EXTENSIONOUT
GOODSMVT_ITEM BAPI2017_GM_ITEM_CREATE 1106 Material Document Items
GOODSMVT_SERIALNUMBER BAPI2017_GM_SERIALNUMBER 94 X Serial Number
GOODSMVT_SERV_PART_DATA /SPE/BAPI2017_SERVICEPART_DATA 150 X
RETURN BAPIRET2 548 Return Messages

Functionality
You can use this method to create a material document for a goodsmovement.
You can only create one material document each time you call up themethod.
You can use a simulation function before posting the goods movement tocheck how the data is updated in the database. The standard system isconfigured so that the goods movement is posted immediately, withoutprior simulation.
Ensure that you transfer the data in the same way as it is managed inthe database. For example:

  • Material number 18-character with leading zeros

  • Batches with uppercase letters

  • Ensure that the header data of the material document includes theposting date for all transactions/events listed below. Populate thePSTNG_DATE field (import structure GOODSMVT_HEADER) in theinterface BAPI2017_GM_HEAD_01 for this purpose.

    Notes
    From Release ERP2005 onwards, it is possible to populate customers'own fields in database tables using the BAPI, without carrying out amodification.
    The enhancements are passed on to the BAPI in a container and can beprocessed within the BAPI function module.
    Technically, this is realized via an extension parameter (ExtensionIn)(see below or tab page 'Tables -> Long Text') .
    Authorization check,,,,check
    In the MM Inventory Management component, the method does not performany authorization checks.
    Note that the system can also check authorization objects of otherapplications during the posting of a goods movement, depending on thebusiness transaction.
    Transfer
    The following information about the material document that is to becreated is passed on to the method:

    • A structure with the header data

    • A structure with the code for the movement

    • A table with the item data

    • A table with the serial numbers

    • The posting is made by the function module MB_CREATE_GOODS_MOVEMENT.
      Confirmations
      INCLUDE BAPI_RET LANGUAGE EN

      Further information
      INCLUDE BAPI_INVENTUR_WEITERINF LANGUAGE EN
      Which fields must be populated during the varioustransactions/events?
      The following example scenarios illustrate which fields have to bepopulated for which business transactions/events (code).
      There are the following types of transactions/events:
      GM_Code 01: Goods receipt for purchase order
      GM_Code 02: Goods receipt for production order
      GM_Code 03: Goods issue
      GM_Code 04: Transfer posting
      GM_Code 05: Other goods receipt
      GM_Code 06: Reversal of goods movements
      GM_Code 07: Subsequent adjustment with regard to a subcontract order
      Entering the movement indicator
      Depending on the transaction, you must enter the following in themovement indicator field:

      • GM_Code 01 (Goods receipt for purchase order): B

      • GM_Code 02 (Goods receipt for production order): F

      • For all other transactions, leave the field blank.

      • For 1: GM_Code 01: Goods receipt for purchase order
        • Purchase order known

        • The following fields must be populated:
          Purchase order
          Purchase order item
          Movement type
          Movement indicator
          Quantity in unit of entry
          ISO code unit of measurement for unit of entry or
          quantity proposal
          The following fields may have to be populated (this is not a completelist):
          Minimum shelf life expiration date (if set up in the system)
          Reason for movement (if set up in the system)
          Batch (if the material is handled in batches and no automatic batchassignment has been set up)
          Storage location (if no storage location us specified in the purchaseorder item)
          The following fields can be populated (this is not a complete list):
          Stock type
          Item text
          Unloading point
          Delivery completed indicator
          The following fields must not be populated (this is not a completelist):
          Account assignment fields (the account assignment is adopted from thepurchase order)
          Reservation
          Receiving/issuing material
          Receiving/issuing plant
          Receiving/issuing storage location
          In the case of a purchase order item with the item category"subcontracting", only the GR item is to be passed on in the interface.The GI items are determined automatically in the system.
          • Purchase order unknown: Shipping notification known

          • The following fields must be populated:
            Delivery
            Delivery item
            Movement type
            Other fields as under "Purchase order known". The system determines therelevant purchase order item via the delivery/delivery item.
            • Purchase order unknown: Purchase order is to be created automatically

            • The following fields must be populated:
              Material number
              Plant
              Storage location
              Vendor
              Movement type
              Movement indicator
              Quantity in unit of entry
              ISO code unit of measurement for unit of entry
              The following fields may have to be populated (this is not a completelist):
              Minimum shelf life expiration date (if set up in the system)
              Reason for movement (if set up in the system)
              Batch (if the material is handled in batches and batches are notassigned automatically)
              The following fields can be populated (this is not a complete list):
              Stock type
              Item text
              Unloading point
              You cannot populate the following fields (this is not a complete list):
              Account assignment fields (automatic creation of purchase order itemswith account assignment is not supported)
              Reservation
              Receiving/issuing material
              Receiving/issuing plant
              Receiving/issuing storage location
              • Purchase order unknown: A purchase order is not to be created

              • The following fields must be populated:
                Material number
                Plant
                Storage location
                Vendor
                Movement type
                Movement indicator
                Quantity in unit of entry
                ISO code unit of measurement for unit of entry
                The following fields may have to be populated in some cases (this is nota complete list)
                Minimum shelf life expiration date (if set up in the system)
                Reason for movement (if set up in the system)
                Batch (if the material is handled in batches and automatic assignment ofbatch numbers is not set)
                The following fields can be populated (this is not a complete list)
                Special stock indicator
                Item text
                Unloading point
                Goods recipient
                The following fields cannot be populated (this is not a complete list)
                Account assignment fields (automatic creation of purchase order itemswith account assignment is not supported)
                Reservation
                Receiving/issuing material
                Receiving/issuing plant
                Receiving/issuing storage location
                Receiving/issuing batch
                The input combinations listed above for the GM_CODE 01 can be combinedwithin an input table so that they can be posted in a material document.Items can also be posted for different purchase orders, provided thatall the purchase orders relate to the same vendor.
                • Transfer of subcontracting components

                • When the end product (ordered material of a subcontract order) is postedusing movement type 101, the populated unique identification of thedocument line (LINE_ID) is additionally needed for the transfer of thesubcontracting components.
                  More information on LINE_ID andPARENT_ID
                  The following fields must be populated for the components:
                  Unique identification of the document line
                  Identification of the immediately superordinate line
                  Material number
                  Plant
                  Storage location
                  Quantity in unit of entry
                  The following fields can be filled for the components:
                  All other fields in the method that are included in thislist.
                  The following fields cannot be populated for the components:
                  All fields that are not included in the list above. The movementindicator must be initial.
                  • Additional fields in goods-receipt-based invoice verification

                  • When you post a goods receipt to purchase order with movement type102, an issue with reference to a previously posted goods issue,the following fields must also be transferred:
                    REF_DOC_IT (LFPOS): Item of a reference document
                    REF_DOC (LFBNR): Document number of a reference document
                    REF_DOC_YR (LFBJA): Fiscal year of a reference document
                    Only if you transfer these fields can you be sure that the link to theoriginal goods movement is retained.
                    For 2 GM_Code 02: Goods receipt for production order
                    The following fields have to be populated:
                    Order
                    Movement type
                    Movement indicator
                    Quantity in unit of entry
                    ISO code unit of measurement for unit of entry or
                    quantity proposal
                    The following fields may have to be populated in some cases (this is nota complete list):
                    Minimum shelf life expiration date (if set up in the system)
                    Reason for movement (if set up in the system)
                    Batch (if the material is handled in batches and automatic batch numberassignment is not set)
                    Storage location (if storage location has not been specified in theorder)
                    The following fields can be populated (this is not a complete list):
                    Order item (co-product)
                    Stock type
                    Item text
                    Unloading point
                    "Delivery completed" indicator
                    The following fields cannot be populated (this is not a complete list):
                    Account assignment fields (the account assignments are adopted from thepurchase order)
                    Reservation
                    Receiving/issuing material
                    Receiving/issuing plant
                    Receiving/issuing storage location
                    Receiving/issuing batch
                    For 3 GM_Code 03: Goods issue
                    • Goods issue without reference to a reservation

                    • The following fields must be populated:
                      Material number
                      Plant
                      Storage location
                      Movement type
                      Movement indicator
                      Quantity in unit of entry
                      ISO code unit of measurement for unit of entry
                      The following fields may have to be populated in some cases (this is nota complete list):
                      Special stock (e.g. sales order, project, vendor etc.)
                      Minimum shelf life expiration date (if set up in the system)
                      Reason for movement (if set up in the system)
                      Batch (if the material is handled in batches and automatic batch numberassignment is not set)
                      Account assignment fields
                      The following fields can be populated (this is not a complete list):
                      Special stock indicator
                      Item text
                      Unloading point
                      Goods recipient
                      The following fields cannot be populated (this is not a complete list):
                      Reservation
                      Receiving/issuing material
                      Receiving/issuing plant
                      Receiving/issuing storage location
                      Receiving/issuing batch
                      • Goods issue with reference to a reservation

                      • The following fields must to be populated:
                        Reservation number
                        Reservation item
                        Record type of the reservation
                        Movement indicator
                        Quantity in unit of entry
                        ISO code unit of measurement for unit of entry
                        The following fields may have to be populated in some cases (this is nota complete list):
                        Minimum shelf life expiration date (if set up in the system)
                        Reason for movement (if set up in the system)
                        Batch (if the material is handled in batches and automatic batch numberassignment is not set)
                        Storage location (if not planned in the reservation)
                        The following fields can be populated (this is not a complete list):
                        Special stock indicator
                        Item text
                        Unloading point
                        Goods recipient
                        The following fields cannot be populated (this is not a complete list):
                        Movement type
                        Material
                        Plant
                        Account assignment fields
                        For 4 GM_Code 04: Transfer posting
                        • Transfer posting without reference to a reservation

                        • The following fields must be populated:
                          Material number
                          Plant
                          Storage location
                          Movement type
                          Movement indicator
                          Quantity in unit of entry
                          ISO code unit of measurement for unit of entry
                          The following fields may have to be populated in some cases (this is nota complete list):
                          Receiving material
                          Receiving plant
                          Receiving storage location
                          Receiving batch (if material is handled in batches and you want tochange batches)
                          Receiving/issuing special stock (e.g. sales order, project, vendor etc.)
                          Minimum shelf life expiration date (if set up in the system)
                          Reason for movement (if set up in the system)
                          Batch (if the material is handled in batches and automatic batch numberassignment is not set)
                          The following fields can be populated (this is not a complete list):
                          Special stock indicator
                          Item text
                          Account assignment fields (for automatic posting lines: expense/incomefrom stock transfer)
                          The following fields cannot be populated (this is not a complete list):
                          Reservation
                          • Transfer posting with reference to a reservation

                          • See goods issue with reference to a reservation
                            For 5 GM_Code 05: Other goods receipts
                            • Other goods receipt without reference to a reservation

                            • See goods issue without reference to a reservation
                              • Other goods receipt with reference to a reservation

                              • See goods issue with reference to a reservation
                                For 6 GM_Code 06: Reversal of goods movements
                                You can use the Cancel method to reverse goods movements. But youmay also want to cancel a goods movement without referring to a materialdocument (see the Cancel method).
                                If you want to work without referring to the document, you have topopulate the BAPI_GM_ITEM_CREATE-XSTOB field in the interface(import table GOODSMVT_ITEM). In this case, the system convertsthe movement type assigned in the interface to the reversal movementtype. Alternatively, you can set the reversal movement type in theinterface. In this case, the BAPI_GM_ITEM_CREATE_XSTOB field mustbe transferred blank.
                                If you want to cancel a goods movement with reference to a reservation(without using the Cancel method) you can only transfer theBAPI_GM_ITEM_CREATE_XSTOB field if it is populated. Movementtypes are not transferred when you post with reference to a reservation,as the movement type is contained in the reservation item.
                                For 7. GM_Code 07: Subsequent adjustment with regard to asubcontract order
                                • Ordered material of subcontract order

                                • The following fields must be populated:
                                  Unique identification of document line (can be freely assigned)
                                  Posting date in document header
                                  Document number of purchasing document
                                  Item number of purchasing document
                                  Material number,,,, check
                                  Plant,,,,check
                                  Movement type (select movement type 121
                                  )
                                  Movement indicator (must be O)
                                  Further entries are not allowed. The entry quantity for the orderedmaterial of a subcontract order must be zero.
                                  • Components

                                  • The following fields must be populated:
                                    Unique identification of document line (can be freely assigned)
                                    Identification of the immediately superordinate line
                                    Plant
                                    Material number,,,, check
                                    Quantity in unit of entry; can also be negative
                                    The following fields can be populated:
                                    Storage location
                                    All other fields in the method that are included in thislist.
                                    The following fields may not be populated:
                                    All fields that are not in the list above. The movement indicator mustbe blank.
                                    More information on LINE_ID andPARENT_ID
                                    • Additional fields in goods-receipt-based invoice verification

                                    • When you post a subsequent adjustment, the following fields must also betransferred:
                                      REF_DOC_IT (LFPOS): Item of a reference document
                                      REF_DOC (LFBNR): Document number of a reference document
                                      REF_DOC_YR (LFBJA): Fiscal year of a reference document
                                      Only if you transfer these fields can you be sure that the link to theoriginal goods movement is retained.

                                      Description
                                      This structure transfers the fields that are filled to the initiatorwhen the material document was successfully posted.
                                      INCLUDE BAPI_DATAELEMENT
                                      number of material document
                                      material document year

                                      Description
                                      INCLUDE BAPI_KEYFIELD

                                      Description
                                      INCLUDE BAPI_KEYFIELD

                                      Description
                                      This parameter transfers the new key assignment of the GM_CODE to therelevant transactions in Inventory Management.
                                      INCLUDE BAPI_DATAELEMENT

                                      Description
                                      This structure contains the header data of the material document thatis to be created.
                                      INCLUDE BAPI_DATAELEMENT

                                      Description
                                      This parameter contains fields for two different functionalities.
                                      On the one hand it contains the fields that must be populated to storethe material document number in Extended Warehouse Management (EWM) as areference in the case of a transfer posting.
                                      On the other hand it contains the scrapping reference number from SAPGlobal Trade Services (GTS) for the bonded warehouse process.
                                      The following fields are involved:

                                      • Document number of material document in EWM

                                      • Logical system of material document in EWM (LOGSYS)

                                      • The scrapping reference number for transfer postings passed on to EWM by
                                      • GTS.

                                        Description
                                        This parameter passes on the data for simulating the goods movementprior to posting.
                                        INCLUDE BAPI_DATAELEMENT OBJECT DOKU ID TX LANGUAGE EN
                                        TESTRUN

                                        Description
                                        Extension parameter on the BAPI interface
                                        Depending on the requirements set with regard to the relevant BAPI, oneextension parameter (ExtensionIn) is created for the data import and/orone extension parameter (ExtensionOut) for the data export on theinterface of the BAPI function module. These extension parameters serveas containers, in which all customer enhancements are passed on to theBAPI. The extension parameters are based on the structure BAPIPAREX.
                                        The data is passed on in a table. The format of the individual datarecords of this table is determined by the structure BAPIPAREX. Thiscontains several data record fields (VALUEPART1, VALUEPART2, ...) and afield for the name of an auxiliary structure (STRUCTURE). Since per datarecord the data is written piecewise consecutively into the data recordfields available for the purpose, an auxiliary structure is needed tointerpret the data.
                                        In the event that the customer wishes to enhance an SAP database tableby adding further fields, BAPI table extensions are particularlysuitable as auxiliary structures. A BAPI table extension can either bepredefined by SAP or created by the customer.
                                        With regard to the technical realization, refer to the more detaileddocumentation provided by SAP.

                                        Description
                                        This table contains the item data for the material document that is tobe created.
                                        INCLUDE BAPI_DATAELEMENT

                                        Description
                                        INCLUDE BAPI_DATAELEMENT
                                        Serial number

                                        Default
                                        If the XSAUT indicator is set in the table parameterGoodsmvtItem, the system automatically determines the serial numbersfor an item.
                                        When creating a goods movement with serial numbers, various scenariosare possible:
                                        The XSAUT indicator is set:

                                        • if all the serial numbers for an item are to be determined
                                        • automatically
                                          • if serial numbers have been preset for a partial quantity of an item,
                                          • but the remaining serial numbers are determined automatically.
                                            The XSAUT indicator is not set:
                                            • if the serial numbers are preset for the complete quantity of an item.

                                            • if serial numbers are preset for only a partial quantity of an item.
                                            • However, if you have not specified that the remaining serial numbersare to be determined automatically, an error occurs.
                                              • an error occurs if the number of serial numbers exceeds the quantity
                                              • for the item.

                                                Description
                                                This parameter contains the fields of the 'Service Parts for SPM'scenario. It contains fields for three different functionalities.
                                                Returns to SAP EWM for scrapping:
                                                The following fields must be populated:

                                                • RMA number (RET_AUTH_NUMBER)

                                                • Delivery number (DELIV_NUMBER)

                                                • Handling unit number (HU_NUMBER)

                                                • Check GUID (INSPOUT-GUID)

                                                • Scrapping indicator (SCRAP_INDICATOR)

                                                • Retention quantity (KEEP_QUANTITY)

                                                • Timestamp to SAP APO:
                                                  For postings between storage locations, the following fields must bepopulated:
                                                  • Delivery number (DELIV_NUMBER)

                                                  • Delivery item (DELIV_ITEM)

                                                  • Event

                                                  • Date

                                                  • Time zone (ZONLO)

                                                  • Start date/time of transaction (TIMESTAMP)

                                                  • Stock type to SAP GTS:
                                                    You must specify the field 'GTS Stock Type' (GTS_STOCK_TYPE) in order topass on the stock type information to GTS in the bonded warehouseprocess.
                                                    In the case of functionalities 1 and 2, you must specify the uniqueidentification of the document line field (LINE_ID).

                                                    Description
                                                    INCLUDE BAPI_TABLE

                                                    Default
                                                    INCLUDE BAPI_WARENBEWEGUNG_RETURN

536769Inspection lots without status object
1075141BAPIs valid for usage with AFS6.0
1426537MILL_CUT: BDC (batch input) not supported
1342225Error AA 629 for movement type 122/102 w/ asset acct assgmt
522583Problems w/ Note 455348: data loss due to REFRESH_TABLES
1052227MIGO: No material number in message M7 306
959797WMMBXY/MBGMCR/BAPI_GOODSMVT_CREATE order confirmation
833624MBEWH inconsistencies in postings to the previous period
784747Incorrect behavior of BAPI_GOODSMVT_CREATE in test case
707495MAU: Problems during replacement and meter reading
677273MBxx: Valuation indicator of special stock
369518Transfer stock not reached if posted with BAPI
521488FAQ: MB_CREATE_GOODS_MOVEMENT
526850LB031 with subcontracting in MB_CREATE_GOODS_MOVEMENT
523453No X-Dock delivery posted by Goods Mvt BAPI
520738M7072 with goods issue for order/reservation in MIGO
424014BAPI: Goods receipt for the outbound delivery
454005M7368 for goods movement via MB_CREATE_GOODS_MOVEMENT
457499No material document generated for BAPI BAPI_GOODSMVT_CREATE
329367No dialog for SC components possible
213078Flag for printing goods receipt/issue slip in EM10
398801Missing import parameters for BAPI BAPI_GOODSMVT_CREATE
375570No inventory transfer posting of decentralized WMS
366175M7146 Special stock not planned
328986Entry GBB VAY/VAX for valuated sales order stock
104626MMIM: Batch created in lower case
211210M7135/136/137/138 for background posting