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:
Incorrect structure of input parameters.
No value is specified for one of the input parameters. Empty table is considered as the specified value.
Error during function work. For example, could not write or read.
Difference between table resource on server and on mobile device:
The platform enables the user to create a table resource on server to work with table access function. It must have common delta cache for any set of input parameters. If input parameters are non-empty on request, refresh the cache.
Table resource response on a mobile device may be saved to local database. Mobile framework provides a easy-to-use wrapper to read and write to local database.
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:
During initialization, the mobile application requests the resource with empty parameters, that is, with empty tables as parameter values.
The server requests data source, gets list of goods in the response, caches directory, sends the directory to the mobile application.
The application gets the directory and saves it.
The application user removes the good.
The application requests with the specified parameter to delete a good.
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.
The application gets and processes delta.
Processing of button click in the application is finished.
See also:
Setting Up Integration with Table Data Sources | Basic SAP Procedure