Inbound IDOC_AAE configuration in PI 7.31 single stack

1. Determining values for GatewayHost and GatewayService 

  • Log in to the SLD and choose Administration -> Settings tab Parameters and All from the drop-down menu:

SLD Gateway PI/PO 7.31 single stack

2. Creation of RFC connection to a SAP system, from which Idocs will be sent:

  • After logging in to SAP NetWeaver Administrator (NWA) go to Configuration -> Infrastructure -> Destinations

SAP NWA Destinations


  • Connection parameters:

Hosting System: Local Java System PID
Destination Type: RFC

SAP NWA Destinations step 1


In next steps please provide connection parameters to the SAP system and logon data:

SAP NWA Destinations step 2


To make sure that the connection works properly you may use an option Ping Destination. An expected test result is Successfully connected to system <PID> as user <user>

Ping destination

3. Creating a JCo connection (Java Connector)

  • In SAP NetWeaver Administrator (NWA) go to Configuration -> Infrastructure -> Jco RFC Provider

JCo RFC Provider


  • Use an option Create, parameters to be provided:

Gateway Host: as in step 1
Gateway Service: as in step 1

JCo step 1


  • In the next step enter the connection name from step 2, in our case XI_IDOC_DEFAULT_DESTINATION

JCo step 2


After saving, the newly created connection needs to be started (option Start), expected message is JCo servers started

4. Adding parameters for Resource Adapter inboundRA

  • In SAP NetWeaver Administrator (NWA) go to Configuration -> Infrastructure -> Application Resources and filter Resource List using *inboundRA*

Resource Adapter step 1

  • In Properties tab please fill parameters (or make sure that they are already entered):

GatewayServer – as in step 1.
ProgramID – as in step 3. – XI_IDOC_DEFAULT_PID
MaxReaderThreadCount – value between 5 and 10
DestinationName – as in step 2. – XI_IDOC_DEFAULT_DESTINATION
GatewayService – as in step 1. – sapgw01
Local – true
BindingKey – PI_AAE_IDOC

Resource Adapter step 2

  • After saving the application needs to be started: More Actions -> Start Applications and choose from the list:

Resource Adapter step 3

5. Creating a RFC destination in SAP system that will send Idocs to PI

  • In transaction SM59 create a new connection of type (T) TCP/IP Connection using parameters:

Activation Type: Registered Server Program
Program ID: as in step 3. – XI_IDOC_DEFAULT_PID
Gateway Host: as in step 1.
Gateway Service: as in step 1. – sapgw01

SM59 TCP/IP Connection


SM59 TCP/IP Connection


  • After connection test an expected message is:

SM59 RFC connection test


6. Creating sender communication channel in PI

  • In contrast with Idoc configuration for Integration Engine (ABAP) a communication channel of type Sender is required, it will be used in Integrated Configuration. 
  • Parameter RFC Server Parameters should be set to Default, in Ack Destination please enter a connection from step 2. – XI_IDOC_DEFAULT_DESTINATION

Idoc_AAE sender channel


After completing all steps above PI system is ready for configuration of inbound Idoc scenarios.

Materials available on and have been used when creating this guide.

XSLT mapping to a flat file

In certain cases it is required to send an output mapping file as a flat file with specified field lengths. When the file adapter is used it is recommended to use standard File Content Conversion. However, in case of i.e. calling web service using SOAP adapter the best option is XSLT transformation. For the sample input file:

[codesyntax lang=”xml” lines=”normal”]



After using XSLT transformation that creates a new line for each occurrence of a <Line> element and sets field lengths to: 20, 20, 3, 20, 5, 5:

[codesyntax lang=”xml” lines=”normal”]

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="" version="1.0">
   <xsl:output method="text" indent="yes" encoding="UTF-8" />
   <xsl:variable name="DocumentNumber">
      <xsl:call-template name="padRightSide">
         <xsl:with-param name="stringToPad" select="Order/Header/DocumentNumber" />
         <xsl:with-param name="totalLength" select="20" />
   <xsl:variable name="Date">
      <xsl:call-template name="padRightSide">
         <xsl:with-param name="stringToPad" select="Order/Header/Date" />
         <xsl:with-param name="totalLength" select="20" />
   <xsl:template match="/Order">
      <xsl:for-each select="Line">
         <!-- Repeat header data -->
         <xsl:copy-of select="$DocumentNumber" />
         <xsl:copy-of select="$Date" />
         <!-- Item data -->
         <xsl:call-template name="padRightSide">
            <xsl:with-param name="stringToPad" select="ItemNumber" />
            <xsl:with-param name="totalLength" select="3" />
         <xsl:call-template name="padRightSide">
            <xsl:with-param name="stringToPad" select="Material" />
            <xsl:with-param name="totalLength" select="20" />
         <xsl:call-template name="padRightSide">
            <xsl:with-param name="stringToPad" select="Quantity" />
            <xsl:with-param name="totalLength" select="5" />
         <xsl:call-template name="padRightSide">
            <xsl:with-param name="stringToPad" select="UOM" />
            <xsl:with-param name="totalLength" select="5" />
         <!-- End Line -->
         <xsl:text />
   <xsl:template name="padRightSide">
      <xsl:param name="totalLength" />
      <xsl:param name="padChar" select="' '" />
      <xsl:param name="stringToPad" />
      <xsl:param name="padBuffer" select="concat($padChar,$padChar,$padChar,$padChar,$padChar, $padChar,$padChar,$padChar,$padChar,$padChar )" />
      <xsl:variable name="vNewString" select="concat($stringToPad, $padBuffer)" />
         <xsl:when test="not(string-length($vNewString) &gt;= $totalLength)">
            <xsl:call-template name="padRightSide">
               <xsl:with-param name="stringToPad" select="$vNewString" />
               <xsl:with-param name="totalLength" select="$totalLength" />
               <xsl:with-param name="padChar" select="$padChar" />
               <xsl:with-param name="padBuffer" select="$padBuffer" />
            <xsl:variable name="output">
               <xsl:value-of disable-output-escaping="no" select="substring($vNewString,1,$totalLength)" />
            <xsl:value-of select="$output" />


we get:
001 20140401 1 1203040 10 PCE
001 20140401 2 2349040 20 PCE