Configuring WebSphere Adapter for SAP Software to interact with SAP CRM

This article explains how to configure the external interface adapter within the Customer Relationship Management - SAP® CRM - to convert BDOCs to IDOCs, which can be consumed by WebSphere® Adapter for SAP Software.


Somya S. Grama (, Software Engineer, IBM

Photo of Somya S. GramaSowmya S. Grama is an L3 support lead and developer for IBM WebSphere Adapters for SAP Software and works at the IBM India Software Labs. She has seven years of experience in IBM working on different technologies and various products such as Adapters, Business Process Management suite of products, ITUAM, WebSphere Portal, and IBM Content Manager.

12 December 2012


IBM® WebSphere Adapters deliver generic technology and business application adapters with wizards that quickly and easily service enable legacy applications, ERP, HR, CRM, and supply chain systems. WebSphere Adapter for SAP software is one such adapter that provides highly functional connectivity and valuable administration and monitoring functions. The SAP adapter supports all of the key SAP R/3 interfaces and offers bi-directional, real time integration between SAP R/3 and other systems, including e-commerce, customer relationship management, supply chain management, enterprise resource planning, and custom and legacy applications. On the inbound, the adapter supports Advanced Event Processing (AEP), BAPI, ALE, ALE pass through interfaces. On the outbound, it supports interfaces like the BAPI, AEP, QISS, ALE, ALE pass through, BAPI Work unit and BAPI Resultset.

Acryonyms used in this article:

  • CRM: Customer Relationship Management
  • ERP: Enterprise resource planning
  • HR: Human Resources
  • AEP: Advanced Event Processing
  • BAPI: Business Application Programming Interface
  • ALE: Application Link Enabling
  • QISS: Query Interface for SAP Software

SAP CRM uses business document (BDOC) technology for internal data distribution within the system. The external display of the interface information is in the form of an IDOC, XML, or ASCII file. SAP CRM contains a component called the External Interface Adapter (XIF) that allows you to interface between SAP CRM and external systems. The XIF Adapter manipulates and populates the outbound and inbound messages. There are two types of delivery possible with XIF adapter: SOAP/XML and ALE/IDOC.

WebSphere Adapter for SAP Software can handle IDOCs by leveraging the XIF adapter in SAP CRM to convert BDOC to IDOC. This provides an additional integration option for the SAP adapter to connect to SAP CRM and fetch the BDOC data indirectly.


This article assumes that you have a system ready with:

  • IBM Integration Designer V7.5 and IBM Business Process Manager V7.5 Advanced Edition
  • WebSphere Adapter for SAP Software V7.5
  • Access to an SAP system with pre-configuration of IDoc/BAPI processing
  • SAP CRM basics
  • A basic understanding of IBM Integration Designer, Process Server, and WebSphere SAP Adapter. For more information on these topics, see the Resources section at the end of the article.

SAP CRM side configurations

This section describes the details required to configure an existing function module that passes the BDOC message to the ALE layer.

Setting up the BDOC

In this article, you will use the standard BDOC in CRM. The BDOC technology is used in the background. The external display of the interface information occurs via an IDoc, XML, or ASCII file. The CRM middleware and BDOC technology are used for the internal data transfer in the CRM system.

The following steps describe how the settings on SAP CRM need to be configured so that BDOCc can be consumed by adapter as an IDOC.

  1. Go to TCODE - BDFG in the SAP CRM system.
  2. Enter the Function Module as CRMXIF_PARTNER_REL_SAVE and press Enter. The corresponding business object and relevant message types are displayed as shown in Figure 1.
    Figure 1. Creating a Function Module
    Creating a Function Module
  3. Click on the Display button to see the generated ALE interfaces as shown in Figure 2.
    Figure 2. View of generated ALE Interface
    View of generated ALE Interface
  4. Go to tcode WE30 to view the IDOC that corresponds to the business partner MDOC. The IDOC used is "CRMXIF_PARTNER_SAVE_M03".

Note: A new BDOC or extended BDOC can be created. BDOCs are created in such a way that they need to have an ALE interface layer generated along with a custom IDOC to include the new attribute, in addition to the BDOC. You also need to create the Business Add-Ins (BADIs) implementation for the newly added attributes for the mapping

Setting up ALE

In this section, we describe how to configure the logical system, the RFC destination, the Partner profile, ALE ports, and the distribution model.

Logical system setup

  1. Start Transaction BD54.
  2. Enter a new logical system as shown in Figure 3.
  3. Ensure that an entry for the Logical System CM1CLNT100 exists. This logical system must be assigned to CRM Client 100 (see Transaction SCC4 - Client Maintenance).
    Figure 3. Logical Systems
    Logical Systems

Create an RFC Destination setup

  1. Start Transaction SM59.
  2. Create a new RFC Destination of Type "T" (TCP/IP Connection) as shown in Figure 4.

Create an ALE Port

  1. Start Transaction WE21.
  2. Create a new ALE Port of type transactional "RFC".
    Figure 4. TRFC ports
    TRFC ports

Create an ALE Partner Profile

  1. Start Transaction WE20.
  2. Create a partner profile of "SOWMYALS" of type LS (Logical System) as shown in Figure 5.
  3. Enter the message types CRMXIF_PARTNER_SAVE_M and SYNCH for the outbound.

    Note: The message type "SYNCH" with IDOC type "SYNCHRON" are added to the partner profile as well.

    Figure 5. Outbound Partner Profile
    Outbound Partner Profile
  4. Enter the message type CRMXIF_PARTNER_SAVE_M for the inbound as shown in Figure 6.
    Figure 6. Inbound Partner Profile
    Inbound Partner Profile

Create a Customer Distribution Model

  1. Start Transaction BD64.
  2. Create a distribution model as follows (see Figure 7):
    1. Sending System: CM1CLNT100
    2. Receiving System: SOWMYALS
    3. Message Type(s): CRMXIF_PARTNER_SAVE_M
  3. Perform a Technical Consistency Check for the model in Transaction BDM5. Switch off the cross-system checking when performing this check.
    Figure 7. Distribution Model
    Distribution Model

Setting up the External Interface Adapter (XIF)

SAP CRM contains a component called the External Interface Adapter (XIF), which allows you to interface between SAP CRM and the external systems.

Create a new site

Create a new site on the SAP CRM, administration console.

  1. Start Transaction SMOEAC > Administration Console.
  2. Create a new site ZSITE01 of the type External Interface for the IDOCs as shown in Figure 8.
    Figure 8. XIF Admin Console
    XIF Admin Console
  3. In the Site Attributes, enter the ALE Partner profile SOWMYALS created earlier, thereby creating a link between the XIF site and the ALE Partner profile.

Create a new subscription

In the same transaction SMOEAC, you need to create two new subscriptions as shown in Tables 1 and 2.

Table 1. Subscription 1 details
Publication All Business Partners (MESG)
Assign to Site ZSITE01
Table 2. Subscription 2 details
Publication All Business Partner Relationships (MESG)
Assign to Site ZSITE01

Assign a site ID to the interface type

  1. Start Transaction CRMXIF_C1.
  2. Enter two new entries in the table as shown in Figure 9.
    Figure 9. Assign a Site ID
    Assign a Site ID

This table links the mBDoc type to the respective External Interface (XIF) Function Module.


In this section, we describe how we can test both Inbound and Outbound scenario's between SAP and SAP adapter to handle BDOC.

Running the interface for inbound testing

In this section, you will send the data in CRM created as a BDOC, convert it to IDOC via the XIF adapter so that it is ready to be consumed by WebSphere Adapter for SAP Software.

The steps mentioned for running the interface assume that you are using the SAP GUI for user interaction. You can also use the CRM Web GUI for running this interface. Although the menus and navigation paths are different in the Web GUI, you still get the same results. The Business Partner numbers mentioned here are specific to the system in which it was tested.

  1. Start Transaction BP.
  2. Create a business partner in the Role Ship-To Party () page as shown in Figure 10. Enter the relevant data and press Save.
    Figure 10. Create a Business Partner
    Create a Business Partner
  3. Business Partner 11 is created in the role (Ship-To Party) as shown in Figure 11.
    Figure 11. Sample Business Partner
    Sample Business Partner
  4. Go to SMW01 and see the MDOC created and its status as shown in Figure 12. A green color indicates it has processed. Figure 13 shows a BDOC message status.
    Figure 12. BDOC message
    BDOC message
    Figure 13. BDOC message status
    BDOC message status
  5. In WE02, you can see the IDOC created that is consumed by the adapter, as shown in Figure 14.
    Figure 14. Display IDOC
    Display IDOC

    Note: If the Mdocs are in the yellow status, then go to Transaction MW_MODE, set it to "On", and save it as shown in Figure 15.

    Figure 15. Middleware Activation Mode
    Middleware Activation Mode

Running the interface for outbound testing

Follow the steps in this section to configure the adapter and to post an IDOC message to SAP CRM, which internally gets converted to a Business Partner BDOC message.

  1. Configure the adapter for the "CRMXIF_PARTNER_SAVE_M03" IDOC. Each time the adapter sends request to SAP to create business partner a new GUID needs to be generated.
  2. Add the message type CRMXIF_PARTNER_SAVE_M in the inbound parameter of WE20.
  3. Execute FM GUID_CREATE, copy the highlighted GUID, and pass in the input XML for the outbound call. The sample input XML is provided in the Download section of the article.
  4. Once the outbound call is successful from the adapter, you can see an IDOC and the corresponding BDOC.
  5. Go to Transaction SMW02 to view the Business Partner BDOC message created from the adapter, as shown in Figure 16.
    Figure 16. BDOC created by Adapter
    BDOC created by Adapter


In this article, you learned how data from CRM can be consumed or sent by WebSphere Adapter for SAP Software with minimal configuration on the CRM side. The conversion of BDOC to IDOC provides the same functional behavior as you had seen before with IDOC processing in addition to another representation called BDOC. This conversion gives you the flexibility to seamlessly connect to SAP CRM.


Code sampleCRM_Input_XML.zip7KB





developerWorks: Sign in

Required fields are indicated with an asterisk (*).

Need an IBM ID?
Forgot your IBM ID?

Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.


The first time you sign into developerWorks, a profile is created for you. Information in your profile (your name, country/region, and company name) is displayed to the public and will accompany any content you post, unless you opt to hide your company name. You may update your IBM account at any time.

All information submitted is secure.

Choose your display name

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

Required fields are indicated with an asterisk (*).

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.


All information submitted is secure.

Dig deeper into WebSphere on developerWorks

ArticleTitle= Configuring WebSphere Adapter for SAP Software to interact with SAP CRM