cancel
Showing results for 
Search instead for 
Did you mean: 

SAPUI5 - Is it better to have just one oData dataSource?

former_member239819
Participant
0 Kudos

My app's controllers mostly call one dataSource with no issues.

One of them, however uses 3 seperate datasources, and sometime returns 403 Forbidden errors when accessing them.

<code>"dataSources": {
        "ZSV_SURVEY_SRV": {
            "uri": "/SAPUI5-ABAP-SFI/sap/opu/odata/sap/ZSV_SURVEY_SR/",
            "type": "OData",
            "settings": {
                "odataVersion": "2.0",
                "localUri": "localService/metadata.xml"
            }
        },
        "ZRUI_COMMON_SRV": {
            "uri": "/SAPUI5-ABAP-SFI/sap/opu/odata/sap/ZRUI_COMMON_SRV/",
            "type": "OData",
            "settings": {
                "odataVersion": "2.0",
                "localUri": "localService/ZRUI_COMMON_SRV/metadata.xml"
            }
        },
        "ZTC_SHOP_TRADING_CALENDAR_SRV": {
            "uri": "/SAPUI5-ABAP-SFI/sap/opu/odata/sap/ZTC_SHOP_TRADING_CALENDAR_SRV/",
            "type": "OData",
            "settings": {
                "odataVersion": "2.0",
                "localUri": "localService/ZTC_SHOP_TRADING_CALENDAR_SRV/metadata.xml"
            }
        }
    }

Would it be better to incorporate the methods all into one dataSource (e.g. ZSV_SURVEY_SRV? or should 3 separate dataSources be fine and present no problems?

If 3 dataSources are fine, why do I sometime get the 403 error?

Is there a performance advantage either way?

Accepted Solutions (0)

Answers (1)

Answers (1)

irfan_gokak
Contributor
0 Kudos

Hi,

It’s better to make single call by merging the all into one. Because while loading the application it’ll call to the backend 3 to times to get the metadata. So better go with the one.

Or else you can make metadata Call ASYNCHRONOUS so that it should not reduce app loading time use this link Click here

There’s one more way but I don’t know how to do it. You can create local metadata file and load it in manifest.json file other than calling backend systems.

Hope this information is clear for you.