on 2024 Jan 29 5:44 AM
Dear Experts,
I generated the offline code using SAP BTP SDK wizard from android studio, Now i want to call the multiple collections in one screen for example : Products and Typesets in single screen, I tried using data query but it is not working , can any one explain how to call the data quey using data service in wizard generated code .
Thanks,
Delli
Request clarification before answering.
Hello Delli,
Could you please show the specify errors you got? And what is the version of the SDK that you were using?
There is a "WizardAppReadme.md" file in the generated application for you to get started with the DataService and DataQuery.
Normally in the application generated by the assistant, you can get the DataService in OfflineWorkerUtil object.
You can check the generated source for how this DataService was initialized.
Once you get the DataService instance, you then can use DataService.executeQuery API to query the date you want.
https://help.sap.com/doc/f53c64b93e5140918d676b927a3cd65b/Cloud/en-US/docs-en/reference/android/java...
Thanks,
Bruce
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bruce ,
Thanks for the reply.
In OfflineWorkerUtil class i am able to see the Data Service , but i am not able to access that Dataservice in another class . Please find the below code snippet in OfflineworkerUtil
* OData service for interacting with local OData Provider
*/
private static SFGW_ALL_Entities sFGW_ALL_Entities;
@NonNull
public static SFGW_ALL_Entities getSFGW_ALL_Entities() {
if (sFGW_ALL_Entities == null) {
throw new NullPointerException("sFGW_ALL_Entities was not initialized.");
}
return sFGW_ALL_Entities;
}
Kindly guide me how to access this in another class
Thanks ,
Delli
Hello Deli,
You may want to go through the tutorial fist,
https://developers.sap.com/tutorials/cp-sdk-android-wizard-app-offline.html.
It is not possible to understand what is the the code snippet your shared means without the sample project.
Could you please share more details?
Thanks,
Bruce
It looks like the generated DataService proxy class is named "SFGW_ALL_Entities" in your project, right?
The source code of SFGW_ALL_Entities is automatically generated after you make the build. You can find all the available APIs in that SFGW_ALL_Entities class(usually under the app/build/generated/source folder).
With that SFGW_ALL_Entities object instance you can make any odata query on the local db to suit your needs, thanks.
Hi Bruce ,
Thanks for your reply ,
It looks like the generated DataService proxy class is named "SFGW_ALL_Entities" in your project, right? : Yes , SFGW_ALL_Entities is the proxy class
When i am trying to create the instance , it is giving me the error like unable to access the SFGW_ALL_Entities,
Can you guide me how to access the Data service class in another class
Thanks ,
Delli
User | Count |
---|---|
57 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 | |
4 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.