PI.SFSF Integration.DOC – SFSF OData Dynamic query “$filter” clause at runtime.

Document Objective: Objective of this document is to providing information about “How to Build SFSF OData query “filter Clause” dynamically at runtime using SAP PI synchronously?”

PI Version 7.4 Single Stack.
Connectivity add on 1.0
Patch OData
Entity Name: SFOData.EmployeeTime
Operation Type Query
Operation Query dummy-tableName?$select=dummy-fieldNames &$filter=dummy-filterCondition.

Normally SFSF OData Sender and Receiver Communication channel supports a hard coded Query.

e.g.
Operation Type: Query
Operation Query: dummy-tableName?$select=dummy-fieldNames &$filter=dummy-filterCondition.

Now as you see in above query filter expression and condition is also included as part of actual written query in Communication Channel (hard-coded).
But our requirement is to build and add this filter expression and condition at runtime rather than doing as fixed/hardcoding.

This document provides an example of main steps required to build interface in SAP PI. This is further divided into following three steps:-
1. PI Enterprise Service Repository Configurations
2. PI Integration Directory Configurations
3. Unit Testing of Scenario.

Brief about Technical Scenario:

SAP HCM is sending Employee Numbers to SAP-PI. Based on this request message a dynamic where/filter clause will be formed in Message mapping then it will be appending with actual Query on runtime and will be sent to Successfactors.

Synchronous scenario flow would be as follows:-

1. Response Message will flow from SAP HCM to Successfactors
2. Response Message will flow from Successfactors to SAP HCM.

SAP HCM is SOAP – XI Proxy Sender Channel.
Successfactors is SFSF Receiver Channel.

PI.SFSF Integration.DOC  – SFSF OData Dynamic query “$filter" clause at runtime.

Enterprise Service Repository:-
External Definition :

PI.SFSF Integration.DOC  – SFSF OData Dynamic query “$filter" clause at runtime.

Request Message will from SAP HCM to Successfactors

External Definition (This is delivered by SAP in their latest patch). I have attached external definition along with this document.
I have attached it in txt format. so before using it save it in xsd format and use it.

PI.SFSF Integration.DOC  – SFSF OData Dynamic query “$filter" clause at runtime.

Note (Just for others information)
You can also create your own data type name, message type but name and its namespace should be fixed as defined by SAP.

Response Message flow from Successfactors to SAP HCM.

PI.SFSF Integration.DOC  – SFSF OData Dynamic query “$filter" clause at runtime.

Service Interface

Outbound Service Interface:

PI.SFSF Integration.DOC  – SFSF OData Dynamic query “$filter" clause at runtime.

Inbound Service Interface:

PI.SFSF Integration.DOC  – SFSF OData Dynamic query “$filter" clause at runtime.

Message Mapping and Operation Mapping

My is pass-through Scenario so no message and operation mapping required.

Integration Directory:-

1. Sender Communication channel.

PI.SFSF Integration.DOC  – SFSF OData Dynamic query “$filter" clause at runtime.

2. Receiver Communication Channel.

Focus on Target Channel Arrow and Double Click.
Channel Properties will be Open.
Choose AdapterType as Successfactors
Message Protocol as SOAP ( Note : For OData choose OData Message Protocol).
Fill the neccessry information.
Eg. Address of SFSF DataCenter . In our case it is API5.
Company ID – User – Password ( Ask above information from SFSF Configuration Expert ).

PI.SFSF Integration.DOC  – SFSF OData Dynamic query “$filter" clause at runtime.

PI.SFSF Integration.DOC  – SFSF OData Dynamic query “$filter" clause at runtime.

3. I-flow

PI.SFSF Integration.DOC  – SFSF OData Dynamic query “$filter" clause at runtime.