SAP Function BAPI_MATERIAL_SAVEREPLICA - BAPI for Mass Maintenance of Material Data

Parameter Reference Type Length Default Optional Text
FLAG_CAD_CALL BAPIE1GLOBAL_DATA-TESTRUN C 1 SPACE X Call From CAD System
FLAG_ONLINE BAPIE1GLOBAL_DATA-TESTRUN C 1 SPACE X No ALE Field Selection
INPFLDCHECK BAPIE1GLOBAL_DATA-INP_FLD_CHECK C 1 Response if Fields Are Inactive
NOAPPLLOG BAPIE1GLOBAL_DATA-NO_APPL_LOG C 1 Do Not Write an Application Log
NOCHANGEDOC BAPIE1GLOBAL_DATA-NO_CHANGE_DOC C 1 Do not write change documents
NO_ROLLBACK_WORK BAPIE1GLOBAL_DATA-TESTRUN C 1 SPACE X Override Rollback Work
TESTRUN BAPIE1GLOBAL_DATA-TESTRUN C 1 Switch to Simulation Session for Write BAPIs

Parameter Reference Type Length Text
RETURN BAPIRET2 u 548 Return Parameter

Parameter Reference Length Optional Text
CLIENTDATA BAPIE1MARA 1088 X Material Data at Client Level
CLIENTDATAX BAPIE1MARAX 234 X Update Information for CLIENTDATA
EXTENSIONIN BAPIE1PAREX 1082 X Reference Structure for BAPI Parameters EXTENSIONIN/EXTENSIONOUT
EXTENSIONINX BAPIE1PAREXX 1082 X Checkbox Structure for Extension In/Extension Out
FORECASTPARAMETERS BAPIE1MPOP 150 X Forecast Parameters
FORECASTPARAMETERSX BAPIE1MPOPX 127 X Update Information for FORECASTPARAMETERS
FORECASTVALUES BAPIE1MPRW 144 X Data Transfer for Forecast Values
HEADDATA BAPIE1MATHEADER 120 Header Segment with Control Information
INTERNATIONALARTNOS BAPIE1MEAN 130 X International Article Numbers (EANs)
MATERIALDESCRIPTION BAPIE1MAKT 147 X Material Descriptions
MATERIALLONGTEXT BAPIE1MLTX 325 X Long Texts
PLANNINGDATA BAPIE1MPGD 221 X Change Document Structure for Material Master/Product Group
PLANNINGDATAX BAPIE1MPGDX 113 X Update Information for PLANNINGDATA
PLANTDATA BAPIE1MARC 1001 X Material Data at Plant Level
PLANTDATAX BAPIE1MARCX 276 X Update Information for PLANTDATA
PRTDATA BAPIE1MFHM 172 X Production Resource Tool (PRT) Fields in the Material Master
PRTDATAX BAPIE1MFHMX 131 X Update Information for PRTDATA
RETURNMESSAGES BAPIE1RET2 548 X Substitute Structure for Return Parameter BAPIRET2
SALESDATA BAPIE1MVKE 330 X Sales Data
SALESDATAX BAPIE1MVKEX 151 X Update Information for SALESDATA
STORAGELOCATIONDATA BAPIE1MARD 160 X Material Data at Storage Location Level
STORAGELOCATIONDATAX BAPIE1MARDX 119 X Update Information for STORAGELOCATIONDATA
STORAGETYPEDATA BAPIE1MLGT 158 X Storage type data
STORAGETYPEDATAX BAPIE1MLGTX 117 X Update Information for STORAGETYPEDATA
TAXCLASSIFICATIONS BAPIE1MLAN 154 X Control Data
TOTALCONSUMPTION BAPIE1MVEG 132 X Data Transfer for Total Consumption of Material
UNITSOFMEASURE BAPIE1MARM 209 X Units of Measure
UNITSOFMEASUREX BAPIE1MARMX 131 X Update Information for UNITSOFMEASURE
UNPLNDCONSUMPTION BAPIE1MVEU 132 X Data Transfer for Unplanned Consumption
VALUATIONDATA BAPIE1MBEW 420 X Valuation Data
VALUATIONDATAX BAPIE1MBEWX 164 X Update Information for VALUATIONDATA
WAREHOUSENUMBERDATA BAPIE1MLGN 192 X Warehouse Number Data
WAREHOUSENUMBERDATAX BAPIE1MLGNX 134 X Update Information for WAREHOUSENUMBERDATA

Functionality
Use this method to create new material master data or change existingmaterial master data. Every time this method is called, data for one ormore materials can be transferred.
When new material master data is created, the material number, thematerial type and the sector must be sent to the method. Furthermore, ashort text and the language in which the short text has been created,have to be entered. When data is being changed, only the material numberneed be entered.
In the header data, at least one view has to be selected for which thedata is to be created. Depending on the selected view, additionalmandatory parameters that have been defined as such in Customizing haveto be created. If not all mandatory fields are field with data, themethod ends with an error message being displayed.
First, the appropriate fields in the tables (for example, CLIENTDATA)have to be filled with data by the user. These fields must also beflagged as the method data can only be written to the database if thisis the case. The user must also provide data for the appropriate fieldsthat have been selected in a checkbox table (for example, CLIENTDATAX).Checkbox tables exist for tables that do not contain language-dependenttexts (MAKT, MLTX), European article numbers (MEAN) and taxclassifications (MLAN). More than one data record can be created for amaterial in these tables (for all materials transferred to the method).
If a structure contains fields for a unit of measure (for example,structure CLIENTDATA, field BASE_UOM), language indicator (for example,structure MATERIALDESCRIPTION, field LANGU) or country identifier (forexample, structure TAXCLASSIFICATIONS, field DEPCOUNTRY) then asimilarly-named field ending with _ISO also exists. In doing so, theuser has the option of using the internal SAP code or the ISO code forunits of measure, language indicators or country identifiers. ISO codesare converted into an SAP code for further processing. The ISO code isonly used if the SAP code is not displayed. In Customizing under"General Settings", a clear assignment has to be made between the ISOcodes and the SAP codes for the following activities, if you want to useISO codes:
INCLUDE ISO OBJECT DOKU ID TX
If long texts (for example, basic data texts, internal notes, purchasinginfo texts, material notes or sales and distribution texts) orcustomer-specific fields have to be created for a material, somespecific characteristics have to be taken into consideration. Thesecharacteristics are detailed in the documentation for parametersMATERIALLONGTEXT and EXTENSIONIN.

Description
This structure is used to return the return code to the calling program.
For information on the meaning of the individual fields in the structure
, see the corresponding data element documentation on the individualfields.
Since numerous information and error messages can occur duringprocessing of the material, the messages are collected and stored intable RETURNMESSAGES. The return parameter only contains the informationas to whether or not the material could be successfully created/changed.
If the material could be created/changed without any major errors, thereturn parameter receives a message of type S (success message).Otherwise it receives a message of type E (error message).

Description
This flag must be set if the BAPI is called from a CAD system.

Description
You must set this flag if you want to receive a message if there arefields that are not ready for input.

Description
This checkbox structure can be used to specify whether an applicationlog is generated or not.
If the parameter is initial, the system generates an application log.

Description
This checkbox structure can be used to specify whether change documentsshould be created during processing of material data.
If the parameter is initial, the system generates change documents.

Description
This checkbox structure can be used to specify whether data isprocessed with or without a subsequent update.
If the parameter is initial, the system updates the data afterprocessing.

Description
Use this structure to display the general basic data for the materials.
INCLUDE DE_DOKU OBJECT DOKU ID TX LANGUAGE EN

Notes
INCLUDE MUSSEINGABENALR OBJECT DOKU ID TX LANGUAGE EN
Field PO_UNIT (or PO_UNIT_ISO) should only contain a unit of measure ifthe order unit of measure does not match the base unit of measure (FeldBASE_UOM or BASE_UOM_ISO).
INCLUDE FOLG_FELDALR OBJECT DOKU ID TX LANGUAGE EN

  • BASE_UOM (or BASE_UOM_ISO)

  • PO_UNIT (or PO_UNIT_ISO)
  • Description
    Use this structure (checkbox) to control which fields in the assigneddata structure (CLIENTDATA) contain change relevant data.
    INCLUDE ANKREUZLEISTE OBJECT DOKU ID TX LANGUAGE EN
    INCLUDE BAPIUPDATE OBJECT DOKU ID TX LANGUAGE EN

    Example
    Only the old material number is to be changed for the material withMAT01:
    Structure CLIENTDATA contains the following data:

    • OLD_MAT_NO,,MAT01_OLD

    • The remaining fields in structure CLIENTDATA can contain any data (orcan simply be left blank).
      Structure CLIENTDATAX must be configured as follows:
      • OLD_MAT_NO,,X

      • All other fields in structure CLIENTDATAX must be blank. The materialnumber is defined in field HEADDATA-MATERIAL.

        Description
        Use this structure to transfer customer-specific fields for materials.
        Information for transferring these fields is detailed in the functionmodule documentation.

        Value range
        In addition to previously defined table fields you can also providecustomer-specific table fields with data. As these fields are created bythe customer, they can only be recognized during runtime and must,therefore, be determined dynamically.
        First, structures BAPI_TE_ ( = MARA, MARC, MARD, MBEW, MLGN,MLGT, MVKE, MARM, MAKT) and the appropriate check structures BAPI_TE_
        ( = MARAX, for example) have to be extended by the customerto include the required fields. The structures that are delivered asstandard only contain the relevant key fields. When new fields are addedto this structure, you should ensure that a field has the same name asthe field in the database table. Furthermore, the fields in thestructures BAPI_TE_ can only be CHARACTER fields. Data elementBAPIUPDATE is to be used for the fields in the check structure(exception to this: key fields.)
        Parameters EXTENSIONIN and EXTENSIONINX are used for transferring datato the method. Field STRUCTURE contains the name of the structure (forexample, BAPI_TE_MARA or BAPI_TE_MARAX). This names is used to identifythe work area (for example, WA_BAPI_TE_MARA or WA_BAPI_TE_MARAX) towhich the data is transferred. The remaining fields in parametersEXTENSIONIN or EXTENSIONINX contain data for the key fields (forexample, the material number) and the data for customer-specific fields.The number of characters reserved in both parameters for the contents ofthe customer-specific fields must match the number of characters for therelevant field in the work area. If the number of required characters isless, the remaining characters are left blank. Only when all charactershave been filled can the contact for an additional field be transferred.Bear in mind that only data for which an appropriate indicator has beenset in the work area can be updated to the database.

        Description
        This structure (checkbox structure) is used to control which fields inthe assigned user data structure (EXTENSIONIN) contain change-relevantinformation.
        INCLUDE ANKREUZLEISTE OBJECT DOKU ID TX LANGUAGE EN
        INCLUDE BAPIUPDATE OBJECT DOKU ID TX LANGUAGE EN

        Description
        This structure can be used to transfer the forecast parameters for thematerial.
        INCLUDE DE_DOKU OBJECT DOKU ID TX LANGUAGE EN

        Description
        This structure (checkbox structure) is used to control which fields inthe assigned user data structure (FORECASTPARAMETERS) containchange-relevant information.
        INCLUDE ANKREUZLEISTE OBJECT DOKU ID TX LANGUAGE EN
        INCLUDE BAPIUPDATE OBJECT DOKU ID TX LANGUAGE EN

        Description
        This structure can be used to transfer the forecast values for thematerial.
        For information on the meaning of individual fields in the structure,see the relevant data element documentation for the fields.

        Description
        This structure is used for storing data required for maintaining amaterial. The fields match the fields displayed in the initial screenfor online maintenance when a material is created for the first time.
        When creating new material master data, only a single material can becreated or changed in this structure.
        INCLUDE DE_DOKU OBJECT DOKU ID TX LANGUAGE EN

        Notes
        The following fields must contain data in the structure when a materialis created for the first time:

        • MATERIAL

        • Only external number assignments are used for material number(MATERIAL). If an internal number is to be assigned, methodBAPI_MATERIAL_GETINTNUMBER must be called. This method defines aninternal number for the material that is to be created. The newinternal number should be entered in field HEADDATA-MATERIAL.
          • IND_SECTOR

          • MATL_TYPE

          • When data is changed, the field MATERIAL in the structure must containdata.
            At least one of the following views must be selected:
            • BASIC_VIEW (required when a new material is created)

            • SALES_VIEW

            • PURCHASE_VIEW

            • MRP_VIEW

            • FORECAST_VIEW

            • WORK_SCHED_VIEW

            • PRT_VIEW

            • STORAGE_VIEW

            • WAREHOUSE_VIEW

            • QUALITY_VIEW

            • ACCOUNT_VIEW

            • COST_VIEW

            • Update structures (for example, CLIENTDATAX, PLANTDATAX) exist forindividual data structures (for example, CLIENTDATA, PLANTDATA). Theupdate structures contain information about which fields in theassigned data structure should be changed.

              Description
              Use this structure to transfer the European Article Numbers (EAN) for amaterial.
              INCLUDE DE_DOKU OBJECT DOKU ID TX LANGUAGE EN
              In this structure, data for the main EAN and alternative EANs isentered for each unit of measure. The main EAN is the EAN that has beenentered in structure UNITSOFMEASURE in field EAN_UPC for the relevantunit of measure.

              Default

              Notes
              If EANs are also used for specific vendors (see structure VENDOREAN),they must also be transferred in structure INTERNATIONALARTNOS.
              INCLUDE UNITSOFMEASUREALR OBJECT DOKU ID TX LANGUAGE EN
              If a material EAN is to be changed (for example, the assignment to themain EAN is to be changed), all units of measure assigned in structureUNITSOFMEASURE have to be transferred because this structure containsinformation identifying the main EAN for the appropriate unit ofmeasure.

              Description
              This structure can be used to transfer the material's short texts.
              INCLUDE DE_DOKU OBJECT DOKU ID TX LANGUAGE EN

              Description
              Use this structure to display material long texts.
              INCLUDE DE_DOKU OBJECT DOKU ID TX LANGUAGE EN

              Hinweis
              Different long texts (for example, basic data texts, purchasing texts,internal notes, sales and distribution texts, material notes) for becreated for a material. To do this, fields APPLOBJECT, TEXT_NAME,TEXT_ID and LANGU or LANGU_ISO have to be filled in table parameterMATERIALLONGTEXT. Depending on the contents of field TEXT_ID, fieldTEXT_NAME has to be structured as follows: the material number isdisplayed first. If the material number contains few than 18characters, the remaining character spaces must be left blank. If thelong text concerned is a material note (LTXT) the site key must also beincluded as of character 19. For a sales text (0001), the salesorganization and the distribution channel must be included. Thefollowing table defines which combinations are permitted for the fourdifferent fields.
              APPLOBJECT,,TEXT_NAME,,,,TEXT_ID,,,,LANGU
              MATERIAL,,Number (18 characters) ,,PO, green,,,,Language
              MDTXT,,Numebr (18 characters) ,, LTXT,,,,Language
              ,,Site
              MVKE,,Number (18 characters) ,,0001,,,,Language
              ,,Sales organization and
              ,,distribution channel

              Description
              This structure can be used to transfer the preplanning data for thematerial.
              INCLUDE DE_DOKU OBJECT DOKU ID TX LANGUAGE EN

              Description
              This structure (checkbox structure) is used to control which fields inthe assigned user data structure (PLANNINGDATA) contain change-relevantinformation..
              INCLUDE ANKREUZLEISTE OBJECT DOKU ID TX LANGUAGE EN
              INCLUDE BAPIUPDATE OBJECT DOKU ID TX LANGUAGE EN

              Description
              This structure can be used to transfer plant-specific data for thematerial.
              INCLUDE DE_DOKU OBJECT DOKU ID TX LANGUAGE EN

              Description
              This structure (checkbox structure) is used to control which fields inthe assigned user data structure (PLANTDATA) contain change-relevantinformation.
              INCLUDE ANKREUZLEISTE OBJECT DOKU ID TX LANGUAGE EN
              INCLUDE BAPIUPDATE OBJECT DOKU ID TX LANGUAGE EN

              Description
              This structure can be used to transfer the material's productionresources/tools data.
              INCLUDE DE_DOKU OBJECT DOKU ID TX LANGUAGE EN

              Description
              This structure (checkbox structure) is used to control which fields inthe assigned user data structure (PRTDATA) contain change-relevantinformation.
              INCLUDE ANKREUZLEISTE OBJECT DOKU ID TX LANGUAGE EN
              INCLUDE BAPIUPDATE OBJECT DOKU ID TX LANGUAGE EN

              Description
              This table is used for storing messages processed by this method.
              Information about the importance of individual fields in the structurecan be found in the appropriate data element documentation for theindividual fields.
              As numerous warning and error messages may occur when the material isbeing processed, any messages that are generated are stored in thistable. The last message to be processed is sent to the return parameter(RETURN).

              Function Module
              BAPI_MATERIAL_SAVEDATA

              Description
              This structure can be used to transfer the material's sales data.
              INCLUDE DE_DOKU OBJECT DOKU ID TX LANGUAGE EN

              Description
              This structure (checkbox structure) is used to control which fields inthe assigned user data structure (SALESDATA) contain change-relevantinformation.
              INCLUDE ANKREUZLEISTE OBJECT DOKU ID TX LANGUAGE EN
              INCLUDE BAPIUPDATE OBJECT DOKU ID TX LANGUAGE EN

              Description
              This structure can be used to transfer the storage location-specificdata for the material.
              INCLUDE DE_DOKU OBJECT DOKU ID TX LANGUAGE EN

              Description
              This structure (checkbox structure) is used to control which fields inthe assigned user data structure (STORAGELOCATIONDATA) containchange-relevant information.
              INCLUDE ANKREUZLEISTE OBJECT DOKU ID TX LANGUAGE EN
              INCLUDE BAPIUPDATE OBJECT DOKU ID TX LANGUAGE EN

              Description
              This structure can be used to transfer the storage type-specific datafor the material.
              INCLUDE DE_DOKU OBJECT DOKU ID TX LANGUAGE EN

              Description
              This structure (checkbox structure) is used to control which fields inthe assigned user data structure (STORAGELOCATIONDATA) containchange-relevant information.
              INCLUDE ANKREUZLEISTE OBJECT DOKU ID TX LANGUAGE EN
              INCLUDE BAPIUPDATE OBJECT DOKU ID TX LANGUAGE EN

              Description
              This structure can be used to transfer the tax classification of thematerial.
              INCLUDE DE_DOKU OBJECT DOKU ID TX LANGUAGE EN

              Description
              This structure can be used to transfer the total consumption of thematerial.
              For information on the meaning of individual fields in the structure,see the data element documentation for the fields.

              Description
              Use this structure to adopt the units of measure for a material.
              INCLUDE DE_DOKU OBJECT DOKU ID TX LANGUAGE EN
              This structure is used for adopting data for the base unit of measurefor an article and for alternative units of measure. The base unit ofmeasure is the unit of measure defined in structure CLIENTDATA in fieldBASE_UOM (or BASE_UOM_ISO).

              Notes
              If field EAN_UPC contains an EAN that does not exist in your system, anappropriate entry must be made for the new EAN in structureINTERNATIONALARTNOS.

              Description
              This structure (checkbox structure) is used to control which fields inthe assigned user data structure (UNITSOFMEASURE) containchange-relevant information.
              INCLUDE ANKREUZLEISTE OBJECT DOKU ID TX LANGUAGE EN
              INCLUDE BAPIUPDATE OBJECT DOKU ID TX LANGUAGE EN

              Description
              Use this structure to display uncalculated consumption for a specificmaterial.
              Information about the meaning of individual fields in the structure canbe found in the appropriate data element documentation for theindividual fields.

              Description
              This structure can be used to transfer the valuation data for thematerial.
              INCLUDE DE_DOKU OBJECT DOKU ID TX LANGUAGE EN

              Description
              This structure (checkbox) controls which fields contain change relevantinformation for the assigned data structure (VALUATIONDATA).
              INCLUDE ANKREUZLEISTE OBJECT DOKU ID TX LANGUAGE EN
              INCLUDE BAPIUPDATE OBJECT DOKU ID TX LANGUAGE EN

              Description
              This structure can be used to transfer the warehouse number-specificdata for the material.
              INCLUDE DE_DOKU OBJECT DOKU ID TX LANGUAGE EN

              Description
              Use this structure (checkbox list) to control which fields in theassigned data structure (WAREHOUSENUMBERDATA) contain change-relevantdata.
              INCLUDE ANKREUZLEISTE OBJECT DOKU ID TX LANGUAGE EN
              INCLUDE BAPIUPDATE OBJECT DOKU ID TX LANGUAGE EN

1147949Missing authorization check for sales data