SAP Function /SAPMP/BAPI_MATERIAL_SAVEDATA - Mill Products: Create and Change Material Master Data

Parameter Reference Type Length Default Optional Text
CLIENTDATA BAPI_MARA u 986 X Client-specific material data
CLIENTDATAX BAPI_MARAX u 131 X Information on Update for CLIENTDATA
FLAG_CAD_CALL SYST-DATAR C 1 SPACE X Call From CAD System
FLAG_ONLINE SYST-DATAR C 1 SPACE X No ALE Field Selection
FORECASTPARAMETERS BAPI_MPOP u 47 X Forecast Parameters
FORECASTPARAMETERSX BAPI_MPOPX u 24 X Information on Update for FORECASTDATA
HEADDATA BAPIMATHEAD u 118 Header segment with control information
IS_MP_CLIENTDATA /SAPMP/BAPI_MARA u 54 X IS-MP: Material Data on Client Level
IS_MP_CLIENTDATAX /SAPMP/BAPI_MARAX u 17 X Check List for /SAPMP/BAPI_MARA
IS_MP_PLANTDATA /SAPMP/BAPI_MARC u 5 X IS-MP: Material Data on Plant Level
IS_MP_PLANTDATAX /SAPMP/BAPI_MARCX u 3 X Checkbox Structure for /SAPMP/BAPI_MARC
PLANNINGDATA BAPI_MPGD u 118 X Planning Data
PLANNINGDATAX BAPI_MPGDX u 10 X Information on Update for PLANNINGDATA
PLANTDATA BAPI_MARC u 887 X Plant-specific material data
PLANTDATAX BAPI_MARCX u 173 X Information on Update for PLANTDATA
SALESDATA BAPI_MVKE u 227 X Sales Data
SALESDATAX BAPI_MVKEX u 48 X Information on Update for SALESDATA
STORAGELOCATIONDATA BAPI_MARD u 48 X Storage-location-specific material data
STORAGELOCATIONDATAX BAPI_MARDX u 16 X Information on Update for STORAGELOCATIONDATA
STORAGETYPEDATA BAPI_MLGT u 55 X Storage-type-specific material data
STORAGETYPEDATAX BAPI_MLGTX u 14 X Information on Update for STORAGETYPEDATA
VALUATIONDATA BAPI_MBEW u 315 X Valuation Data
VALUATIONDATAX BAPI_MBEWX u 61 X Information on Update for VALUATIONDATA
WAREHOUSENUMBERDATA BAPI_MLGN u 89 X Warehouse-number-specific material data
WAREHOUSENUMBERDATAX BAPI_MLGNX u 31 X Information on Update for WAREHOUSEDATA

Parameter Reference Type Length Text
RETURN BAPIRET2 u 548 Return Parameters

Parameter Reference Length Optional Text
EXTENSIONIN BAPIPAREX 990 X Reference Structure for BAPI Parameters EXTENSIONIN/EXTENSIONOUT
EXTENSIONINX BAPIPAREXX 990 X Reference Structure for BAPI Parameters EXTENSIONIN/EXTENSIONOUT
INTERNATIONALARTNOS BAPI_MEAN 27 X International Article Numbers (EANs)
MATERIALDESCRIPTION BAPI_MAKT 44 X Material Descriptions
MATERIALLONGTEXT BAPI_MLTX 222 X Long Texts
NFMCHARGEWEIGHTS /NFM/BAPITVGW 26 X /NFM/: NF Charge Weights for Materials on Org. Level
NFMCHARGEWEIGHTSX /NFM/BAPITVGWX 16 X /NFM/: Update Information for /NFM/BAPITVGW
NFMSTRUCTURALWEIGHTS /NFM/BAPITKGW 28 X /NFM/: NF Structural Weights
NFMSTRUCTURALWEIGHTSX /NFM/BAPITKGWX 10 X /NFM/: Update Information for /NFM/BAPITKGW
PRTDATA BAPI_MFHM 69 X Production Resource Tool (PRT) Fields in the Material Master
PRTDATAX BAPI_MFHMX 28 X Information on Update for PRTDATAX
RETURNMESSAGES BAPI_MATRETURN2 548 X All Messages
TAXCLASSIFICATIONS BAPI_MLAN 51 X Tax classifications
UNITSOFMEASURE BAPI_MARM 106 X Units of Measure
UNITSOFMEASUREX BAPI_MARMX 28 X Information on Update for UNITSOFMEASURE

Functionality
You use this method to create new material master data or changeexisting material master data. You can transfer material data for eachcall.
When you create new material master data, you have to transfer thematerial number, material type and the industry to the method. You alsohave to enter a short text and the language in which the short text wasentered.
When you change existing material master data, you only have to enterthe material number.
You have to select at least one view in header data for which to createdata. You then have to maintain additional obligatory parameters for theselected parameter. If you have not filled all the obligatory parameters
, the system ends the method by issuing an error message.
Firstly, you have to fill the relevant fields in the tables (for example
, CLIENTDATA). For the method data to be updated to the database, youalso have to set an additional indicator for each of these fields in acheckbox table (for example, CLIENTDATAX). Checkbox tables exist fortables that do not contain any language-dependent text (MAKT, MLTX), anyEuropean Article Numbers (MEAN) or any tax classification (MLAN). You ca
n create several data records for a material in these tables.
INCLUDE ISO OBJECT DOKU ID TX
If you want to maintain long texts (basic data texts, internal comments,purchase order texts, material memos or sales texts) orcustomer-specific fields, observe the special requirements described inthe documentation for the parameters MATERIALLONGTEXT or EXTENSIONIN.

Description
INCLUDE STRUKTUR OBJECT DOKU ID TX LANGUAGE DE
INCLUDE DE_DOKU OBJECT DOKU ID TX LANGUAGE DE
Many information and error messages can appear during processing. Themessages that are generated are collected and stored in the tableH_MESSAGES. The return parameter only contains information about whetherthe material was successfully created/changed or not.
INCLUDE GRAVIEREND OBJECT DOKU ID TX LANGUAGE DE

Value range
TYPE,,ID,,NUMBER,,MESSAGE
S,,MG,,537,,Messages about material &: Log number &
E,,MG,,537,,Messages about material &: Log number &

Description
You use this structure to transfer the general basic data for amaterial.
INCLUDE DE_DOKU OBJECT DOKU ID TX LANGUAGE DE

Notes
INCLUDE MUSSEINGABENALR OBJECT DOKU ID TX LANGUAGE DE
Only enter a unit of measure in the field PO_UNIT (or PO_UNIT_ISO) ifthe order unit is not the same as the base unit of measure (fieldBASE_UOM or BASE_UOM_ISO).
INCLUDE FOLG_FELDALR OBJECT DOKU ID TX LANGUAGE DE

  • BASE_UOM (or BASE_UOM_ISO)

  • PO_UNIT (or PO_UNIT_ISO)
  • Description
    This structure (checkbox list) controls which fields in the assigneduser data structure (CLIENTDATA) contain change-relevant information.
    INCLUDE ANKREUZLEISTE OBJECT DOKU ID TX LANGUAGE DE
    INCLUDE BAPIUPDATE OBJECT DOKU ID TX LANGUAGE DE

    Example
    Only the old material number should be changed for the material with thenumber MAT01:
    The structure CLIENTDATA is filled as follows:

    • OLD_MAT_NO,,MAT01_OLD

    • You can fill the remaining fields of the structure CLIENTDATA asrequired (or, in the simplest case, leave them in initial status).
      The structure CLIENTDATAX must be filled as follows:
      • OLD_MAT_NO,,X

      • All other fields of the structure CLIENTDATAX must be in initial status.The material number is stored in the field HEADDATA-MATERIAL.

        Description
        You use this structure to transfer the forecast parameters for thematerial.
        INCLUDE DE_DOKU OBJECT DOKU ID TX LANGUAGE EN

        Description
        You use this structure (checkbox list) to control which fields in theassigned user data structure (FORECASTPARAMETERS) containchange-relevant information.
        INCLUDE ANKREUZLEISTE OBJECT DOKU ID TX LANGUAGE EN
        INCLUDE BAPIUPDATE OBJECT DOKU ID TX LANGUAGE EN

        Description
        The data that is required for maintaining a material is stored in thisstructure. The fields are largely similar to the fields available in theinitial screen of dialog maintenance when you create a new material.
        You can only create or change an individual material when you creatematerial master data.
        INCLUDE DE_DOKU OBJECT DOKU ID TX LANGUAGE DE

        Notes
        When you create a new material, you must fill the following fields inthe structure:

        • MATERIAL

        • The system only supports external number assignment for the materialnumber (MATERIAL). If you want to make an internal number assignment,you have to call the method BAPI_MATERIAL_GETINTNUMBER, which determinesan internal number for the material to be created. You then have toenter this internal number in the field HEADDATA-MATERIAL.
          • IND_SECTOR

          • MATL_TYPE

          • When you change the material data, you must fill the field MATERIAL inthe structure.
            You also have to select at least one view:
            • BASIC_VIEW (required when you create a new material)

            • SALES_VIEW

            • PURCHASE_VIEW

            • MRP_VIEW

            • FORECAST_VIEW

            • WORK_SCHED_VIEW

            • PRT_VIEW

            • STORAGE_VIEW

            • WAREHOUSE_VIEW

            • QUALITY_VIEW

            • ACCOUNT_VIEW

            • COST_VIEW

            • Relevant update structures (for example, CLIENTDATAX, PLANTDATAX) alsoexist for individual user data structures (for example, CLIENTDATA,PLANTDATA,). These update structures contain information about whichfields in the assigned user data structure are change-relevant.

              Description
              You use this structure to transfer the basic data for a length-basedmaterial or the technical data for a reel.
              INCLUDE DE_DOKU OBJECT DOKU ID TX LANGUAGE EN

              Notes
              INCLUDE MUSSEINGABENALR OBJECT DOKU ID TX LANGUAGE EN

              Description
              You use this structure (checkbox list) to control which fields in theassigned user data structure (IS_MP_CLIENTDATA) contain change-relevantinformation.
              INCLUDE ANKREUZLEISTE OBJECT DOKU ID TX LANGUAGE EN
              INCLUDE BAPIUPDATE OBJECT DOKU ID TX LANGUAGE EN

              Description
              You use this structure to transfer the plant-specific data for theindustry solution IS-MP.
              INCLUDE DE_DOKU OBJECT DOKU ID TX LANGUAGE DE
              It is not possible to post this data using /SAPMP/BAPI_MATERIAL_SAVEDATAbecause the data is set using characteristic valuation.
              You can use this structure (checkbox list) to control which fields inthe assigned user data structure (IS_MP_PLANTDATA) containchange-relevant information.
              INCLUDE ANKREUZLEISTE OBJECT DOKU ID TX LANGUAGE EN
              INCLUDE BAPIUPDATE OBJECT DOKU ID TX LANGUAGE EN

              Description
              You use this structure to transfer the forecast data for the material.
              INCLUDE DE_DOKU OBJECT DOKU ID TX LANGUAGE EN

              Description
              You use this structure (checkbox list) to control which fields in theassigned user data structure (PLANNINGDATA) contain change-relevantinformation.
              INCLUDE ANKREUZLEISTE OBJECT DOKU ID TX LANGUAGE EN
              INCLUDE BAPIUPDATE OBJECT DOKU ID TX LANGUAGE EN

              Description
              YOu use this structure to transfer plant-specific data for the material.
              INCLUDE DE_DOKU OBJECT DOKU ID TX LANGUAGE EN

              Notes

              Description
              You use this structure (checkbox list) to control which fields in theassigned user data structure (PLANTDATA) contain change-relevantinformation.
              INCLUDE ANKREUZLEISTE OBJECT DOKU ID TX LANGUAGE EN
              INCLUDE BAPIUPDATE OBJECT DOKU ID TX LANGUAGE EN

              Description
              You use this structure to transfer the sales data for the material.
              INCLUDE DE_DOKU OBJECT DOKU ID TX LANGUAGE EN

              Description
              You use this structure (checkbox list) to control which fields in theassigned user data (SALESDATA) contain change-relevant information.
              INCLUDE ANKREUZLEISTE OBJECT DOKU ID TX LANGUAGE EN
              INCLUDE BAPIUPDATE OBJECT DOKU ID TX LANGUAGE EN

              Description
              You use this structure to transfer the storage location specific datafor the material.
              INCLUDE DE_DOKU OBJECT DOKU ID TX LANGUAGE EN

              Description
              You use this structure (checkbox list) to control which fields in theassigned user data structure (STORAGELOCATIONDATA) containchange-relevant information.
              INCLUDE ANKREUZLEISTE OBJECT DOKU ID TX LANGUAGE EN
              INCLUDE BAPIUPDATE OBJECT DOKU ID TX LANGUAGE EN

              Description
              You use this structure to transfer the storage type specific data forthe material.
              INCLUDE DE_DOKU OBJECT DOKU ID TX LANGUAGE EN

              Description
              You use this structure (checkbox list) to control which fields in theassigned user data structure (STORAGELOCATIONDATA) containchange-relevant information.
              INCLUDE ANKREUZLEISTE OBJECT DOKU ID TX LANGUAGE EN
              INCLUDE BAPIUPDATE OBJECT DOKU ID TX LANGUAGE EN

              Description
              You use this structure to transfer the valuation data for the material.
              INCLUDE DE_DOKU OBJECT DOKU ID TX LANGUAGE EN

              Description
              You use this structure (checkbox list) to control which fields in theassigned user data structure (VALUATIONDATA) contain change-relevantinformation.
              INCLUDE ANKREUZLEISTE OBJECT DOKU ID TX LANGUAGE EN
              INCLUDE BAPIUPDATE OBJECT DOKU ID TX LANGUAGE EN

              Description
              You use this structure to transfer the warehouse number specific datafor the material.
              INCLUDE DE_DOKU OBJECT DOKU ID TX LANGUAGE EN

              Description
              You use this structure (checkbox list) to control which fields in theassigned user data structure (WAREHOUSENUMBERDATA) containchange-relevant information.
              INCLUDE ANKREUZLEISTE OBJECT DOKU ID TX LANGUAGE EN
              INCLUDE BAPIUPDATE OBJECT DOKU ID TX LANGUAGE EN

              Description
              You use this structure to transfer the customer-specific fields for amaterial.
              For more information about transferring these fields, see the functionmodule documentation.

              Hinweis
              As well as the table fields that have already been defined, you can fillcustomer-specific table fields. These fields are created by the customerand only known during runtime, so they have to be determineddynamically.
              Firstly, the customer has to add the required fields to the structuresBAPI_TE_ ( = MARA, MARC, MARD, MBEW, MLGN, MLGT, MVKE) andthe corresponding checkbox structures BAPI_TE_ (
              = MARAX, usw.). The structures in the standard delivery onlycontain the relevant key fields. When you are entering new fields inthese structures, ensure that the field has the same name as the fieldin the database table. In addition, the fields in the BAPI_TE_<(>
              <<)>NAME> structures can only be of the type CHARACTER. Use theBAPIUPDATE data element for the fields in the checkbox structure (exceptfor key fields).
              The EXTENSIONIN and EXTENSIONINXZ parameters are used to transfer thedata to the method. The name of the structure (for example BAPI_TE_MARAor BAPI_TE_MARAX) that is used to identify the work area to which thedata is transferred (for example, WA_BAPI_TE_MARA or WA_BAPI_TE_MARAX)is saved in the field STRUCTURE. The remaining fields of the parameterEXTENSIONIN or EXTENSIONINX contain the data for the key fields (forexample, the material number) and the data for the customer-specificfields. The number of places that are reserved in the two parameters forthe contents of a customer-specific field must match the number offields for the corresponding field in the work area. If the number ofrequired places is smaller, fill the remaining places in the parameterswith blank characters. Only then can you transfer the contents of asubsequent field.
              You must set indicators in the work area for the fields you want toupdate to the databank.

              Description
              You use this structure (checkbox list) to control which fields in theassigned user data structure (EXTENSIONIN) contain change-relevantinformation.
              INCLUDE ANKREUZLEISTE OBJECT DOKU ID TX LANGUAGE EN
              INCLUDE BAPIUPDATE OBJECT DOKU ID TX LANGUAGE EN

              Description
              You use this structure to transfer the European Article Numbers (EAN)for the material.
              INCLUDE DE_DOKU OBJECT DOKU ID TX LANGUAGE DE
              Data about the main EAN and about the alternative EANs is transferredfor each unit of measure in this structure. The main EAN is the EAN forthe relevant unit of measure that is stored in the field EAN_UPC in thestructure UNITSOFMEASURE.

              Notes
              If you use EANs for specific vendors (see the structure VENDOREAN), youalso have to transfer these in the structure INTERNATIONALARTNOS.
              INCLUDE UNITSOFMEASUREALR OBJECT DOKU ID TX LANGUAGE DE
              If you want to change an EAN for a material, such as the assignments forthe main EAN, you have to transfer all assigned units of measure in thestructure UNITSOFMEASURE. This structure contains the information aboutwhich EAN is the main EAN for the relevant unit of measure.

              Description
              You use this structure to transfer the short texts for the material.
              INCLUDE DE_DOKU OBJECT DOKU ID TX LANGUAGE EN

              Description
              You use this structure to transfer the material long texts.
              INCLUDE DE_DOKU OBJECT DOKU ID TX LANGUAGE DE

              Hinweis
              A variety of long texts can be created for a material (basic data texts,purchase order texts, internal comments, sales texts, material memos).To create them, you have to fill the fields APPLOBJECT, TEXT_NAME,TEXT_ID and LANGU or LANGU_ISO of the table parameter MATERIALLONGTEXT.The field TEXT_NAME has to be structured in accordance with the contentof the field TEXT_ID, as follows: firstly, you enter the materialnumber. If there are less than 18 characters in the material number, youhave to fill the additional spaces with blank characters. In a materialmemo (LTXT), you have to enter the plant key after the material number,that is to say, from the 19th character space onwards. In a sales text(0001), on the other hand, you enter the sales organization and thedistribution channel here. The following table indicates whichcombinations are permitted for the four fields.
              APPLOBJECT,,TEXT_NAME,,,,TEXT_ID,,,,,,,,LANGU
              MATERIAL,,Matl. No. (18 characters),,BEST, GRUN or IVER,,Language
              MDTXT,,Matl. No. (18 characters),,LTXT,,,,,,,,,,Language
              ,,Plant
              MVKE,,Matl. No. (18 characters),,0001,,,,,,,,,,Language
              ,,Sales Organization
              ,,and Distribution Channel
              INCLUDE '/NFM/CHARGEWEIGHT' OBJECT DOKU ID TX
              INCLUDE DE_DOKU OBJECT DOKU ID TX LANGUAGE EN
              INCLUDE '/NFM/CHARGEWEIGHTX' OBJECT DOKU ID TX
              INCLUDE ANKREUZLEISTE OBJECT DOKU ID TX LANGUAGE EN
              INCLUDE BAPIUPDATE OBJECT DOKU ID TX LANGUAGE EN
              INCLUDE '/NFM/STRUCTURALWEIGHT' OBJECT DOKU ID TX
              INCLUDE DE_DOKU OBJECT DOKU ID TX LANGUAGE EN
              INCLUDE '/NFM/STRUCTURALWEIGHTX' OBJECT DOKU ID TX
              INCLUDE ANKREUZLEISTE OBJECT DOKU ID TX LANGUAGE EN
              INCLUDE BAPIUPDATE OBJECT DOKU ID TX LANGUAGE EN

              Description
              You use this structure to transfer production resource and tool data forthe material.
              INCLUDE DE_DOKU OBJECT DOKU ID TX LANGUAGE EN

              Description
              You use this structure (checkbox list) to control which fields in theassigned user data structure (PRTDATA) contain change-relevant data.
              INCLUDE ANKREUZLEISTE OBJECT DOKU ID TX LANGUAGE EN
              INCLUDE BAPIUPDATE OBJECT DOKU ID TX LANGUAGE EN

              Description
              You use this table to store the messages processed by the method.
              INCLUDE DE_DOKU OBJECT DOKU ID TX LANGUAGE DE
              Many information and error messages can occur during processing of thematerial. The messages that are generated are stored in this table. Thelast message to be processed is transferred to the return parameter(RETURN).

              Description
              You use this structure to transfer the tax classifications for thematerial.
              INCLUDE DE_DOKU OBJECT DOKU ID TX LANGUAGE EN

              Description
              You use this structure to transfer the units of measure for thematerial.
              INCLUDE DE_DOKU OBJECT DOKU ID TX LANGUAGE DE
              Data about the base unit of measure and about the alternative units ofmeasure is transferred in this structure. The unit of measure that isstored in the structure CLIENTDATA in the field BASE_UOM (orBASE_UOM_ISO) is identified as the base unit of measure.

              Notes
              If an EAN that does not yet exist in the system is transferred in thefield EAN_UPC, this new EAN has to be entered in the structureINTERNATIONALARTNOS.

              Description
              You use this structure (checkbox list) to control which fields in theassigned user data structure (UNITSOFMEASURE) contain change-relevantinformation.
              INCLUDE ANKREUZLEISTE OBJECT DOKU ID TX LANGUAGE EN
              INCLUDE BAPIUPDATE OBJECT DOKU ID TX LANGUAGE EN