You are on page 1of 6

SAP Metadata Utility

User Guide

2016 Informatica Corporation. No part of this document may be reproduced or transmitted in any form, by any means
(electronic, photocopying, recording or otherwise) without prior consent of Informatica Corporation. All other company and
product names may be trade names or trademarks of their respective owners and/or copyrighted materials of such
owners.
Overview
You can use the SAP Metadata utility on the Windows operating system to access SAP BAPI/RFC and SAP IDoc
API functionality through Informatica Cloud mapplets.
Import metadata from a BAPI/RFC or an IDoc by using the SAP Metadata utility to generate an Informatica Cloud
mapplet XML file. Import this mapplet into Informatica Cloud to use it in a mapping or an integration template.
You can import standard BAPIs, custom RFCs, IDocs, and extended IDocs.
The utility writes the XML file to a folder named generatedMappings. You can configure the directory for the output
file and generatedMappings folder. By default, the utility uses the utility installation directory.
The utility imports one BAPI/RFC or IDoc at a time. After you import, you can stay connected to the same
destination so you can import more than one BAPI/RFC or IDoc in the same session. To import metadata from a
different destination, end the session and launch the utility again.
Note: You do not need to configure SAP or install SAP transports to use the SAP Metadata utility.

Prerequisites
Before you use the SAP Metadata utility, verify the following prerequisites:
Configure the saprfc.ini file to include information about the SAP server with the metadata you want to extract.
The saprfc.ini file is a proprietary SAP file, similar to the ODBC.ini file.
Warning: Avoid using Notepad. Notepad can add unwanted characters to the file.
Configure the RFC_INI system environment variable for the path to the saprfc.ini file, including the file name.
Download and install the 32-bit SAP JCo libraries for your operating system. You can find the libraries on the
SAP Service Marketplace at the following URL: http://service.sap.com. Unzip the contents to a local directory.
Add the location of the SAP JCo libraries to the PATH system environment variable.
Verify that your SAP user has the authorization to browse and extract metadata.
For information about configuring the saprfc.ini file, see the Informatica Cloud - Winter 2016 - SAP Connector
Guide from the following link:
https://kb.informatica.com/proddocs/Product%20Documentation/5/IC_Winter2016_SAPConnectorGuide_en.pdf

Installation and Configuration


To install and configure your system to use the SAP Metadata utility, perform the following steps:
1. Download the SAP Metadata utility zip file, SapUtility.zip, from the following Informatica Cloud Community
article: SAP Metadata Utility and User Guide.
2. Unzip the file to a local directory.
Note: Avoid using spaces in the directory name. Spaces can cause imports to fail.
3. In the installation directory, use a text editor to open the following batch file: SAPUtil.bat.
4. Define the CLASSPATH in the batch file.
Enter the SAP JCo libraries directory and the sapjco3.jar file name, and remove REM from the following line:
REM SET CLASSPATH=%CLASSPATH%;<Location of sapjco3.jar>\sapjco3.jar
For example:
SET CLASSPATH=%CLASSPATH%;C:\SAP\JCo\sapjco3.jar
5. In the batch file, define JAVA_HOME. Enter the JAVA JRE directory and remove REM from the following
line:
REM SET JAVA_HOME=<JRE_LOCATION>
For example:
SET JAVA_HOME=C:\Program Files (x86)\Informatica Cloud Secure Agent\jre
Use the JAVA JRE included with the Informatica Cloud Secure Agent.

2
6. Save and close the batch file.

BAPI/RFC Mapplets
The BAPI/RFC mapplet includes a BAPI/RFC transformation. The BAPI/RFC transformation makes BAPI/RFC
calls in SAP. BAPI/RFC calls include requests to the SAP system, such as creating, changing, or deleting data in
SAP applications. To perform these tasks, BAPI/RFC functions use function parameter values. BAPI/RFC
functions can have the following parameters:
Scalar input parameters. Scalar input values. Some BAPI functions require scalar input values to perform
tasks. For example, some BAPI functions require scalar inputs to change data.
Scalar output parameters. Scalar output values that a BAPI function returns after performing a task.
Table parameters. SAP structures with more than one row. Configure the direction of the table parameters to
input, output, or both for your interface requirements. Input table parameters pass table input values to a
BAPI/RFC function. For example, some BAPI/RFC functions require table inputs to change data.

Accessing BAPI/RFC Functionality


To access the BAPI/RFC functionality through the SAP Metadata utility, perform the following tasks:
1. Import the BAPI/RFC metadata from SAP into the SAP Metadata utility to create a mapplet.
2. Import the BAPI/RFC mapplet into Informatica Cloud.
3. Map the Integration ID field and other inputs and outputs.

Step 1. Import BAPI/RFC Metadata


1. In the SAP Metadata utility installation directory, double-click the SAPUtil.bat file.
The SAP Metadata utility wizard opens.
2. On the Connection Properties page, enter the following connection information:

Connection Property Description

Connection String The SAP destination to use. You can select destinations
defined in the saprfc.ini file.

User Name SAP ID.

Password Password.

Client Client number.

Language Language code, such as EN.

Select Method BAPI/RFC.

3. Click Connect.
The Next button appears after the utility establishes a connection.
4. Click Next.
5. On the BAPI/RFC Selection page, enter the BAPI or RFC name, and then click Get Objects.
The Parameters and Return Structure tabs display details about the selected object.
6. To select a directory for the output files, click the select button for Output Directory.
7. Click Finish.
When successful, the utility displays a message indicating the name and directory for generated XML file, and
asks if you want to create an additional mapplet.
8. To import another BAPI/RFC from the same destination, click Yes. To end the session, click Finish.
To end the session and import a BAPI/RFC from a different destination, click Finish and launch the utility
again.

3
Step 2. Import the BAPI/RFC Mapplet into Informatica Cloud
After you extract a BAPI or RFC, you can import it into Informatica Cloud as a mapplet and use it in the Cloud
Mapping Designer.
1. Log in to Informatica Cloud.
2. Click Configure > Mapplets > New.
3. Enter a mapplet name. Include the BAPI/RFC name in the mapplet name.
4. For the mapplet type, select Active.
All BAPIs and RFCs are active by default.
5. Click Upload to navigate to the XML file you created in the SAP Metadata utility.

Step 3. Map Inputs and Outputs


Each BAPI/RFC mapplet includes an Integration ID input field and output field. The Integration ID field is a key field
in the BAPI transformation. The Integration ID controls the boundaries of a single transaction and ensures data
integrity.
When you configure a mapping, integration template, or mapping configuration task, map a primary key field from
the source to the Integration ID input field. To define the boundaries of the transaction, map the Integration ID
output field.
Note: You must map the Integration ID input field even when a BAPI or RFC does not require other input fields.
A BAPI/RFC mapplet includes input groups and output groups based on the BAPI/RFC transformation. The
BAPI/RFC transformation can contain the following groups:
Scalar input. Input group for scalar parameters. Contains a field for each scalar input parameter. The group
name is SCALAR_INPUT and the field names are SI_<FieldName>.
Table input. One group for each table parameter. The fields represent import structures. The group name is
TABLE_INPUT_<structure name> and field names are TI_<StructureName>_<FieldName>.
Scalar output. Output group for scalar parameters. Contains a field for each scalar output parameter. The
group name is SCALAR_OUTPUT and field names are SO_<FieldName>.
Table output. One group for each table parameter. The fields represent output structures. The group name is
TABLE_OUTPUT_<structure name> and field names are TO_<StructureName>_<FieldName>.
Error output. Map this field to see error messages about data conversion and BAPI/RFC calls.

Accessing IDoc Functionality


To access IDoc functionality through the SAP Metadata utility, perform the following tasks:
1. Verify prerequisites.
2. Import the IDoc Metadata from SAP into the SAP Metadata utility and create a mapplet.
3. Import the IDoc mapplet into Informatica Cloud.
4. Map the primary key and foreign key field.
The IDoc mapplet includes an IDoc transformation.

Step 1. Verify Prerequisites


Before you use the SAP Metadata utility to extract IDoc metadata, verify the following prerequisites:
Work with your SAP Cross Applications configurator to set up the following ALE communication profiles/model
views:
Logical System
Distribution Model
Partner Profile
RFC Destination
Ensure that the Logical System name is consistent across all environments.

4
Step 2. Import IDoc Metadata
The import process maintains hierarchical dependencies. For example, if you select a child segment, then the
parent segment is selected. Similarly, if you deselect a parent segment, the child segment is deselected.

1. In the SAP Metadata utility installation directory, double-click the SAPUtil.bat file.
The SAP Metadata utility wizard launches.
2. On the Connection Properties page, enter the following information:

Connection Property Description

Connection String The SAP destination to use. Displays destinations defined in


the saprfc.ini file.

User Name SAP ID.

Password Password.

Client Client number.

Language Language code, such as EN.

Select Method IDoc.

3. Click Connect.
The Next button appears when the utility establishes a connection.
4. Click Next.
5. On the Generate SAP IDoc Prepare Transformation page, enter the message type and IDoc type.
6. Under Select Transformation, select one of the following options:
To write data to SAP, select Prepare.
To read data from SAP, select Interpreter.
To read data from and write data to from SAP, select Both.
7. Click Fetch.
8. Select the segments that you want to use.
You cannot clear mandatory segments.
The number of occurs indicates the number of values that can go into a segment.
9. To add other fields into the Control Record input group of a mapplet, perform the following steps:
a. Click Control.
b. Select the field that you want to add, and then click Partner Profile > New.
c. Enter the key and value for the partner profile.
9. The key is the field name, and the value is the partner type.
10. To add fields to a Prepare transformation, enter the following keys and values:
Key: SNDPRT
Value: LS (for Logical System)
Key: SNDPRN
Value: ICS (might vary, based on your system)
d. Click OK.
10. To select a directory for the output files, click the button next to Select Location.
11. Click Finish.
When successful, the utility displays a message indicating the name and directory for generated XML file and
asks if you want to create more mapplets.
12. To import another IDoc from the same destination, click Yes. To end the session, click Finish.

5
To end the session and import an IDoc from a different destination, click Finish and launch the utility
again.

Step 3. Import an IDoc Mapplet into Informatica Cloud


After you import an IDoc, you can import the mapplet into Informatica Cloud.
1. Log in to Informatica Cloud.
2. Click Configure > Mapplets > New.
3. Enter a mapplet name.
4. For the mapplet type, select Active.
All IDocs are active by default.
5. Click Upload to navigate to the XML file that you want to import.

Step 4. Map Key Fields


An IDoc mapplet includes a primary key (GPK) and a foreign key (GFK) in each segment. When you configure a
mapping, integration template, or mapping configuration task, map the primary key and foreign key fields.
In addition to the primary key and foreign key fields, the Prepare transformation can have many other input fields.
The Prepare transformation has the following output fields:
IDoc Data. Map this field to an IDoc target.
Error IDoc Data. Map this field to see error messages about IDoc syntax/data conversion.
In contrast, the Interpreter transformation has the IDoc data as the input field, and can have many output fields.

Integration Templates
For information about building integration templates to use a mapplet, see the following resources:
Installing the Informatica Cloud Integration Template Designer plug-in for Microsoft Visio
Creating a Template in Informatica Cloud
Creating Templates with Informatica Clouds Template Designer

Informatica Global Customer Support


You can contact a Customer Support Center online or by telephone.
For online support, click Submit Support Request in the Informatica Cloud application. You can also use
Informatica MySupport to log a case. You need a user name and a password to access MySupport. You can
request a user name and password at https://mysupport.informatica.com.
The telephone numbers for Informatica Global Customer Support are available from the Informatica web site at
http://www.informatica.com/us/services-and-training/support-services/global-support-centers/.