Skip to Content
Author's profile photo Former Member

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


Document ObjectiveObjective 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

Lastest sca file : PICOASUF and PIADAPTERS.sca

Entity Type:

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.


  1. 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. 1. PI Enterprise Service Repository Configurations
  2. 2. PI Integration Directory Configurations
  3. 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. 1. Response Message will flow from SAP HCM to Successfactors
  2. 2. Response Message will flow from Successfactors to SAP HCM.

SAP HCM is SOAP – XI Proxy Sender Channel.

Successfactors is SFSF Receiver Channel.

Integration Scenario.PNG

Enterprise Service Repository:-

External Definition :


/wp-content/uploads/2014/10/1_554605.png



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.



/wp-content/uploads/2014/10/2_554606.png



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.

External Definition (This is generated from eclipse Juno – How to generate this xsd using Juno: Please follow my other blog).

URL to Blog: PI.SFSF Integration.DOC – How to Model Successfactors SOAP and ODATA Entities using Eclipse Juno Tool.




/wp-content/uploads/2014/10/3_554608.png



Service Interface

Outbound Service Interface:

/wp-content/uploads/2014/10/4_554609.png

Inbound Service Interface:


/wp-content/uploads/2014/10/5_554610.png


Message Mapping and Operation Mapping

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



Integration Directory:-

1. Sender Communication channel.


/wp-content/uploads/2014/10/6_554611.png



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 ).


/wp-content/uploads/2014/10/7_554612.png

/wp-content/uploads/2014/10/8_554613.png

3. I-flow


/wp-content/uploads/2014/10/9_554615.png


http://help.sap.com/nw-connectivity-addon101?current=nw-connectivity-addon101

https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/sno/ui_entry/entry.htm?param=69765F6D6F64653D3030312669765F7361706E6F7465735F6E756D6265723D3139363438363826

https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/sno/ui_entry/entry.htm?param=69765F6D6F64653D3030312669765F7361706E6F7465735F6E756D6265723D3139363438363826

Important Note:


SAP recently released patch to support pulling complete data from Successfactors with an upper limit of 25MB.

It will be good for customers if they can download latest PICOASUF and PIADAPTERS.sca from the SMP and apply both to the PI system.

Assigned Tags

      7 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Bhavesh Kantilal
      Bhavesh Kantilal

      Hello,

      Is there a document that provides a list of operators supported by the Dynamic Query $Filter?

      I am trying to use a like operatore in my Filter but the same fails with a error:

      org.apache.olingo.odata2.api.uri.expression.ExpressionParserException: Invalid token "like" detected after parsing at position 10 in "username like '%25admin%25'

      Regards,

      Bhavesh

      Author's profile photo Former Member
      Former Member

      Hi Prabhat

      Can you please tell me how are u generating dynamic query?

      Where you are using dynamic query in receiver adapter ?

      you have mentioned your scenario is a pass through one.

      Thanks,

      Indrajit

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Dymanic Query Paramter true means whats ever filter value will come in structure it will directly add this value to query mentioned in Communication Channel.

      In my case we were sending dynamic query using SAP Proxy Side. in filter field.

      Author's profile photo Former Member
      Former Member

      Hi Prabhat,

      Could you provide sample xml for QueryStringOptions having example with field values to understand the format of filter field passed over payload part "<xsd:element name="filter" type="xsd:string" minOccurs="0"/>


      Regards

      Deepak

      Author's profile photo Nimrod Gisis
      Nimrod Gisis

      Well done my firend.

      Author's profile photo Former Member
      Former Member

      Is there a similar approach for SFAPI? I have to query CompoundEmployee XSD which is a SFAPI.

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Yes Same Approaach for oData and SOAP.