Data Flow - Fetch

A fetch defines how the SAP Agentry Server synchronizes data for a target object collection. This object collection must be a top-level collection within the module. A fetch is made up of steps that retrieve the data for the collection from the back end system. These steps are grouped into three categories within the Fetch definition: Client Exchange Steps, Server Exchange Steps, and Removal Steps. A fetch may also include properties to store data captured from the user and validation rules for those property values.

The following diagram and steps depict what happens when the Agentry Client must load or reload a fetch.

Data Flow - Fetch

  1. A Server exchange steplet defined in a fetch calls the steplet doSteplet() method to fetch objects for the user.
  2. The doSteplet() method calls the appropriate method in the appropriate xxxStepHandler class.
  3. The xxxStepHandler method instantiates the necessary appropriate xxxFetchBAPI object, passing the User object and clientLastUpdate parameter to it.
  4. The xxxFetchBAPI constructor retrieves the JCo function object from the repository, using the connection on User.
  5. xxxFetchBAPI class sets BAPI import parameters IV_xxx and/or IS_xxx.
  6. xxxFetchBAPI constructor adds IT_xxx records to BAPI import tables for search criteria or other input parameters.
  7. xxxStepHandler method calls processResults() method from xxxFetchBAPI.
  8. xxxFetchBAPI processResults() calls execute() method on BAPI and checks for exceptions.
  9. xxxFetchBAPI processResults() reads appropriate ET_xx_RETURNS table for error messages.
  10. xxxFetchBAPI processResults() iterates over ET_xx_RETURNS table and reads records from the table.
  11. For each record, xxxFetchBAPI processResults() calls appropriate constructor in the appropriate SAPObject subtype.
  12. The SAPObject subtype constructor maps JCo record column names to field names.
  13. xxxFetchBAPI processResults() collects these SAPObjects in an array and passes it back to xxxStepHandler.
  14. xxxStephandler passes SAPObjects array back to steplet doSteplet().
  15. Steplet doSteplet() stores SAPObjects array in _returnData.
  16. Agentry application within the SAP Mobile Server parses _returnData and sends object collection up to Client.