Fetch More than 800 Records from SAP SuccessFactors Using the queryMore Operation in SFQL

If you need to fetch more than 800 records at a time from SAP SuccessFactors, use the queryMore operation.

The SFQL query object retrieves the first 800 records from SAP SuccessFactors and creates a server-side querySessionId. The queryMore (SFQL) call processes subsequent records in up to 800-record chunks and returns a newly-generated querySessionId in the SAP SuccessFactors response. To iterate through records in the result set, you generally call queryMore (SFQL) repeatedly until all records in the result set have been processed (the hasMore flag is true). The while loop is exited only after no more records are returned by the query when the hasMore flag is false.

The response returned by SAP SuccessFactors for the SFQL operation has the following structure:
numResults
hasMore
querySessionId
  • numResults: The numResults variable contains the number of records retrieved from SAP SuccessFactors.

  • hasMore: The hasMore response is a boolean value. If it returns true, there are more records available to fetch. If it returns false, there are no more records available to fetch.

  • querySessionId: The querySessionID stores the value of the last record retrieved from SAP SuccessFactors. Initially, it has no value; the local querySessionID is initialized with empty single quotes ('').

Perform the following steps for implementing the queryMore operation in Oracle Integration:
  1. Log in to Oracle Integration.

  2. Create SOAP Adapter and SAP SuccessFactors Adapter connections.

  3. Create an orchestrated integration.

  4. Drag and drop an SOAP Adapter from the Triggers section to the trigger side and configure it.

  5. Drag and drop an assign activity from the Actions section and create the following two variables:

    • $hasMore ----- hardcode hasMore= “true”

    • $querySessionId ---- hardcode with an empty value

  6. Drag and drop a while loop activity and specify the condition hasMore =’true' in the while loop.

  7. Drag and drop the SAP SuccessFactors Adapter inside the while loop and configure it with the following SFQL query. The query can be a normal or bind query.

    Query : Select status from the user
    Bind Query : Select status from the user where status='&status'
  8. Create a mapping between the SOAP AdapterSAP SuccessFactors Adapter and the SAP SuccessFactors Adapter with the variable that you created in the assign activity for “hasMore”.

    hasMore(Variable)----------> status (Query input parameter)
  9. After request mapping is completed, drag and drop one more assign activity next to the SAP SuccessFactors Adapter inside the while loop, and assign the queryMore response to the variables that you created in the first assign activity as follows:

    $querySessionId ------>    nsmpr2:querySessionId
    $hasMore--------------->   nsmpr2:hasMore
  10. Check the response received from SuccessFactors. The condition is first checked. If the condition is satisfied, the records are fetched.

    • If the hasMore value is true, then it enters into the while loop.

    • If the hasMore value is false, then the condition is not satisfied and the while loop is exited.

    This completes the invoking of the queryMore operation in SuccessFactors. Further in your orchestration, you can add adapters and activities as per your business requirement.