28
SIMATIC IT UA DM Gateway for SAP S/ 4HANA - Configuration Guide

SIMATIC IT UA DM Gateway for SAP S/4HANA - Configuration Guide · 1. CLM4S Introduction The SIMATIC IT UA DM Gateway for SAP S/4HANA (CLM4S) software solution is an integration software

  • Upload
    others

  • View
    49

  • Download
    2

Embed Size (px)

Citation preview

Page 1: SIMATIC IT UA DM Gateway for SAP S/4HANA - Configuration Guide · 1. CLM4S Introduction The SIMATIC IT UA DM Gateway for SAP S/4HANA (CLM4S) software solution is an integration software

SIMATIC IT UA DMGateway for SAP S/4HANA -ConfigurationGuide

Page 2: SIMATIC IT UA DM Gateway for SAP S/4HANA - Configuration Guide · 1. CLM4S Introduction The SIMATIC IT UA DM Gateway for SAP S/4HANA (CLM4S) software solution is an integration software

Contents

Preface 3

CLM4S Introduction 1-1

Basic ConfigurationImport Objects by Schedule ─────────────────────────────── 2-1Add T4x Job Agent ───────────────────────────────────── 2-1Addressing Multiple Simatic IT Servers ──────────────────────── 2-1SIMATIC IT UA DM connection configuration ──────────────────── 2-2SAP Connection Configuration ───────────────────────────── 2-3Install Certificate ────────────────────────────────────── 2-4The File clm4s_mapping_config.sd ────────────────────────── 2-5CLM SAP ID Mapping ─────────────────────────────────── 2-6

SAP to SIMATIC IT UA DM InteractionMaterial Definition Import ──────────────────────────────── 3-1Work Order Import ───────────────────────────────────── 3-2

SIMATIC IT UA DM to SAP InteractionCreate Confirmation in ERP ─────────────────────────────── 4-1

CLM4S Glossary A-1

SIMATIC IT UA DM Gateway for SAP S/4HANA - Configuration Guide 2© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 3: SIMATIC IT UA DM Gateway for SAP S/4HANA - Configuration Guide · 1. CLM4S Introduction The SIMATIC IT UA DM Gateway for SAP S/4HANA (CLM4S) software solution is an integration software

PrefaceThis documentation cannot be used as a substitute for consulting advice, because it can never considerthe individual business processes and configuration. Despite our best efforts it is probable that someinformation about functionality and coherence may be incomplete.

Issue: November 2018

Legal notice:

All rights reserved. No part of this documentation may be copied by any means or made available toentities or persons other than employees of the licensee of the SIMATIC IT UA DM Gateway for SAP S/4HANA or those that have a legitimate right to use this documentation as part of their assignment onbehalf of the licensee to enable or support usage of the software for use within the boundaries of thelicense agreement.

© 2018 Siemens Product Lifecycle Management Software Inc.

Trademark notice:

Siemens, the Siemens logo and SIMATIC IT are registered trademarks of Siemens AG.

Camstar and Teamcenter are trademarks or registered trademarks of Siemens Product LifecycleManagement Software Inc. or its subsidiaries in the United States and in other countries.

Oracle is a registered trademark of Oracle Corporation.

SAP, R/3, SAP S/4HANA®, SAP Business Suite® and mySAP are trademarks or registered trademarks of SAPor its affiliates in Germany and other countries.

TESIS is a registered trademark of TESIS GmbH.

All other trademarks, registered trademarks or service marks belong to their respective holders.

SIMATIC IT UA DM Gateway for SAP S/4HANA - Configuration Guide 3© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 4: SIMATIC IT UA DM Gateway for SAP S/4HANA - Configuration Guide · 1. CLM4S Introduction The SIMATIC IT UA DM Gateway for SAP S/4HANA (CLM4S) software solution is an integration software

4 SIMATIC IT UA DM Gateway for SAP S/4HANA - Configuration Guide© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 5: SIMATIC IT UA DM Gateway for SAP S/4HANA - Configuration Guide · 1. CLM4S Introduction The SIMATIC IT UA DM Gateway for SAP S/4HANA (CLM4S) software solution is an integration software

1. CLM4S IntroductionThe SIMATIC IT UA DM Gateway for SAP S/4HANA (CLM4S) software solution is an integration softwarethat provides data and process integration between SAP Business Suite® and SAP S/4HANA® by SAP AGand SIMATIC IT Unified Architecture Discrete Manufacturing by Siemens AG.

CLM4S provides a wide range of automatic and interactive functions to transfer and synchronize databetween SAP and SIMATIC IT UA DM.

This document details the components of the SAP - SIMATIC IT UA DM integration, which are availableout of the box and configurable to meet customer specific solution requirements.

SIMATIC IT UA DM Gateway for SAP S/4HANA - Configuration Guide 1-1© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 6: SIMATIC IT UA DM Gateway for SAP S/4HANA - Configuration Guide · 1. CLM4S Introduction The SIMATIC IT UA DM Gateway for SAP S/4HANA (CLM4S) software solution is an integration software

1. CLM4S Introduction

1-2 SIMATIC IT UA DM Gateway for SAP S/4HANA - Configuration Guide© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 7: SIMATIC IT UA DM Gateway for SAP S/4HANA - Configuration Guide · 1. CLM4S Introduction The SIMATIC IT UA DM Gateway for SAP S/4HANA (CLM4S) software solution is an integration software

2. Basic Configuration

Import Objects by Schedule

To automatically import production objects like orders or materials from SAP, CLM4S needs to repeatedlycheck the so-called SAP Z-table and start import jobs if orders are available. For details on how toconfigure this scheduled import, see chapter "Scheduled Triggers" in the Teamcenter Gateway -Generic Configuration Guide. The Z-table only gets filled with entries about new or changed objects, ifa specific user exit is applied to the SAP configuration, see .

Add T4x Job Agent

For some external events, CLM4S needs to execute jobs in the background (e.g. incoming web servicesfrom MES, long-running transfer workflows). Therefore the CLM4S GS instance(s) need to be configuredto have at least one Job Agent. For details on Job Agent creation, see chapter T4x Agent configurationin the Teamcenter Gateway - Generic Configuration Guide.

Addressing Multiple Simatic IT Servers

CLM4S can address one or many SIMATIC IT servers based on some mapping logic. The delivered demomapping assumes the following restrictions:

• The SAP production plant is mapped to the SIMATIC IT UA DM top-level equipment element(enterprise) exclusively by the ::SIT::PLANTMAPPING functionality (see below).

• Each SIMATIC IT server can handle several top-level equipment elements (enterprises). This essentiallymeans that a single CLM4S connection can be used to address several enterprises.

The mapping is defined by a triple of enterprise name (for SIMATIC IT UA DM and Teamcenter, ifapplicable), the SAP plant ID and the CLM4S connection name. In the demo mapping this is definedusing ::SIT::PLANTMAPPING functionality, similar to the following example:

::SIT::PLANTMAPPING::add "Factory1" "1000" "SITConnectionA"::SIT::PLANTMAPPING::add "Factory2" "2000" "SITConnectionA"::SIT::PLANTMAPPING::add "Factory3" "3000" "SITConnectionB"

This is a global definition and should be defined in clm4s_mapping_config.sd file. The example definesthat the work area with name "Factory1" (the SIMATIC IT UA DM enterprise) maps to SAP plant 1000 andthe CLM4S connection "SITConnectionA" has to be used to address SIMATIC IT UA DM. A secondenterprise "Factory2" is also hosted be the same SIMATIC IT server which can be addressed by the CLM4Sconnection "SITConnectionA", but maps to SAP plant 2000. Finally a separate SIMATIC IT server hosts"Factory3" (SAP plant 3000) and can be addresses using CLM4S connection "SITConnectionB".

Whenever CLM4S needs to transfer data to SIMATIC IT, it determines the CLM4S connection based onthe top-level work area.

SIMATIC IT UA DM Gateway for SAP S/4HANA - Configuration Guide 2-1© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 8: SIMATIC IT UA DM Gateway for SAP S/4HANA - Configuration Guide · 1. CLM4S Introduction The SIMATIC IT UA DM Gateway for SAP S/4HANA (CLM4S) software solution is an integration software

All incoming web service calls from SIMATIC IT carry an "Enterprise" field. Based on this value anysubsequent CLM4T, CLM4S or T4S action can determine the correct connection to SIMATIC IT. Thenamespace ::SIT::PLANTMAPPING contains all necessary procedures to uniformly access thepreviously defined plant mapping.

SIMATIC IT UA DM connection configuration

In <T4x_GS_ROOT>/var/mmap/clm4s_mapping_config/clm4s_mapping_config.sd you shouldconfigure the URL to access CLM4S services. There is a piece of template code included, which you canadapt:

set RootConnectString http://<nameOrIPofSITUAServer>/sit-svcset ConnectString [dict create \ BaseURL "${RootConnectString}" \ ODATAApplication "/Application/AppU4DM/odata" \ ODATARuntime "/runtime/AppU4DM/odata/File" \ TokenExecutable "[rcwd]/lib/token/getToken.exe" \ TokenAppName T4CLMIntegration \ TokenExpiresInSeconds 720]

Replace <nameOrIPofSITUAServer> in the first line with the actual hostname of your SIMATIC ITserver. Consult the administrator if necessary for any further adaptions on the URL. The next line addsadditional information to that URL. Usually, you will not need to modify these settings, as any OOTBCLM4S installation will use the same values.

BaseURL: Identical to the previously configured RootConnectString.

ODATAApplication:

the URL extension to be appended to the BaseURL in order to address the service layerwhen invoking SIMATIC IT UA DM commands.

ODATARuntime:

the URL extension to be appended to the BaseURL in order to read data from SIMATIC ITvia ODATA queries.

TokenExecutable:

the configured binary path is executed whenever CLM4S needs to extract a token fromthe certificate. The token is necessary in order to authenticate against the CLM4Sserver. For details on the certificate, see Install Certificate. The default value refers toa Windows binary delivered with CLM4S. The binary must take one parameter (theTokenAppName) and return the corresponding token on the standard output.

TokenAppName:

A name used during extraction of the token from the certificate.

TokenExpiresInSeconds:

This parameter determines the validity period of the created token as configured onthe server (CLM4S requests a new token after this period).

The configured ConnectString variable is then used in callslike ::CLM4S_SIT::CONNECTION2EA::setConnectionInfoPlain to build a named connectionthat is used in RAC or in the mappings in order to address a specific SIMATIC IT system. Severalconnections may be configured here, allowing to address different SIMATIC IT systems if required. A

2. Basic Configuration

2-2 SIMATIC IT UA DM Gateway for SAP S/4HANA - Configuration Guide© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 9: SIMATIC IT UA DM Gateway for SAP S/4HANA - Configuration Guide · 1. CLM4S Introduction The SIMATIC IT UA DM Gateway for SAP S/4HANA (CLM4S) software solution is an integration software

"preferred" CLM4S connection can be definedby ::T4X::CONNECTION2EA::selectActiveConnection2EA CLM4S_SIT "*" "UAFReal".This connection will be used if not otherwise specified.

Before each interaction with SIMATIC IT, CLM4S checks the connectivity using a simple and fast call tothe server. This can be configuredin ::CLM4S_SIT::CONNECTION2EA::CUSTOM::MAPPING::connectEA. The demo implementationcalls ::CLM4S::SERVICES::checkConnection. The following API will be used in this function:

Target System Used API

SIMATIC IT UA DM DependencyType

Caution:

If your SIMATIC IT exposes an SSL (https) URL, you need to tell CLM4S which certificates should beused, otherwise no certificates will be checked - opening the connection for man-in-the-middleattacks! Active Integration clients do not use certificates from the operating system certificatestore, so the certificates have to be specified using the optional AdditionalParameters entryin the dictionary when defining a connection. Here is an example:

::CLM4S_SIT::CONNECTION2EA::setConnectionInfoPlain SITUADMServerUingHTTPS [dict create \ BaseURL "https://<SITUADMServerUingHTTPSIPorName>:443/sit-svc" \ ODATAApplication "/Application/AppU4DM/odata" \ ODATARuntime "/runtime/AppU4DM/odata" \ TokenExecutable "[rcwd]/lib/token/getToken.exe" \ TokenAppName "" \ TokenExpiresInSeconds 720\ AdditionalArguments [list -cert [rcwd]/etc/cert/server_certificate.cer] \ -clientcert [rcwd]/etc/cert/client_certificate.cer]]

The difference is in the BaseURL ("https:") and the last two lines. The -clientcert option is onlynecessary when 2-way SSL is required. For details on -cert and -clientcert please seeCLM4S API Reference for the command tpco_httpClient.

SAP Connection Configuration

The settings described here have to be done in the file clm4s_mapping_config.sd.

The following SAP connection use cases are supported:

• Storing SAP account information in plain text format.

SAP Connection Configuration

SIMATIC IT UA DM Gateway for SAP S/4HANA - Configuration Guide 2-3© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 10: SIMATIC IT UA DM Gateway for SAP S/4HANA - Configuration Guide · 1. CLM4S Introduction The SIMATIC IT UA DM Gateway for SAP S/4HANA (CLM4S) software solution is an integration software

Using this format, the SAP credentials (username + password) are stored in clear text in the fileclm4s_mapping_config.sd. Using a plain text password is not recommended and should only be usedin a development or test environment or for demo purposes.Format:

::CLM4S_SAP::CONNECTION2SAP::setConnectionInfoPlain System Client User Passwd Language Mode

Example:

::CLM4S_SAP::CONNECTION2SAP::setConnectionInfoPlain ET5 800 Username Password EN ALL

• Storing SAP account information in encrypted format.Format:

::CLM4S_SAP::CONNECTION2SAP::setConnectionInfo System Client EncryptedUser EncryptedPassword Language Mode

Example:

::CLM4S_SAP::CONNECTION2SAP::setConnectionInfo ET5 800 351e1aa4559ce 300c0ca54c92f EN ALL

The username and password has to be encrypted using the script “T4x Password Crypt” provided bythe BGS script environment.

Install Certificate

SIMATIC IT uses 2-legged OAuth 2.0 for authentication. This mechanism does not require the user toenter any credentials, but instead, the host running the service (each CLM4S GS host in our case) andthe SIMATIC IT host must have the identical certificate installed in the system's certificate store. Usually,this certificate is created and provided by the SIMATIC IT administrator. On Windows, such a certificate isa file with the extension .pfx. Usually, when double-clicking it, Windows will open a wizard to import itinto the local machines certificate store. The wizard may ask for a password, which should be providedby the administrator who created the certificate. Usually, the default settings for the wizard will workwell, and you should leave them unchanged unless the creator of the certificate tells you to.

Please do not forget to keep CLM4S server clock and SIMATIC IT server clock synchronized because ofattribute nbf (not before) in the payload part of the token.

The Chapter SIMATIC IT UA DM connection configuration describes how to configure CLM4S to usethe imported certificate. For more details on certificate handling, consult the SIMATIC IT manuals.

2. Basic Configuration

2-4 SIMATIC IT UA DM Gateway for SAP S/4HANA - Configuration Guide© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 11: SIMATIC IT UA DM Gateway for SAP S/4HANA - Configuration Guide · 1. CLM4S Introduction The SIMATIC IT UA DM Gateway for SAP S/4HANA (CLM4S) software solution is an integration software

The File clm4s_mapping_config.sd

The file clm4s_mapping_config.sd in the directory <T4x_GS_ROOT>\var\mmap\clm4s_mapping_config\is the first configuration file of the CLM4S software that is read by each TCL worker thread or process. Itloads the rest of the mapping files and may contain basic settings as well as variables which aresupposed to be used in more than one mapping file.

This file is also the place to define the connection details for both, the SIMATIC IT UA DM connection aswell as the SAP connection. Please see chapter SIMATIC IT UA DM connection configuration and SAPConnection Configuration for more information.

The following basic settings has to be configured in clm4s_mapping_config.sd for Teamcenter, SAP andSIMATIC IT UA DM integration scenarios:

• By default, set ::CLM4S::IDMAPPING::Implementation ::CLM4S::JDBC::SQLSERVERenables the using of MS SQL Server database to store the mapping keys.

• Caution:

Comment out and configure this part only for Teamcenter, ERP and SIMATIC IT UA DMintegration scenarios. It does not apply for SAP and SIMATIC IT UA DM only integrationscenarios.

Setting of connection data and concatenating to the MS SQL Server database connection string

set dbServerHost <myDbServerHost>:<myDbServerPort>set database clm4sset connUrl "jdbc:sqlserver://${dbServerHost}\;DatabaseName=${database}\;integratedSecurity=true\;"

set ::CLM4S_Defaults(EASystem) SQLServerset ::CLM4S_Defaults(EAConnectString) $connUrlset ::CLM4S_Defaults(EALanguage) ""set ::CLM4S_Defaults(EAUser) domain\\dbaset ::CLM4S_Defaults(EAPassword) dba

The code starting with set overlay... is only relevant in SPLM-internal development and testingenvironments and will not become active in any custom environment, so that it can be ignored.

In addition to the above mentioned settings, this is also the place to define the configuration formultiple SIMATIC IT UA DM servers (see chapter Addressing Multiple Simatic IT Servers) and toconfigure the language of internal messages directly returned by CLM4S:

Example:

The File clm4s_mapping_config.sd

SIMATIC IT UA DM Gateway for SAP S/4HANA - Configuration Guide 2-5© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 12: SIMATIC IT UA DM Gateway for SAP S/4HANA - Configuration Guide · 1. CLM4S Introduction The SIMATIC IT UA DM Gateway for SAP S/4HANA (CLM4S) software solution is an integration software

set strLanguageCode "en_US" ; # default language (check /var/lang/CLM4S/ for more language codes)

Other possible languages can be found in the directory <T4x_GS_ROOT>\var\lang\CLM4S>.

It is also possible to control the language using an OS environment variable:

set TP_LANGUAGE_CODE=de_DE

Note that this language setting only controls the language for messages created internally by CLM4S.The language of messages returned by SAP is defined by the language used for the SAP login. Seechapter SAP Connection Configuration for more information. The recommendation is to use the samelanguage as the SAP connection language to make sure that all messages displayed in the samelanguage.

CLM SAP ID Mapping

Caution:

This chapter is only relevant in context of Closed Loop Manufacturing (CLM), i.e. if Teamcenter isinvolved. Although this functionality is part of the CLM4S package it is also used by T4S andCLM4T. CLM4S uses ID mapping only for orders and confirmations authored from data created inTeamcenter and transferred by T4S and CLM4T.

In order to synchronize data over all three systems PLM, ERP and MES, you must make sure to uniquelyidentify objects when transferring them. In our scenario, Teamcenter is the leading system for materialIDs, routing IDs, BOM IDs and others. SAP Business Suite® consumes some of these IDs and creates newartifacts, e.g. orders. CLM4S consumes data from both other systems and must keep track of identities.The Teamcenter and SIMATIC IT UA DM data models are relatively easy to adapt in order to storeidentification and reference information. It has proven more difficult to adapt ERP data models and sowe need to keep track of the mapping of ERP identifiers to PLM identifiers and vice versa. AlthoughTeamcenter implicitly stores all these mappings (e.g. for materials it can store the SAP material master IDon the revision and a form on the CC object stores SAP BOM and routing identifiers), CLM4S usesseparate storage to externalize this information. The implementation of this storage can change.

In the demo scenario, a configurable MSSQL server database is used to store the ID mappings. Theparameters have to be adapted in <T4x_GS_ROOT>/clm4s_mapping_config/clm4s_mapping_config.sd inthe following segment:

set dbServerHost <myDbServerHost>:<myDbServerPort>set database clm4sset connUrl "jdbc:sqlserver://${dbServerHost}\;DatabaseName=${database}

2. Basic Configuration

2-6 SIMATIC IT UA DM Gateway for SAP S/4HANA - Configuration Guide© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 13: SIMATIC IT UA DM Gateway for SAP S/4HANA - Configuration Guide · 1. CLM4S Introduction The SIMATIC IT UA DM Gateway for SAP S/4HANA (CLM4S) software solution is an integration software

\;integratedSecurity=true\;"

set ::CLM4S_Defaults(EASystem) SQLServerset ::CLM4S_Defaults(EAConnectString) $connUrlset ::CLM4S_Defaults(EALanguage) ""set ::CLM4S_Defaults(EAUser) domain\\dbaset ::CLM4S_Defaults(EAPassword) dba

The database must have three columns, all are of string type:

CTXT denotes the context of the mapping. Valid contexts are defined and explained in<T4x_GS_ROOT>/clm4s_mapping_config/clm4s_idmapping.sd.

FIELD This is the "key" identifier. Depending on the context, it can be a Teamcenter identifier(UID), an SAP identifier or a combined key.

VALUE This is the mapped value for the given key in the given context.

Other implementations can easily be added as long as the interface described in <T4x_GS_ROOT>/clm4s_mapping_config/clm4s_idmapping.sd is fulfilled.

CLM SAP ID Mapping

SIMATIC IT UA DM Gateway for SAP S/4HANA - Configuration Guide 2-7© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 14: SIMATIC IT UA DM Gateway for SAP S/4HANA - Configuration Guide · 1. CLM4S Introduction The SIMATIC IT UA DM Gateway for SAP S/4HANA (CLM4S) software solution is an integration software

2. Basic Configuration

2-8 SIMATIC IT UA DM Gateway for SAP S/4HANA - Configuration Guide© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 15: SIMATIC IT UA DM Gateway for SAP S/4HANA - Configuration Guide · 1. CLM4S Introduction The SIMATIC IT UA DM Gateway for SAP S/4HANA (CLM4S) software solution is an integration software

3. SAP to SIMATIC IT UA DM Interaction

Material Definition Import

The capability to create a Material Definition in SIMATIC IT UA DM is based on a MaterialMaster from theERP system. This capability uses the SIMATIC IT UA DM command UADMCreateMaterialDefinitionto create the Material Definition and the SAP BAPI BAPI_MATERIAL_GET_ALL to read the MaterialMaster.

Target system Used API

SIMATIC IT UA DM UADMCreateMaterialDefinition

SAP BAPI_MATERIAL_GET_ALL

The following procedure is executed during this process:

Saving a MaterialMaster in SAP triggers a UserExit/BADI which stores meta information about thisMaterialMaster into the CLM4S Z-Table (SAP database table). This table is read by CLM4S every nminutes and for each new entry a Material Definition import job is created in CLM4S. The record in thetable is marked as “Q” (= QUEUED) to make sure that the same MaterialMaster is not imported morethan once. Once the import job is executed by the CLM4S job engine, the MaterialMaster is read fromSAP in detail, the data is mapped into the format required by the target system and sent to SIMATIC ITUA DM in order to create a Material Definition object. After the job has been executed, the status of theZ-Table entry is either set to “S” (= SUCCESS) or “E” (= ERROR) with a corresponding message dependingon the result of the Material Definition creation.

According to this scenario, the following steps are required:

• Implement the CLM4S Z-Table functionality provided with the SAP transport package“TESISPLM_T4S_ZPTC”. See for more information.

• Implement a SAP UserExit or BADI as a trigger on the MaterialMaster “Save” action which will thencreate a MATERIAL entry (stands for MaterialMaster) in the CLM4S Z-Table for each MaterialMasterbeing saved in SAP. The UserExit or BADI ABAP code should be configured in a way that onlyMaterialMaster relevant for CLM4S - SIMATIC IT UA DM are stored in this Z-Table.

• Start trigger script called "CLM4S Trigger Z-Table import job (Scheduler)" in the CLM4S GS Admin GUIto check the Z-Table for new entries. Learn more about the Script-based (scheduled) Triggers chapter"Scheduled Triggers" in the Teamcenter Gateway - Generic Configuration Guide.

• Create and save a MaterialMaster in SAP.

If everything is configured correctly, a SIMATIC IT UA DM Material Definition will be createdautomatically for each MATERIAL entry of the Z-Table or in other words, for each material being savedin SAP aligning with the UserExit ABAP code conditions.

SIMATIC IT UA DM Gateway for SAP S/4HANA - Configuration Guide 3-1© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 16: SIMATIC IT UA DM Gateway for SAP S/4HANA - Configuration Guide · 1. CLM4S Introduction The SIMATIC IT UA DM Gateway for SAP S/4HANA (CLM4S) software solution is an integration software

The attribute mapping for this Material Definition import can be controlled in two ways:

1. The basic attribute mapping can be defined using the easy2go Mapping Tool, please check thecorresponding documentation for more information.

2. More advanced configuration and attribute mapping can be configured using the fileclm4s_material_mapping.sd:This file contains the following important procedures:mapping4MaterialMasterReadSAP_Material2MES_MaterialThe procedure mapping4MaterialMasterRead can be used to control how the MaterialMasterdata is read from SAP. More specific, this is the place where SAP MaterialMaster read parameterslike the plant, the company code, the valuation area or type, the storage location or other thingscan be controlled.Important: The SAP plant is already defined at this stage (usually by the Z-Table entry triggering theimport) and is only mentioned here for the sake of completeness. All other parameters are emptyand can be defined if required to properly read the MaterialMaster data from SAP.The procedure SAP_Material2MES_Material can be used to configure how the extracted SAPMaterialMaster data is mapped to the Material Definition object being created in SIMATIC IT UA DMas well as part of the business logic used for the transfer. An example for this would be to skip thetransfer completely. At this point, the basic attribute mapping provided by the easy2go mappingtool has already been executed. The result of this initial mapping can be seen and modified usingthe section MaterialDefinition:dict of the input TCL dictionary input. The SAPMaterialMaster data can be accessed using the section MaterialDetails of the input TCLdictionary input. Skipping a Material Definition transfer to SIMATIC IT UA DM MaterialDefinitioncan be done by setting the key skipUADMCreateMaterialDefinition of the inputTCL dictionary input to true.

Work Order Import

The capability to create a Work Order in SIMATIC IT UA DM is based on a Production Order from the ERPsystem.

This capability uses the API's to create the Work Order:

Target system Used API

SIMATIC IT UA DM CreateWorkOrder

SIMATIC IT UA DM CreateWorkOrderOperation

SIMATIC IT UA DM CreateWorkOOperationDependencies

SIMATIC IT UA DM CreateToBeConsumedMaterials

SIMATIC IT UA DM CreateToBeUsedMachine

SIMATIC IT UA DM ReleaseOrder

SIMATIC IT UA DM DeleteWorkOrder (only in case of an error toperform a rollback)

SAP BAPI_PRODORD_GET_DETAIL

3. SAP to SIMATIC IT UA DM Interaction

3-2 SIMATIC IT UA DM Gateway for SAP S/4HANA - Configuration Guide© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 17: SIMATIC IT UA DM Gateway for SAP S/4HANA - Configuration Guide · 1. CLM4S Introduction The SIMATIC IT UA DM Gateway for SAP S/4HANA (CLM4S) software solution is an integration software

The following procedure is executed during this process:

Saving a Production Order in SAP triggers a UserExit/BADI which stores meta information about thisProduction Order into the CLM4S Z-Table (SAP database table). This table is read by CLM4S every nminutes and for each new entry a Work Order import job is created in CLM4S. The record in the table ismarked as “Q” (= QUEUED) to make sure that the same Production Order is not imported more thanonce. Once the import job is executed by the CLM4S job engine, the Production Order is read from SAPin detail, the data is mapped into the format required by the target system and sent to SIMATIC IT UA DMin order to create a Work Order object. After the job has been executed, the status of the Z-Table entry iseither set to “S” (= SUCCESS) or “E” (= ERROR) with a corresponding message depending on the result ofthe Work Order creation.

According to this scenario, the following steps are required:

• Implement the CLM4S Z-Table functionality provided with the SAP transport package“TESISPLM_T4S_ZPTC”. See for more information.

• Implement a SAP UserExit or BADI as a trigger on the Production Order “Save” action which will thencreate a PROD_ORDER entry (stands for Production Order) in the CLM4S Z-Table for each ProductionOrder being saved in SAP. The UserExit or BADI ABAP code should be configured in a way that onlyProduction Orders relevant for CLM4S - SIMATIC IT UA DM are stored in this Z-Table (e. g. only releasedorders).

• Start trigger script called "CLM4S Trigger Z-Table import job (Scheduler)" in the CLM4S GS Admin GUIto check the Z-Table for new entries. Learn more about the Script-based (scheduled) Triggers in the"Scheduled Triggers" in the Teamcenter Gateway - Generic Configuration Guide.

• Create and save a Production Order in SAP.

If everything is configured correctly, a SIMATIC IT UA DM Work Order will be created automatically foreach PROD_ORDER entry of the Z-Table or in other words, for each production order being saved in SAPaligning with the UserExit ABAP code conditions.

The creation of thisWork Order can be controlled in two ways:

1. The basic attribute mapping can be defined using the easy2go mapping Tool, please check thecorresponding documentation for more information.

2. More advanced configuration and attribute mapping can be configured using the fileclm4s_workorder_mapping.sd:This file contains the following important procedures:

mapping4SapProdOrderRead

getMachineToBeUsedStructure4SIT

SAP_ProdOrder2MES_WorkOrderHeader

Work Order Import

SIMATIC IT UA DM Gateway for SAP S/4HANA - Configuration Guide 3-3© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 18: SIMATIC IT UA DM Gateway for SAP S/4HANA - Configuration Guide · 1. CLM4S Introduction The SIMATIC IT UA DM Gateway for SAP S/4HANA (CLM4S) software solution is an integration software

SAP_ProdOrder2MES_WorkOrderOperation

SAP_ProdOrder2MES_WorkOrderConsumed

SAP_ProdOrder2MES_WorkOrderToBeUsedMachine

SAP_ProdOrder2MES_WorkOrderDependencies

SAP_ProdOrder2MES_WorkOrderReleaseStatus

The procedure mapping4SapProdOrderRead can be used to control how the Production Orderdata is read from SAP. More specific, this is the place where SAP Production Order read parameterslike “which objects should be read for order” (e. g. operations, consumed, …) can be controlled.Usually, there is nothing to be changed here as the default settings should cover all use cases.The procedure getMachineToBeUsedStructure4SIT can be used to control the locationassigned to a SIMATIC IT UA DM Work Order Operation. The location in SIMATIC IT UA DM usuallyhas a format like <Factory name>.<work area name>.<station name>. Example:Factory1.WA1.TestingStation.The default template shipped with CLM4S tries to calculate the SIMATIC IT UA DM factory based onthe SAP plant and the station name based on the SAP work center text. However, the SIMATIC IT UADM work area is hard coded with WA1. One way to calculate the work area could be to evaluate theSAP work center and find the corresponding SIMATIC IT UA DM work area based on a mappingtable (example: SAP work center 1000 = WA1, 2000 = WA2…). The TCL variablestrSapWorkcenter4Operation already provides access to the SAP work center for eachoperation. Keep in mind that this procedure is called in a loop (once for each operation).The procedure SAP_ProdOrder2MES_WorkOrderHeader can be used to configure how theextracted SAP production order data is mapped to the work order header object being created inSIMATIC IT UA DM as well as part of the business logic used for the transfer. An example for thiswould be to skip the transfer completely. At this point, the basic attribute mapping provided by theeasy2go mapping tool has already been executed. The result of this initial mapping can be seenand modified using the section WorkOrderHeaderDefintion:dict of the input TCL dictionaryinput. The SAP Production Order data can be accessed using the sectionProductionOrderDetails of the input TCL dictionary input. Skipping a work order transfer toSIMATIC IT UA DM can be done by setting the key skipCreateWorkOrder of the input TCLdictionary input to true.The procedure SAP_ProdOrder2MES_WorkOrderOperation can be used to configure how theextracted SAP production order operation data is mapped to the work order operation objectsbeing created for the work order header in SIMATIC IT UA DM as well as part of the business logicused for the transfer. An example for this would be to skip the transfer for one or more operations.At this point, the basic attribute mapping provided by the easy2go mapping tool has already beenexecuted. The result of this initial mapping can be seen and modified using the sectionWorkOrderOperationDefintion:dicts of the input TCL dictionary input. This key points toa TCL list holding the data for each operation. The SAP Production Order Operation data can beaccessed using the section ProductionOrderDetails of the input TCL dictionary input.Skipping a Work Order Operation transfer to SIMATIC IT UA DM can be done in two ways. Settingthe key skipCreateWorkOrderOperation of the input TCL dictionary input to true willresult in skipping all Work Order Operation. Setting the key

3. SAP to SIMATIC IT UA DM Interaction

3-4 SIMATIC IT UA DM Gateway for SAP S/4HANA - Configuration Guide© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 19: SIMATIC IT UA DM Gateway for SAP S/4HANA - Configuration Guide · 1. CLM4S Introduction The SIMATIC IT UA DM Gateway for SAP S/4HANA (CLM4S) software solution is an integration software

skipCreateWorkOrderOperationSingle of the input TCL dictionary input to a specificindex or a TCL list of indices representing one or more operations of the list behindWorkOrderOperationDefintion:dicts will result in skipping only the operations identifiedby these indices.The procedure SAP_ProdOrder2MES_WorkOrderConsumed can be used to configure how theextracted SAP Production Order component data is mapped to the Work Order Operation materialobjects being created for the Work Order Operation in SIMATIC IT UA DM as well as part of thebusiness logic used for the transfer. An example for this would be to skip the transfer for one ormore operation materials. At this point, the basic attribute mapping provided by the easy2gomapping tool has already been executed. The result of this initial mapping can be seen andmodified using the section WorkOrderConsumedDefintion:dicts of the input TCL dictionaryinput. This key points to a TCL list holding the data for each operation material. The SAPProduction Order Operation data can be accessed using the section ProductionOrderDetailsof the input TCL dictionary input. Skipping a Work Order Operation material transfer to SIMATIC ITUA DM can be done in two ways. Setting the key skipCreateWorkOrderConsumed of the inputTCL dictionary input to true will result in skipping all Work Order Operation materials. Settingthe key skipCreateWorkOrderConsumedSingle of the input TCL dictionary input to aspecific index or a TCL list of indices representing one or more operation materials of the listbehind WorkOrderConsumedDefintion:dicts will result in skipping only the operationmaterials identified by these indices.The procedure SAP_ProdOrder2MES_WorkOrderDependencies can be used to configure howthe extracted SAP production order dependency data is mapped to the Work Order Operationdependency objects being created for the Work Order Operations in SIMATIC IT UA DM as well aspart of the business logic used for the transfer. An example for this would be to skip the transfer forone or more operation dependencies. At this point, the basic attribute mapping provided by theeasy2go mapping tool has already been executed. The result of this initial mapping can be seenand modified using the section WorkOrderOperationDependencyDefintion:dicts of theinput TCL dictionary input. This key points to a TCL list holding the data for each operationdependency. The SAP Production Order Operation data can be accessed using the sectionProductionOrderDetails of the input TCL dictionary input. Skipping a Work Order Operationdependency transfer to SIMATIC IT UA DM can be done in two ways. Setting the keyskipCreateWorkOOperationDependencies of the input TCL dictionary input to true willresult in skipping all Work Order Operation dependencies. Setting the keyskipCreateWorkOOperationDependenciesSingle of the input TCL dictionary input to aspecific index or a TCL list of indices representing one or more operation dependencies of the listbehind WorkOrderOperationDependencyDefintion:dicts will result in skipping only theoperation dependencies identified by these indices. At the moment, the SIMATIC IT UA DMoperation dependencies are created based on the operation number (0010, 0020, 0030, …) fromSAP.The procedure SAP_ProdOrder2MES_WorkOrderToBeUsedMachine can be used to configurehow the extracted SAP production order operation data is mapped to the Work Order Operationlocation objects being created for the Work Order Operations in SIMATIC IT UA DM as well as part ofthe business logic used for the transfer. An example for this would be to skip the transfer for one ormore operation locations. At this point, the basic attribute mapping provided by the easy2gomapping tool has already been executed. The result of this initial mapping can be seen andmodified using the section WorkOrderOperationToBeUsedMachineDefintion:dicts ofthe input TCL dictionary input. This key points to a TCL list holding the data for each operationlocation. The SAP Production Order Operation data can be accessed using the section of the input

Work Order Import

SIMATIC IT UA DM Gateway for SAP S/4HANA - Configuration Guide 3-5© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 20: SIMATIC IT UA DM Gateway for SAP S/4HANA - Configuration Guide · 1. CLM4S Introduction The SIMATIC IT UA DM Gateway for SAP S/4HANA (CLM4S) software solution is an integration software

TCL dictionary input. Skipping a work order operation location transfer to SIMATIC IT UA DM canbe done in two ways. Setting the key skipCreateToBeUsedMachine of the input TCL dictionaryinput to true will result in skipping all work order operation locations. Setting the keyskipCreateToBeUsedMachineSingle of the input TCL dictionary input to a specific index ora ProductionOrderDetails TCL list of indices representing one or more operation locations ofthe list behind WorkOrderOperationToBeUsedMachineDefintion:dicts will result inskipping only the operation locations identified by these indices. See proceduregetMachineToBeUsedStructure4SIT for more information.The procedure SAP_ProdOrder2MES_WorkOrderReleaseStatus can be used to configure ifthe created SIMATIC IT UA DM Work Order will be released at the end of the overall transfer or not.Releasing the order can be skipped by setting the key skipReleaseOrder of the input TCLdictionary input to true.

3. SAP to SIMATIC IT UA DM Interaction

3-6 SIMATIC IT UA DM Gateway for SAP S/4HANA - Configuration Guide© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 21: SIMATIC IT UA DM Gateway for SAP S/4HANA - Configuration Guide · 1. CLM4S Introduction The SIMATIC IT UA DM Gateway for SAP S/4HANA (CLM4S) software solution is an integration software

4. SIMATIC IT UA DM to SAP Interaction

Create Confirmation in ERP

Create Confirmation in ERP is the capability to send a confirmation about completion from the SIMATICIT UA DM Operator Landing Page to ERP system.

Caution:

This chapter is valid only for Teamcenter, ERP and SIMATIC IT UA DM integration scenarios. It doesnot apply for Teamcenter and SIMATIC IT UA DM only integration scenarios. The following featuresare shipped with CLM4S and not with CLM4T.

By default, you can decide either to send the confirmation by each of the Work Order Operations or onlyby completion of the whole Work Order in SIMATIC IT UA DM. In case, if a component in SAP has abackflash flag, CLM4S does not transfer any data from SIMATIC IT UA DM and uses only proposal datafrom SAP.

If you use components with serial number without backflash in SAP, the dictionary keyProdOrderConf:GOODSMOVEMENTS:SERIALNO_AUTO_NUMBERASSIGNMENT:$index has to bechanged to "X". This means again that SAP assigns serial number automatically, regardless from inputsin SIMATIC IT UA DM. In contrast to serial number, by using components with batchId CLM4S is able totransfer the batchId value from SIMATIC IT UA DM as shown in the following example (backflash is notset in SAP ).

set SITMaterialItemValue [dict get $SITODATADictConsumedMat\MaterialItem BatchId]if {$SITMaterialItemValue ne "null"} { dict set res ProdOrderConf:GOODSMOVEMENTS:BATCH:$index\ $SITMaterialItemValue} else { dict set res\ ProdOrderConf:GOODSMOVEMENTS:SERIALNO_AUTO_NUMBERASSIGNMENT:$index ""}

Note that the current mapping supports either serial number auto assignment or batch numberassignment, but not both at the same time.

• If the execution of the SIMATIC IT UA DM Work Order Operation is completed, SIMATIC IT UA DM sendsa signal to trigger confirmation for the corresponding operation in the production order. Add the URLas followed (please adapt the <GSInstance>):http://<GSInstance>:11301/pxml/createProdOrderOperationConfAsync.Request-Example:{ "orderId": "000100004298", "Enterprise": "Factory1" }

SIMATIC IT UA DM Gateway for SAP S/4HANA - Configuration Guide 4-1© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 22: SIMATIC IT UA DM Gateway for SAP S/4HANA - Configuration Guide · 1. CLM4S Introduction The SIMATIC IT UA DM Gateway for SAP S/4HANA (CLM4S) software solution is an integration software

Field Type Description

orderId String Production order unique ID from SAP with leading zeroes will be used for SAP BAPIcall.

Enterprise String Enterprise from SIMATIC IT UA DM.

Success-Response:

HTTP/1.1 200 OK{ "status": "QUEUED", "message": "9bba11525aec537240317d57"}

Error-Response:

HTTP/1.1 500 Internal Server Error{ "status": "ERROR", "message": "The job cannot be created"}

The Web API above calls the following BAPI's:

Target system Used API

SAP BAPI_PRODORD_GET_DETAIL

BAPI_PRODORDCONF_GET_HDR_PROP

BAPI_PRODORDCONF_CREATE_HDR

OData query to retrieve the data for the given Work Order and confirmationId:

Target system Used API

SIMATIC IT UA DM WorkOrder?$expand=ProductionType($select=NId)&$filter=NId%20eq%20'000100001234'

WorkOrderOperation?$filter=ERPConfirmationId%20eq%20'0000123456'

OData query to retrieve the ActualConsumedMaterials data for the given WorkOperationNId:

Target system Used API

SIMATIC IT UA DM WorkOrderOperation?$expand=ActualConsumedMaterials($expand=MaterialItem,ToBeConsumedMaterial($expand=Mate

4. SIMATIC IT UA DM to SAP Interaction

4-2 SIMATIC IT UA DM Gateway for SAP S/4HANA - Configuration Guide© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 23: SIMATIC IT UA DM Gateway for SAP S/4HANA - Configuration Guide · 1. CLM4S Introduction The SIMATIC IT UA DM Gateway for SAP S/4HANA (CLM4S) software solution is an integration software

Target system Used API

rialDefinition))&$filter=NId%20eq%20'34059838-8fb8-4b7e-9c1b-8d9f14b54426'

• If the execution of the SIMATIC IT UA DM Work Order is completed, SIMATIC IT UA DM sends a signalto trigger confirmation for the entire production order in ERP system by calling the web API in CLM4S:http://<GSInstance>:11301/pxml/createProdOrderConfAsync.Request-Example for SAP and SIMATIC IT UA DM integration scenarios only:

{ "confirmationId": "000000014298", "Enterprise": "Factory1"}

Request-Example for Teamcenter, SAP and SIMATIC IT UA DM integration scenarios:

{ "orderId": "000100004298", "operationId": "0040", "Enterprise": "Factory1"}

Field Type Description

orderId String Production order unique ID from SAP.

operationId String Occurrence ID tag from Teamcenter hex- encoded, CLM4T and CLM4Sintegration scenario only.

confirmationId String Confirmation ID from SAP for operation, CLM4S standalone integrationscenario only.

Enterprise String Enterprise from SIMATIC IT UA DM.

Success-Response:

HTTP/1.1 200 OK{ "status": "QUEUED", "message": "9bba11525aec537240317d67"}

Error-Response:

HTTP/1.1 500 Internal Server Error{ "status": "ERROR", "message": "The job cannot be created"}

Create Confirmation in ERP

SIMATIC IT UA DM Gateway for SAP S/4HANA - Configuration Guide 4-3© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 24: SIMATIC IT UA DM Gateway for SAP S/4HANA - Configuration Guide · 1. CLM4S Introduction The SIMATIC IT UA DM Gateway for SAP S/4HANA (CLM4S) software solution is an integration software

The web API must be configured in SIMATIC IT UA DM configuration keys in the section "CLM4TIntegration" accordingly.The payload for this API consists only of orderId and Enterprise for the completed SIMATIC IT UADM Work Order. For the Work Order Operation operationId is the additional attribute in thepayload. The data for the Work Order or Work Order Operation will be retrieved from SIMATIC IT UADM in the step getWorkOrderExecutionData via an OData query. For more details please take alook at <T4x_GS_ROOT>/var/mmap/clm4s_mapping_config/clm4s_operation_conf_config.sd foroperation confirmation and <T4x_GS_ROOT>/var/mmap/clm4s_mapping_config/clm4s_production_order_conf_config.sd for production order.If the backflash flag is enabled for the component in SAP, CLM4S sends the confirmation usingproposal data from SAP otherwise CLM4S retrieves the ActualConsumedMaterials from SIMATICIT UA DM and sends it to SAP instead of proposal for values.The Web API above calls the following BAPI's:

Target system Used API

SAP BAPI_PRODORD_GET_DETAIL

BAPI_PRODORDCONF_GET_TT_PROP

BAPI_PRODORDCONF_CREATE_TT

• OData query to retrieve the ActualConsumedMaterials data for the given WorkOperationNId:

Target system Used API

SIMATIC IT UA DM WorkOrder?$expand=ParentOrder($select=NId),ProducedMaterialItems($expand=MaterialItem),FinalMaterial,ProductionType($select=NId),WorkOrderOperations($expand=ActualConsumedMaterials($expand=MaterialItem,ToBeConsumedMaterial($expand=MaterialDefinition)))&$filter=NId%20eq%20'000100001234'

4. SIMATIC IT UA DM to SAP Interaction

4-4 SIMATIC IT UA DM Gateway for SAP S/4HANA - Configuration Guide© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 25: SIMATIC IT UA DM Gateway for SAP S/4HANA - Configuration Guide · 1. CLM4S Introduction The SIMATIC IT UA DM Gateway for SAP S/4HANA (CLM4S) software solution is an integration software

A. CLM4S Glossary

B

BGSBasic Gateway Service.

C

CLM4SClosed Loop Manufacturing for SAP S/4HANA®

G

GSGateway Service, manages the communication between Enterprise Applications.

T

T4x_BGS_ROOTThe installation directory of the T4x Basic Gateway Service (e.g. C:\Siemens\T4x_BGS)

TCLis a high-level, general-purpose, interpreted, dynamic programming language.

Z

Z-Table"Z" is a well-known prefix name for custom tables in the SAP world. A special table used with is thetable /TESISPLM/ZPTC.

SIMATIC IT UA DM Gateway for SAP S/4HANA - Configuration Guide A-1© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 26: SIMATIC IT UA DM Gateway for SAP S/4HANA - Configuration Guide · 1. CLM4S Introduction The SIMATIC IT UA DM Gateway for SAP S/4HANA (CLM4S) software solution is an integration software
Page 27: SIMATIC IT UA DM Gateway for SAP S/4HANA - Configuration Guide · 1. CLM4S Introduction The SIMATIC IT UA DM Gateway for SAP S/4HANA (CLM4S) software solution is an integration software
Page 28: SIMATIC IT UA DM Gateway for SAP S/4HANA - Configuration Guide · 1. CLM4S Introduction The SIMATIC IT UA DM Gateway for SAP S/4HANA (CLM4S) software solution is an integration software

Siemens Industry Software

HeadquartersGranite Park One5800 Granite ParkwaySuite 600Plano, TX 75024USA+1 972 987 3000

AmericasGranite Park One5800 Granite ParkwaySuite 600Plano, TX 75024USA+1 314 264 8499

EuropeStephenson HouseSir William Siemens SquareFrimley, CamberleySurrey, GU16 8QD+44 (0) 1276 413200

Asia-PacificSuites 4301-4302, 43/FAIA Kowloon Tower, Landmark East100 How Ming StreetKwun Tong, KowloonHong Kong+852 2230 3308

About Siemens PLM SoftwareSiemens PLM Software, a business unit ofthe Siemens Industry Automation Division,is a leading global provider of productlifecycle management (PLM) software andservices with 7 million licensed seats and71,000 customers worldwide.Headquartered in Plano, Texas, SiemensPLM Software works collaboratively withcompanies to deliver open solutions thathelp them turn more ideas into successfulproducts. For more information onSiemens PLM Software products andservices, visit www.siemens.com/plm.

© 2018 Siemens Product LifecycleManagement Software Inc. Siemens, theSiemens logo and SIMATIC IT are registeredtrademarks of Siemens AG. Camstar, D-Cubed, Femap, Fibersim, Geolus, I-deas, JT,NX, Omneo, Parasolid, Solid Edge,Syncrofit, Teamcenter and Tecnomatix aretrademarks or registered trademarks ofSiemens Product Lifecycle ManagementSoftware Inc. or its subsidiaries in theUnited States and in other countries. Allother trademarks, registered trademarks orservice marks belong to their respectiveholders.