SAP Function /SAPMP/BAPI_MAT_BOM_GR_CREATE - Mill Products: Create a Material BOM Group

Parameter Reference Type Length Default Optional Text
ALL_ERROR XFLAG C 1 SPACE X Indicator
TESTRUN BAPIFLAG u 1 SPACE X Switch to Simulation Session for Write BAPIs

Parameter Reference Length Optional Text
BOMGROUP BAPI1080_BGR_C 138 BOM group CREATE-/CHANGE BAPI material BOM
ITEMASSIGNMENTS BAPI1080_REL_ITM_BOM_C 125 X Assignments CREATE-/CHANGE BAPI ITM/BOM material BOMs
ITEMS BAPI1080_ITM_C 540 X Components CREATE-/CHANGE BAPI Material BOM
LENGTHCALCULATION /SAPMP/BAPI1080_LC_ITM_C 48 X Length Calculation Data CREATE/CHANGE BAPI Material BOMs
MATERIALRELATIONS BAPI1080_MBM_C 153 Material assignment CREATE-/CHANGE BAPI Material BOM
RETURN BAPIRET2 548 Return Parameters
SUBITEMASSIGNMENTS BAPI1080_REL_SUI_ITM_C 102 X Assignments CREATE-/CHANGE BAPI SUI/ITM Mat.BOMs
SUBITEMS BAPI1080_SUI_C 138 X Sub item CREATE-/CHANGE BAPI Material BOM
TEXTS BAPI1080_TXT_C 201 X Long text line: CREATE-/CHANGE BAPI for material BOMs
VARIANTS BAPI1080_BOM_C 154 Alternative/Variant CREATE-/CHANGE BAPI Material BOM


This method is used to create a bill of material (BOM) and all of theobjects assigned to it.
If absolutely necessary, the entire bill of material can be copied, inother words,
All variants in a variant BOM or alternatives in a multiple BOM
The entire history
All material assignments
All items
All subitems
This allows initial data to be transferred from external systems in asingle step.
Caution:

  • Please bear in mind that a bill of material can only be copied once.
  • This means that you cannot copy different parts of the BOM group atdifferent times. For example, you cannot copy part of the variants oritems (especially those related to the history) and then copy the rest(such as other variants, other assignments, other historical states) ata later date.
    • Before you can copy a BOM successfully, all business objects that
    • refer to a BOM must have been transferred to an SAP system. Theseobjects are:
      Material masters
      Document info records, if there are document items in the BOM
      Classes, if you want to copy class items
      Change numbers that monitor the change state of the BOMs
      Standard texts, if you want to integrate these in the long texts ofthe BOM group, variants or items
      You want to copy several (complete) BOM groups and their entire history.
      • This includes their variants (in the case of variant BOMs) or their
      • alternatives (in the case of multiple BOMs) together with their historyand assigned long texts.
        • The assignments of the assembly materials perhaps from different plants
        • to the BOMs.
          • The relevant items and their historical states and long texts.

          • The subitems for these items.

          • To do so, you make entries in the following table, which are dividedinto three categories.
            • Tables that define objects

            • BOMGROUP,,,,,,-,,,,Basic data for whole BOM group
              VARIANTS,,,,,,,,-,,,,Variants or alternative data
              ITEMS,,,,,,,,-,,,,Items
              SUBITEMS,,,,,,,,-,,,,Subitems
              • Tables that define dependencies between objects

              • MATERIALRELATIONS,,,,-,,Assignment of header materials to the BOM groupwith the relevant conditions
                ITEMASSIGNMENTS,,,,-,,Conditions for assignments of components tovariants or alternatives
                SUBITEMASSIGNMENTS,,,,-,,Assignments of subitems to items
                • Table with other assigned attributes

                • TEXTS,,,,-,,Long texts for the different objects
                  In the transfer, the BOM groups are grouped together and given a uniquegroup definition of up to 32 characters (BOM_GROUP_IDENTIFICATION). Youenter this in all table entries. You can use this group definition toidentify any external (unique) BOM groups that you store in the SAPsystem.
                  You identify each object in a BOM group uniquely in the OBJECT_ID field.To enable easy identification of the objects in the import data flow,the following values are also entered in the OBJECT_TYPE field:
                  BOM,,,,in the VARIANTS table
                  BGR,,,,in the BOMGROUP table
                  ITM,,,,in the ITEMS table
                  SUI,,,,in the SUBITEMS table.
                  In addition to this general data, the various tables also contain thefollowing:
                  BOMGROUP
                  This table contains the basic characteristics of a BOM group, such as
                  BOM usage (BOM_USAGE)
                  Authorization group (AUTH_GROUP)
                  Description text (BOM_TEXT)
                  VARIANTS
                  This table contains the variant-specific data, such as
                  Laboratory (LAB_DESIGN)
                  Base quantity in which the component quantities are given (BASE_QTY)
                  Validity data, such as the change number (CHANGE_NO) or the valid fromdate (VALID_FROM_DATE)
                  In the FUNCTION field, you store the value
                  NEW,,,,If the variant validity begins on the specified valid from date
                  DEL ,,,,if the variant validity ends on the specified valid from date
                  ITEMS
                  This table contains the component attributes. Concurrent attributes thatrefer to primary objects, such as component material (COMPONENT),document number (DOCUMENT_NUMBER) and class number (CLASS_NUM) aredefined using the item type (ITEM_CAT). See SAP Customizing for moreinformation about the relevantitem types and other attributes that aredependent on the specified primary object.
                  SUBITEMS
                  This table contains data about the subitems, such as
                  Quantity (SUBITEM_QTY)
                  Installation point (INSTALLATION_POINT)
                  MATERIALRELATIONS
                  When you enter the BOM variant number, this table displays theassignments of assembly group materials to the BOM with the conditions
                  Plant
                  Lot size range with multiple BOMs (LOT_SIZE_FROM, LOT_SIZE_TO)
                  ITEMASSIGNMENTS
                  This table assigns the components to the different variants/alternativesor BOM group.
                  You enter the BOM component using the SUB_OBJECT_TYPE and SUB_OBJECT_IDfields and the variant/alternative using the SUPER_OBJECT_TYPE andSUPER_OBJECT_ID fields. In other words, you store the values from theOBJECT_TYPE and OBJECT_ID fields that appear in the ITEMS table in theSUB_OBJECT_TYPE and SUB_OBJECT_ID fields and the values from theOBJECT_TYPE and OBJECT_ID fields that appear in the VARIANTS table inthe SUPER_OBJECT_TYPE, SUPER_OBJECT_ID fields.
                  The validity period for the assignment is defined using the valid fromdate (VALID_FROM_DATE) or change number (CHANGE_NO).
                  You must enter either of the following values in the FUNCTION field
                  NEW,,,,Component validity begins on this date
                  DEL,,,,Component validity ends on this date
                  SUBITEMASSIGNMENTS
                  This table assigns the subitems to the components.
                  Enter the subitems using the SUB_OBJECT_TYPE and SUB_OBJECT_ID fieldsand the component using the SUPER_OBJECT_TYPE and SUPER_OBJECT_IDfields. In other words, store the values from the OBJECT_TYPE andOBJECT_ID fields that appear in the SUBIITEMS table in theSUB_OBJECT_TYPE and SUB_OBJECT_ID fields and the values from theOBJECT_TYPE and OBJECT_ID fields that appear in the ITEMS table in theSUPER_OBJECT_TYPE and SUPER_OBJECT_ID fields.
                  TEXTS
                  The TEXTS table contains the various long texts for all objects to whichlong text can be assigned. The assignment to the relevant objects isassigned using the OBJECT_TYP and OBJECT_ID fields.

                  Notes
                  To update the data to the database, you have to execute a COMMIT WORKafter each BOM group.
                  Any errors that occur are logged in the RETURN export parameter. If anyinconsistencies arise, the entire BOM group is discarded.
                  Two types of message are issued in the RETURN export parameter:

                  • Messages with the message ID BAPI provide information about the general
                  • result of input processing.
                    000,,Processing was successful
                    001,,Processing failed
                    • Messages with the message ID BAPI1080 provide detailed information about
                    • processing.
                      There are also two types of detail message:
                      • Message 028 indicates errors or warnings that result from the
                      • analysis of the structure of the BOM data. If only warning messages areissued, processing continues and is concluded successfully if no othererrors occur. However, you should take heed of the warning.
                        • Message 029 indicates errors in the data for the objects that
                        • have been imported (such as variants and items). In this case,processing is terminated.
                          In addition to messages 028 and 029, the system issues additional(error) messages that give a more detailed description of the particularsubobjects (for example, variants or items) or their mutualdependencies. You identify the objects using theBOM_GROUP_IDENTIFICATION message variables and you identify the objects(for example, variants or items) in a group using OBJECT_TYP andOBJECT_ID.
                          The system also issues the application log (if one exists) or theinternal message that was set in the APIs in the RETURN exportparameter.

                          Description
                          You use this parameter to define whether the consistency of thetransferred data should simply be checked or only written to thedatabase. The system will only write the data to the database if noinconsistencies have arisen.
                          A new BOM number from the internal number range will be issued even whenyou are only checking the consistency of the data. This number will nolonger be available for creating a new BOM.

                          Value range
                          The following values are permitted:
                          ' ' (BLANK),,Check and then flag for posting, if no inconsistenciesarise
                          'X',,Check only

                          Default
                          The default value is BLANK, that is to say, if there are noinconsistencies, the data is flagged for the database insert.

                          Description
                          This structure is used to transfer the basic data for a BOM group in SAPR/3.
                          To ensure that the whole BOM group in the imported data flow and thevarious data objects in the group (BOM group, (BOMGROUP),variants/alternatives (VARIANTS), items (ITEMS), subitems (SUBITEMS))are identified correctly, you must valuate the followingattributes.
                          BOM_GROUP_IDENTIFICATION ,,,,-,,Unique group identification with amaximum of 32 characters
                          OBJECT_TYPE,,,,- ,,Fixed value 'BGR'
                          OBJECT_ID,,,,- ,,Unique object identification with a maximum of 32characters
                          For more information about the meaning of the other parameter fields,see the relevant data element documentation in the ABAP Dictionary.
                          This structure contains the assignments of the items to thevariants/alternatives.
                          The following attributes must be valuated:
                          SUB_OBJECT_TYPE,,-,,Fixed value 'ITM'
                          SUB_OBJECT_ID,,-,,Unique identification (with a maximum of 32characters) of the item in the group
                          SUPER_OBJECT_TYPE,,-,,Fixed value 'BOM'
                          SUPER_OBJECT_ID,,-,,Unique identification (with a maximum of 32characters) of the variants/alternatives in the group
                          You must enter either the VALID_FROM_DATE or the CHANGE_NO attribute todefine the validity period of the assignment.
                          You must save one of the following values in the FUNCTION field:
                          NEW,,-,,Indicates when the validity of the item to variant/alternativeassignment begins (the specified key date/change status)
                          DEL,,-,,Indicates when the validity of the item to variant/alternativeassingment ends (the specified key date/change status)
                          This structure is used to transfer the item data.
                          To assign the items in the BOM group, you have to enter the value thatappears in the BOMGROUP structure in the BOM_GROUP_IDENTIFICATION field.
                          You must also valuate the following attributes to ensure that the itemsin the group can be identified correctly.
                          OBJECT_TYPE,,,,,,- ,,Fixed value 'ITM'
                          OBJECT_ID,,,,,,- ,,Unique identification (with a maximum of 32characters) in the group
                          You must enter one of the following values in the FUNCTION field:
                          NEW ,,,,,,,,,,-,,When the validity period of the item begins on thespecified key date
                          DEL ,,,,,,,,,,-,,When the validiy period of the item ends on thespecified key date
                          For more information about the remaining structure fields, see therelevant data element documentation in the ABAP Dictionary.

                          Description
                          The length calculation data for the BOM items is transferred in thistable.
                          The length calculation data is assigned to a BOM item in the DATAINDEXfield when you enter an index that refers to the assigned entry in theITEMS table.

                          Description
                          When you enter the BOM variant number, the structure contains theassignments of the assembly materials to the BOM group.
                          You must valuate the following attributes:
                          MATERIAL,,-,,Material
                          ALTERNATIVE_BOM,,-,,Alternative BOM
                          You have to enter an (existing) plant in the PLANT attribute if you areusing a plant BOM, that is to say, if the CREATED_IN_PLANT field in theBOMGROUP structure is filled with a plant. If, on the other hand, theCREATED_IN_PLANT field in the BOMGROUP structure is empty, you are usinga group BOM and you have to transfer an assignment record with PLANT = '' (BLANK) for each material and alternative.
                          For more information about the meaning of the remaining structure fields
                          , see the relevant data element documentation in the ABAP Dictionary.
                          All of the messages that are issued during the creation of a routing arecollected in this table. These messages can be used as a basis forcorrecting subsequent data inconsistencies.
                          The structure contains assignments of subitems to items.
                          The following attributes have to be valuated:
                          SUB_OBJECT_TYPE,,-,,Fixed value 'SUI'
                          SUB_OBJECT_ID,,-,,Unique, 32-character identification of the subitemwithin the group
                          SUPER_OBJECT_TYPE,,-,,Fixed value 'ITM'
                          SUPER_OBJECT_ID,,-,,Unique, 32.character identification of the subitemwithin the group

                          Description
                          This structure is used to transfer the subitem data.
                          To assign the subitems to the BOM group, you must enter the value thatappears in the BOMGROUP structure in the BOM_GROUP_IDENTIFICATION field.
                          You also have to valuate the following attributes to ensure that thesubitem in the group can be identified correctly.
                          OBJECT_TYPE,,,,,,- ,,Fixed value 'SUI'
                          OBJECT_ID,,,,,,- ,,Unique identification (with a maximum of 32characters) in the group
                          For more information about the meaning of the remaining structure fields
                          , see the relevant data element documentation in the ABAP Dictionary.
                          This structure is used to transfer the text line of the long texts thatare assigned to the objects.
                          To assign the texts to an object from the BOM group, you must enter thevalue that appears in the BOMGROUP structure in theBOM_GROUP_IDENTIFICATION field.
                          To identify the object that is assigned to the long text line, you mustalso valuate the following attributes.
                          OBJECT_TYPE,,- ,,Value ''BGR' or 'BOM' or 'ITM'
                          OBJECT_ID,,- ,,Unique object identification (with a maximum of 32characters) in the group
                          For more information about the meaning of the remaining structure fields
                          , see the relevant date element documentation in the ABAP Dictionary.

                          Description
                          This structure is used to transfer variant-specific data.
                          To assign variants/alternatives to the BOM group, you must enter thevalue that appears in the BOMGROUP structure in theBOM_GROUP_IDENTIFICATION field.
                          You must also valuate the following attributes to ensure correctidentification of the variants/alternatives in the group.
                          OBJECT_TYPE,,,,,,- ,,Fixed value 'BOM'
                          OBJECT_ID,,,,,,- ,,Unique object identification (with a maximum of 32characters) in the group
                          You must save one of the following values in the FUNCTION field:
                          NEW,,,,,,,,-,,Specified key date on which the validity date of thevariant begins
                          DEL,,,,,,,,-,,Specified key date on which the validity date of thevariant ends
                          For mor einformation about the remaining structure fields, see therelevant data element documentation in the ABAP Dictionary.