Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Enter scheduling Key - BAPI_MATERIAL_SAVEREPLICA

Former Member
0 Likes
1,370

I am using BAPI_MATERIAL_SAVEREPLICA to create new Material Header in a reference plant. The reference plant does not have a scheduling margin key. I am getting error 'Enter the scheduling margin key'. The BAPI is expecting the plantdata-sm_key. I have tried passing space but that does not work. Please help

2 REPLIES 2
Read only

Former Member
0 Likes
824

While filling plant data structure "PLANTDATAX" dont pass PLANTDATAX-sm_key = 'X'.

Regards

Vinod

Read only

Former Member
0 Likes
824

Hi Sabita,

You can have a proper understanding of the functionality of BAPI and be familiar with what data you need to be filled in the fields.

BAPI_MATERIAL_SAVEREPLICA

FUNCTIONALITY

Use this method to create new material master data or change existing material master data. Every time this method is called, data for one or more materials can be transferred.

When new material master data is created, the material number, the material type and the sector must be sent to the method. Furthermore, a short text and the language in which the short text has been created, have to be entered. When data is being changed, only the material number need be entered.

First, the appropriate fields in the tables (for example, CLIENTDATA) have to be filled with data by the user. These fields must also be flagged as the method data can only be written to the database if this is the case. The user must also provide data for the appropriate fields that have been selected in a checkbox table (for example, CLIENTDATAX). Checkbox tables exist for tables that do not contain language-dependent texts (MAKT, MLTX), European article numbers (MEAN) and tax classifications (MLAN). More than one data record can be created for a material in these tables (for all materials transferred to the method).

CALL FUNCTION 'BAPI_MATERIAL_SAVEREPLICA' "BAPI for Mass Maintenance of Material Data

EXPORTING

noappllog = " bapie1global_data-no_appl_log Do Not Write an Application Log

nochangedoc = " bapie1global_data-no_change_doc Do not write change documents

testrun = " bapie1global_data-testrun Switch to Simulation Session for Write BAPIs

inpfldcheck = " bapie1global_data-inp_fld_check Response if Fields Are Inactive

  • flag_cad_call = SPACE " bapie1global_data-testrun Call From CAD System

  • no_rollback_work = SPACE " bapie1global_data-testrun Override Rollback Work

  • flag_online = SPACE " bapie1global_data-testrun No ALE Field Selection

IMPORTING

return = " bapiret2 Return Parameter

TABLES

headdata = " bapie1matheader Header Segment with Control Information

  • clientdata = " bapie1mara Material Data at Client Level

  • clientdatax = " bapie1marax Update Information for CLIENTDATA

  • plantdata = " bapie1marc Material Data at Plant Level

  • plantdatax = " bapie1marcx Update Information for PLANTDATA

  • forecastparameters = " bapie1mpop Forecast Parameters

  • forecastparametersx = " bapie1mpopx Update Information for FORECASTPARAMETERS

  • planningdata = " bapie1mpgd Change Document Structure for Material Master/Product Group

  • planningdatax = " bapie1mpgdx Update Information for PLANNINGDATA

  • storagelocationdata = " bapie1mard Material Data at Storage Location Level

  • storagelocationdatax = " bapie1mardx Update Information for STORAGELOCATIONDATA

  • valuationdata = " bapie1mbew Valuation Data

  • valuationdatax = " bapie1mbewx Update Information for VALUATIONDATA

  • warehousenumberdata = " bapie1mlgn Warehouse Number Data

  • warehousenumberdatax = " bapie1mlgnx Update Information for WAREHOUSENUMBERDATA

  • salesdata = " bapie1mvke Sales Data

  • salesdatax = " bapie1mvkex Update Information for SALESDATA

  • storagetypedata = " bapie1mlgt Storage type data

  • storagetypedatax = " bapie1mlgtx Update Information for STORAGETYPEDATA

  • materialdescription = " bapie1makt Material Descriptions

  • unitsofmeasure = " bapie1marm Units of Measure

  • unitsofmeasurex = " bapie1marmx Update Information for UNITSOFMEASURE

  • internationalartnos = " bapie1mean International Article Numbers (EANs)

  • materiallongtext = " bapie1mltx Long Texts

  • taxclassifications = " bapie1mlan Control Data

  • prtdata = " bapie1mfhm Production Resource Tool (PRT) Fields in the Material Master

  • prtdatax = " bapie1mfhmx Update Information for PRTDATA

  • extensionin = " bapie1parex Reference Structure for BAPI Parameters EXTENSIONIN/EXTENSIONOUT

  • extensioninx = " bapie1parexx Checkbox Structure for Extension In/Extension Out

  • forecastvalues = " bapie1mprw Data Transfer for Forecast Values

  • unplndconsumption = " bapie1mveu Data Transfer for Unplanned Consumption

  • totalconsumption = " bapie1mveg Data Transfer for Total Consumption of Material

  • returnmessages = " bapie1ret2 Substitute Structure for Return Parameter BAPIRET2

. " BAPI_MATERIAL_SAVEREPLICA

Regards,

Soundarya.