Maintain Plant Specific Data

  • Creating or Updating a Material Master for one specific plant.

  • Creating or Updating a Material Master for multiple plants.

Creating or Updating a Material Master for one specific plant

Set the following in your mapping:

set ::SAPDat(Material:MarcData:PLANT) $::T4S_Defaults(PlantId)

Caution:

You also need to maintain a plant specific View to create the Material in the Plant context.

Creating or Updating a Material Master for multiple plants.

SAP only accepts one Plant ID per transaction. In order to set additional data for another plant, you have the following options:

  • Multi Plant Transfer

    Use the T4S functionality allows transferring more than one set of data to SAP where SAP only allows one per transaction. You can find an example in the file <T4x_GS_ROOT>\var\template\capabilities\T4S\t4s_materialmaster_mapping_doc.sd under "Maintain Plant Specific Data".

  • In the Workflow via Parameter

    Attach an additional action handler T4S_update-MaterialMaster-AH. For every plant you must use one instance of this handler in the same or an additional task. In order to have the action handlers perform different things for each plant, add a parameter for the plant to each of those handlers (e.g. "-Plant" as argument name and the needed Plant ID as value). This parameter has to be read in the mapping via

    set Plant [::T4X::TC::Mappping::getWorkflowArgumentValue -Plant]

  • Via T4S Gateway Menu

    Every "Change Direct" can set data for another plant. Therefore it is useful to store the data for the new plant in a Teamcenter attribute that is modifiable in the T4S Gateway Menu.

List of Available Plants in SAP

You can see the list of available plant numbers in SAP:

  • Log in to SAP

  • Start transaction MM01 (Create Material)

  • Type an existing Material number and press Enter

  • The fields "Industry sector" and "Material type" are filled from the existing MM

  • Click "Select Views"

  • Select at least one plant specific view (e.g. MRP or Purchase) and press Enter (or click the green tick icon)

  • The window "Organizational Levels" opens

  • Click on the Button for the list of values beneath the field "Plant"

  • The window "Possible entries: Plants" opens

It shows every plant that is maintained for this SAP system. The plants, for which any data is already stored with the current MM, are marked with an "x"

Check in which Plants a Specific Material Master is Maintained.

In your mapping you can use the function ::TPSAP::MM::getPlantsOfMaterial to get a list of all plants a specific Material is maintained and the views which exist for each plant. Please see also List of Maintained MM Views for a Plant.

The result variable $::MMResultDat(PLANTS:WERKS:$LineIndex) contains the Plant ID. The variable $::MMResultDat(PLANTS:PSTAT:$LineIndex) contains a string of digits that represent the views that are maintained in that Plant:

  • A: Work scheduling

  • B: Accounting

  • C: Classification

  • D: MRP

  • E: Purchasing

  • F: Production resources/tools

  • G: Costing

  • K: Basic data

  • L: Storage

  • P: Forecasting

  • Q: Quality management

  • S: Warehouse management

  • V: Sales

  • X: Plant stocks

  • Z: Storage location stocks

List of Maintained MM Views for a Plant

Use the function ::TPSAP::MM::getViewList4Plant that returns a list of maintained Views.

Troubleshooting

The error message Field WERKS has been transferred inconsistently or is blank or WERKS for MARC is ""; previously "" means that you tried to set plant specific data but did not give a valid Plant ID. Maybe additional plant specific data needs an additional plant ID (although the ID is the same in most cases). E.g. the "Storage Location" requires setting the plant ID for the storage data separately:

set ::SAPDat(Material:MardData:PLANT) ...