teamcenter product cost management gateway for sap s/4hana ... · the teamcenter product cost...

40
Teamcenter Product Cost Management Gateway for SAP S/ 4HANA Configuration Guide

Upload: others

Post on 05-Jun-2020

30 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Teamcenter Product Cost Management Gateway for SAP S/4HANA ... · The Teamcenter Product Cost Management Gateway for SAP S/4HANA (TCPCM4S) software solution is an integration software

TeamcenterProduct CostManagementGateway for SAP S/4HANAConfigurationGuide

Page 2: Teamcenter Product Cost Management Gateway for SAP S/4HANA ... · The Teamcenter Product Cost Management Gateway for SAP S/4HANA (TCPCM4S) software solution is an integration software

Contents

Preface 5

Introduction 1-1

Basic ConfigurationThe File tcpcm4s_mapping_config ────────────────────────── 2-1Provide SAP Account Information ─────────────────────────── 2-2Configurable Teamcenter Product Cost Management URL ─────────── 2-4Configure Communication Channel ────────────────────────── 2-4Mapping Templates ──────────────────────────────────── 2-6

SAP Authentication ConceptTechnical Concept Manual SAP Logon ──────────────────────── 3-1Technical Concept SAP Auto Logon ────────────────────────── 3-2

Calculation Structure PreviewTechnical Concept TCPCM4S Calculation Structure Preview ─────────── 4-1Calculation Structure Preview Mapping File ───────────────────── 4-1Structure of the Input Dictionary for the Calculation Structure Preview Usecase

───────────────────────────────────────────── 4-2

Calculation Structure ImportTechnical Concept TCPCM4S Calculation Structure Import ─────────── 5-1Teamcenter Product Cost Management Gateway for SAP S/4HANA Calculation

Structure Import Mapping File ───────────────────────── 5-3Structure of the Input Dictionary for the Calculation Structure Import Usecase

───────────────────────────────────────────── 5-5

Masterdata SynchronisationTechnical Concept Teamcenter Product Cost Management Gateway for SAP S/

4HANA Masterdata Synchronisation ───────────────────── 6-1Technical Concept TCPCM4S Masterdata Synchronisation for Generic Objects ──── 6-1Technical Concept TCPCM4S Intelligent Material Masterdata Synchronisation ──── 6-2

Teamcenter Product Cost Management Gateway for SAP S/4HANA - MasterdataSynchronisation Trigger Script ───────────────────────── 6-3

Teamcenter Product Cost Management Gateway for SAP S/4HANA MasterdataSynchronisation Mapping File ───────────────────────── 6-4

Structure of the Input Dictionary for the Masterdata Synchronization Usecase───────────────────────────────────────────── 6-6

Teamcenter Product Cost Management Gateway for SAP S/4HANA Configuration Guide 2© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 3: Teamcenter Product Cost Management Gateway for SAP S/4HANA ... · The Teamcenter Product Cost Management Gateway for SAP S/4HANA (TCPCM4S) software solution is an integration software

Glossary A-1

Contents

Teamcenter Product Cost Management Gateway for SAP S/4HANA Configuration Guide 3© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 4: Teamcenter Product Cost Management Gateway for SAP S/4HANA ... · The Teamcenter Product Cost Management Gateway for SAP S/4HANA (TCPCM4S) software solution is an integration software

4 Teamcenter Product Cost Management Gateway for SAP S/4HANA Configuration Guide© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 5: Teamcenter Product Cost Management Gateway for SAP S/4HANA ... · The Teamcenter Product Cost Management Gateway for SAP S/4HANA (TCPCM4S) 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 Teamcenter Product Cost ManagementGateway for SAP S/4HANA or those that have a legitimate right to use this documentation as part oftheir assignment on behalf of the licensee to enable or support usage of the software for use within theboundaries of the license 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.

Teamcenter Product Cost Management Gateway for SAP S/4HANA Configuration Guide 5© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 6: Teamcenter Product Cost Management Gateway for SAP S/4HANA ... · The Teamcenter Product Cost Management Gateway for SAP S/4HANA (TCPCM4S) software solution is an integration software

6 Teamcenter Product Cost Management Gateway for SAP S/4HANA Configuration Guide© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 7: Teamcenter Product Cost Management Gateway for SAP S/4HANA ... · The Teamcenter Product Cost Management Gateway for SAP S/4HANA (TCPCM4S) software solution is an integration software

1. IntroductionThe Teamcenter Product Cost Management Gateway for SAP S/4HANA (TCPCM4S) software solution isan integration software that provides data and process integration between Teamcenter Product CostManagement® by Siemens Product Lifecycle Management Software Inc. and SAP S/4HANA® by SAP AG

TCPCM4S provides functionality to sync masterdata from SAP ERP, search and import calculations intoTeamcenter Product Cost Management. It is also possible to show a preview of the calculation prior tothe import. TCPCM4S also comes with an authentication suite to authenticate against SAP ERP.

This document details the components of Teamcenter Product Cost Management Gateway for SAP S/4HANA integration, which are available out of the box and configurable to meet customer specificsolution requirements.

Teamcenter Product Cost Management Gateway for SAP S/4HANA Configuration Guide 1-1© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 8: Teamcenter Product Cost Management Gateway for SAP S/4HANA ... · The Teamcenter Product Cost Management Gateway for SAP S/4HANA (TCPCM4S) software solution is an integration software

1. Introduction

1-2 Teamcenter Product Cost Management Gateway for SAP S/4HANA Configuration Guide© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 9: Teamcenter Product Cost Management Gateway for SAP S/4HANA ... · The Teamcenter Product Cost Management Gateway for SAP S/4HANA (TCPCM4S) software solution is an integration software

2. Basic Configuration

The File tcpcm4s_mapping_config

The file tcpcm4s_mapping_config.sd in the directory <T4x_GS_ROOT>\var\mmap\tcpcm4s_mapping_config\ is the first file that is read by each TCL worker thread or process of theTCPCM4S software. It loads the rest of the mapping files and may contain basic settings as well asvariables which are supposed to be used in more than one mapping file.

The following basic configuration data can be set in generic mapping configuration filetcpcm4s_mapping_config.sd:

• System login data, see chapter Provide SAP Account Information

• The variable ::TCPM4S_Defaults(SapAutoLoginSystemId) is used to define which connectioninformation should be used for the autologon of the scripting(::TCPCM4S::CONNECTION2SAP::connect4Autologin).

• The variable ::TCPM4S_Defaults(MasterDataSyncURL) determines the URL of TeamcenterProduct Cost Management endpoint for the masterdata sync. For more information on how to set upthis enpoint, please refer to the official Teamcenter Product Cost Management documentation.

• The variables ::TCPM4S_Defaults(ConfigGuid<My_Masterdata_Object_Type>) define theTeamcenter Product Cost Management config GUID that is used for a specific masterdata object type(<My_Masterdata_Object_Type>). Possible values for the masterdata object types are:MaterialMasterHeader, MaterialMasterDetail, MaterialMasterRevision, PlantHeader,WorkcenterHeader, CostcenterHeader, ActivityTypeHeader and ActivityRateHeader.

• Thevariables ::TCPM4S_Defaults(ImportConfigAttributes<My_Masterdata_Object_Type>) define the Teamcenter Product Cost Management attributes that will be sent in the payload. All ofthose attributes need to be found in the corresponding import configuration for that specificmasterdata object type.

• Since the there could be a difference between the attributes that are in the import config and theattributes we might want to map and send, thevariables ::TCPM4S_Defaults(AttributesForPayload<My_Masterdata_Object_Type>)define the Teamcenter Product Cost Management attributes that will be mapped for the payload. Allof those attributes need to be found in the corresponding import configuration for that specificmasterdata object type.

• Sourcing of mapping files with source -relax.Example: source -relax tcpcm4s_calcstruct_import_custom.sd. This means TCPCM4Shas to read the content of the file tcpcm4s_calcstruct_import_custom.sd. The argument -relax

Teamcenter Product Cost Management Gateway for SAP S/4HANA Configuration Guide 2-1© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 10: Teamcenter Product Cost Management Gateway for SAP S/4HANA ... · The Teamcenter Product Cost Management Gateway for SAP S/4HANA (TCPCM4S) software solution is an integration software

means the file is looked up in the memory first and only if its content is not there, the file is loadedfrom disc (only in the same directory <T4x_GS_ROOT>\var\mmap\tcpcm4s_mapping_config).In principle, the file names may be modified freely as long as the file extension .sd is kept. Every filestated there that has the file extension .sd is actually used for the mapping functionality. In fact theonly file TCPCM4S actually uses for the mapping is the compiled mappingfiletcpcm4s_mapping_config.rfdt. So this is what you need to think about in order to create thecompiled mapping file correctly.In order to not use a mapping file it is enough to not "source" it in tcpcm4s_mapping_config.sd.However, we strongly recommend keeping only those mapping files in the mmap directory that youreally want to use!Be sure to have the correct file names (the files located in <T4x_GS_ROOT>\var\mmap\tcpcm4s_mapping_config) in the "source" section of this file

Provide SAP Account Information

When authenticating against SAP ERP out of Teamcenter Product Cost Management there are twopotential ways to authenticate:

• Manual logon = User enters SAP Logon credentials for a certain SAP system manually over a userlogon dialogue

• Auto logon = No input from the user is needed and the authentication against SAP is managedautomatically by TCPCM4S in the background

The settings described here have to be done in the file tcpcm4s_mapping_config.sd. For theconfiguration that has to be done in Teamcenter Product Cost Management in terms of logonconfiguration (TCPCM4S Adapter Config) please refer to the official Teamcenter Product CostManagement documentation. It is also possible to combine the definition of manual and auto logon.Solely the Teamcenter Product Cost Management configuration determines which approach is used.

Storing SAP logon information for Manual logon

TCPCM4S Configuration

Since all information about the logon is entered manually in the Teamcenter Product Cost Managementuser dialogue, there is no need to define any information in the tcpcm4s_mapping_config.sd. Theinformation is just routed through to TCPCM4S. It just needs to be ensured that the sapnwrfc.inicontains all SAP systems that the user mights selects within Teamcenter Product Cost Management.

Storing SAP logon information for Auto logon

TCPCM4S Configuration

The auto logon information for the SAP system can be defined in the ::TCPM4S_Defaults array in thetcpcm4s_mapping_config.sd. The following code snippet shows the concept of the auto logondefinition:

2. Basic Configuration

2-2 Teamcenter Product Cost Management Gateway for SAP S/4HANA Configuration Guide© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 11: Teamcenter Product Cost Management Gateway for SAP S/4HANA ... · The Teamcenter Product Cost Management Gateway for SAP S/4HANA (TCPCM4S) software solution is an integration software

## PCM SAP auto connect feature## Set the technical user for TCPCM4S autologin##set ::TCPM4S_Defaults(<SAP System ID>:SapTechnicalUserName) "MyUsername" ; # Username must be encrypted#set ::TCPM4S_Defaults(<SAP System ID>:SapTechnicalUserPassword) "MyPassword" ; # Password must be encrypted#

The next code snippet shows for example the auto logon definition for two SAP systems (ET5 and ET1):

## Example for SAP auto connection definition for system ET5 (used for scripting)#set ::TCPM4S_Defaults(ET5:SapTechnicalUserName) "3a7d6fc50ef58904a" ; # Username must be encryptedset ::TCPM4S_Defaults(ET5:SapTechnicalUserPassword) "28282d947eafdaf67677a309506875d2" ; # Password must be encryptedset ::TCPM4S_Defaults(ET5:SapTechnicalClient) "800"set ::TCPM4S_Defaults(ET5:SapTechnicalLanguage) "EN"

## Example for SAP auto connection definition for system ET1 (used for scripting)#set ::TCPM4S_Defaults(ET1:SapTechnicalUserName) "d2a0f1bbeaf952b" ; # Username must be encryptedset ::TCPM4S_Defaults(ET1:SapTechnicalUserPassword) "517f6cc2eaf0beb9222" ; # Password must be encryptedset ::TCPM4S_Defaults(ET1:SapTechnicalClient) "800"set ::TCPM4S_Defaults(ET1:SapTechnicalLanguage) "EN"#

It is important that the sapnwrfc.ini contains all SAP systems that are configured as potential auto logontargets in the mapping config.

Caution:

Never store your credentials in plain format in the mapping file. TCPCM4S only supports autologon with credentials that are stored in encrypted format!

• Open the BGS Admin UI and select "Script -> Scripts" in the menu.

• Search for the script T4x Password Crypt.

Provide SAP Account Information

Teamcenter Product Cost Management Gateway for SAP S/4HANA Configuration Guide 2-3© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 12: Teamcenter Product Cost Management Gateway for SAP S/4HANA ... · The Teamcenter Product Cost Management Gateway for SAP S/4HANA (TCPCM4S) software solution is an integration software

• Enter the CEP user name into the input field and run the script.

• You will get an output like 341d0a857eaf9529.

• Include the output string into the line above in the file tcpcm4s_mapping_config.sd.

• Do the same for the password.

• Rebuild the mapping

Configurable Teamcenter Product Cost Management URL

TCPCM4S executes the web services calls to the Teamcenter Product Cost Management webserviceendpoint that is configured on an IIS. The service call for all masterdata objects is implemeted inthe ::TCPCM4S::PCM::WEBSERVICE::TOOLBOX::callTcPCMService4Masterdata function. Itis important to only configure the second part of the URL, because the base URL to the IIS needs to beconfigured in the communication channel configuration (for more information please refer toConfigure Communication Channel). The target URL suffix may have the following structure:

#***************************************************************************************************# Configuration of the masterdata sync from SAP to TCPCM#***************************************************************************************************## set ::TCPM4S_Defaults(MasterDataSyncURL) "/<your.iis.service.name>/PpcConnectorService.svc/<your authentication method>"#

The following code shows an example configuration:

## Example configuration for localhost environment:#set ::TCPM4S_Defaults(MasterDataSyncURL) "/PpcConnectorService.svc/basic"

Configure Communication Channel

The Teamcenter Product Cost Management Gateway for SAP S/4HANA connection to TeamcenterProduct Cost Management is configured via a "Communication Channel". By default TCPCM4S has acommunication channel called "PCM" configured. This communication channel needs to be used toconfigure the connection to Teamcenter Product Cost Management for outgoing webservice calls. Donot rename the default communication channel!

Since the configuration of the webservices for Teamcenter Product Cost Management is a manual step,the default communication channel needs to be adjusted to the configuration of the corresponding

2. Basic Configuration

2-4 Teamcenter Product Cost Management Gateway for SAP S/4HANA Configuration Guide© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 13: Teamcenter Product Cost Management Gateway for SAP S/4HANA ... · The Teamcenter Product Cost Management Gateway for SAP S/4HANA (TCPCM4S) software solution is an integration software

endpoint on the IIS. For more information on configuring the Teamcenter Product Cost Managementendpoint for the masterdata sync, please refer to the official Teamcenter Product Cost Managementdocumentation.

In order to adjust the configuration of the "PCM" communication channel, open the advanced settings inthe "Communication Channel" Menu:

Afterwards you can select and edit the default communication channel "PCM":

In the actual communication channel dialogue you can then configure base url of your webservice (theendpoint url until but without /PpcConnectorService.svc), the port the webservice endpoint is listeningto (default IIS port is :80). It also gives you the possibility to enable TLS. For more information on TLSplease refer to the help in the Admin UI.

Configure Communication Channel

Teamcenter Product Cost Management Gateway for SAP S/4HANA Configuration Guide 2-5© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 14: Teamcenter Product Cost Management Gateway for SAP S/4HANA ... · The Teamcenter Product Cost Management Gateway for SAP S/4HANA (TCPCM4S) software solution is an integration software

Mapping Templates

The installation package of the GS contains mapping templates under the following path<T4x_GS_ROOT>\var\mmap\tcpcm4s_mapping_config\. Those mapping templates only work with thecorresponding import configuration within Teamcenter Product Cost Management. The demo mappingtemplates depend further on an out of the box SAP system with IDES demo data to work.

The samples in the mapping template files may serve as a guideline to your own customer specificimplementation and show the use of the functions provided to make the implementation easier.

• tcpcm4s_calcstruct_import_custom.sdSample implementation of a multi-level calculation structure import.

• tcpcm4s_calcstruct_preview_custom.sdContains a sample implementation of a calculation structure preview.

• tcpcm4s_material_import_custom.sdImplementation of an example import job mapping that reads material master information from SAPand creates Material Header, Material Revision and Material Details for all plants that the MaterialMaster is maintained.

• tcpcm4s_plant_import_custom.sd

2. Basic Configuration

2-6 Teamcenter Product Cost Management Gateway for SAP S/4HANA Configuration Guide© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 15: Teamcenter Product Cost Management Gateway for SAP S/4HANA ... · The Teamcenter Product Cost Management Gateway for SAP S/4HANA (TCPCM4S) software solution is an integration software

Implementation of an example import job mapping that creates a plant in Teamcenter Product CostManagement based on metadata that is assigned to the import job.

• tcpcm4s_workcenter_import_custom.sdImplementation of an example import job mapping that creates a workcenter in Teamcenter ProductCost Management based on metadata that is assigned to the import job.

• tcpcm4s_costcenter_import_custom.sdImplementation of an example import job mapping that creates a costcenter in Teamcenter ProductCost Management.

• tcpcm4s_activity_rates_import_custom.sdImplementation of an example import job mapping that creates activity rates in Teamcenter ProductCost Management based on metadata that is assigned to the import job.

• tcpcm4s_activity_types_import_custom.sdImplementation of an example import job mapping that creates activity types in Teamcenter ProductCost Management based on metadata that is assigned to the import job.

• tcpcm4s_custom_functions.sdThis mapping file can be used to implement custom functions that might be called from multiplemapping files.

The delivery also contains a script to trigger the masterdata sync between SAP and Teamcenter ProductCost Management by creating the import jobs. This script might be modified as well as the mappingfiles, according to customer specific requirements. The script tcpcm4s_trigger_masterdata_sync.tcl islocated under the following path: <T4x_GS_ROOT>\var\test\TCPCM4S\

Mapping Templates

Teamcenter Product Cost Management Gateway for SAP S/4HANA Configuration Guide 2-7© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 16: Teamcenter Product Cost Management Gateway for SAP S/4HANA ... · The Teamcenter Product Cost Management Gateway for SAP S/4HANA (TCPCM4S) software solution is an integration software

2. Basic Configuration

2-8 Teamcenter Product Cost Management Gateway for SAP S/4HANA Configuration Guide© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 17: Teamcenter Product Cost Management Gateway for SAP S/4HANA ... · The Teamcenter Product Cost Management Gateway for SAP S/4HANA (TCPCM4S) software solution is an integration software

3. SAP Authentication Concept

Technical Concept Manual SAP Logon

The following picture describes the concept that is used for the manual logon. For more informationabout how to configure the auto logon in TCPCM4S itself please refer to the chapter Provide SAPAccount Information. For more information on how to configure the manual logon in TeamcenterProduct Cost Management please refer to the official product documentation.

The center of the whole manual logon mechanism is a unique logon token that is stored in TeamcenterProduct Cost Management and Teamcenter Product Cost Management Gateway for SAP S/4HANA for thelength of a user session (= open Teamcenter Product Cost Management instance on a client). Thedialogue to enter the logon information will only pop up for the first logon in the session. TCPCM4Smanages the the SAP logon information that was entered over a logon dialogue in Teamcenter ProductCost Management. In case the import and preview of a calculation structure has to be done withanother language, then this can be accomplished by restarting / opening another Teamcenter ProductCost Management session in combination with entering the desired language in the logon dialogue.

Teamcenter Product Cost Management Gateway for SAP S/4HANA Configuration Guide 3-1© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 18: Teamcenter Product Cost Management Gateway for SAP S/4HANA ... · The Teamcenter Product Cost Management Gateway for SAP S/4HANA (TCPCM4S) software solution is an integration software

Technical Concept SAP Auto Logon

The following picture describes the concept that is used for the auto logon. For more information aboutwhat to consider for the auto logon in TCPCM4S itself please refer to the chapter Provide SAP AccountInformation. For more information on how to configure the auto logon in Teamcenter Product CostManagement please refer to the official product documentation.

Like for the manual logon the center of the logon mechanism is a unique logon token that is stored inTeamcenter Product Cost Management and Teamcenter Product Cost Management Gateway for SAP S/4HANA for the length of a user session (= open Teamcenter Product Cost Management instance on aclient). The auto logon does self understanding not have a dialogue in Teamcenter Product CostManagement that asks for the SAP system and credentials to establish a connection. This informationhas to be stored in the tcpcm4s_mapping_config.sd as described in Provide SAP Account Information.At least the information of the system that is configured in the TCPCM4S Adapter config must be stored

Caution:

At least the information of the system that is configured in the TCPCM4S Adapter config must bestored in the tcpcm4s_mapping_config.sd. Otherwise neither the calculation structure import, northe calculation structure import will work.

3. SAP Authentication Concept

3-2 Teamcenter Product Cost Management Gateway for SAP S/4HANA Configuration Guide© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 19: Teamcenter Product Cost Management Gateway for SAP S/4HANA ... · The Teamcenter Product Cost Management Gateway for SAP S/4HANA (TCPCM4S) software solution is an integration software

4. Calculation Structure Preview

Technical Concept TCPCM4S Calculation Structure Preview

The following picture describes the technical concept of the calculation structure preview on a highlevel:

Caution:

For the preview of the calculation structure there is no import configuration layer in TeamcenterProduct Cost Management as it is for the calculation structure import or the masterdata sync. Theconsequence of this is, that the attribute names are shown in the Teamcenter Product CostManagement as they come in the payload. Therefore be very careful how you name yourattributes in the JSON payload response that is sent to Teamcenter Product Cost Management.

Calculation Structure Preview Mapping File

When the mapping logic for the calculation structure preview gets triggered, there are the functions inthe custom mapping that will be called by the core in a certain order:

Teamcenter Product Cost Management Gateway for SAP S/4HANA Configuration Guide 4-1© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 20: Teamcenter Product Cost Management Gateway for SAP S/4HANA ... · The Teamcenter Product Cost Management Gateway for SAP S/4HANA (TCPCM4S) software solution is an integration software

The getCalculationsForImport function implements the logic to get a list of available calculationsfor the given material number / plant combination and determines which of those calculations should beused for import. Customer specific subfunctions might be called from here in order to structure the codebetter:

proc getCalculationsForImport {MaterialNumber PlantNumber} { # Implement your logic here return $Status (OK|ERROR)}

The getPCMStructureInputDict function is just used to return the structure input dict to thecustomer. This gives the implementation consultant the freedom to name the dict of the structure as hepleases.

proc getPCMStructureInputDict {} {

# Implement your logic here

return $TCPCMInputDict}

Structure of the Input Dictionary for the Calculation StructurePreview Usecase

The JSON payload of the webservice response that contains the preview information of the calculationstructure is based on the structure of the TCL dictionary that is returned by the functiongetPCMStructureInputDict (for futher reference about the function calls of the calculationstructure import mapping please refer to the chapter Calculation Structure Preview Mapping File).The following picture illustrates how the dictionary needs to be structured, so that TCPCM4S is able tocreate the response payload:

4. Calculation Structure Preview

4-2 Teamcenter Product Cost Management Gateway for SAP S/4HANA Configuration Guide© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 21: Teamcenter Product Cost Management Gateway for SAP S/4HANA ... · The Teamcenter Product Cost Management Gateway for SAP S/4HANA (TCPCM4S) software solution is an integration software

Caution:

Teamcenter Product Cost Management can only display a flat list of attributes. Therefore adictionary structure with an index higher than one is not supported!

Structure of the Input Dictionary for the Calculation Structure Preview Usecase

Teamcenter Product Cost Management Gateway for SAP S/4HANA Configuration Guide 4-3© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 22: Teamcenter Product Cost Management Gateway for SAP S/4HANA ... · The Teamcenter Product Cost Management Gateway for SAP S/4HANA (TCPCM4S) software solution is an integration software

4. Calculation Structure Preview

4-4 Teamcenter Product Cost Management Gateway for SAP S/4HANA Configuration Guide© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 23: Teamcenter Product Cost Management Gateway for SAP S/4HANA ... · The Teamcenter Product Cost Management Gateway for SAP S/4HANA (TCPCM4S) software solution is an integration software

5. Calculation Structure Import

Technical Concept TCPCM4S Calculation Structure Import

The following picture describes the technical concept of the calculation structure import on a high level:

It is important to know that there are also mapping capabilities in the import configuration layer on theTeamcenter Product Cost Management side. The following picture shows the import configurationconcept for TCPCM4S. In general it is recommeded to place as many mappings and business logic in theTCPCM4S mapping files. But it has proven to be very handy to leverage the import configuration layer inTeamcenter Product Cost Management for the definition of default values and for the mapping fromabstract payload values to Teamcenter Product Cost Management internal types. The illustration belowshows the Teamcenter Product Cost Management import configuration layer more in detail:

Teamcenter Product Cost Management Gateway for SAP S/4HANA Configuration Guide 5-1© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 24: Teamcenter Product Cost Management Gateway for SAP S/4HANA ... · The Teamcenter Product Cost Management Gateway for SAP S/4HANA (TCPCM4S) software solution is an integration software

The following screenshot shows an example configuration of the the adapter configuration inTeamcenter Product Cost Management:

The following screenshot shows an example Teamcenter Product Cost Management importconfiguration for the a structure import:

5. Calculation Structure Import

5-2 Teamcenter Product Cost Management Gateway for SAP S/4HANA Configuration Guide© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 25: Teamcenter Product Cost Management Gateway for SAP S/4HANA ... · The Teamcenter Product Cost Management Gateway for SAP S/4HANA (TCPCM4S) software solution is an integration software

For detailed information on how to configure the adapter config and an import configuration inTeamcenter Product Cost Management, please refer to the official Teamcenter Product CostManagement documentation.

Teamcenter Product Cost Management Gateway for SAP S/4HANACalculation Structure Import Mapping File

When the mapping logic for the calculation structure import gets triggered, there are the functions inthe custom mapping that will be called by the core in a certain order:

Teamcenter Product Cost Management Gateway for SAP S/4HANA Calculation Structure Import Mapping File

Teamcenter Product Cost Management Gateway for SAP S/4HANA Configuration Guide 5-3© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 26: Teamcenter Product Cost Management Gateway for SAP S/4HANA ... · The Teamcenter Product Cost Management Gateway for SAP S/4HANA (TCPCM4S) software solution is an integration software

The getCalculationsForImport function implements the logic to get a list of available calculationsfor the given material number / plant combination and determines which of those calculations should beused for import. Customer specific subfunctions might be called from here in order to structure the codebetter:

proc getCalculationsForImport {MaterialNumber PlantNumber} { # Implement your logic here return $Status (OK|ERROR)}

The iterateCalculationStructure function implements the logic that reads the calculationexplosion that is supposed to be imported. It iterates through the structure and fills a dictionary that willbe the base for the payload creation. Customer specific subfunctions might be called from here in orderto structure the code better.

proc iterateCalculationStructure {SapDatIndexPar…} { # Implement your logic here

return $Status (OK|ERROR)}

The getPCMStructureInputDict function is just used to return the structure input dict to thecustomer. This gives the implementation consultant the freedom to name the dict of the structure as hepleases.

proc getPCMStructureInputDict {} {

# Implement your logic here

return $TCPCMInputDict}

5. Calculation Structure Import

5-4 Teamcenter Product Cost Management Gateway for SAP S/4HANA Configuration Guide© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 27: Teamcenter Product Cost Management Gateway for SAP S/4HANA ... · The Teamcenter Product Cost Management Gateway for SAP S/4HANA (TCPCM4S) software solution is an integration software

Structure of the Input Dictionary for the Calculation StructureImport Usecase

The JSON payload of the webservice response that contains the calculation structure is based on thestructure of the TCL dictionary that is returned by the function getPCMStructureInputDict (forfuther reference about the function calls of the calculation structure import mapping please refer to thechapter Teamcenter Product Cost Management Gateway for SAP S/4HANA Calculation StructureImport Mapping File). The following picture illustrates how the dictionary needs to be structured, sothat TCPCM4S is able to create the response payload:

Structure of the Input Dictionary for the Calculation Structure Import Usecase

Teamcenter Product Cost Management Gateway for SAP S/4HANA Configuration Guide 5-5© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 28: Teamcenter Product Cost Management Gateway for SAP S/4HANA ... · The Teamcenter Product Cost Management Gateway for SAP S/4HANA (TCPCM4S) software solution is an integration software

5. Calculation Structure Import

5-6 Teamcenter Product Cost Management Gateway for SAP S/4HANA Configuration Guide© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 29: Teamcenter Product Cost Management Gateway for SAP S/4HANA ... · The Teamcenter Product Cost Management Gateway for SAP S/4HANA (TCPCM4S) software solution is an integration software

6. Masterdata Synchronisation

Technical Concept Teamcenter Product Cost Management Gatewayfor SAP S/4HANA Masterdata Synchronisation

Technical Concept TCPCM4S Masterdata Synchronisation for Generic Objects

The following picture describes the technical concept of the calculation structure import on a high level:

It is important to know that there are also mapping capabilities in the import configuration layer on theTeamcenter Product Cost Management side. The following picture shows the import configurationconcept for TCPCM4S. In general it is recommeded to place as many mappings and business logic in theTCPCM4S mapping files. But it has proven to be very handy to leverage the import configuration layer inTeamcenter Product Cost Management for the definition of default values and for the mapping fromabstract payload values to Teamcenter Product Cost Management internal types. In contrast to theCalculation Structure Usecase there is no TCPCM4S Adapter Configuration Layer, due to the fact that theendpoint connection is managed in the <T4x_GS_ROOT>\var\mmap\tcpcm4s_mapping_config.sd (seeThe File tcpcm4s_mapping_config). The file <T4x_GS_ROOT>\var\mmap\tcpcm4s_mapping_config.sdis also the place where the GUID of the Teamcenter Product Cost Management Import Config is definedfor the Material Header, Material Revision, Material Detail. The illustration below shows the TeamcenterProduct Cost Management import configuration layer more in detail:

Teamcenter Product Cost Management Gateway for SAP S/4HANA Configuration Guide 6-1© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 30: Teamcenter Product Cost Management Gateway for SAP S/4HANA ... · The Teamcenter Product Cost Management Gateway for SAP S/4HANA (TCPCM4S) software solution is an integration software

Technical Concept TCPCM4S Intelligent Material Masterdata Synchronisation

The following picture describes the technical concept of the calculation structure import on a high level:

Due to the fact that the Material Masterdata can reach a very high volume and considering further thatonly a few changes in this area are relavant for costing there is a slightly different approach for thesynchronization of Material Masterdata in comaprison the approach for the other masterdata objects(see Technical Concept TCPCM4S Masterdata Synchronisation for Generic Objects). Instead ofquerying all material masters TCPCM4S will just query the corresponding material masters that arewritten in the ZPTC table. How the material master entries for the ZPTC table are marked as relevant forthe material masterdata sync needs to be defined by the solution architect (for more information on

6. Masterdata Synchronisation

6-2 Teamcenter Product Cost Management Gateway for SAP S/4HANA Configuration Guide© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 31: Teamcenter Product Cost Management Gateway for SAP S/4HANA ... · The Teamcenter Product Cost Management Gateway for SAP S/4HANA (TCPCM4S) software solution is an integration software

how to work with the ZPTC Table search for the term "ZPTC" in the documentation). Which changes arerelevant for costing can be different from customer to customer.

Caution:

A BAPI that fills the ZPTC table with entries of Material Numbers that had relevant changes is notpart of the TCPCM4S delivery. Such a BAPI needs to be provided by the customer!

It is important to know that there are also mapping capabilities in the import configuration layer on theTeamcenter Product Cost Management side. The following picture shows the import configurationconcept for TCPCM4S. In general it is recommeded to place as many mappings and business logic in theTCPCM4S mapping files. But it has proven to be very handy to leverage the import configuration layer inTeamcenter Product Cost Management for the definition of default values and for the mapping fromabstract payload values to Teamcenter Product Cost Management internal types. In contrast to theCalculation Structure Usecase there is no TCPCM4S Adapter Configuration Layer, due to the fact that theendpoint connection is managed in the <T4x_GS_ROOT>\var\mmap\tcpcm4s_mapping_config.sd (seeThe File tcpcm4s_mapping_config). The file <T4x_GS_ROOT>\var\mmap\tcpcm4s_mapping_config.sdis also the place where the GUID of the Teamcenter Product Cost Management Import Config is definedfor each object type that might be synced. The illustration below shows the Teamcenter Product CostManagement import configuration layer more in detail:

Teamcenter Product Cost Management Gateway for SAP S/4HANA -Masterdata Synchronisation Trigger Script

The script that is used to trigger the masterdata sync can be found under <T4x_GS_ROOT>\var\test\TCPCM4S\tcpcm4s_trigger_masterdata_sync.tcl. It follows the concept of asynchronous triggers. Toinstall such a polling mechanism, configure the Task Management in the TCPCM4S Admin Tool (see theonline help of the Admin UI chapter "Task Management" for details). In this case you have to switch offthe scheduling mechanism of the trigger script by setting paramter "Mode" to value "single". In addition

Teamcenter Product Cost Management Gateway for SAP S/4HANA - Masterdata Synchronisation Trigger Script

Teamcenter Product Cost Management Gateway for SAP S/4HANA Configuration Guide 6-3© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 32: Teamcenter Product Cost Management Gateway for SAP S/4HANA ... · The Teamcenter Product Cost Management Gateway for SAP S/4HANA (TCPCM4S) software solution is an integration software

to the synced runs it is possible to trigger the script out of the TCPCM4S administration user interfacemanually at any time.

The script itself has flags that can be set to determine the scope of the masterdata sync. For example ifyou only want to sync costcenters and workcenters during a specific run, you should only set the flagsfor those object types to true, while the flags for the other object types remain on false.

In case there is the need to select the objects to be synced by a customer specific logic, or if there is acustomer specific rule that can reduce the amount of data that needs to be synced the masterdata synctemplate can be modified accordingly.

Teamcenter Product Cost Management Gateway for SAP S/4HANAMasterdata Synchronisation Mapping File

When the mapping logic for the calculation structure import gets triggered, there is only one function inthe template of the import mapping for each specific object type to be synced that will be called by thecore: Map<SyncObject>MasterData. The term <SyncObject> needs to be replaced with the syncobject type.

namespace eval ::TCPCM4S::PCM::<Sync Job Object Type>::CUSTOM {

proc Map<SyncObject>MasterData {} { …

6. Masterdata Synchronisation

6-4 Teamcenter Product Cost Management Gateway for SAP S/4HANA Configuration Guide© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 33: Teamcenter Product Cost Management Gateway for SAP S/4HANA ... · The Teamcenter Product Cost Management Gateway for SAP S/4HANA (TCPCM4S) software solution is an integration software

return $Status (OK|ERROR and Input Dictionary) }

}

The following list maps the possible sync object types to namespaces and the corresponding keywords:

• Object type: Material Master

• Keyword: MaterialMaster

• Namespace for custom mapping: ::TCPCM4S::PCM::MM_IMPORT::CUSTOM

• Name of the mapping functions called by the core: MapMaterialMasterHeaderData,MapMaterialMasterRevisionData, MapMaterialMasterDetailData

Caution:

The material import is an exeption and has three funtions that get called in the order describedabove (all other imports only have one). But the concept is for all functions that get called bythe core for all object types the same. They all return a status and an input dictionary. Thereason for the exception for the material import is the Teamcenter Product Cost Managementdatamodel. For more information please refer to the official Teamcenter Product CostManagement documentation.

• Object type: Plant

• Keyword: Plant

• Namespace for custom mapping: ::TCPCM4S::PCM::PLANT_IMPORT::CUSTOM

• Name of the mapping function called by the core: MapPlantMasterData

• Object type: Workcenter

• Keyword: Workcenter

• Namespace for custom mapping: ::TCPCM4S::PCM::WORKCENTER_IMPORT::CUSTOM

• Name of the mapping function called by the core: MapWorkcenterMasterData

• Object type: Costcenter

• Keyword: Costcenter

• Namespace for custom mapping: ::TCPCM4S::PCM::COSTCENTER_IMPORT::CUSTOM

Teamcenter Product Cost Management Gateway for SAP S/4HANA Masterdata Synchronisation Mapping File

Teamcenter Product Cost Management Gateway for SAP S/4HANA Configuration Guide 6-5© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 34: Teamcenter Product Cost Management Gateway for SAP S/4HANA ... · The Teamcenter Product Cost Management Gateway for SAP S/4HANA (TCPCM4S) software solution is an integration software

• Name of the mapping function called by the core: MapCostcenterMasterData

• Object type: Activity Types

• Keyword: ActivityTypes

• Namespace for custom mapping: ::TCPCM4S::PCM::ACTIVITY_TYPES_IMPORT::CUSTOM

• Name of the mapping function called by the core: MapActivityTypesMasterData

• Object type: Activity Rates

• Keyword: ActivityRates

• Namespace for custom mapping: ::TCPCM4S::PCM::ACTIVITY_RATES_IMPORT::CUSTOM

• Name of the mapping function called by the core: MapActivityRatesMasterData

Mapping templates for the specific sync object types can be found under <T4x_GS_ROOT>\var\mmap\.

Structure of the Input Dictionary for the MasterdataSynchronization Usecase

The XML payload of the webservice response that contains the calculation structure is based on thestructure of the TCL dictionary that is returned as second parameter by the functionMap<SyncObject>MasterData (for futher reference about the function call of the masterdata syncmapping please refer to the chapter Teamcenter Product Cost Management Gateway for SAP S/4HANA Masterdata Synchronisation Mapping File). The following picture illustrates how thedictionary needs to be structured, so that TCPCM4S is able to create the response payload:

6. Masterdata Synchronisation

6-6 Teamcenter Product Cost Management Gateway for SAP S/4HANA Configuration Guide© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 35: Teamcenter Product Cost Management Gateway for SAP S/4HANA ... · The Teamcenter Product Cost Management Gateway for SAP S/4HANA (TCPCM4S) software solution is an integration software

The payload attributes need to match the attributes in the Teamcenter Product Cost Managementimport configuration. Structure pays respect to the fact that Teamcenter Product Cost Managementcould potentially handle multiple data tables for the same object type in one request. For the mostimplemention it should be enough to work with only one table index (Table Index = 1).

Structure of the Input Dictionary for the Masterdata Synchronization Usecase

Teamcenter Product Cost Management Gateway for SAP S/4HANA Configuration Guide 6-7© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 36: Teamcenter Product Cost Management Gateway for SAP S/4HANA ... · The Teamcenter Product Cost Management Gateway for SAP S/4HANA (TCPCM4S) software solution is an integration software

6. Masterdata Synchronisation

6-8 Teamcenter Product Cost Management Gateway for SAP S/4HANA Configuration Guide© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 37: Teamcenter Product Cost Management Gateway for SAP S/4HANA ... · The Teamcenter Product Cost Management Gateway for SAP S/4HANA (TCPCM4S) software solution is an integration software

A. Glossary

G

GUIDGlobally Unique Identifier

S

SAPSAP S/4HANA® / SAP Business Suite®

T

TCPCMTeamcenter Product Cost Management

TCPCM4STeamcenter Product Cost Management Gateway for SAP S/4HANA

Teamcenter Product Cost Management Gateway for SAP S/4HANA Configuration Guide A-1© 2018 Siemens Product Lifecycle Management Software, Inc.

Page 38: Teamcenter Product Cost Management Gateway for SAP S/4HANA ... · The Teamcenter Product Cost Management Gateway for SAP S/4HANA (TCPCM4S) software solution is an integration software
Page 39: Teamcenter Product Cost Management Gateway for SAP S/4HANA ... · The Teamcenter Product Cost Management Gateway for SAP S/4HANA (TCPCM4S) software solution is an integration software
Page 40: Teamcenter Product Cost Management Gateway for SAP S/4HANA ... · The Teamcenter Product Cost Management Gateway for SAP S/4HANA (TCPCM4S) 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.