Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
Showing results for 
Search instead for 
Did you mean: 

Hi everyone,

Let's start with the "store" object.

Store (or more precisely, "ODataStore") is the common interface and acts as a central access point of the OData service.

In a formal description,

The ODataStore is covering exactly one OData service (service document and metadata). It shall be possible for an application to create multiple ODataStores (also in combination on- and offline) at the same time, which shall be completely independent from the API perspective and have own life cycles.

So in a nutshell, you have to create the store object in order to CRUD the OData. How do we do it?

Here's a typical code snippet for online store:

01  SODataOnlineStore *onlineStore = [[SODataOnlineStore alloc]
02                              initWithURL:smpOdataUrl             
03                  httpConversationManager:myConversationManager];
04  [onlineStore setOnlineStoreDelegate:self];
05  [onlineStore openStoreWithError:&error];

Note: I'll talk about how we create for offline store in later blogs, as the online store is simpler than offline and easier to understand as a first step.

You see the first method name initWithURL:, which is the OData Endpoint URL in SMP server. SMP works as the OData content proxy so once the app gets onboarded to SMP server, SMP should know which URL you need to use. (I'll also cover the onboarding APIs in another blog)

The second method httpConversationManager: is another interesting new object from the new SDK. While onboarding, we create the HttpConverstationManager, which hides the complexities of HTTP communication - such as headers and credentials.

Once you create the SODataOnlineStore, we need to set the callback methods via SODataOnlineStoreDelegate protocol. For this case, the SODataOnlineStoreDelegate is declared in its own class, so simply set as self.

Okie now we can open the store. Invoke openStoreWithError: and either

  • onlineStoreOpenFinished:


  • onlineStoreOpenFailed: 

Will be called back.

Congratulations, now you have successfully obtained the online store. What's next...? Yes, CRUD OData.

See you in the next blog,


List of blogs