Basic CRUD Procedure

Table data sources provide API for function call. The data source contains a table that must be read and changed in the client. Currently, the platform enables the user to solve such problem using two functions: the first provides reading, the second provides changing. There is an approach to creation of the function that can read and change at the same time. This approach automatically synchronizes data between the client and the server.

The data source contains a table that cannot be directly accessed. To work with the table in the platform, use a specially created function to access the table with the parameters:

Parameter type Parameter name Description
Input upsert_rows The table, which structure matches basic table structure. Rows from this parameter are inserted into the basic table. If the primary keys match, the basic table is refreshed.
delete_ids One column table. Parameter type and name match the type and name of basic table primary key. Deletion must be executed after the "upsert" parameter is processed.
Output No name Basic table.

The function returns error in the following cases:

Difference between table resource on server and on mobile device:

Example

The data source contains a table with goods list. An access function is created for the table. The appropriate resource is loaded to the platform.

Algorithm execution example:

  1. During initialization, the mobile application requests the resource with empty parameters, that is, with empty tables as parameter values.

  2. The server requests data source, gets list of goods in the response, caches directory, sends the directory to the mobile application.

  3. The application gets the directory and saves it.

  4. The application user removes the good.

  5. The application requests with the specified parameter to delete a good.

  6. The server requests the data source to delete a good. The server gets a full refreshed list of goods in the response. The server refreshes cache and sends delta to the application.

  7. The application gets and processes delta.

  8. Processing of button click in the application is finished.

See also:

Setting Up Integration with Table Data Sources | Basic SAP Procedure