SAP Function /SAPMP/BAPI_GOODSMVT_CREATE - Mill Products: Post Goods Movements with Single-Unit Batch Information

Parameter Reference Type Length Default Optional Text
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
TESTRUN BAPI2017_GM_GEN-TESTRUN C 1 SPACE X Simulate Goods Movement

Parameter Reference Type Length Text
GOODSMVT_HEADRET BAPI2017_GM_HEAD_RET u 14 Material document number/material document year
MATDOCUMENTYEAR BAPI2017_GM_HEAD_RET-DOC_YEAR N 4 Year of material document
MATERIALDOCUMENT BAPI2017_GM_HEAD_RET-MAT_DOC C 10 Number of Material Document

Parameter Reference Length Optional Text
GOODSMVT_ITEM BAPI2017_GM_ITEM_CREATE 1106 Material document items
GOODSMVT_SERIALNUMBER BAPI2017_GM_SERIALNUMBER 94 X Serial Number
IS_MP_GOODSMVT_ITEM /SAPMP/BAPI2017_GM_ITEM_CREATE 8 X BAPI Communication Structure: Material Document Item Single-Unit Batch
RETURN BAPIRET2 548 Confirmations

Functionality
You use this method to create a material document for a goods movement,while taking into account single-unit batch information.
Only one material document can be created each time the method iscalled.
You can use a simulation function prior to posting to check how the datais written to the database. In the standard system, the goods movementis posted without prior simulation.
Ensure that you transfer the data in the same form as it appears in thedatabase, for example:

  • 18-character material number that begins with zeros

  • Batches in upper case type

  • Ensure to enter the posting date for all of the operations in the headerdata of the material document. Do so by filling the PSTNG_DATEfield (import structure GOODSMVT_HEADER) in theBAPI2017_GM_HEAD_01 interface.

    Notes
    Transfer
    The following information is transferred to the method using thematerial document to be created:

    • A structure containing the header data

    • A structure containing the code for the movement

    • A table containing the item data

    • A table containing single-unit batch information for the item data

    • Table parameter IS_MP_GOODSMVT_ITEM(/SAPMP/BAPI2017_GM_ITEM_CREATE structure)
      INDEX_GDSMVT field
      A unique assignment to an entry in the GOODSMVT_ITEM table has tobe made using the index for this entry.
      SU_BATCH_SET field
      The field has to be filled with the value 'X', because the value BLANKhas a particular meaning in the SU_BATCH and SU_BATCH_TPfields. If the SU_BATCH_SET field contains the value BLANK, thesingle-unit batch information is taken from the default values in thematerial master.
      • A table containing the serial numbers

      • The method uses the methodBAPI_GOODSMVT_CREATE and its parameters.
        Confirmations
        INCLUDE BAPI_RET

        Further information
        INCLUDE BAPI_INVENTUR_WEITERINF

        Description
        If the material document has been posted successfully, this structuretransfers the fields that have been filled to the caller.
        INCLUDE BAPI_DATAELEMENT
        Number of the Material Document
        Material Document Year

        Description
        INCLUDE BAPI_KEYFIELD

        Description
        INCLUDE BAPI_KEYFIELD

        Description
        This parameter transfers the conversion of the GM_CODE to the relevanttransactions in inventory management.
        INCLUDE BAPI_DATAELEMENT

        Description
        This structure contains the header data for the material document to becreated.
        INCLUDE BAPI_DATAELEMENT

        Description
        This parameter transfers the data to enable simulation of the goodsmovement before posting.
        INCLUDE BAPI_DATAELEMENT OBJECT DOKU ID TX LANGUAGE DE
        TESTRUN

        Description
        This table contains the item data for the material document to becreated.
        INCLUDE BAPI_DATAELEMENT

        Description
        INCLUDE BAPI_DATAELEMENT
        Serialnummer

        Default
        The system determines the serial numbers for an item automatically whenthe XSAUT indicator is set in the GoodsmvtItem tableparameter.
        Various scenarios are possible when you create a goods movement withserial numbers:
        The XSAUT indicator is set:

        • If all serial numbers are set automatically for an item.

        • If serial numbers are set for part of the item quantity, and the
        • remaining serial numbers are set automatically.
          The XSAUT indicator is set:
          • If the serial numbers are set for the entire item quantity.

          • If serial numbers are only set for part of the item quantity.

          • ,,If you have not specified that the remaining serial numbers should bedetermined ,,automatically, the system issues an error message.
            If the quantity of serial numbers exceeds the quantity of items, thesystem issues an error message.

            Description
            INCLUDE /SAPMP/BAPI_GOODSMOVEMENT_IT

            Description
            INCLUDE BAPI_TABLE

            Default
            INCLUDE BAPI_WARENBEWEGUNG_RETURN