comos 4 - siemens · of these various technologies, comos uses bapi (business application...

70
SAP interface _____________________________________ _________________________________________________________________________ ___________________ ___________________ ___________________ _____________________________________ COMOS Platform SAP interface Operating Manual 04/2012 A5E03864945-01 Trademarks 1 Introduction 2 Technical prerequisites 3 Basic concepts of the COMOS SAP Interface 4 General settings 5 XML scheme for the data exchange 6 SAP Maintenance module 7 SAP Material management module 8 SAP Documents module 9 Export or import via XML connectors 10 Importing the device catalog 11

Upload: nguyentruc

Post on 27-May-2018

224 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

� �SAP interface

___________________

___________________

___________________

___________________

___________________

___________________

___________________

___________________

___________________

___________________

___________________

COMOS

Platform SAP interface

Operating Manual

04/2012 A5E03864945-01

Trademarks 1

Introduction 2

Technical prerequisites 3

Basic concepts of the COMOS SAP Interface

4

General settings 5

XML scheme for the data exchange

6

SAP Maintenance module 7

SAP Material management module

8

SAP Documents module 9

Export or import via XML connectors

10

Importing the device catalog 11

Page 2: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

Legal information

Legal information Warning notice system

This manual contains notices you have to observe in order to ensure your personal safety, as well as to prevent damage to property. The notices referring to your personal safety are highlighted in the manual by a safety alert symbol, notices referring only to property damage have no safety alert symbol. These notices shown below are graded according to the degree of danger.

DANGER indicates that death or severe personal injury will result if proper precautions are not taken.

WARNING indicates that death or severe personal injury may result if proper precautions are not taken.

CAUTION with a safety alert symbol, indicates that minor personal injury can result if proper precautions are not taken.

CAUTION without a safety alert symbol, indicates that property damage can result if proper precautions are not taken.

NOTICE indicates that an unintended result or situation can occur if the relevant information is not taken into account.

If more than one degree of danger is present, the warning notice representing the highest degree of danger will be used. A notice warning of injury to persons with a safety alert symbol may also include a warning relating to property damage.

Qualified Personnel The product/system described in this documentation may be operated only by personnel qualified for the specific task in accordance with the relevant documentation, in particular its warning notices and safety instructions. Qualified personnel are those who, based on their training and experience, are capable of identifying risks and avoiding potential hazards when working with these products/systems.

Proper use of Siemens products Note the following:

WARNING Siemens products may only be used for the applications described in the catalog and in the relevant technical documentation. If products and components from other manufacturers are used, these must be recommended or approved by Siemens. Proper transport, storage, installation, assembly, commissioning, operation and maintenance are required to ensure that the products operate safely and without any problems. The permissible ambient conditions must be complied with. The information in the relevant documentation must be observed.

Trademarks All names identified by ® are registered trademarks of Siemens AG. The remaining trademarks in this publication may be trademarks whose use by third parties for their own purposes could violate the rights of the owner.

Disclaimer of Liability We have reviewed the contents of this publication to ensure consistency with the hardware and software described. Since variance cannot be precluded entirely, we cannot guarantee full consistency. However, the information in this publication is reviewed regularly and any necessary corrections are included in subsequent editions.

Siemens AG Industry Sector Postfach 48 48 90026 NÜRNBERG GERMANY

A5E03864945-01 Ⓟ 05/2012 Technical data subject to change

Copyright © Siemens AG 2012. All rights reserved

Page 3: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

SAP interface Operating Manual, 04/2012, A5E03864945-01 3

Table of contents

1 Trademarks ............................................................................................................................................... 7

2 Introduction................................................................................................................................................ 9

3 Technical prerequisites............................................................................................................................ 11

3.1 Installing the SAP-GUI .................................................................................................................11

4 Basic concepts of the COMOS SAP Interface ......................................................................................... 13

4.1 Architecture ..................................................................................................................................13

4.2 User and password management................................................................................................13 4.2.1 SAP target systems .....................................................................................................................14 4.2.2 Creating an SAP target system....................................................................................................14 4.2.3 "SAP login" tab.............................................................................................................................15 4.2.4 "Properties" window for the SAP target system...........................................................................15 4.2.5 Logging in to the SAP target system ...........................................................................................17

4.3 Management of XML files ............................................................................................................18 4.3.1 Deleting XML files automatically ..................................................................................................18

5 General settings ...................................................................................................................................... 19

5.1 Checking the SAP interface configuration using the configuration assistant ..............................19 5.1.1 User interface of the configuration assistant................................................................................20 5.1.2 Opening the configuration assistant ............................................................................................21 5.1.3 Testing the SAP connection.........................................................................................................21 5.1.4 Checking the XML connector configuration .................................................................................22 5.1.4.1 Specifying the business object types...........................................................................................22 5.1.4.2 Checking an XML connector........................................................................................................22 5.1.4.3 Checking the query configuration ................................................................................................23 5.1.4.4 RFC object configuration .............................................................................................................23 5.1.4.5 Checking the configuration of the SAP interface objects.............................................................24

5.2 Create RFC objects .....................................................................................................................25

5.3 "RFCs" tab of the RFC object ......................................................................................................25 5.3.1 Using catalog attributes as a template.........................................................................................25 5.3.2 Type mapping of the RFC object .................................................................................................25 5.3.3 Attributes of the RFC object.........................................................................................................26

5.4 Preparing SAP interface objects ..................................................................................................28 5.4.1 Parameter types...........................................................................................................................28

5.5 Linking SAP interface objects to COMOS objects .......................................................................29 5.5.1 Creating a SAP interface object as an element ...........................................................................29 5.5.2 Linkage.........................................................................................................................................30

5.6 Preparing XML connectors ..........................................................................................................31 5.6.1 Preparing an object query............................................................................................................31 5.6.2 Queries of the same business object type underneath an SAP adapter .....................................33 5.6.3 Collecting SAP interface objects in a query.................................................................................34

Page 4: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

Table of contents

SAP interface 4 Operating Manual, 04/2012, A5E03864945-01

5.6.4 Adding the object query to the XML connector ........................................................................... 34 5.6.5 Creating an XML connector ........................................................................................................ 35 5.6.6 "SAP" tab..................................................................................................................................... 36 5.6.7 "XML" tab .................................................................................................................................... 37 5.6.8 SAP connection using the saplogon.ini file ................................................................................. 37 5.6.9 Configuring an XML connector ................................................................................................... 38

5.7 Classification ............................................................................................................................... 40 5.7.1 Displaying class characteristics from SAP in COMOS ............................................................... 40 5.7.2 SAP characteristics with multiple evaluation............................................................................... 40 5.7.3 Multiple selection of class types.................................................................................................. 41 5.7.4 Object-query-specific attributes for the classification.................................................................. 42

5.8 Import and export settings for the COMOS attributes................................................................. 43

6 XML scheme for the data exchange ........................................................................................................ 45

6.1 Description of the XML scheme .................................................................................................. 45

7 SAP Maintenance module ....................................................................................................................... 49

7.1 Technical areas........................................................................................................................... 49 7.1.1 Export and Import workflow for technical areas.......................................................................... 49 7.1.2 Preparing an RFC object............................................................................................................. 50 7.1.2.1 Special settings on the "RFCs" tab of the RFC object ................................................................ 50 7.1.3 SAP interface objects.................................................................................................................. 51 7.1.4 XML connectors .......................................................................................................................... 51

7.2 Equipment ................................................................................................................................... 53 7.2.1 Export and import workflow for equipments................................................................................ 53 7.2.2 Preparing an RFC object............................................................................................................. 53 7.2.3 SAP interface objects.................................................................................................................. 54 7.2.4 XML connectors .......................................................................................................................... 54

8 SAP Material management module ......................................................................................................... 55

8.1 Materials...................................................................................................................................... 55 8.1.1 Export and import workflow for materials.................................................................................... 55 8.1.2 Preparing RFC objects................................................................................................................ 56 8.1.2.1 Attributes for the import............................................................................................................... 56 8.1.3 SAP interface objects.................................................................................................................. 57 8.1.4 XML connectors .......................................................................................................................... 57

8.2 Bill of Materials............................................................................................................................ 58 8.2.1 Export workflow for Bill of Materials ............................................................................................ 58 8.2.2 Preparing an RFC object............................................................................................................. 59 8.2.2.1 Special settings on the "RFCs" tab of the RFC object ................................................................ 59 8.2.3 SAP interface objects.................................................................................................................. 59 8.2.4 XML connectors .......................................................................................................................... 59

9 SAP Documents module.......................................................................................................................... 61

9.1 Export workflow for documents................................................................................................... 61

9.2 Preparing an RFC object............................................................................................................. 61 9.2.1 XML connectors .......................................................................................................................... 61 9.2.2 Special settings on the "RFCs" tab of the RFC object ................................................................ 62

9.3 SAP interface objects.................................................................................................................. 63

Page 5: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

Table of contents

SAP interface Operating Manual, 04/2012, A5E03864945-01 5

10 Export or import via XML connectors ....................................................................................................... 65

11 Importing the device catalog .................................................................................................................... 67

11.1 Defining an SAP catalog object ...................................................................................................67

11.2 Defining a query...........................................................................................................................68

11.3 Commands in the context menu of the column headers .............................................................69

11.4 Importing devices.........................................................................................................................69

11.5 Assignment of XML data..............................................................................................................70

Page 6: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

Table of contents

SAP interface 6 Operating Manual, 04/2012, A5E03864945-01

Page 7: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

SAP interface Operating Manual, 04/2012, A5E03864945-01 7

Trademarks 1Trademarks

Registered trademark: COMOS®

Page 8: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

Trademarks

SAP interface 8 Operating Manual, 04/2012, A5E03864945-01

Page 9: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

SAP interface Operating Manual, 04/2012, A5E03864945-01 9

Introduction 2Usage

The COMOS SAP Interface enables communication between COMOS objects and the SAP Maintenance, Materials Management and Document Management modules. This means that you can export business objects from COMOS to SAP or import from SAP to COMOS via the COMOS SAP Interface.

SAP has a number of interface technologies which allows data to be exchanged with other systems. Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized programming interface that allows you to access SAP business objects.

The following modules and business objects are supported by the COMOS SAP Interface:

● Maintenance

– Technical areas

– Equipment

● Material Management

– Materials

– Bill of Materials

● Document Management

– Documents

● Classification

– Classes

– Mapping of objects

● Additional modules

– User-defined data exchange

The SAP interface of COMOS is not statically based on specific BAPIs and RFCs, meaning that you can specify for yourself in COMOS which RFCs you wish to use.

About this documentation This documentation presupposes that the reader has a basic knowledge of the following:

● COMOS customizing

● Visual Basic Script

● XML connectors

The reader must also be familiar with the operation of SAP. For that reason SAP tools and forms of working that are typical for SAP are only explained superficially.

The document has the following structure:

Page 10: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

Introduction

SAP interface 10 Operating Manual, 04/2012, A5E03864945-01

● Sections 2 to 8 These sections are aimed at administrators.

● Section 9 This section is aimed at users.

Page 11: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

SAP interface Operating Manual, 04/2012, A5E03864945-01 11

Technical prerequisites 3

In order to be able to use the COMOS SAP Interface, you must have installed a SAP GUI on your workstation and you need access to the SAP Server.

3.1 Installing the SAP-GUI Install the SAP GUI for Windows Version 6.4 and later with RFC libraries featuring Unicode capability.

Page 12: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

Technical prerequisites 3.1 Installing the SAP-GUI

SAP interface 12 Operating Manual, 04/2012, A5E03864945-01

Page 13: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

SAP interface Operating Manual, 04/2012, A5E03864945-01 13

Basic concepts of the COMOS SAP Interface 44.1 Architecture

As already stated, the COMOS SAP Interface enables the export and import of SAP business objects. On the COMOS side, an XML connector searches for a set of COMOS objects and then generates an XML file from the objects found. This XML file is passed to a DLL, the so-called SAP Broker. The SAP Broker communicates with the SAP default interface and converts the XML file into concrete function calls. The results of the function calls are written to the XML file and transported to COMOS by means of the XML connector.

4.2 User and password management In COMOS, a connection with SAP can be established by means of login objects. See also chapter Checking the SAP interface configuration using the configuration assistant (Page 19).

COMOS does not allow multiple users to use the same user and password data for a login object when establishing a connection with SAP.

Each user only sees the data that corresponds to the current COMOS user and can only change this data. Similarly, only the user and password data of the current COMOS user is used if the SAP system login takes place in the background.

Copying/inheriting login objects If you have saved user and password data for a login object, this data is only valid for this object or copies of it, not for login objects which are inherited.

Page 14: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

Basic concepts of the COMOS SAP Interface 4.2 User and password management

SAP interface 14 Operating Manual, 04/2012, A5E03864945-01

Downward compatibility Login objects at which user and password data was stored using earlier COMOS versions continues to be supported as usual and is used to establish connections. If you want to save your user and password data for this object and data which was saved with an earlier version is still present, a hint appears informing you that the system will use the new method to save the data.

You are asked if you want to perform this step. If you confirm this, the old data is deleted and the new data is saved with the current method. From then on, user and password data for this object will be stored separately for every user.

4.2.1 SAP target systems

Overview For login purposes, you manage a personal list of SAP target systems. In addition to storing the actual connection data, you also have the option of storing a user name and password for logging in to each specific target system. See also chapter Logging in to the SAP target system (Page 17).

As soon as you log in to the SAP system, the COMOS standard SAP interface starts exchanging data via this connection.

4.2.2 Creating an SAP target system

Procedure 1. In the menu bar, select the "Plugins > SAP > SAP login" command.

The "SAP login" tab opens. See also chapter "SAP login" tab (Page 15).

2. Click "New" on the "SAP login" tab.

The "Properties" window opens.

3. Enter the properties of the SAP target system.

The "Client", "Application server", and "System number" fields are mandatory.

4. Save your entries.

Page 15: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

Basic concepts of the COMOS SAP Interface 4.2 User and password management

SAP interface Operating Manual, 04/2012, A5E03864945-01 15

4.2.3 "SAP login" tab Button Description "Log in to selected SAP system" Use this button to log in to the selected SAP

target system. "Log off from current SAP system" Use this button to log off from the selected SAP

target system. "New" Use this button to open the "Properties" window

and have the option of creating a new SAP target system. The new SAP target system is then listed in the table.

"Properties" Use this button to open the "Properties" window for the selected SAP target system.

"Current user" Use this button to show and hide the SAP target systems that have been created for the current user only.

"All users" Use this button to show and hide the SAP target systems that have been created for all users.

4.2.4 "Properties" window for the SAP target system

"General" control group Control element Description "saplogon.ini file" option When this option is activated, the connection to

SAP is established via the "saplogon.ini" file. Depending on which option is selected, properties are either activated or deactivated in the "General" control group accordingly. You will be alerted to any missing entries.

"Server" option When this option is activated, the connection to SAP is established via an application server. Depending on which option is selected, properties are either activated or deactivated in the "General" control group accordingly. You will be alerted to any missing entries.

"Group" option When this option is activated, the connection to SAP is established via load balancing. Depending on which option is selected, properties are either activated or deactivated in the "General" control group accordingly. You will be alerted to any missing entries.

"Client" field Mandatory field. The description of the SAP client.

Page 16: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

Basic concepts of the COMOS SAP Interface 4.2 User and password management

SAP interface 16 Operating Manual, 04/2012, A5E03864945-01

Control element Description "System description" list The description of the SAP target system must be

entered here exactly as it appears in the "saplogon.ini" file.

"Application server" field The description or IP of the application server. "System number" field The number of the SAP target system. "Messager server" field The description or IP of the messager server. "Group" field Shows the group. "System ID" field Shows the ID of the SAP target system. "Router" field Optional SAP router string.

"Options" control group Control element Description "Language" field Specifies the language for establishing the

connection to SAP. "SAP GUI" list Specifies whether or not the SAP GUI should

generally be displayed and whether it should be hidden between individual RFC calls.

"Enable RFC trace" option When this option is activated, the RFC trace is enabled for this connection.

"Administrator" control group To edit this control group, you need administrator rights.

The user category specifies whether the entry in the connection list is valid for just the current user or for all users. Entries that are valid for the current user can only be viewed and edited by the specific user concerned. Entries that are valid for all users can be viewed and used to establish a connection by all users. However, they can only be edited by COMOS administrators. It is not possible for standard users to create entries that are valid for all users.

See also "SAP" tab (Page 36)

Page 17: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

Basic concepts of the COMOS SAP Interface 4.2 User and password management

SAP interface Operating Manual, 04/2012, A5E03864945-01 17

4.2.5 Logging in to the SAP target system

Requirement An SAP target system has been created.

Procedure 1. In the menu bar, select the "Plugins > SAP > SAP login" command.

The "SAP login" tab opens.

2. Select an SAP target system from the list.

3. Click the "Log in to selected SAP system" button.

The "SAP login data" window opens.

4. Enter your user name and password.

5. To save your data so that it is there for you the next time you want to log in to COMOS, activate the "Remember login data for next COMOS session" option.

6. Click the "OK" button.

Result The connection remains active until you log off again or close COMOS. The current connection status is displayed in the COMOS status line.

The COMOS standard SAP interface uses this connection to exchange data for as long as the connection remains active. This means that the connection takes priority over any locally defined connections, e.g. an SAP adapter. In particular, the following areas are affected:

● SAP adapter (SAP XML connectors)

● SAP manufacturer device catalogs and the associated query extender class required to create these catalogs (Comos.Sap.Xml.SapCatalogQueryExtender class)

● Script-based interface calls that involve the Comos.Sap.Xml.ComosSapExchanger class

Page 18: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

Basic concepts of the COMOS SAP Interface 4.3 Management of XML files

SAP interface 18 Operating Manual, 04/2012, A5E03864945-01

4.3 Management of XML files The SAP adapter generates the following XML files for the purpose of exchanging data between COMOS and SAP:

● An XML file for sending data from COMOS to SAP

● An XML file for the data returned by SAP

The way in which these files are managed means that multiple users cannot use the same SAP adapter to access the same file simultaneously.

Multi-user management To prevent multiple users from simultaneously accessing the same XML file for data exchange with SAP, the user name is appended to the file name, which is generated automatically. In this way, a separate file is created for each user.

4.3.1 Deleting XML files automatically

Requirement The "Show file" option is deactivated during data exchange. If this option is activated, the XML file with the data returned by SAP is not deleted, as it is needed for display purposes.

Procedure To have the XML files deleted automatically, proceed as follows:

1. Open the "Documents" tab in the Navigator.

2. Navigate to object "SO1 > @MXC > SAP" and select an SAP adapter.

3. Open the context menu of the adapter in the Navigator and select the "Properties" item from the list.

4. Open the "SAP" tab.

5. Activate the "Delete XML file after exchange" option.

Result The XML file generated is deleted after every instance of data exchange.

Page 19: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

SAP interface Operating Manual, 04/2012, A5E03864945-01 19

General settings 5

In order to prepare the import or export, you must make a series of modifications in the COMOSDB.

The following remarks are oriented towards the "Functional locations" area in the SAP Maintenance module but can be transferred in an analogous fashion to the other areas.

The following gives you an overview concerning the adjustments you have to conduct.

● Create RFC objects

● Preparing SAP interface objects

● Linking SAP interface objects to COMOS objects

● Preparing XML connectors

● Classification (preparation is optional)

● Import and export settings for the COMOS attributes (preparation is optional)

5.1 Checking the SAP interface configuration using the configuration assistant

You can check the SAP interface configuration with the help of a configuration assistant. In so doing, you can check the COMOS objects involved in exchanging data with SAP:

● Login objects

See also chapter User and password management (Page 13).

● XML connectors

● Queries

● SAP interface objects

These objects contain all the data to be exchanged with SAP.

● RFC objects

SAP function components involved in exchanging data are saved at these objects.

Definition: Login object In COMOS, you can use login objects to establish a connection with SAP. You store the data required to log in to an SAP system at the login objects, so you do not need to enter it anew each time a connection is established. If SAP XML connectors are used, the connector itself acts as a login object, as the login data is stored at the connector directly.

Page 20: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

General settings 5.1 Checking the SAP interface configuration using the configuration assistant

SAP interface 20 Operating Manual, 04/2012, A5E03864945-01

Definition: SAP interface object The SAP interface objects are used for data exchange between COMOS and SAP. The data of a COMOS object, such as an engineering object or a document, is not exchanged with SAP directly; rather, it is exchanged indirectly via an associated SAP interface object. This SAP interface sends and receives the values assigned to the parameters of the RFCs (Remote Function Calls) during data exchange with SAP. To facilitate this, the SAP interface object is located directly underneath the associated COMOS object in the form of an element. Values are transferred from the COMOS object to the SAP interface object by means of COMOS attributes at the SAP interface object, which have the link type "By owner". Unlike an RFC object, which only specifies the names of the RFC parameters used, an SAP interface object contains the actual values for these parameters.

Definition: RFC object You can use RFC objects to define which RFCs (Remote Function Calls) are called during data exchange with SAP and which RFC parameters are used in this process. An individual workflow is followed, according to the type of SAP business objects being exchanged and the type of the exchange process itself (import or export). The different workflows are defined in the descriptions of the relevant SAP modules. Only the names of the RFC parameters are stored at the RFC objects. When data is exchanged, the actual values of the parameters are read from the corresponding SAP interface objects.

5.1.1 User interface of the configuration assistant The user interface of the configuration assistant is divided into two areas for most steps. In the upper area, you select one or more objects which are to be checked, while the lower area displays configuration messages. These messages provide information about the configuration and are divided into three categories:

Configuration messages

Description

Errors Messages in this category indicate incorrect configuration settings, which you need to correct.

Warnings Messages in this category relate to problematic configuration settings. A warning indicates that the corresponding configuration setting could cause the SAP interface to behave in an unwanted manner.

Information Messages in this category are for information purposes only. They usually point out the purpose of an attribute or alternative configurations.

To show and hide configuration messages, click the "Errors", "Warnings" or "Information" button.

Page 21: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

General settings 5.1 Checking the SAP interface configuration using the configuration assistant

SAP interface Operating Manual, 04/2012, A5E03864945-01 21

5.1.2 Opening the configuration assistant

Procedure To open the configuration assistant, proceed as follows:

1. In the "Plugins > Basic" menu, click the "SAP interface configuration" entry.

2. Select the action you want to carry out. You can choose from the following options:

– "Test SAP connection"

– "Check XML connector configuration"

5.1.3 Testing the SAP connection The configuration assistant provides an option to test a connection to an SAP system defined in COMOS.

Requirement A login object containing the SAP login data exists.

Performing a connection test To perform a connection test, proceed as follows:

1. Drag&drop a COMOS object into the "Login object" field. This object must contain the login data for the SAP system.

Configuration messages for the object in question are displayed in the message window.

If you have selected an object with login data, the "Test SAP connection" button will be active.

2. Click the "Test SAP connection" button.

The "SAP login data" window opens.

3. Enter the user name and password for the SAP connection.

4. Click the "OK" button.

COMOS attempts to establish a test connection with the SAP system. A window opens and indicates whether or not it was possible to establish the connection.

5. If the connection was established successfully, click the "Continue" button.

6. Click the "End" button to save your changes and close the configuration assistant.

Page 22: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

General settings 5.1 Checking the SAP interface configuration using the configuration assistant

SAP interface 22 Operating Manual, 04/2012, A5E03864945-01

5.1.4 Checking the XML connector configuration The configuration assistant provides an option to check the configuration of an XML connector for the SAP interface, including queries, RFC objects, and SAP interface objects.

Specifying the direction of data exchange Once you have selected the "Check XML connector configuration" action, you can choose from three options:

● "Export and import"

● "Export to SAP"

● "Import to Comos"

These options specify which data exchange directions are supported by the XML connector.

Click the "Continue" button.

5.1.4.1 Specifying the business object types

Procedure To specify the business object types, proceed as follows:

1. Select which business object types you would like to exchange.

Select at least one option.

2. Click the "Continue" button.

5.1.4.2 Checking an XML connector

Procedure To check the XML connector, proceed as follows:

1. Drag&drop an XML connector for further checking to the "XML connector" field.

You can omit this step by clicking the "Skip" button and continue from the "Checking the query configuration" step. See also chapter Checking the query configuration (Page 23).

If you have not yet selected a query, an RFC object, or an SAP interface object by performing subsequent configuration steps and then navigating back to this point, when the XML connector is set an attempt is made to set these objects automatically too.

Configuration messages for the object in question are displayed in the message window.

2. Click the "Test SAP connection" button.

The "SAP login data" window opens.

3. Enter the user name and password for the SAP connection.

Page 23: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

General settings 5.1 Checking the SAP interface configuration using the configuration assistant

SAP interface Operating Manual, 04/2012, A5E03864945-01 23

4. Click the "OK" button.

COMOS attempts to establish a test connection with the SAP system. A window opens and indicates whether or not it was possible to establish the connection.

5. If the connection was established successfully, click the "Continue" button.

5.1.4.3 Checking the query configuration When an XML connector runs, it uses the queries which have been defined for its XML connector template. In this step, you check the configuration of the query for the XML connector.

If you have already selected an XML connector which contains a query, the "Query" field is pre-assigned.

You can omit this step by clicking the "Skip" button and continue from the "RFC object configuration" step. See also chapter RFC object configuration (Page 23).

Procedure To check a query, proceed as follows:

1. If the "Query" field is not pre-assigned, drag&drop a query for exchanging business objects of the type which you selected previously.

If you set the query manually and have not previously selected an associated RFC object by performing subsequent configuration steps and then navigating back to this point, COMOS attempts to set an associated RFC object for the next configuration step automatically too when setting the query.

Configuration messages for the query in question are displayed in the message window.

2. Click the "Continue" button.

5.1.4.4 RFC object configuration

Procedure To perform the RFC object configuration, proceed as follows:

You can omit this step by clicking the "Skip" button and continue from the "Checking the configuration of the SAP interface objects" step.

Every query of an XML connector has an RFC object, which defines which RFCs are to be called by the SAP interface for the purpose of exchanging data between COMOS and SAP. The "RFC object configuration" is used to check this type of RFC object.

If an XML connector or a query which has an RFC object assigned to it has already been selected, the "RFC object" field is pre-assigned.

Page 24: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

General settings 5.1 Checking the SAP interface configuration using the configuration assistant

SAP interface 24 Operating Manual, 04/2012, A5E03864945-01

1. If the "RFC object" field is not pre-assigned, drag&drop an RFC object of the type which you selected previously to the "RFC object" field.

Configuration messages for the RFC object in question are displayed in the message window.

If an XML connector has previously been set with login data for an SAP system, the "Match RFC data with SAP" button will be active.

2. Click the "Match RFC data with SAP" button, if it is active.

COMOS attempts to establish a connection with SAP. If the connection can be established, COMOS checks whether the RFCs defined at the RFC object and their parameters actually exist in the SAP system. It also checks whether the specified parameter types (import, export, or table parameters) are correct.

A window indicates whether or not it was possible to establish the connection and whether or not the necessary checks have been performed. If incorrect values were detected during these checks, corresponding messages are displayed in the message window.

3. Click the "Continue" button.

5.1.4.5 Checking the configuration of the SAP interface objects The SAP interface uses SAP interface objects to exchange data between COMOS and SAP.

In this step, you can check the configuration of the SAP interface objects and configure the exchange properties of the attributes.

You can omit this step by clicking the "Skip" button and complete the configuration of the XML connector.

Procedure To check the configuration of the SAP interface objects, proceed as follows:

1. If the "SAP interface objects" field is not pre-assigned, drag&drop an SAP interface object of the type which you selected previously to the "RFC object" field.

Configuration messages for the selected SAP interface object are displayed in the message window.

2. Click the "SAP exchange properties" button.

A window opens, where you can edit the data exchange properties of the SAP interface object you have just selected. These properties include the flow direction, the exchange type, and the physical unit of specific attributes or entire tabs.

3. Click the "Continue" button.

Once the configuration of all queries, including the associated RFC objects and SAP interface objects, is complete for a business object type, you will be asked whether you want to configure another query for this business object type.

4. Click the "Continue" button.

If you selected the option "Yes, configure another query for this business object type", you can configure another query. Otherwise, click the "End" button.

Page 25: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

General settings 5.2 Create RFC objects

SAP interface Operating Manual, 04/2012, A5E03864945-01 25

5.2 Create RFC objects First you have to decide which RFCs you require for the data transfer. This step is usually carried out by an SAP administrator, e.g. by means of the BAPI Explorer from SAP.

Once the SAP administrator has found the required function blocks, it is necessary to check which parameters of the function blocks are to be exchanged between COMOS and SAP. This information serves to prepare RFC objects.

Procedure Proceed as follows to prepare the RFC objects:

1. Open the base objects of the base project.

2. In the Navigator, open the "@SAP SAP Interface > RFC RFC Config" node.

3. Create a new object underneath the "RFC RFC Config" node.

4. In the newly created object, you create a tab called "RFCs", and there you create the required attributes. See section "RFCs" tab of the RFC object (Page 25).

The tab must have the name "RFCs".

5.3 "RFCs" tab of the RFC object You deposit the selected RFCs as well as the associated parameters on the "RFCs" tab.

5.3.1 Using catalog attributes as a template You can also create the "RFCs" tab with the help of catalog attributes. Catalog attributes are templates that speed up the creation of attributes and tabs.

You find the catalog attributes for the COMOS SAP Interface in the base objects underneath the "@SAP > Y > D Selection Catalog" node.

The catalog attribute that is used in this example is:

"02 > RFC01 > RFC01 technical area"

5.3.2 Type mapping of the RFC object Define a type for the entire "RFCs" tab which also fits the corresponding SAP business object:

The following gives you an overview of the various types:

Type Assignment FunctionalLocation Technical area Equipment Equipment

Page 26: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

General settings 5.3 "RFCs" tab of the RFC object

SAP interface 26 Operating Manual, 04/2012, A5E03864945-01

Type Assignment BOM Bill of materials Material Material Documents Document Custom User-defined

5.3.3 Attributes of the RFC object The value of the attributes consists of a prefix (e.g. CREATE) and a suffix, whereby the prefix depends on the type of the RFC.

Overview The following gives you an overview of settings that are made across modules and which you must make on the "RFCs" tab for the attributes:

Description Name of the attribute Attribute

type Function

RFC <PRÄFIX> Edit field Here you input the name of the RFCs that you selected. Has Commit <PRÄFIX>_HASCOMMIT Checkbox If this option is activated, a Commit is called at the SAP

database after calling the RFC. Check Result Message

<PRÄFIX>_CHECKRESULT_MSG

Edit field If needed, you can here state a RFC parameter which is written as a message to the SAP interface object. This value is solely used for information purposes and has no effect on the procedure of the import or export operation.

Check Result Parameter

<PRÄFIX> _CHECKRESULT_PAR

Edit field If required, here you can input an RFC parameter that shows whether the call of the function component was successful.

Check Result Values

<PRÄFIX> _CHECK_RESULT_VALS

List If the Check Result Parameter field was filled in, you must here save the values that show the successful call of the RFCs.

Parameter <PRÄFIX>_PARAMS List Here you can input the names of those RFC parameters that are to be exchanged with the SAP interface, i.e. the mandatory parameters of the RFC at the very least. Parameter:

Here you input the name of the parameter. Import/Export:

Here you input whether the parameter is an import, export or table parameter.

Ref. Parameter:

The entries in this column are optional.

For more information, see Ref. Parameter in the section below.

Page 27: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

General settings 5.3 "RFCs" tab of the RFC object

SAP interface Operating Manual, 04/2012, A5E03864945-01 27

Ref. Parameter RFC parameters often have different names although they have the same structure. As a rule, it is superfluous to retain the attributes for such parameters on the SAP interface object doubled. Instead, you should enter a reference parameter in the column so that this can be used instead of the parameter specified in the Parameters column. Depending on whether the parameter involves a field, a structure or a table, the relevant prefix F_, S_ or T_ must be used.

● Example 1

The import parameter DATA_GENERAL of RFCs BAPI_FUNCLOC_CHANGE has the same structure as the export parameter DATA_GENERAL_EXP. In order to write the data of DATA_GENERAL_EXP to the corresponding COMOS attributes for DATA_GENERAL at the SAP interface object, enter S_DATA_GENERAL as the reference parameter.

● Example 2

The number of a technical location (field parameter FUNCTLOCATION) is used for the OBJECTKEY import parameter of the BAPI_OBJCL_CHANGE RFC. This is done by entering F_FUNCTLOCATION as the reference parameter.

● Example 3

In the case of import fields it is also possible to state the field of a structure as the reference parameter. The MATERIAL field of the HEADDATA structure is to be used for the MATERIAL import field of the BAPI_MATERIAL_GET_DETAIL RFC. This is done by stating the structure and the field names separated by a period (full stop) as follows: S_HEADDATA.MATERIAL.

In some RFCs two associated structure parameters are used that have exactly the same number of fields with the same field names. While the first structure contains the actual values for the RFC, the fields of the second structure indicate by an X whether or not the value of the first structure is actually to be used. It is not necessary to create attributes in COMOS for this second structure. You simply enter the name of the second structure in the "Ref. parameter" table column, prefixed by #X_. An X is then automatically entered in the relevant field of the second structure for each field of the first structure (assuming that there is an existing attribute for this in COMOS).

● Example

There is an analogous import structure DATA_GENERALX for import structure DATA_GENERAL of RFCs BAPI_FUNCLOC_CHANGE. In order for the X entries to be set correctly, it is sufficient to input the #X_DATA_GENERALX value in the "Ref Parameter" table column.

Depending on the type of business objects that are to be exchanged with SAP, the COMOS SAP Interface makes use (to a certain extent) of special RFC parameters that need to be explicitly specified on the "RFCs" tab. In order to enable the access to these parameters in subsequent RFCs it is necessary to input special designators in the Ref. Parameters table column. The individual designators always begin with #, but differ individually and are presented separately in the description of the individual import and export modules.

Page 28: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

General settings 5.4 Preparing SAP interface objects

SAP interface 28 Operating Manual, 04/2012, A5E03864945-01

● Example

During the import of equipment the RFC is called first, that then returns a table with the equipment. A specific column of this table contains the unique numbers of the equipment items. Subsequently, further RFCs are called for each column entry and supply the required details for the relevant equipment items. These column entries are referenced by means of the #ObjectIdColumn designator and thus can be passed onto further RFCs.

The sequence of calls of the SAP function blocks defined on the "RFCs" tab depends on the business object type which has been assigned to the tab. See also chapter Type mapping of the RFC object (Page 25).

5.4 Preparing SAP interface objects Once you have prepared the RFC objects you can start creating the SAP interface objects. The SAP interface objects are provided with attributes that correspond to the RFC parameters that are to be exchanged with SAP.

You can create the SAP interface objects in the base project underneath the "@SAP SAP Interface > SIO SAP Interface Objects" node.

Underneath the "@SAP > Y Attribute Catalog" node, you find templates for the required attributes and tabs of the SAP interface objects.

5.4.1 Parameter types

Introduction There are three different RFC parameter types in SAP:

● Fields

● Structures

● Tables

There is an equivalent in the COMOS SAP interface object for each parameter.

Fields Fields can either be import or export parameters. In COMOS, fields are represented by attributes on the "General" tab.

The attribute name of a field in COMOS is "F_<SAP parameter name>". If, for example, you want the parameter name for the SAP "FUNCTLOCATION" field to be displayed in COMOS, the relevant attribute name is: "F_FUNCTLOCATION".

Page 29: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

General settings 5.5 Linking SAP interface objects to COMOS objects

SAP interface Operating Manual, 04/2012, A5E03864945-01 29

Structures Structures can be just like import and export parameter fields. In COMOS, structures are represented by a tab of their own. The name of the tab is "S_<SAP parameter name>". If, for example, you want to display the "DATA_GENERAL" parameter from SAP in COMOS, the name of the corresponding tab is "S_DATA_GENERAL".

The fields of the structure are deposited on the tab as attributes. The names of the attributes must correspond to the field names in SAP. Please note that you do not need to create all fields, but only those that you wish to use for data exchange with SAP.

Tables Table parameters are displayed in COMOS in exactly the same way as structures with their own tab. The name of the tab is "T_<SAP parameter name>". If, for example, you wish to display the "MATERIALDESCRIPTION" table parameter from SAP in COMOS, the name of the corresponding tab is "T_MATERIALDESCRIPTION".

Once you have created the tab, you must create an attribute on the tab that bears the name of the RFC table from SAP. This attribute can either be a list attribute or a query attribute.

A maximum of 5000 entries are created per list attribute. You have the option of placing multiple list attributes on a tab, but these must have the same name. After you have assigned the name to the first list attribute, append the suffix "%COUNTER" to each following list attribute, whereby COUNTER represents a consecutive number which begins at 1. When you open the tab, COMOS loads all data of the lists. During the import, the lists are emptied in preparation and filled in sequence, beginning at the list without a suffix.

Query attributes have the advantage that they are more dynamic than list attributes. However, you only use query attributes for exporting data. Place just one query attribute per tab.

The column names of the RFC table from SAP are displayed in COMOS as column names of the list or the query.

5.5 Linking SAP interface objects to COMOS objects The SAP interface objects are used solely for data exchange with SAP. As far as the COMOS user is concerned, they are generally of no relevance to everyday work and are often not even noticeable. In any case, users will want to continue working with the normal COMOS objects. In order to enable this, the data of the SAP interface objects is linked with the data of the regular COMOS objects.

In order to conduct the linking you first have have to create the SAP interface object as an element.

5.5.1 Creating a SAP interface object as an element In the following example, the SAP interface object is created as an element of the COMOS base object

"@01 > PID > 0 > |02 > 03 > 01 Liquid pump, general".

Page 30: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

General settings 5.5 Linking SAP interface objects to COMOS objects

SAP interface 30 Operating Manual, 04/2012, A5E03864945-01

Procedure Proceed as follows to create the SAP interface object as an element:

1. Open the properties of the COMOS base object "01 P Liquid pump, general".

2. Click on the "Elements" tab.

3. From the Navigator, drag the "SAP interface object for pumps" object onto the "Elements" tab.

4. "SAP interface object for pumps" is created as an element underneath the COMOS base

object "01 P Liquid pump, general".

5. Select the entry "Off" or "1" for the element in the "Virtual" column.

5.5.2 Linkage Once you have created the SAP interface object as an element, you can link it with the COMOS object. To do so, you need to link the attributes of the SAP interface object with the corresponding attributes of the COMOS object.

The following illustrates the link based on the example of the "OBJ_WEIGHT" SAP attribute. The "OBJ_WEIGHT" SAP attribute is linked with the "PI030.PIA014 Weight" attribute of the "Pump" COMOS object.

Page 31: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

General settings 5.6 Preparing XML connectors

SAP interface Operating Manual, 04/2012, A5E03864945-01 31

Procedure Proceed as follows to create the link:

1. Navigate to object "@SAP > SIO > FTL > SAP-PUM > S_DATA_GENERAL".

2. Open the properties of the "OBJ_WEIGHT" attribute.

3. Click on the "Link" tab.

4. Select "By owner" from the "Link type" list.

5. In the "Attribute" field, enter the attribute for the COMOS object that you want to use to create the link. In this example, this is the "PI030.PIA014 Weight" attribute of the COMOS object "Pump".

6. Select one of the following options as the link value:

– "Dynamic"

– "Full dynamic"

7. Confirm your settings with a mouse click on "OK".

5.6 Preparing XML connectors The SAP interface objects are converted into XML by means of the XML connectors that you collect in an object query beforehand.

You find additional information on this topic in the "Interfaces" manual, keyword "Free import/export ("XML connectors")".

5.6.1 Preparing an object query In the base project underneath the "@SAP SAP Interface Objects > SQT SAP Query Templates > XML Connectors QueryTemplates" node, you find ready prepared queries. If you prepare a query for the XML connector, you simply copy one of these queries and edit it to suit your specific requirements.

"RFCs" tab The query that you use for assigning the SAP interface objects to the XML connectors must contain a tab called "RFCs". You can use a template to create the tab. Take great care with the spelling.

You find tab "02 > RFC02 RFC tab for queries" underneath the "@SAP > Y > D Selection Catalog" node.

Page 32: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

General settings 5.6 Preparing XML connectors

SAP interface 32 Operating Manual, 04/2012, A5E03864945-01

The following gives you an overview of the attributes that are located on the "RFCs" tab:

Description Explanation Classification Info The attributes that are located under the "Classification Info"

heading contain classification settings. See also chapter Classification (Page 40).

RFC object The attribute is a mandatory attribute and must contain a reference to the RFC object which you prepared beforehand. See also chapter Create RFC objects (Page 25).

Class Here input the name of the .NET class that is in charge for the processing of the business objects.

Assembly Here input the name of the assembly in which the .NET class is located.

.NET classes The following gives you an overview of the .NET classes that you can use and the Business Objects to which the .NET classes are assigned to:

.NET class Business-Object Comos.Sap.Xml.FunctLocation Technical area Comos.Sap.Xml.Equipment Equipment Comos.Sap.Xml.Material Material Comos.Sap.Xml.Bom Bill of materials Comos.Sap.Xml.Document Document Comos.Sap.Xml.Custom Freely selectable Business Object

Ensure that you spell the .NET classes in precisely the same way as stated in the table.

"Filter" tab Add the "Filter" tab if you want to import the query. Via the tab, you can limit the import of the business objects with the help of RFC parameters.

You can only create tables and fields as attributes on the "Standard filter" tab: The syntax of the attributes corresponds to the syntax of the attributes at the SAP interface objects. See also chapter Preparing SAP interface objects (Page 28).

If you create an object under the XML connector and this object has the same name as the query and also features the "Filter" tab, the filter settings of this object will be used rather than the filter settings of the query.

Page 33: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

General settings 5.6 Preparing XML connectors

SAP interface Operating Manual, 04/2012, A5E03864945-01 33

5.6.2 Queries of the same business object type underneath an SAP adapter SAP adapters are XML connectors which have been configured for the COMOS standard SAP interface.

SAP adapters can be used to exchange data between COMOS and SAP using an XML file. Queries are located underneath the adapter template for this purpose. One or more queries are used for every type of SAP business object (BOType) involved in the data exchange process.

To use several queries of the same BOType underneath an adapter, you need to create the "GroupID" attribute for the relevant "BOGroup" XML elements. This attribute serves to distinguish the queries from one another in XML.

The values of the "GroupID" attributes can be freely selected and only have to differ from one another within the same SAP adapter.

Requirement Several queries of the same BOType are located underneath the SAP adapter.

Procedure To transfer queries of the same BOType underneath an SAP adapter into XML, proceed as follows:

1. Click on the "XML > Configure XML connector" list item in the context menu of the SAP adapter.

2. Open the "Assignment" tab.

You will see an operation for generating part of the XML file in the "XML collection" field.

3. In the "XML collection" field, add the "GroupID" attribute to the "/BOGroup[@Type ="<BOType>"]/BO" operation.

Structure the operation as follows: "/BOGroup[@Type ="<BOType>" and @GroupID="<unique name>"]/BO".

It would make sense to use the name of the relevant query, for example, as the value of the "GroupID" attribute.

1. Select another query from the "Query" list.

2. Repeat steps 2 and 3 for this query.

3. Click the "OK" button to save your changes.

Result You can transfer several queries of the same BOType underneath an SAP adapter into an XML file.

Page 34: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

General settings 5.6 Preparing XML connectors

SAP interface 34 Operating Manual, 04/2012, A5E03864945-01

5.6.3 Collecting SAP interface objects in a query You must collect the SAP interface objects that you wish to assign to the XML connector by means of an object query.

Procedure Proceed as follows to do this:

1. Open the according object query.

2. Drag a start object into the Start object field, and an SAP interface object of the desired type into the base objects field.

3. Click the "OK" button to save the setting.

5.6.4 Adding the object query to the XML connector After having collected the SAP interface objects by means of a query, you can now prepare the XML connector. To do so you first have to create a template for the XML connector.

Creating a template for the XML connector 1. Open the "Documents" tab.

2. Right-click on the "MM SAP XML Connector Templates" folder and select the "New > XML connector template" command in the context menu.

3. Open the properties of the template.

4. From the Navigator, drag the "@O > XML > SAPXML XML document - SAP" base object into the "Base object" field.

5. Save your changes.

Page 35: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

General settings 5.6 Preparing XML connectors

SAP interface Operating Manual, 04/2012, A5E03864945-01 35

6. In the Navigator, arrange the "Base objects" and "Documents" tabs so that they are side by side.

7. Take the query that you want to assign to the XML connector and drag&drop it from the "Base objects" tab (in the Navigator) onto the template (on the "Documents" tab).

5.6.5 Creating an XML connector

Procedure 1. Open the "Documents" tab in the Navigator.

2. To create a new document group, select the "New > Enterprise Server XML connector documents" command in the context menu of the "@MXC Enterprise Server XML connectors" document group.

You can skip this step if you do not want to create a new document group underneath the "@MXC" node.

3. Select the "New > XML connector document" command in the context menu of the folder you created in step 2.

4. Open the properties of the XML connector and drag the XML connector template into the "Template" field.

Page 36: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

General settings 5.6 Preparing XML connectors

SAP interface 36 Operating Manual, 04/2012, A5E03864945-01

5. Click on the "SAP" tab and deposit the connection data for the SAP server here.

See also chapter "SAP" tab (Page 36).

6. Select the "XML" tab and deposit the data.

See also chapter "XML" tab (Page 37).

5.6.6 "SAP" tab

"SAP login" control group Control element Function "Login mode" list Select the desired login mode from this list. "Client" field This field displays the description of the SAP

client. "Language" field This field specifies the language for establishing

the connection to SAP. "SAP GUI" list Use this list to specify whether or not the SAP

GUI should generally be displayed and whether it should be hidden between individual RFC calls.

"Enable RFC trace" option When this option is activated, the RFC trace is enabled for this connection.

"Set user and password" button When you click on the "Set user and password" button, the "SAP Login Data" window opens so that you can deposit a user name and a password for the connection to the SAP Server. See also chapter "SAP login" tab (Page 15).

"System description" list The description of the SAP target system must be entered here exactly as it appears in the "saplogon.ini" file.

"Application server" field The description or IP of the application server. "Router" field Optional SAP router string. "System ID" field Shows the ID of the SAP target system. "System number" field The number of the SAP target system. "Group" field Shows the group. "Message server" field The description or IP of the messager server.

See also chapter "Properties" window for the SAP target system (Page 15).

Page 37: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

General settings 5.6 Preparing XML connectors

SAP interface Operating Manual, 04/2012, A5E03864945-01 37

"Options" control group Option Description "Write back export parameters" When this option is activated, data is written back

to COMOS after an SAP export operation. If, for example, you export documents from COMOS to SAP that do not exist yet in SAP, SAP assigns a new document number when it creates the documents. If the option is activated, the document number is written back to COMOS.

"Delete XML file after data exchange" When this option is activated, the XML file is deleted automatically once the data has been exchanged.

"Keep COMOS active during RFCs with GUI" When this option is activated, COMOS remains active throughout your SAP session.

5.6.7 "XML" tab Control element Meaning "Envelope" field When the XML connector converts the SAP interface objects into XML it

puts them in an envelope that identifies the name of the external XML element. Deposit the following input: <ComosSAPInterface> <Content/> </ComosSAPInterface>

"Adapter type" list Select the "SAP" adapter type from the list.

5.6.8 SAP connection using the saplogon.ini file One way of establishing a connection with SAP is to use the "saplogon.ini" file. This method means you no longer have to enter all the parameters for an SAP system. Instead, all the descriptions are read out from the SAP systems, saved in the "saplogon.ini" file, and made available for selection.

Procedure 1. Open the "SAP" tab in the properties of the SAP adapter.

2. Select the label of the required SAP system from the "System label" list.

3. Select the "saplogon.ini file" item from the "Login mode" list.

A connection with SAP is established via the "saplogon.ini" file.

Page 38: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

General settings 5.6 Preparing XML connectors

SAP interface 38 Operating Manual, 04/2012, A5E03864945-01

5.6.9 Configuring an XML connector

Requirement You have prepared the XML connector.

Procedure 1. Right-click on the XML connector that you have created and select the "XML > Configure

XML connector" command in the context menu.

A window opens that displays on the left the query that you added to the XML connector and on the right the associated XML structure.

2. You must configure the following three columns of the query:

– "SAPID"

– "Parameters"

– "SystemUID"

Configure "SAPID" column 1. Right-click on the "SAPID" column.

If this column does not exist, click on a different one instead.

2. Select the "Properties" command in the context menu.

If you need to create the column from scratch, select the "New > General" command.

3. Click on the "Object evaluation" tab.

4. From the "Navigation step" column, select the "SpecificationByNestedName" entry.

5. In the "Parameter" field, deposit the value "SYS.SAPID".

6. Click on the "Extra" tab.

7. Activate the "Key column" option.

8. Enter the value "@SAPID" in the "XML mapping" field.

Configuring the "Parameters" column 1. Right-click on the "Parameters" column.

If this column does not exist, click on a different one instead.

2. Select the "Properties" command in the context menu.

If you need to create the column from scratch, select the "New > General" command.

3. Click on the "Value calculation" tab.

4. If you have selected the "Script" calculation mode, the editor opens.

You find additional information on this topic in the "Queries" manual, keyword "Value calculation" tab".

Page 39: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

General settings 5.6 Preparing XML connectors

SAP interface Operating Manual, 04/2012, A5E03864945-01 39

5. Input the following script in the editor:

Function ColumnValue(RefColObject, ColumnObject, BaseRowIndex, BaseColumnIndex)Set

RFCObjSpec = Container.spec("RFCs.RFCObject")If RFCObjSpec Is Nothing Then Exit

FunctionSet RFCObject = RFCObjSpec.linkobjectIf RFCObject Is Nothing Then Exit

FunctionIf RefColObject Is Nothing Then Exit FunctionSet Mapper =

CreateObject("Comos.Sap.Xml.ComosXmlMapper")ColumnValue =

Mapper.ExportParametersToXml (RefColObject, RFCObject)Set Mapper = NothingEnd

Function

6. Click on the "Object by value" tab.

7. Input the following script in the editor that opens:

Function ColumnObjectByValue(RefColObject, ColumnObject, BaseRowIndex,

BaseColumnIndex, vNewValue, IsValid)

If Not Res Is Nothing and trim(vNewValue) >"" Then

Set Mapper = CreateObject("Comos.Sap.Xml.ComosXmlMapper")

Mapper.ImportParametersFromXml Res, Container, vNewValue

Set Mapper = Nothing

End If

Set ColumnObjectByValue = Res

End Function

This script is important for the import.

8. Click on the "Extra" tab and enter the value "XFrag("Parameters")" in the "XML mapping" field.

Configuring the "SystemUID" column 1. Right-click on the "SystemUID" column.

If this column does not exist, click on a different one instead.

2. Select the "Properties" command in the context menu.

If you need to create the column from scratch, select the "New > General" command.

3. Click on the "Value calculation" tab.

4. Enter the values "Expression (CallByName)" and "SystemUID" in the "Calculation type" field.

5. Click on the "Extra" tab and enter the value "@SystemUID" in the "XML mapping" field.

"Options" 1. Right-click on any query column.

2. Select the "Options" command in the context menu.

Page 40: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

General settings 5.7 Classification

SAP interface 40 Operating Manual, 04/2012, A5E03864945-01

3. Click on the "MotionX" tab.

4. In the "XML mapping" column, enter the type you stated in the "XML collection" field on the "Assignment" tab. See also chapter Queries of the same business object type underneath an SAP adapter (Page 33).

You can find additional information on this topic in the "Interfaces" manual, keyword "Exporting XML attributes: "XML mapping" column".

With this input you ensure that, when the XML connector is tested, each target object is written to a BO element which is within a BOGroup element in the XML scheme.

5.7 Classification SAP offers you the option to assign various classes to business objects. The business objects get additional characteristics in this way.

In order for you to be able to exchange the classification data with COMOS, you must create a tab for each desired class in COMOS that bears the name of the class.

Tab designations The tab you require for data exchange in COMOS needs to have the CL_ prefix. This means that if, for example, you wanted to create a tab for the PUMP class from SAP, the tab in COMOS would need to have the name CL_PUMP.

5.7.1 Displaying class characteristics from SAP in COMOS Each SAP class comprises a series of characteristics. In order for you to be able to exchange the characteristics between SAP and COMOS, you must create an attribute for each characteristic on the tab that you have created in COMOS for the exchange of data. The name of the attribute must correspond to the name of the characteristic from SAP.

Once you have created the tab in COMOS, you assign the tab to an SAP interface object (see chapter " Preparing SAP interface objects (Page 28)").

5.7.2 SAP characteristics with multiple evaluation A class characteristic in SAP corresponds to an attribute on a class tab of SAP interface objects in COMOS. This attribute is located on a tab for the corresponding class, e.g. on the "CL_TERMINAL" tab for a "TERMINAL" SAP class.

If a characteristic contains one value, the characteristic is displayed in COMOS in an attribute of type "Edit field", "Edit: [MinMax]" or "Date". These types contain exactly one (interval) value. If a characteristic contains several values, it is represented by means of a list attribute in COMOS.

Units also support list attributes. These are handled in a similar way to the other attributes for characteristics. The exchange options, such as the flow direction, are also supported in a similar way to the other attributes.

Page 41: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

General settings 5.7 Classification

SAP interface Operating Manual, 04/2012, A5E03864945-01 41

There is no equivalence for calendar data in list attributes. They can only be transferred in text form and are therefore treated as normal text.

Procedure To display SAP characteristics with a multiple evaluation, proceed as follows:

1. Open the properties of an SAP interface object.

2. Open the "Attributes" tab and the lower-level tab on which you want to create a list attribute.

3. Create a list attribute.

You can find more information on this topic in the "Properties" manual, keyword "Creating list attributes".

4. Create a column named "VALUE0". If you want to display intervals, create an additional column named "VALUE1". "VALUE0" displays the lower value, "VALUE1" the higher value.

If you have created two columns, however, it is only possible to enter data in the "VALUE0" column or in neither column.

Each line in the list corresponds to a characteristic value in SAP.

Result You can display SAP characteristics with a multiple evaluation in the list you have generated.

5.7.3 Multiple selection of class types COMOS can support several class types for individual objects on the SAP standard interface.

Export Create a class type attribute named "CLI_CLASSTYPE" on the tab of the class in question.

The class type is read directly from the class tab when exporting.

If there is no class type attribute available on the class tab, the class type is read from the "RFCs" tab at the query.

Page 42: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

General settings 5.7 Classification

SAP interface 42 Operating Manual, 04/2012, A5E03864945-01

Import

To import several class types, proceed as follows:

1. Delete the value for the "CLASSTYPE_IMP" parameter for BAPI_OBJCL_GETCLASSES.

Classes from all class types are returned, including information on which class type a class belongs to.

2. On the "RFCs" tab at the RFC object, create an attribute named "GETCLASSES_CLASSTYPECOLUMN". The description can be as you wish. In this example: "Class type column".

3. In the attribute you have created, enter a value for the name of the table column that contains the class types after the corresponding RFC call.

4. For the "CLASSTYPE" parameter of the "BAPI_OBJCL_GETDETAIL" function component, enter the reference parameter "#ClassTypeColumn".

5.7.4 Object-query-specific attributes for the classification Finally, you must set two attribute values at the query that you prepared for the corresponding business object. See also chapter Preparing an object query (Page 31).

Procedure 1. Open the properties of the query that you prepared.

2. Open the "RFCs" tab.

3. Select from the "Object table" list the name of the object table that you require for the classification.

4. Select from the "Class type" list the type of class that you require for the classification.

On export, the class type is only evaluated if this attribute is not available on the class tab of the interface object.

On import, the class type is only evaluated if the "GETCLASSES_CLASSTYPECOLUM" attribute is not defined on the "RFCs" tab of the RFC object.

Page 43: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

General settings 5.8 Import and export settings for the COMOS attributes

SAP interface Operating Manual, 04/2012, A5E03864945-01 43

5.8 Import and export settings for the COMOS attributes There is an XML string on each COMOS attribute. You can use this XML string to assign import and export properties to the attributes that you wish to use for the exchange of data with SAP. <Comos> <System> <SAP> <FlowDirection>IN/OUT</FlowDirection> <Unit>M0.25</Unit> <Type>Character/Date/Time/Numeric/Currency</Type> </SAP> </System> </Comos>

<FlowDirection> You can specify the direction of data exchange between COMOS and SAP by means of the <FlowDirection> element. By default the element is blank and the data flows in both directions.

● If you fill the element with the "IN" value, the data only flows from SAP to COMOS.

● If you fill the element with the "OUT" value, the data only flows from COMOS to SAP.

<Unit> In COMOS, you can assign units to numeric attributes. For example, you can assign the unit grams, kilogram, ton, etc., to the Weight attribute.

In order to assign a unit to an attribute, you must select a physical unit group (e.g. bulk) and a unit (e.g. kilogram) in the attribute properties.

When working with the attribute you can change the unit shown within the scope of the group and for example switch from kilograms to grams.

In this context, the <Unit> element guarantees that the attribute value is always exchanged with SAP using the unit defined by you and is converted if necessary. You must fill the element with the name of the desired unit in order to do this.

The unit must be a constituent part of the units group that had been set at the attribute.

<Type> It may happen that you need to put attribute values in a specific form when exchanging data between COMOS and SAP.

For example, the attribute for the date in COMOS contains both a date and a time, whereas in SAP the time and date are managed separately from one another.

With the help of the <Type> element, you can specify in which format the attribute values are to be exchanged with SAP.

Page 44: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

General settings 5.8 Import and export settings for the COMOS attributes

SAP interface 44 Operating Manual, 04/2012, A5E03864945-01

Overview The following table gives you an overview of the values that you can set in the <Type> element:

Value Description Character The attribute value from COMOS is treated as a character string. Numeric The attribute value from COMOS is interpreted as a number. Currency The attribute value from COMOS is interpreted as a number and as a currency at

the same time. Date The attribute value from COMOS is interpreted as an SAP date in the format

YYYYMMDD. Time The attribute value from COMOS is interpreted as an SAP time in the format

HHMMSS.

If you omit the <Type> element, a default behavior is automatically selected:

● For attributes of the "Edit field" type

– (Number): Numeric

– (Text or alphanumeric): Character

● For attributes of the Date type: Date

Page 45: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

SAP interface Operating Manual, 04/2012, A5E03864945-01 45

XML scheme for the data exchange 66.1 Description of the XML scheme

The following describes the individual elements of the XML scheme in detail.

<ComosSAPInterface> The XML base element must always have the name ComosSAPInterface.

<Login> The <Login> element is located directly underneath the base element and contains five sub-elements:

● <Application>

Contains the IP address of the SAP Application Server.

● <Client>

Contains the SAP Client ID.

● <Language>

Contains the login language code.

● <SystemNumber>

Contains the SAP system number.

● <User>

Contains the SAP user name.

<Context> The Context element contains general information on data exchange with SAP. It comprises the following sub-elements and attributes:

● <Timestamp>

Contains the date and time of the data exchange with SAP.

● <Project>

Contains the name of the project in which the data exchange took place.

Page 46: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

XML scheme for the data exchange 6.1 Description of the XML scheme

SAP interface 46 Operating Manual, 04/2012, A5E03864945-01

● <WorkingLayer>

This element and the associated attributes are only created if the data exchange took place in a COMOS working layer. The SystemFullName attribute contains the SystemFullName of the working layer in which the exchange took place. The ID attribute contains the identification number of the working layer.

● <StartObject>

Contains the reference object for data exchange with SAP. This is usually the XML connector.

<BOGroup> The <BOGroup> element groups together several business objects (BOs) of the same type that are all processed with the same SAP function blocks.

The XML scheme must include an element with the name BOGroup for each different BOType that is to be exchanged.

● The Type attribute contains the type of the business object.

● The Assembly attribute contains the name of the assembly that contains the class for handling the BOGroup element.

● The Class attribute contains the full name of the class for handling the BOGroup element.

● The GroupID attribute contains a value which serves to distinguish between several BOGroup nodes of the same type within an XML file.

<RFCS> The BOGroup element contains the RFCS sub-element. The content of the RFCS element is based on the "RFCs" tab of the RFC object. See also chapter Type mapping of the RFC object (Page 25).

The RFCS element contains a sub-element for each RFC that is used during the data exchange with SAP:

● <RFC>

– The Name attribute contains the name of the RFC.

– The Type attribute contains the RFC type.

– The RFC element contains additional sub-elements: <Import><Export><Table>.

Import parameters are grouped together underneath the <Import> element.

Export parameters and table parameters are grouped together underneath the <Export> and <Table> elements respectively.

Within these sub-elements, there are additional Parameter sub-elements that contain the parameters the SAP interface needs for the data exchange.

Page 47: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

XML scheme for the data exchange 6.1 Description of the XML scheme

SAP interface Operating Manual, 04/2012, A5E03864945-01 47

<BOGroupParam> The BOGroupParam element contains the RFC parameters required for the import. The values of these parameters are located on the "RFCs" tab of the query. It contains the following three sub-elements:

● <Fields>

For each field parameter, the Fields element contains a Field element with a Name attribute, which contains the name of the field, and a Value attribute, which contains the value of the field.

● <Structures>

The Structures element contains sub-elements with the name Structure. The Structure sub-element contains a sub-element with the name Field for each element in the structure.

● <Tables>

The Tables element contains sub-elements with the name Table. The Table sub-element contains a Row element for each row in the table and a Field element for each field in the row.

<BO> The BOGroup element contains a BO sub-element for each Business Object that is imported or exported via the SAP interface. The BO sub-element contains the attributes SAPID and Status.

● The SAPID attribute contains the identification number of the business object that was imported or exported via the SAP interface.

● After the import or export, the Status attribute is set according to the success or failure of the operation.

● <Parameters>

The Parameters sub-element contains a description of the parameters that are required for the RFC calls pertaining to each business object. It contains the following three sub-elements:

– <Fields>

For each field parameter, the Fields element contains a Field element with a Name attribute, which contains the name of the field, and a Value attribute, which contains the value of the field.

– <Structures>

The Structures element contains sub-elements with the name Structure. The Structure sub-element contains a sub-element with the name Field for each element in the structure.

Page 48: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

XML scheme for the data exchange 6.1 Description of the XML scheme

SAP interface 48 Operating Manual, 04/2012, A5E03864945-01

– <Tables>

The Tables element contains sub-elements with the name Table. The Table sub-element contains a Row element for each row in the table and a Field element for each field in the row.

● <Return>

The Return sub-element is created after the exchange of data and contains information on the progress of the export or import operation.

– <RFC>

An RFC sub-element is created for each RFC called for the corresponding business object. The element contains the attributes Name, Type, DateTime and Status.

– The Name attribute contains the name of the RFC.

– The Type attribute contains the RFC type.

– The DateTime attribute contains information on the time of the RFC call.

– The Status attribute contains information on the success or failure of the RFC call. The data that is displayed within the attribute depends on the details that you entered and saved on the "RFCs" tab of the RFC object.

Page 49: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

SAP interface Operating Manual, 04/2012, A5E03864945-01 49

SAP Maintenance module 7

COMOS supports data exchange with the SAP Maintenance module. The COMOSDB contains examples for exchanging technical locations and equipment. You can implement data exchange in other areas of the Maintenance module via the user-defined BOType "Custom".

7.1 Technical areas

7.1.1 Export and Import workflow for technical areas

Export workflow Activity RFC type Example RFC

A check is made for each technical area to determine whether a technical area had already been created in SAP.

CHECKEXISTENCE BAPI_FUNCLOC_GETDETAIL

If the technical area already exists, then an RFC is called to update the technical area.

UPDATE BAPI_FUNCLOC_CHANGE

If there is no technical area, then the technical area is created newly.

CREATE BAPI_FUNCLOC_CREATE

Last of all, the classification of the technical area is updated.

CHANGECLASS BAPI_OBJCL_CHANGE

Import workflow Activity RFC type Example RFC

The list of technical areas is generated from the search criteria entered on the "Filter" tab of the object query.

GETOBJECTS BAPI_FUNCLOC_GETLIST, BAPI_FUNCLOC_GETOBJECTS

The data of the technical area is called for each object in the list.

READSTANDARD-PARAMS

BAPI_FUNCLOC_GETDETAIL

The corresponding classification data is determined. This means that all classes to which the technical area belongs to are read out first.

CHANGECLASSES BAPI_FUNCLOC_GETCLASSES

Next, the data of the characteristics of the technical area is called for each class.

READCLASS-ATTRIBUTES

BAPI_OBJCL_GETDETAIL

Page 50: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

SAP Maintenance module 7.1 Technical areas

SAP interface 50 Operating Manual, 04/2012, A5E03864945-01

7.1.2 Preparing an RFC object In order to prepare the import or export for technical areas, configure the "RFCs" tab at an RFC object. See also chapters Create RFC objects (Page 25) and Type mapping of the RFC object (Page 25).

This tab has already been prepared for you in the COMOSDB. You will find it in the Navigator under "Y > D > 02 > RFC01 > RFC01 technical area".

7.1.2.1 Special settings on the "RFCs" tab of the RFC object RFC type: Equipment

Create attributes for each RFC type that is specified in the export or import workflow. See also chapter "RFCs" tab of the RFC object (Page 25). Furthermore, additional attributes are required. An overview of these is provided below.

Attributes for the export ● CHECKEXISTENCE_CHECKFIELD

With the CHECKEXISTENCE_CHECKFIELD attribute, you define which RFC parameter of the CHECKEXISTENCE RFC specifies whether a particular item of equipment already exists. The parameter can involve a field parameter or an individual field of a structure parameter. If the latter applies, the parameter and the field name must be separated by a period (full stop) in the "CheckField" field: DATA_SPECIFIC_EXP.EQUICATGRY

● CHECKEXISTENCE_CHECKVALUE

With the CHECKEXISTENCE_CHECKVALUE attribute, you specify which return value stands for an existing piece of equipment.

If you want any returned value that is not blank to be interpreted as meaning success, then you must enter the value #NotEmpty in the "Check Value" field.

Attributes for the import ● GETOBJECTS_OBJECTSIDCOLUMN

The GETOBJECTS RFC returns a list of equipment in table format. In the GETOBJECTS_OBJECTSIDCOLUMN attribute, you can input the name of the table column that contains the IDs of the objects.

Example: ALLOCLIST.OBJECT

In this example, ALLOCLIST is the table name and OBJECT the column name.

The individual IDs of the items of equipment can be used in the following RFCs by means of an #ObjectIdColumn entry in the Ref. parameter column. This means that the return parameter of an RFC can be used as the input parameter in another RFC.

Page 51: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

SAP Maintenance module 7.1 Technical areas

SAP interface Operating Manual, 04/2012, A5E03864945-01 51

For example, GETOBJECTS_OBJECTSIDCOLUMN has the value ALLOCLIST.OBJECT. For each object ID returned by the GETOBJECTS RFC, the ReadStandardParams RFC is called once. By entering the #ObjectIdColumn identifier in the "Ref. parameter" column of the FUNCTLOCATION parameter, the current object ID for the FUNCTLOCATION parameter is used when calling the RFC.

● READSTANDARDPARAMS_OWNERID

With the READSTANDARDPARAMS_OWNERID attribute, you specify that the equipment is to be created in the correct order when it is imported into COMOS, namely, from the highest to the lowest hierarchy level. To do this you must input the RFC parameter in the attribute that contains the superordinate equipment. The parameter can be a field parameter or a structure parameter.

Example: DATA_SPECIFIC.READ_SUPEQ. in the "Owner ID" field

● GETCLASSES_CLASSIDCOLUMN

The RFC type GETCLASSES puts out a table with all classes to which an item of equipment belongs.

With the GETCLASSES_CLASSIDCOLUMN attribute, you specify which table column contains the class names.

Example: ALLOCLIST.CLASSNUM. in the "Class ID" field

The returned class names can be used as input parameters in subsequent function blocks later on in the import procedure, by means of the #ClassIdColumn identifier. For this to work, you must enter the #ClassIdColumn identifier in the "Ref. parameter" column of the corresponding parameter.

7.1.3 SAP interface objects Now you can create the SAP interface objects (see also section "Preparing SAP interface objects (Page 28)").

7.1.4 XML connectors Finally, you have to prepare the XML connectors for the technical areas.

You can find a query with the name "SAPPM01" in the base objects of the base project underneath the "@SAP > SQT > 01" node.

This query has already been fully configured for the import and export of technical areas. If you want to create the query again: See also chapter Preparing an object query (Page 31). Then configure the query as described below.

Page 52: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

SAP Maintenance module 7.1 Technical areas

SAP interface 52 Operating Manual, 04/2012, A5E03864945-01

Right-click on the query and select the "Properties" command in the context menu. In the properties which appear, click "Attributes > RFCs". Configure the attributes that are located on the "RFCs" tab.

Attribute Setting Status From the list, select the status of the class (e.g., Released). Class Type Select the setting from the list

Functional Location Class. Object Table Select the setting from the list

Functional Location Table. RFC object In the field, set the RFC object "@SAP > RFC > FL > RFC for technical areas" as a

reference. Class Input the following value in the field:

Comos.Sap.Xml.FunctLocation. Assembly Input the following value in the field:

Comos.Sap.Xml.

Procedure Once you have configured the above mentioned attributes, you can connect the query with the corresponding XML connector. An XML connector has already been prepared for you in the COMOSDB. You will find it in the base project within the Navigator. It is located on the "Documents" tab under "@MXC > SAP > PM > XQC.3".

1. Right-click on the XML connector and, in its context menu, select the "XML > Configure XML connector" command.

You also have the option of creating a new XML connector. See also chapter: Preparing XML connectors (Page 31).

2. In the window that opens, click on the "Mapping" tab.

3. Input the following value in the XML-Collection field:

"/BOGroup[@Type ="FunctionalLocation"]/BO".

See also Preparing an RFC object (Page 50)

Page 53: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

SAP Maintenance module 7.2 Equipment

SAP interface Operating Manual, 04/2012, A5E03864945-01 53

7.2 Equipment

7.2.1 Export and import workflow for equipments

Export workflow Activity RFC type Example RFC

A check is made for each item of equipment to see whether it has already been created in SAP.

CHECKEXISTENCE BAPI_EQUI_GETDETAIL

If the equipment already exists, then an RFC is called to update the equipment.

UPDATE BAPI_EQUI _CHANGE

If the equipment does not exist yet, then the equipment is created newly.

CREATE BAPI_EQUI_CREATE

At the end, the classification of the equipment is updated. CHANGECLASS BAPI_OBJCL_CHANGE

Import workflow Activity RFC type Example RFC

The list of equipment is generated from the search criteria entered on the "Filter" tab of the object query.

GETOBJECTS BAPI_EQUI_GETLIST, BAPI_OBJCI_GETOBJECTS

For each item of equipment in the list, the data of the equipment is read out.

READSTANDARD-PARAMS

BAPI_EQUI_GETDETAIL

The corresponding classification data is created. This means that all classes that belong to this equipment are readout.

GETCLASSES BAPI_OBJCL_GETCLASSES

Subsequently, the characteristics of the equipment are read out for each class.

READCLASS-ATTRIBUTES

BAPI_OBJCL_GETDETAIL

7.2.2 Preparing an RFC object In order to prepare the export or import of the equipment, you must first create the "RFCs" tab at an RFC object. See also chapters Create RFC objects (Page 25) and Type mapping of the RFC object (Page 25).

This tab has already been prepared for you in the COMOSDB. You will find it in the Navigator under "Y Attribute Catalog > D Selection Catalog > 02 Tabs > RFC01 > RFC02 Equipment".

Page 54: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

SAP Maintenance module 7.2 Equipment

SAP interface 54 Operating Manual, 04/2012, A5E03864945-01

See also Special settings on the "RFCs" tab of the RFC object (Page 50)

7.2.3 SAP interface objects Now create the SAP interface objects. See also chapter Preparing SAP interface objects (Page 28).

7.2.4 XML connectors Last of all, you prepare the XML connectors for the equipment.

You can find a query with the name "SAPPM02 Equipments with import through classification" in the base objects of the base project underneath the "@SAP > SQT > 01" node.

Open the properties of the query. Select the "Attributes > RFCs" tab. Configure the attributes that are located on the "RFCs" tab.

Control element Setting "Status" list From the list, select the status of the class. "Class type" list Select the "Equipment class" setting from the list. "Object table" list Select the "Equipment table" entry from the list. "RFC object" field In the field, set the prepared RFC object as a reference. See also chapter

Preparing an RFC object (Page 53). "Class" field Enter the value "Comos.Sap.Xml.Equipment" in the field. "Assembly" field Enter the value "Comos.Sap.Xml" in the field.

Procedure Once you have configured the above mentioned attributes, you can connect the query with the corresponding XML connector. An XML connector has already been prepared for you in the COMOSDB. You will find it in the base project within the Navigator. It is located on the "Documents" tab under branch"@MXC > SAP > PM > XQC.4".

1. Right-click on the XML connector and select the "XML > Configure XML connector" command in the context menu.

You also have the option of creating a new XML connector. See also chapter Preparing XML connectors (Page 31).

2. In the window that opens, click on the "Mapping" tab.

3. Input the following value in the XML-Collection field:

/BOGroup[@Type ="Equipment"]/BO.

Page 55: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

SAP interface Operating Manual, 04/2012, A5E03864945-01 55

SAP Material management module 8

The COMOSDB provides examples of exchanging materials and bills of materials. You can implement data exchange in other areas of the Material Management module via the user-defined business object type ("Custom").

8.1 Materials

8.1.1 Export and import workflow for materials

Export workflow Activity RFC type Example RFC

A check is made for each material to determine whether the material had already been created in SAP.

CHECKEXISTENCE BAPI_MATERIAL_EXISTENCE-CHECK, BAPI_MATERIAL_GET_DETAIL

If the material does not exist, a new material number is called up in SAP and a new material is then created with this number.

GETSAPID BAPI_STDMATERIAL_GETINT-NUMBER

If the material already exists, it is updated. SAVEDATA BAPI_MATERIAL_SAVEDATA

Last of all, the classification of the material is updated. CHANGECLASS BAPI_OBJCL_CHANGE

Import workflow Activity RFC type Example RFC

The list of technical areas is generated from the search criteria entered on the "Filter" tab of the object query.

GETOBJECTS BAPI_MATERIAL_GETLIST, BAPI_OBJCL_GETOBJECTS

The data of the material is called for each object in the list.

READSTANDARD-PARAMS

BAPI_MATERIAL_GET_DETAIL

The corresponding classification data is created. This means that at first all the classes to which the material belongs are readout.

GETCLASSES BAPI_OBJCL_GETCLASSES

Then the characteristics data of the material is called for each class.

READCLASS-ATTRIBUTES

BAPI_OBJCL_GETDETAIL

Page 56: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

SAP Material management module 8.1 Materials

SAP interface 56 Operating Manual, 04/2012, A5E03864945-01

8.1.2 Preparing RFC objects In order to prepare the import or export for materials, you first have to create the "RFCs" tab of the RFC object; see chapters Create RFC objects (Page 25) and Type mapping of the RFC object (Page 25).

A tab has already been prepared for you in the COMOSDB. You will find it in the Navigator under "@SAP > Y > D > 02 > RFC01 > RFC03".

8.1.2.1 Attributes for the import RFC type: Material

Create attributes for each RFC type that is specified in the export or import workflow. See also chapter "RFCs" tab of the RFC object (Page 25). Furthermore, additional attributes are required. An overview of these is provided below.

Attributes for the export ● GETSAPID_OBJECTSIDCOLUMN

When a new material is to be created in SAP, then first of all an RFC to query a new material number is called. The GETSAPID_OBJECTSIDCOLUMN attribute must contain the name of the parameter with the material number that is to be returned.

The parameter can be a field parameter, the field of a structure or the column of a table.

If the attribute is the column of a table, then the first column entry is always used. If the attribute involves structure fields or a table column, then you must separate the parameter name and the field name by a period (full stop),

for example, MATERIAL_NUMBER.MATERIAL. in the "SAP ID column" field.

● SAVEDATA_ADDPARAM

In the "SAP ID parameter" attribute input the name of the parameter that contains the material number of the material to be saved, e.g. HEADDATA.MATERIAL.

Attributes for the import ● GETOBJECTS_OBJECTSIDCOLUMN

The GETOBJECTS RFC provides you with a list of materials in table format. You can enter the name of the table columns that contain the material numbers in the GETOBJECTS_OBJECTSIDCOLUMN attribute.

Example: MATNRLIST.MATERIAL. in the "Objects ID Column" field

You can reference the object IDs in the following SAP function components by means of the #ObjectIdColumn identifier. For this to work, you must enter the #ObjectIdColumn identifier in the "Ref. parameter" column of the corresponding parameter.

Result: The object IDs are used as input parameters in the function component.

Page 57: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

SAP Material management module 8.1 Materials

SAP interface Operating Manual, 04/2012, A5E03864945-01 57

● GETCLASSES_CLASSIDCOLUMN

The RFC GETCLASSES puts out a table with all classes to which a material belongs. By means of the GETCLASSES_CLASSIDCOLUMN attribute you can specify which table column is to contain the class names, e.g ALLOCLIST.CLASSNUM.

You can use the returned class names as input parameters in subsequent function blocks later on in the import procedure, by means of the #ClassIdColumn identifier. For this to work, you must enter the #ClassIdColumn identifier in the "Ref. parameter" column of the corresponding parameter.

8.1.3 SAP interface objects Now you can create the SAP interface objects. You can use the same SAP interface objects for material lists and Bill of Materials lists. However, if you want to use the SAP interface objects for the bills of materials, you must activate the "Is BOM" option on the "SYS" tab of the "@SAP SAP Interface > SIO SAP Interface Objects > MAT Material" object.

In the preconfigured SAP interface object for materials, the subordinated materials of a bill of materials are collected on the "T_T_STPO BOM elements" tab by means of a query.

8.1.4 XML connectors Last of all, you have to prepare the XML connectors for the materials.

You can find the following in the base objects of the base project underneath the "@SAP > SQT > 01 XML connector templates" node:

● "SAPMMQ01 Material import through classification"

● "SAPMMQ02 Materials import through GetList"

The difference between the two queries is that either classification criteria or material properties (such as material names) are used when importing materials.

● If you want to use classification criteria to search for materials during import, select the query "SAPMMQ01 Material import through classification".

● If you want to use material properties (such as material names) for searching during the import process, select the query "SAPMMQ02 Materials import through GetList".

Creating a new query You also have the option of creating a new query. See also chapter Preparing XML connectors (Page 31). After that, configure the query.

1. Open the properties of the query. Select the "Attributes > RFCs" tab.

2. On the "RFCs" tab, configure the attributes that are underneath the "Classification info" and "Interface components" headings.

Page 58: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

SAP Material management module 8.2 Bill of Materials

SAP interface 58 Operating Manual, 04/2012, A5E03864945-01

Control element Setting "Status" list From the list, select the status of the class. "Class type" list From the list, select the "Material class" entry. "Object table" list Select the "Material table" setting from the list. "RFC object" field In the field, set the prepared RFC object as a reference. "Class" field Enter the value "Comos.Sap.Xml.Material" in the field. "Assembly" field Enter the value "Comos.Sap.Xml" in the field.

Procedure Once you have configured the above-mentioned attributes, you can connect the object query with the corresponding XML connector. An XML connector has already been prepared for you in the COMOSDB. You will find the XML connector in the base project within the Navigator. It is located on the "Documents" tab under the "@MXC > SAP > MM > XQC.1 SAP Material" node.

1. Select the "XML > Configure XML connector" command in the context menu for the XML connector.

2. In the window that opens, click on the "Mapping" tab.

3. Input the following path in the XML-Collection field:

/BOGroup[@Type ="Material"]/BO.

8.2 Bill of Materials

8.2.1 Export workflow for Bill of Materials The COMOSDB contains an SAP example for exporting bills of materials.

Only export operations are supported for Bill of Materials.

Activity RFC type Example RFC

First of all, a check is made to determine whether the material whose Bill of Materials is to be amended already exists in SAP.

CHECKEXISTENCE BAPI_MATERIAL_EXISTENCE-CHECK, BAPI_MATERIAL_GET_DETAIL

The corresponding Bill of Materials is only updated if the material already exists.

SAVEBOM CSAP_MAT_BOM_MAINTAIN

Page 59: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

SAP Material management module 8.2 Bill of Materials

SAP interface Operating Manual, 04/2012, A5E03864945-01 59

8.2.2 Preparing an RFC object You first have to create the "RFCs" tab of the RFC object to prepare the export operation for bills of materials. See also chapters Create RFC objects (Page 25) and Type mapping of the RFC object (Page 25).

A tab has already been prepared for you in the COMOSDB. You will find it in the Navigator under "@SAP > Y > D > 02 > RFC01 > RFC04 BOM".

8.2.2.1 Special settings on the "RFCs" tab of the RFC object You first have to create the "RFCs" tab to prepare the export operation for Bills of Materials. The attributes that you require are the default attributes. See also chapter "RFCs" tab of the RFC object (Page 25).

8.2.3 SAP interface objects After having created the "RFCs" tab, you create the SAP interface objects. You can use the same SAP interface objects for the Bill of Materials as for materials.

However, please note that in the case of bills of materials you must activate the "Is BOM" option on the "Attributes > SYS" tab of the "@SAP SAP Interface > SIO SAP Interface Objects > MAT Material" object.

8.2.4 XML connectors Last of all, you have to prepare the XML connectors for the Bills of Materials.

You can find the query "SAPMMQ03 export Bills of Materials" in the base objects of the base project underneath the "@SAP > SQT > XML connector templates" node.

Open the properties of the query. Select the "Attributes > RFCs" tab.

On the "RFCs" tab, configure the attributes that are underneath the "Classification info" and "Interface components" headings.

Control element Setting "Status" list From the list, select the status of the class. "Class type" list From the list, select the "Material class" entry. "Object table" list From the list, select the "Material table" entry. "RFC object" field In the "RFC object" field, set the prepared object as a reference. See also

chapter Preparing an RFC object (Page 59). "Class" field Enter the value "Comos.Sap.Xml.Bom" in the field. "Assembly" field Enter the value "Comos.Sap.Xml" in the field.

Page 60: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

SAP Material management module 8.2 Bill of Materials

SAP interface 60 Operating Manual, 04/2012, A5E03864945-01

Procedure Once you have configured the above-mentioned attributes, you can connect the object query with the corresponding XML connector. You will find it in the base project within the Navigator. It is located on the "Documents" tab, "@MXC > SAP > MM > XQC.3 SAP BOM" node.

1. Select the "XML > Configure XML connector" command in the context menu for the XML connector.

You also have the option of creating a new XML connector. See also chapter Preparing XML connectors (Page 31).

2. In the window that opens, click on the "Mapping" tab.

3. Input the following path in the "XML-Connection" field:

/BOGroup[@Type ="BOM"]/BO.

Page 61: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

SAP interface Operating Manual, 04/2012, A5E03864945-01 61

SAP Documents module 9

You can use the COMOS SAP Interface to exchange documents between COMOS and SAP. Only the export is currently supported.

9.1 Export workflow for documents Activity RFC type Example RFC

Each document is checked if the document has already been created in SAP.

CHECKEXISTENCE BAPI_DOCUMENT_EXISTENCE-CHECK

If the document does not exist, a new document is created in SAP.

CREATE BAPI_DOCUMENT_CREATE2

If the document already exists, a new version of the document is created depending on the settings.

CREATENEW-VERSION

BAPI_DOCUMENT_CREATENEW-VRS2

Afterwards the document is updated. UPDATE BAPI_DOCUMENT_CHANGE2

Last of all, the classification of the document is updated. CHANGECLASS BAPI_OBJCL_CHANGE

9.2 Preparing an RFC object You first have to create the "RFCs" tab of the RFC object at a COMOS object to prepare the export operation for documents. See also chapters Create RFC objects (Page 25) and Type mapping of the RFC object (Page 25).

This tab has already been prepared for you in the COMOSDB. You will find it in the Navigator under "@ > Y > D > 02 > RFC01 > RFC07 document".

9.2.1 XML connectors Last of all, you have to prepare the XML connectors for the documents. You can find the query "SAPDMQ01 export documents" in the base objects of the base project underneath the "@SAP > SQT > 01 XML connector templates" node.

Open the properties of the query. Select the "Attributes > RFCs" tab.

On the "RFCs" tab, configure the attributes that are underneath the "Classification info" and "Interface components" headings.

Page 62: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

SAP Documents module 9.2 Preparing an RFC object

SAP interface 62 Operating Manual, 04/2012, A5E03864945-01

Control element Setting "Status" list From the list, select the status of the class. "Class type" list Select the "Document class" setting from the list. "Object table" list Select the "Document table" setting from the list. "RFC object" field In the "RFC object" field, set the prepared object as a reference. See also

chapter Preparing an RFC object (Page 61). "Class" field Enter the value "Comos.Sap.Xml.Document" in the field. "Assembly" field Enter the value "Comos.Sap.Xml" in the field.

Procedure Once you have configured the above-mentioned attributes, you can connect the object query with the corresponding XML connector:

1. Select the "XML > Configure XML connector" command in the context menu for the XML connector.

You also have the option of creating a new XML connector. See also chapter Preparing XML connectors (Page 31).

2. In the window that opens, click on the "Mapping" tab.

3. Input the following path in the "XML-Connection" field:

/BOGroup[@Type ="Document"]/BO.

9.2.2 Special settings on the "RFCs" tab of the RFC object RFC type: Document

Create attributes for each RFC type that is specified in the export workflow. See also chapter "RFCs" tab of the RFC object (Page 25). Furthermore, additional attributes are required. An overview of these is provided below.

Attributes for the export ● CHECKEXISTENCE_CHECKFIELD

With the CHECKEXISTENCE_CHECKFIELD attribute, you define which parameter of the CHECKEXISTENCE RFC specifies whether a particular document already exists. The parameter can involve a field parameter or an individual field of a structure parameter. If the last mentioned case arises you have to enter the parameter name and the field name divided by a period (full stop).

● CHECKEXISTENCE_CHECKVALUE

Via the CHECKEXISTENCE_CHECKVALUE attribute, you state which return value should be output for an already existing document.

Page 63: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

SAP Documents module 9.3 SAP interface objects

SAP interface Operating Manual, 04/2012, A5E03864945-01 63

If you want any return value that is not empty to be interpreted as successful, then you must enter the value #NotEmpty in the "Check Value" field:

● CHANGECLASS_OBJECTKEY

In order to refresh the classification data of an object in SAP you usually need a key for this object. For documents this key is set up of multiple values. Use the CHANGECLASS_OBJECTKEY attribute to define the elements used to set up the key. Enter the names of the individual key parameters in the desired order, separated by semicolons.

For example: DOCUMENTTYPE;DOCUMENTNUMBER;DOCUMENTVERSION;DOCUMENTPART.

The SAP interface sets up the key according to the different parameter values. In the parameter table of the CHANGECLASS RFC, you define which parameter you want the key (once set up) to be mapped to. The #ObjectKey value is entered in the "Ref. parameter" column of the corresponding parameter.

9.3 SAP interface objects After having created the "RFCs" tab, you create the SAP interface objects. A special feature of SAP interface objects for documents is that there is a "Create new version on export" option available on the "SYS" tab of the "@SAP SAP Interface > SIO SAP Interface Objects > DOC SAP Interface Objects" object. If this checkbox is active during an export, a new version of the document is created in SAP as long as the document already exists in SAP.

Page 64: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

SAP Documents module 9.3 SAP interface objects

SAP interface 64 Operating Manual, 04/2012, A5E03864945-01

Page 65: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

SAP interface Operating Manual, 04/2012, A5E03864945-01 65

Export or import via XML connectors 10Export or import of SAP business objects

Proceed as follows to export or import the SAP business objects:

1. Right-click on the XML connector.

2. Select one of the following options:

– To carry out an export, select the "XML > Export" command in the context menu.

– To carry out an import, select the "XML > Import" command in the context menu.

Export or import via the properties of the XML connector You also have the option to carry out the export or import operation by using the properties of the XML connector.

1. Right-click on the XML connector.

2. Select the "XML > Configure XML connector" command in the context menu.

3. Select one of the following options:

– To carry out an export, click the "Export" button .

– To carry out an import, click the "Import" button .

Page 66: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

Export or import via XML connectors

SAP interface 66 Operating Manual, 04/2012, A5E03864945-01

Page 67: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

SAP interface Operating Manual, 04/2012, A5E03864945-01 67

Importing the device catalog 11

Device selection enables you to assign a device to a request object. During the assignment, the relevant product data of the selected material is directly copied to the request object.

Some of the manufacturer devices are provided in the form of COMOS base objects. To keep the number of base objects low, it is also possible to connect external device catalogs from SAP.

11.1 Defining an SAP catalog object You must define an SAP catalog object for each manufacturer device catalog which you want to access from COMOS. A catalog object groups together all the information you need to access the corresponding external device catalog.

Procedure To define an SAP catalog object, proceed as follows:

1. In the base data, use the "New > New base object" command in the context menu of the "S01 > @System > @D > @DeviceCatalog > SAP" object to create a new catalog object.

2. Open the properties of the catalog object.

3. Enter the login data for connecting to the SAP system on the "SAP" tab.

The entries are the same as in the standard login objects or SAP adapters.

4. On the "Class" tab, enter "Comos.Sap.Xml.SapCatalogConnection" in the "Class used" field. This component is used for the following tasks:

– To create a connection to the device catalog

– To download materials

– To convert from the XML format of the SAP interface into the XML format of the device selection.

The field "Program path" remains blank.

5. Open the "Filter" tab.

6. Specify the selection criteria of the devices that are to be downloaded. This involves filter parameters, such as those already offered by the SAP interface. See also chapter Preparing an object query (Page 31).

Page 68: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

Importing the device catalog 11.2 Defining a query

SAP interface 68 Operating Manual, 04/2012, A5E03864945-01

7. In the properties, open the "General" tab.

8. Drag&drop an SAP interface base object to the "Reference SAP interface object" field.

From this object, the necessary information for mapping an XML file in the format of the SAP interface is converted into the COMOS internal format of the manufacturer device selection.

The "Language List" and "Prevent catalog generation by end user" attributes are not relevant for device selection.

Result You have defined an SAP catalog object for device selection.

11.2 Defining a query Every SAP catalog object always has a query with a special extension for device selection from SAP. It shows the manufacturer devices (rows) imported from SAP and how they are assigned to COMOS attributes (columns). The SAP interface base object set at the catalog is used for the assignment. The COMOS attributes displayed in the query are the attributes of the SAP interface base object that have the link type "By owner".

Procedure To define a query for device selection, proceed as follows:

1. Open the "Elements" tab in the properties of the SAP catalog object.

2. Navigate in the base data to object "S01 > @SAP > SQT > 02 > QGen001".

3. Drag&drop the "QGen001" query to the "Elements" tab of the catalog object.

Result The "QGen001" query is created underneath the device catalog.

Page 69: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

Importing the device catalog 11.3 Commands in the context menu of the column headers

SAP interface Operating Manual, 04/2012, A5E03864945-01 69

11.3 Commands in the context menu of the column headers The query has the following special commands in the context menu of its column headers:

Command Description "Import data from SAP" This entry opens a connection with SAP, using the connection data defined at the

SAP catalog object. The RFCs which are also defined by means of the catalog object are called via the standard SAP interface. The called XML mapping is then reevaluated.

"Refresh mapping" This entry refreshes the assignment of the data retrieved from SAP in XML format to the assignment of XML data for the device selection and evaluates it again. In contrast to the "Import data from SAP" entry, no new data is read from SAP. However, changes to the SAP interface base object are considered. See also section Assignment of XML data (Page 70).

"Generate XML" Generates an XML file in the format for the device selection from all imported devices.

"Generate XML for selection" Generates an XML file in the format for the device selection from the devices selected in the query.

"Restore last selection" Selects the devices in the query that were selected during the last generation of the device XML file.

11.4 Importing devices

Procedure To import devices, proceed as follows:

1. Open the "QGen001" query, which you previously created underneath the device catalog.

2. Open the context menu by right-clicking on a column header in the query. See also section Commands in the context menu of the column headers (Page 69).

3. Select the "Import data from SAP" command in the context menu.

A window opens, where you must enter your user data.

4. Enter your user data.

An XML file containing all devices from SAP is generated in the interface format.

5. Select the "Generate XML" command in the context menu.

An XML file is generated in the format for the device selection from all imported devices.

If you only want to generate an XML file from the devices selected in the query, select the "Generate XML for selection" command.

6. Click the "OK" button to save your changes.

Page 70: COMOS 4 - Siemens · Of these various technologies, COMOS uses BAPI (Business Application Programming Interface) and RFC (Remote Function Call). BAPI is a standardized

Importing the device catalog 11.5 Assignment of XML data

SAP interface 70 Operating Manual, 04/2012, A5E03864945-01

Result The devices from SAP are saved in the SAP catalog object. You can use the catalog via the standard user interface for device selection. You can find more information on this topic in the "EI&C Administration" manual, keyword "Manufacturer device selection".

11.5 Assignment of XML data To convert XML data from the standard SAP interface format into the format of the device selection, the information required for the assignment is read from an SAP interface base object. This SAP Interface base object must be set at the corresponding SAP object catalog. The following takes place during assignment:

1. A search is performed for SAP-related attributes at the SAP interface base object. These are primarily those with a corresponding prefix, such as F_, on the "General" tab or on a tab with the prefix S_, T_, or CL_.

2. These attributes are checked for a "By owner" type link. If such a link is available, it is used for assigning the corresponding value in the XML document of the standard SAP interface to the value in the XML device selection document. The assignment follows the behavior of the standard SAP interface as closely as possible.

3. If settings are made at such an attribute for the flow direction, exchange type, or unit, these are also taken into consideration.