Skip to Content

This blog outlines steps required for exchanging IDocs with non-SAP systems over TCP/IP using PI as Middleware. This blog will cover following scenarios.

 

  1. A non SAP system sends data using SOAP protocol to PI, which in turns send it to a non SAP system in form of IDocs.
  2. A non sap system sends IDocs to PI system over TCP/IP protocol. PI in turn sends it to another non SAP system over SOAP protocol.

 

There are several non SAP systems which are capable of sending/Receiving IDocs over TCP/IP protocol.

Here we had to exchange IDocs with non-SAP system SQL*LIMS which is capable of exchanging IDocs over TCP/IP. LIMS uses IDoc Interface to connect to any external system.

 

Here we had created Z-Idocs as per the requirements. I will use SOAP to IDoc & IDoc to SOAP scenarios. I will explains only the necessary steps for exchanging Idocs with non SAP system over TCP/IP and will skip steps like data types, mappings etc.

 

This is how IDOCs look like:

image

 

 

The control record section of an IDOC contains routing information. There might be multiple SAP systems using the same SAP gateway. The IDOC control record can be used to address a specific SAP system. Furthermore, it identifies the sender system, allowing the target SAP instance to activate the correct logic subsystem to process the inbound message.

 

The data record defines the structure to hold the actual information to exchange. Data records are organized on a per-line basis: each line contains a short header plus segments and fields. The short header identifies the record-type for the current line. Then there is the segment, which contains fields. The same IDOC can contain multiple data records, each one containing its own specific segment with a specific segment type.

                               

SAP is capable of producing a text file with the description of a specific IDOC type. This file is called “Parser File”.  External applications can process parser files in order adapt to the structure of the relating IDOC types and this is usually done during the initial configuration process of the interfaces.

This is how a parser file looks like:

 

image

 

For a standard IDOC, we can go into WE60, give the basic type and press F9 to get the parser file.

For a custom IDOC we should release all the segments of the IDOC before we can create a parser file.

 

LIMS IDoc interface includes a module that can parse the SAP Parser Files. Using the SAP Parser Files, it will be possible to describe the content of a specific IDOC type (be it standard or custom, basic or extended) to the SQL*LIMS. Specific tables will be created in order to store that specific IDOC type, enabling the developer to fetch the content of specific fields in the IDOC by means of classical “select” SQL statements.

  

 

A – Sending the IDOC to the LIMS:

Here a third party non SAP system will send data via SOAP to SAP PI. PI will convert it into IDoc xml and send the IDoc to LIMS via TCP/IP protocol.

LIMS inbound IDOCs will be received by means of a background Windows 32bit service, the IdocReceiver service.

 

The IdocReceiver service, which is part of the Transport Layer, performs the following actions:

 

  1. Listens for LIMS inbound IDOCs
  2. Creates new inbound requests in the transactions table with status “DOWNLOADING”
  3. Saves the downloaded IDOC as a plain-text clob attachment to the transaction
  4. Changes the status of the request to “RECEIVED”, in order to pass it to the IdocAgent service for processing.

 

Error messages generated by the IdocReceiver service will be saved in the service’s log file.

IDoc received by LIMS are stored into the SQL*LIMS Oracle database in a way that its content can be easily extracted by means of SQL “select” statements

The wrapper package “ABI_IDOC_SL_WRAPPER” is used to perform the requested actions into the SQL*LIMS application. 

 

image

 

Following are the important configurations steps that are necessary for sending IDocs to LIMS system.

 

1. Create the Business System for the Non SAP system in SLD (System Landscape Directory) with the logical system name mentioned in the Business System.

Note – The logical system name should be other than SAPXXX. Here in our example the logical system name of the Business system is LS_LIMS as shown below. 

 

image

 

 

2. Create a TCP/IP connection (MYDEST) of type T in transaction SM59 in the PI system. The program ID should be register on SAP PI system. Take help of your basis team to register the program ID on PI server

 

 

image

 

 

3. Create the Port in PI in the transaction IDX1. The port name should be same as Logical system name of the business system defined in SLD (i.e. LS_LIMS).  See troubleshooting section for the reason for having.  We will use this Port name in the SNDPOR control record field of IDOC.

 

 

image

 

4. Configure the IDOC Receiver communication channel in PI for sending the IDOC to the LIMS system.

 

image

 

Rest of the objects like Mappings, Receiver determination etc. are straight forward hence I will skip them.

Testing:  A third party non- SAP system sends data to PI via SOAP. PI converts it into IDoc and sends it to LIMS. Check in Transaction SXMB_MONI to verify the status of the message as shown below.

 

image

 

Also check in transaction IDX5 to monitor IDoc message as shown below. 

 

image 

 

 

B. Receiving the IDOC from the LIMS system:

 

Here a LIMS system will send IDocs to SAP PI via TCP/IP protocol. PI will convert IDoc xml into SOAP message and send it to another third party non-SAP system using SOAP.

The SQL*LIMS will create the IDOC into the SQL*LIMS Oracle database with direction “Outbound” from SQL*LIMS, and status as “REQUESTED”.

 

The LIMS SAP IDOC Interface will then:

1. Build the IDOC from the Oracle tables;

2. Send the IDOC to the target SAP system.

 

LIMS Outbound IDOCs will be created by means of PL/SQL procedures/functions/packages called as status actions or events.

 

As soon as a new outbound transaction is created, its status is set to “CREATING”. During this stage of the process, segments and fields will be added to the IDOC into its internal database tables.

When all the segments and fields have been entered for the current IDOC, the status of the current transaction is set to “REQUESTED”.

 

A specific API (PL/SQL package “ABI_IDOC_BUILDER”) allows building the IDOC from its internal tables. At this stage, the status of the transaction is set to “BUILDING”. At the end of this process, the IDOC will be saved as a plain-text clob attachment to the transaction, whose status will be set to “READY”.

 

When the new transaction is submitted, its status changes to “READY”.

The IdocSender Windows 32bit service will load the IDOC from the relating clob attachment and send it to the target SAP system.

Upon successful completion of sending the IDOC to the SAP, the status of the transaction is set to “COMPLETE”.

 

 

 

image

The Configuration steps are similar to those mentioned above and are highlighted as follows:

1. Create the Business System for the LIMS system in SLD (System Landscape Directory) with the logical system name (Other Than SAPXXX) mentioned in the Business System.  Refer Step 1 above.

2. Create a TCP/IP connection (MYDEST) of type T in transaction SM59 in the PI system. The program ID should be register on SAP PI system. Refer Step 2 above.

3. Create the Port in PI in the transaction IDX1. The port name should be same as Logical system name of the business system defined in SLD (i.e. LS_LIMS).  See troubleshooting section for the reason for having.  We will use this Port name in the SNDPOR control record field of IDOC.

4.  The IDoc received from Non sap system will be mapped and converted into SOAP xml and will be sent to another third party system using SOAP protocol. The receiver SOAP channel is as shown below.

 

image

 

Give following system details to the LIMS system for connection to PI. Details include:

—  Server full name  

—  Sap System Number

—  Gateway Service

—  Client

—  Program ID

 

While sending IDoc, the non SAP system will send following Values in the Control record of IDOC.

  •         RCVPOR  = SAPXXX
  •         RCVPRT  = LS
  •         SNDPOR  = LS_LIMS
  •         SNDPRT  = LS
  •         SNDPRN  = LS_LIMS
  •         MESTYP  = message type
  •         IDOCTYP = IDoc type.

 

 

Rest of the objects like Mappings, Receiver determination etc. are straight forward hence I will skip them.

Testing:  Here LIMS will send IDocs to SAP PI using TCP/IP. Verify the status of the message in Transaction SXMB_MONI

  

 

image

 

Check the Payload of the incoming message for the control record information as shown below.

  

image

 

Check the IDoc Message in transaction IDX5 in the SAP PI system.

 

 image

  

 

 

Troubleshooting:  While triggering data to SAP PI, sender LIMS application was getting following error message “No service for system SAPXXX client in Integration Directory”

 

Solution:  This is traced from the Transaction SM21 where the error is logged with the following solution

                                                    

image

To report this post you need to login first.

3 Comments

You must be Logged on to comment or reply to a post.

Leave a Reply