How to integrate SAP xMII with SAP ERP

You can accomplish communication between ERP and xMII in several ways. This tip from SAP Developer Network walks through all the major methods, including using a BLS transaction as a Web service or HTTP service, sending IDocs, and more.

Many times I have faced the question of how SAP ERP can communicate with SAP xMII and vice-versa. To list, there...

are quite a few ways for ERP-xMII communication. We'll discuss them one-by one.


  1. BLS transaction as a Web service
  2. Any xMII BLS transaction can be called as a Web service in the following way: The URL http://<server>:<port>/Lighthammer/WSDLGen/<transactionname> generates the WSDL for the Web service (BLS transaction as specified in the URL as <transactionname>). You can run the transaction as a Web service by the following URL:
    http://<server>:<port>/Lighthammer/SOAPRunner/<transactionname> For authentication, you can use the xMII username and password, which has reader/writer roles assigned to that transaction. Assign the login user and password to the input params itself, as xMII doesn't support basic authentication. To call a BLS transaction from ABAP as a Web service, you need to create a proxy for the Web service in ABAP. You can do this with ABAP T-code SE80 (ABAP Workbench) by create -> Enterprise Service/Web Service -> proxy object. Select the URL option and enter the BLS Web service's WSDL URL :

    Select the package and a prefix to generate the proxy classes. Call the proxy class method execute_synchronous or execute_asynchronous to call the xMII BLS as a Web service.

  3. BLS transaction as an HTTP service
  4. Any xMII BLS transaction can be called as an HTTP service by the following URL pattern:
    http://<server>/Lighthammer/Runner?Transaction=<transaction name>&XacuteLoginName=<user>&XacuteLoginpassword=<password>&<input param name>=<input param value>

    Use the ABAP class CL_HTTP_CLIENT (create_by_url, send and receive methods can be used to call a HTTP URL) to execute the BLS transaction.

  5. Sending IDocs from ERP to xMII
  6. IDOCs can be sent to xMII using the the xMII IDOC Listener, which is configured at the xMII menu path : Data Services -> IDOC Listener. First, configure the logical system, logical port, RFC destination and partner profile in ERP and use the same information to configure the IDoc Listener in xMII. You can also define a processing rule (a BLS transaction in xMII to process the IDOC message) in xMII. The IDoc messages received in xMII are saved as XML files in the folder specified in the processing rule. Similarly, using the xMII IDoc listener RFC data can also be passed to xMII from ERP. These communications using xMII IDoc listener are asynchronous in nature.

To communicate the other way around, the ABAP RFC/BAPI or Web services can also be called from xMII Business Logic Transaction using the JCO action blocks or the Web service action block respectively.

  1. Executing ERP RFC/BAPI from xMII

    Using the JCO action block, any ERP RFC/BAPI can be executed from xMII. Create the configuration for the ERP JCO system in Data Services -> SAP Server Configuration. Enter the SAP server details and login details to be used by the JCo action block in BLS. Then configure a JCo action block in BLS and select the SAP server configured previously from the drop-down. Enter the RFC/BAPI name or search pattern and select the required RFC/BAPI from the search result. Once you click ok and close the dialog box, the RFC input and output parameter structures will get created automatically in the xMII JCo action block based on the RFC metadata. Map the input and output parameters as required and the RFC/BAPI will get executed from SAP ERP while executing the BLS transaction.

  2. Calling ERP Web services from xMII
  3. Any ERP Web service canxMII using the Web service action block in BLS transaction. Copy the WSDL URL of the Web service from the wsnavigator, and in xMII's BLS transaction Web service action block, enter it in the Web service location URL and click Next to select the port and operation. The input and output parameter structures will get created automatically in the xMII Web service action block based on the WSDL.

    Map the input and output parameters as required and the Web service will get executed from SAP ERP while executing the BLS transaction. This feature may not work for Web services with a nested structure due to an issue in the Web service action block in xMII, which is hoped to get resolved in the next xMII patch release.

Dipankar Saha is an Advisory System Analyst working for IBM India

This content is reposted from the SAP Developer Network.
Copyright 2007, SAP Developer Network

SAP Developer Network (SDN) is an active online community where ABAP, Java, .NET, and other cutting-edge technologies converge to form a resource and collaboration channel for SAP developers, consultants, integrators, and business analysts. SDN hosts a technical library, expert blogs, exclusive downloads and code samples, an extensive eLearning catalog, and active, moderated discussion forums. SDN membership is free.

Want to read more from this author? Click here to read Dipankar Saha's Weblog. Click here to read more about SAP xApps on SDN.


Dig Deeper on SAP integration