Quantcast
Viewing all articles
Browse latest Browse all 1306

Pass values dynamically to the WHERE clause in SFAPI

Hi there

 

We have a requirement to pass values dynamically (in the run-time of the interface) to the WHERE condition to our SFAPI query.

 

Eg -

SELECT person, personal_information, address_information, phone_information, email_information, employment_information, job_information, compensation_information, paycompensation_recurring, paycompensation_non_recurring, job_relation, accompanying_dependent,         global_assignment_information, direct_deposit, national_id_card, person_relation

          FROM CompoundEmployee

          WHERE last_modified_on >= to_date('LAST_RUN_DATE')  AND

                       last_modified_on <= to_date('CURRENT_RUN_TIME') 

 

LAST_RUN_DATE is stored in a custom entity for which we execute another OData query. The custom entity is updated with the CURRENT_RUN_TIME once the interface has been executed successfully. So the next time the interface is run it picks up the LAST_RUN_DATE from the custom OData entity.

 

SAP PO has the functionality to run a dynamic query for OData adapters. Refer to Note 2051137 - PI Successfactors adapter : Dynamic odata query and single synchronous sfapi query

 

Eg - select fields from position (this is what you state in OData query path in the comms channel; this is static); and you have an advanced tab in comms channel where you mention dynamicquery and set it to true (this points to a XSD which has the keyword TOP, SKIP & FILTER in it).

 

This gets the filter values passed from the BPM from another query (from a OData cust_table).

 

So the whole query is - select fields from position filter field a = x field b = y etc. Field a field b are fields in position that are you passing values x and y in run time of the interface.

 

SAP PO also has the advanced tab feature for SFAPI for dynamic query.

 

Question is -

 

how to use it?

 

has anyone implemented this before?

 

What does XSD will look like?

 

How do we pass values to the fields to the Where clause for SFAPI.

 

Any ideas are welcome!

 

Regards

Arijit Das


Viewing all articles
Browse latest Browse all 1306

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>