cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Create an offline mobile app using successfactors odata api

vhsbc92
Explorer
0 Kudos
749

Hello everyone,

I'm trying to an offline mobile application using SAP SuccessFactors OData API and I've been facing some problems to retrieve the data.

I've done all the configuration settings inside mobile cockpit, I can get the metadata from MBT URL generated by Mobile Connectivity configuration, I also can retrieve the data. But when I open the app, I can't see the data there, just an empty table.

I've tried to use offline data store and http rest connection, didn't work.

I've been seeing some videos, but everyone uses the sample odata service provided by Mobile Sample OData ESPM feature. I've tried government's public odata and I can retrieve. There is something wrong I must have been doing.

I appreciate if someone could share any tutorial about how to create a Mobile Connectivity and use it in the SAP MDK.

Accepted Solutions (0)

Answers (4)

Answers (4)

Jitendra_Kansal78
Product and Topic Expert
Product and Topic Expert

@vhsbc92 

You don't need to create an MBT service as you already have an OData service for consumption.

I don't see any issue in the destination configured in the mobile services app configuration.

Regarding the MDK project in SAP Business Application Studio, did you create it using a template? For example, base, List Detail or CRUD? If so, did you select enabling offline for the given destination?

Could you share the page metadata where you have bound an Object Table control to the defined service? 

 

 

 

 

vhsbc92
Explorer
0 Kudos

Hello Jitendra, hope you are great!

I have good and bad news! The good one, I tried to use SAP CPI OData API as a middleware to reach SuccessFactors and it's working.

The bad, I'm still having problems to connect directly with SF.

I've done a documentation with all the steps to create the APP Connected with SF and other app connected to SF using CPI.

Here is the documentation, I'm sorry to ask this, but could you please take a look? This is a Notion website I've shared.

https://persistent-hovercraft-94e.notion.site/SAP-MDK-Offline-App-9c8c7d62cbb046cb816e5ae322229f44

Maybe I'm doing something wrong, I've been working in both apps to figure out why one is working and other one doesn't.

Any comments or suggestion will be helpful.

Thanks a lot!

Jitendra_Kansal78
Product and Topic Expert
Product and Topic Expert

@vhsbc92 

Just to confirm, did you try calling the "Launch in browser" option for the SuccessFactors destination configured under Mobile Connectivity in the admin UI? And were you able to see the data? 

Did you already try accessing the data in Online mode in your MDK app? Change OfflineEnabled parameter to false in .service file in your MDK metadata project.

Did you use MDK template in BAS to generate a project? What template type did you choose? 

 

 

 

vhsbc92
Explorer
0 Kudos

Hey Jitendra,

I've created a destination inside mobile connectivity to successfactors, after that I could test the connection in the same screen and I could see the data and metadata.

vhsbc92_0-1725551750915.png

vhsbc92_1-1725551779330.png

Here is the metadata retrived by the destination I've created.

vhsbc92_4-1725552116717.png

 

Here is an example of retrieving data from an SF entity called FOLocation

vhsbc92_3-1725552046279.png

 

After that, I've created the MDK App using this service, there I can see the Entities and I've selected FOLocation. Then I created an object table to show all the data, then I deployed and open the mobile services app.

Nothing appears, even errors.

 

I think I know what's happened, I'm trying to use it as offline, but I didn't create an MBT Service as this tutorial ask to be done before run the app.

https://developers.sap.com/tutorials/cp-mobile-backend-tools-simple-odata.html

I think I've done everything correctly, but once I haven't done the MBT sync with SuccessFactors, the offline store is empty, I think I need to fill it first and then I'll be able to see the data. The way I'm using seems to be an online app using an OData api, but this is not what I need.

I think, lol.

Thank you for your reply, I appreciate any comments or suggestions.

 

 

vhsbc92
Explorer
0 Kudos

Hello Sir,

I'm trying to fix this issue and I received and error message saying: -10343  Communcation with the server failed for the download operation due to invalid authentication.

After some changes, now I'm receiving another message saying "Failed to initialize application data service - Error [-10340] the download failed due to an error on the server: -857 (SERVER_SYNCHRONIZATION_ERROR) ([-10225] Message: User exc.."

I really appreciate your help

vhsbc92
Explorer
0 Kudos

Hello experts!

Just to let everyone know about what I've done in this issue.

I decided to create a API OData in SAP CPI with only the necessary entities. After that I could retrieve the data from SuccessFactors.

I think the problem is the SuccessFactors metadata, I don't know which one.

bing_fang
Product and Topic Expert
Product and Topic Expert
0 Kudos
About this error "Failed to initialize application data service - Error [-10340] the download failed due to an error on the server: -857 (SERVER_SYNCHRONIZATION_ERROR) ([-10225] Message: User exc..", please reproduce it, then in the admin cockpit of mobile service, you can get some error message and there is a correlationID in it. Please provide us the correlationID and your url of mobile service. We can get some useful server log which can help to check what's the reason for this error.