SAP BAPI_MATERIAL_SAVEREPLICA Function Module for BAPI for Mass Maintenance of Material Data
BAPI_MATERIAL_SAVEREPLICA is a standard bapi material savereplica SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for BAPI for Mass Maintenance of Material Data processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.
See here to view full function module documentation and code listing for bapi material savereplica FM, simply by entering the name BAPI_MATERIAL_SAVEREPLICA into the relevant SAP transaction such as SE37 or SE38.
Function Group: 1001MASSUEB
Program Name: SAPL1001MASSUEB
Main Program: SAPL1001MASSUEB
Appliation area:
Release date: 30-Apr-2003
Mode(Normal, Remote etc): Remote-Enabled
Update:

Function BAPI_MATERIAL_SAVEREPLICA pattern details
In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.CALL FUNCTION 'BAPI_MATERIAL_SAVEREPLICA'"BAPI for Mass Maintenance of Material Data.
EXPORTING
NOAPPLLOG = "Do Not Write an Application Log
NOCHANGEDOC = "Do not write change documents
TESTRUN = "Switch to Simulation Session for Write BAPIs
INPFLDCHECK = "Response if Fields Are Inactive
* FLAG_CAD_CALL = ' ' "Call From CAD System
* NO_ROLLBACK_WORK = ' ' "Override Rollback Work
* FLAG_ONLINE = ' ' "No ALE Field Selection
IMPORTING
RETURN = "Return Parameter
TABLES
HEADDATA = "Header Segment with Control Information
* STORAGELOCATIONDATA = "Material Data at Storage Location Level
* STORAGELOCATIONDATAX = "Update Information for STORAGELOCATIONDATA
* VALUATIONDATA = "Valuation Data
* VALUATIONDATAX = "Update Information for VALUATIONDATA
* WAREHOUSENUMBERDATA = "Warehouse Number Data
* WAREHOUSENUMBERDATAX = "Update Information for WAREHOUSENUMBERDATA
* SALESDATA = "Sales Data
* SALESDATAX = "Update Information for SALESDATA
* STORAGETYPEDATA = "Storage type data
* STORAGETYPEDATAX = "Update Information for STORAGETYPEDATA
* CLIENTDATA = "Material Data at Client Level
* MATERIALDESCRIPTION = "Material Descriptions
* UNITSOFMEASURE = "Units of Measure
* UNITSOFMEASUREX = "Update Information for UNITSOFMEASURE
* INTERNATIONALARTNOS = "International Article Numbers (EANs)
* MATERIALLONGTEXT = "Long Texts
* TAXCLASSIFICATIONS = "Control Data
* PRTDATA = "Production Resource Tool (PRT) Fields in the Material Master
* PRTDATAX = "Update Information for PRTDATA
* EXTENSIONIN = "Reference Structure for BAPI Parameters EXTENSIONIN/EXTENSIONOUT
* EXTENSIONINX = "Checkbox Structure for Extension In/Extension Out
* CLIENTDATAX = "Update Information for CLIENTDATA
* FORECASTVALUES = "Data Transfer for Forecast Values
* UNPLNDCONSUMPTION = "Data Transfer for Unplanned Consumption
* TOTALCONSUMPTION = "Data Transfer for Total Consumption of Material
* RETURNMESSAGES = "Substitute Structure for Return Parameter BAPIRET2
* PLANTDATA = "Material Data at Plant Level
* PLANTDATAX = "Update Information for PLANTDATA
* FORECASTPARAMETERS = "Forecast Parameters
* FORECASTPARAMETERSX = "Update Information for FORECASTPARAMETERS
* PLANNINGDATA = "Change Document Structure for Material Master/Product Group
* PLANNINGDATAX = "Update Information for PLANNINGDATA
IMPORTING Parameters details for BAPI_MATERIAL_SAVEREPLICA
NOAPPLLOG - Do Not Write an Application Log
Data type: BAPIE1GLOBAL_DATA-NO_APPL_LOGOptional: No
Call by Reference: No ( called with pass by value option)
NOCHANGEDOC - Do not write change documents
Data type: BAPIE1GLOBAL_DATA-NO_CHANGE_DOCOptional: No
Call by Reference: No ( called with pass by value option)
TESTRUN - Switch to Simulation Session for Write BAPIs
Data type: BAPIE1GLOBAL_DATA-TESTRUNOptional: No
Call by Reference: No ( called with pass by value option)
INPFLDCHECK - Response if Fields Are Inactive
Data type: BAPIE1GLOBAL_DATA-INP_FLD_CHECKOptional: No
Call by Reference: No ( called with pass by value option)
FLAG_CAD_CALL - Call From CAD System
Data type: BAPIE1GLOBAL_DATA-TESTRUNDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
NO_ROLLBACK_WORK - Override Rollback Work
Data type: BAPIE1GLOBAL_DATA-TESTRUNDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
FLAG_ONLINE - No ALE Field Selection
Data type: BAPIE1GLOBAL_DATA-TESTRUNDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for BAPI_MATERIAL_SAVEREPLICA
RETURN - Return Parameter
Data type: BAPIRET2Optional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for BAPI_MATERIAL_SAVEREPLICA
HEADDATA - Header Segment with Control Information
Data type: BAPIE1MATHEADEROptional: No
Call by Reference: Yes
STORAGELOCATIONDATA - Material Data at Storage Location Level
Data type: BAPIE1MARDOptional: Yes
Call by Reference: Yes
STORAGELOCATIONDATAX - Update Information for STORAGELOCATIONDATA
Data type: BAPIE1MARDXOptional: Yes
Call by Reference: Yes
VALUATIONDATA - Valuation Data
Data type: BAPIE1MBEWOptional: Yes
Call by Reference: Yes
VALUATIONDATAX - Update Information for VALUATIONDATA
Data type: BAPIE1MBEWXOptional: Yes
Call by Reference: Yes
WAREHOUSENUMBERDATA - Warehouse Number Data
Data type: BAPIE1MLGNOptional: Yes
Call by Reference: Yes
WAREHOUSENUMBERDATAX - Update Information for WAREHOUSENUMBERDATA
Data type: BAPIE1MLGNXOptional: Yes
Call by Reference: Yes
SALESDATA - Sales Data
Data type: BAPIE1MVKEOptional: Yes
Call by Reference: Yes
SALESDATAX - Update Information for SALESDATA
Data type: BAPIE1MVKEXOptional: Yes
Call by Reference: Yes
STORAGETYPEDATA - Storage type data
Data type: BAPIE1MLGTOptional: Yes
Call by Reference: Yes
STORAGETYPEDATAX - Update Information for STORAGETYPEDATA
Data type: BAPIE1MLGTXOptional: Yes
Call by Reference: Yes
CLIENTDATA - Material Data at Client Level
Data type: BAPIE1MARAOptional: Yes
Call by Reference: Yes
MATERIALDESCRIPTION - Material Descriptions
Data type: BAPIE1MAKTOptional: Yes
Call by Reference: Yes
UNITSOFMEASURE - Units of Measure
Data type: BAPIE1MARMOptional: Yes
Call by Reference: Yes
UNITSOFMEASUREX - Update Information for UNITSOFMEASURE
Data type: BAPIE1MARMXOptional: Yes
Call by Reference: Yes
INTERNATIONALARTNOS - International Article Numbers (EANs)
Data type: BAPIE1MEANOptional: Yes
Call by Reference: Yes
MATERIALLONGTEXT - Long Texts
Data type: BAPIE1MLTXOptional: Yes
Call by Reference: Yes
TAXCLASSIFICATIONS - Control Data
Data type: BAPIE1MLANOptional: Yes
Call by Reference: Yes
PRTDATA - Production Resource Tool (PRT) Fields in the Material Master
Data type: BAPIE1MFHMOptional: Yes
Call by Reference: Yes
PRTDATAX - Update Information for PRTDATA
Data type: BAPIE1MFHMXOptional: Yes
Call by Reference: Yes
EXTENSIONIN - Reference Structure for BAPI Parameters EXTENSIONIN/EXTENSIONOUT
Data type: BAPIE1PAREXOptional: Yes
Call by Reference: Yes
EXTENSIONINX - Checkbox Structure for Extension In/Extension Out
Data type: BAPIE1PAREXXOptional: Yes
Call by Reference: Yes
CLIENTDATAX - Update Information for CLIENTDATA
Data type: BAPIE1MARAXOptional: Yes
Call by Reference: Yes
FORECASTVALUES - Data Transfer for Forecast Values
Data type: BAPIE1MPRWOptional: Yes
Call by Reference: Yes
UNPLNDCONSUMPTION - Data Transfer for Unplanned Consumption
Data type: BAPIE1MVEUOptional: Yes
Call by Reference: Yes
TOTALCONSUMPTION - Data Transfer for Total Consumption of Material
Data type: BAPIE1MVEGOptional: Yes
Call by Reference: Yes
RETURNMESSAGES - Substitute Structure for Return Parameter BAPIRET2
Data type: BAPIE1RET2Optional: Yes
Call by Reference: Yes
PLANTDATA - Material Data at Plant Level
Data type: BAPIE1MARCOptional: Yes
Call by Reference: Yes
PLANTDATAX - Update Information for PLANTDATA
Data type: BAPIE1MARCXOptional: Yes
Call by Reference: Yes
FORECASTPARAMETERS - Forecast Parameters
Data type: BAPIE1MPOPOptional: Yes
Call by Reference: Yes
FORECASTPARAMETERSX - Update Information for FORECASTPARAMETERS
Data type: BAPIE1MPOPXOptional: Yes
Call by Reference: Yes
PLANNINGDATA - Change Document Structure for Material Master/Product Group
Data type: BAPIE1MPGDOptional: Yes
Call by Reference: Yes
PLANNINGDATAX - Update Information for PLANNINGDATA
Data type: BAPIE1MPGDXOptional: Yes
Call by Reference: Yes
Copy and paste ABAP code example for BAPI_MATERIAL_SAVEREPLICA Function Module
The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.| DATA: | ||||
| lv_return | TYPE BAPIRET2, " | |||
| lt_headdata | TYPE STANDARD TABLE OF BAPIE1MATHEADER, " | |||
| lv_noappllog | TYPE BAPIE1GLOBAL_DATA-NO_APPL_LOG, " | |||
| lt_storagelocationdata | TYPE STANDARD TABLE OF BAPIE1MARD, " | |||
| lt_storagelocationdatax | TYPE STANDARD TABLE OF BAPIE1MARDX, " | |||
| lt_valuationdata | TYPE STANDARD TABLE OF BAPIE1MBEW, " | |||
| lt_valuationdatax | TYPE STANDARD TABLE OF BAPIE1MBEWX, " | |||
| lt_warehousenumberdata | TYPE STANDARD TABLE OF BAPIE1MLGN, " | |||
| lt_warehousenumberdatax | TYPE STANDARD TABLE OF BAPIE1MLGNX, " | |||
| lt_salesdata | TYPE STANDARD TABLE OF BAPIE1MVKE, " | |||
| lt_salesdatax | TYPE STANDARD TABLE OF BAPIE1MVKEX, " | |||
| lt_storagetypedata | TYPE STANDARD TABLE OF BAPIE1MLGT, " | |||
| lt_storagetypedatax | TYPE STANDARD TABLE OF BAPIE1MLGTX, " | |||
| lt_clientdata | TYPE STANDARD TABLE OF BAPIE1MARA, " | |||
| lv_nochangedoc | TYPE BAPIE1GLOBAL_DATA-NO_CHANGE_DOC, " | |||
| lt_materialdescription | TYPE STANDARD TABLE OF BAPIE1MAKT, " | |||
| lt_unitsofmeasure | TYPE STANDARD TABLE OF BAPIE1MARM, " | |||
| lt_unitsofmeasurex | TYPE STANDARD TABLE OF BAPIE1MARMX, " | |||
| lt_internationalartnos | TYPE STANDARD TABLE OF BAPIE1MEAN, " | |||
| lt_materiallongtext | TYPE STANDARD TABLE OF BAPIE1MLTX, " | |||
| lt_taxclassifications | TYPE STANDARD TABLE OF BAPIE1MLAN, " | |||
| lt_prtdata | TYPE STANDARD TABLE OF BAPIE1MFHM, " | |||
| lt_prtdatax | TYPE STANDARD TABLE OF BAPIE1MFHMX, " | |||
| lt_extensionin | TYPE STANDARD TABLE OF BAPIE1PAREX, " | |||
| lt_extensioninx | TYPE STANDARD TABLE OF BAPIE1PAREXX, " | |||
| lv_testrun | TYPE BAPIE1GLOBAL_DATA-TESTRUN, " | |||
| lt_clientdatax | TYPE STANDARD TABLE OF BAPIE1MARAX, " | |||
| lt_forecastvalues | TYPE STANDARD TABLE OF BAPIE1MPRW, " | |||
| lt_unplndconsumption | TYPE STANDARD TABLE OF BAPIE1MVEU, " | |||
| lt_totalconsumption | TYPE STANDARD TABLE OF BAPIE1MVEG, " | |||
| lt_returnmessages | TYPE STANDARD TABLE OF BAPIE1RET2, " | |||
| lt_plantdata | TYPE STANDARD TABLE OF BAPIE1MARC, " | |||
| lv_inpfldcheck | TYPE BAPIE1GLOBAL_DATA-INP_FLD_CHECK, " | |||
| lt_plantdatax | TYPE STANDARD TABLE OF BAPIE1MARCX, " | |||
| lv_flag_cad_call | TYPE BAPIE1GLOBAL_DATA-TESTRUN, " SPACE | |||
| lv_no_rollback_work | TYPE BAPIE1GLOBAL_DATA-TESTRUN, " SPACE | |||
| lt_forecastparameters | TYPE STANDARD TABLE OF BAPIE1MPOP, " | |||
| lv_flag_online | TYPE BAPIE1GLOBAL_DATA-TESTRUN, " SPACE | |||
| lt_forecastparametersx | TYPE STANDARD TABLE OF BAPIE1MPOPX, " | |||
| lt_planningdata | TYPE STANDARD TABLE OF BAPIE1MPGD, " | |||
| lt_planningdatax | TYPE STANDARD TABLE OF BAPIE1MPGDX. " |
|   CALL FUNCTION 'BAPI_MATERIAL_SAVEREPLICA' "BAPI for Mass Maintenance of Material Data |
| EXPORTING | ||
| NOAPPLLOG | = lv_noappllog | |
| NOCHANGEDOC | = lv_nochangedoc | |
| TESTRUN | = lv_testrun | |
| INPFLDCHECK | = lv_inpfldcheck | |
| FLAG_CAD_CALL | = lv_flag_cad_call | |
| NO_ROLLBACK_WORK | = lv_no_rollback_work | |
| FLAG_ONLINE | = lv_flag_online | |
| IMPORTING | ||
| RETURN | = lv_return | |
| TABLES | ||
| HEADDATA | = lt_headdata | |
| STORAGELOCATIONDATA | = lt_storagelocationdata | |
| STORAGELOCATIONDATAX | = lt_storagelocationdatax | |
| VALUATIONDATA | = lt_valuationdata | |
| VALUATIONDATAX | = lt_valuationdatax | |
| WAREHOUSENUMBERDATA | = lt_warehousenumberdata | |
| WAREHOUSENUMBERDATAX | = lt_warehousenumberdatax | |
| SALESDATA | = lt_salesdata | |
| SALESDATAX | = lt_salesdatax | |
| STORAGETYPEDATA | = lt_storagetypedata | |
| STORAGETYPEDATAX | = lt_storagetypedatax | |
| CLIENTDATA | = lt_clientdata | |
| MATERIALDESCRIPTION | = lt_materialdescription | |
| UNITSOFMEASURE | = lt_unitsofmeasure | |
| UNITSOFMEASUREX | = lt_unitsofmeasurex | |
| INTERNATIONALARTNOS | = lt_internationalartnos | |
| MATERIALLONGTEXT | = lt_materiallongtext | |
| TAXCLASSIFICATIONS | = lt_taxclassifications | |
| PRTDATA | = lt_prtdata | |
| PRTDATAX | = lt_prtdatax | |
| EXTENSIONIN | = lt_extensionin | |
| EXTENSIONINX | = lt_extensioninx | |
| CLIENTDATAX | = lt_clientdatax | |
| FORECASTVALUES | = lt_forecastvalues | |
| UNPLNDCONSUMPTION | = lt_unplndconsumption | |
| TOTALCONSUMPTION | = lt_totalconsumption | |
| RETURNMESSAGES | = lt_returnmessages | |
| PLANTDATA | = lt_plantdata | |
| PLANTDATAX | = lt_plantdatax | |
| FORECASTPARAMETERS | = lt_forecastparameters | |
| FORECASTPARAMETERSX | = lt_forecastparametersx | |
| PLANNINGDATA | = lt_planningdata | |
| PLANNINGDATAX | = lt_planningdatax | |
| . " BAPI_MATERIAL_SAVEREPLICA | ||
ABAP code using 7.40 inline data declarations to call FM BAPI_MATERIAL_SAVEREPLICA
The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.| "SELECT single NO_APPL_LOG FROM BAPIE1GLOBAL_DATA INTO @DATA(ld_noappllog). | ||||
| "SELECT single NO_CHANGE_DOC FROM BAPIE1GLOBAL_DATA INTO @DATA(ld_nochangedoc). | ||||
| "SELECT single TESTRUN FROM BAPIE1GLOBAL_DATA INTO @DATA(ld_testrun). | ||||
| "SELECT single INP_FLD_CHECK FROM BAPIE1GLOBAL_DATA INTO @DATA(ld_inpfldcheck). | ||||
| "SELECT single TESTRUN FROM BAPIE1GLOBAL_DATA INTO @DATA(ld_flag_cad_call). | ||||
| DATA(ld_flag_cad_call) | = ' '. | |||
| "SELECT single TESTRUN FROM BAPIE1GLOBAL_DATA INTO @DATA(ld_no_rollback_work). | ||||
| DATA(ld_no_rollback_work) | = ' '. | |||
| "SELECT single TESTRUN FROM BAPIE1GLOBAL_DATA INTO @DATA(ld_flag_online). | ||||
| DATA(ld_flag_online) | = ' '. | |||
Search for further information about these or an SAP related objects