Skip to Content
Author's profile photo Former Member

Synchronizing SAP CRM data to external systems via SAP PI



     The data exchange between CRM Middleware and external systems (non-SAP) is performed via XIF adapter. In outbound process, creating or changing a data object, a mBDoc is created and transferred to CRM Middleware. External receivers for the mBDoc are determined within CRM Middleware and are transferred to XIF adapter together with mBDoc. SAP PI provides a client proxy structure in SAP CRM to send the data to PI, from there it will send to the appropriate receiver. The data in mBDoc is converted in the XIF adapter into a PI client proxy structure. Series of interface function modules are maintained for each BDoc type in CRMXIF_BDOCIF table in CRM. CRMXIF_<IF_TYPE>_MAPSEND (i.e CRM_XIF_IBASE_MAPSEND) function module calls the appropriate interface function module to deliver data to appropriate channel (PI, XML, IDoc….etc). Each interface function module maintains certain naming conventions CRMXIF_<IF_TYPE>_IDOC_SEND, CRMXIF_<IF_TYPE>_XML_SEND and CRMXIF_<IF_TYPE>_XI_SEND based on their method of communication. Standard SAP system does not provide PI interface function modules for all BDoc types. This blog is going to shed some light on how to enable PI integration through some customizing and custom development.



Implementation steps to setup PI integration through XIF adapter:

Note: IBASE BDoc type has been chosen in the following steps as an example, however, the same steps will be applicable for any BDoc type.

  1. Tcode: SBDM (OR) Architecture and Technology ® Middleware ® Development ® Meta Object Modeling ® BDoc Modeler
  •      Choose Goto ® Site Type Mapping.


The Maintain Table Views: Initial Screen appears.

  • Choose Maintain.

The Determine Work Area: Entry dialog box appears.

  • Enter the name of the BDoc type.

The View for BDoc type/Site type mappings: Overview screen appears. To map a BDoc type to a site type, the BDoc type must be active.

  • Choose New Entries.


  • In the Site Type ID field, enter the site type ID.

Choose Save.

    2. Copy CRMXIF_IBASE_XML_SEND to ZCRMXIF_IBASE_PI_SEND, add appropriate code to convert BDoc structure to PI proxy structure and call the PI proxy.

    3. Copy CRMXIF_IBASE_MAPSEND to ZCRMXIF_IBASE_MAPSEND, add additional condition to call the ZCRMXIF_IBASE_PI_SEND FM for PI


     4. Change the standard (pertains to CRM_IBASE_MESS BDoc type) CRMXIF_IBASE_MAPSEND with custom ZCRMXIF_IBASE_MAPSEND FM in the  CRMXIF_BDOCIF table.



Assigned Tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.