cancel
Showing results for 
Search instead for 
Did you mean: 

Data is not coming back from Odata service in UI5 application

former_member511960
Participant
0 Kudos

Hi Experts,

I am trying to consume the odata service in my application, when i ran it i am getting the below error when i ran it locally and i am confused why it is calling "Webide Testing"

When i test the odata service in browser its working fine and the data is coming

Can someone help me to fix this issue ?

KR,

Anil

Accepted Solutions (1)

Accepted Solutions (1)

former_member186852
Contributor
0 Kudos

There is a mistake in your code. please correct below part.

"models": {
			"i18n": {
				"type": "sap.ui.model.resource.ResourceModel",
				"settings": {
					"bundleName": "table.table.i18n.i18n"
				}
			},
                     "": {
				"dataSource": "ZBPE_MAINT_BPE_SRV",
				"preload": true
			}
		}
former_member511960
Participant
0 Kudos

Thanks Meghal.

I have made my code correction as per your suggestion and now i am getting a below error

Is this something to with the odata service ?

KR,

Anil

former_member186852
Contributor
0 Kudos

Hi Anil,

According to your metadata file you need to pass two key values to get the data.

try to run the odata separately and check the output.

<PropertyRef Name="Kokrs"/>
<PropertyRef Name="ZbpeBpe"/>

Answers (5)

Answers (5)

srinivas_sistu
Active Contributor
0 Kudos

Hi,

Do you have a manifest.json file? what is the model destination maintained in your local version?

former_member511960
Participant
0 Kudos

Hi Srinivas,

Below is the manifest.json file code

https://answers.sap.com/storage/attachments/128670-manifest.txt

and below is the local metadata file metadata.txt

KR,

Anil


imsuryapandiyan
Participant
0 Kudos

Hi Anil,

For using other domain services in Web IDE, you need to create destination in SCP Cockpit.

For this S4I, the neo-app.json should have:

and data source path should be:

Check if all these are correct.

Regards,

Suriya

gururajenamate
Explorer
0 Kudos

Hi,

Included destinations in neo-app.json file?

Regards,

Gururaj

former_member511960
Participant
0 Kudos

Hi Gururaj,

Yes the destination is added in neo-app.json below is the code

{
"path": "/ODP",
"target": {
"type": "destination",
"name": "ODP"
},
"description": "Odata"
}
],

KR,

Anil


gururajenamate
Explorer
0 Kudos

Ok..

How are you defining model in manifesrt.json?

>As you have given "path": "/ODP". But in metadata call the path is different.

the "/ODP" should be prefixed to model path in manifest.json file.

Regards,

Gururaj

former_member511960
Participant
0 Kudos

Hi Experts,

Any other inputs ?

KR,

Anil

saurabh_vakil
Active Contributor
0 Kudos

What are the errors in the Console tab of the developer console? Are you getting the errors when testing from Web IDE or testing the app locally? In case of local testing you will have to remove the destination reference in the OData service URL within the app descriptor file.

former_member511960
Participant
0 Kudos

Thanks for the reply @Saurabh.

I am running my index.html file locally(Run) and below is the error when i ran it

Can you please let me know what should be modified in the manifest.json file ? attached the manifest file and also as i mentioned earlier when i ran the service through browser i am getting the data.

manifest.txt

KR,

Anil

saurabh_vakil
Active Contributor
0 Kudos

Please change the uri value in the manifest.json file as below and check again.

dataSources: {
    ZBPE_MAINT_BPE_SRV: {
        uri: "/sap/opu/odataZBPE_MAINT_BPE_SRV/",
        type: "OData",
        settings: {
            odataVersion: "2.0",
            localUri: "localService/metadata.xml"
        }
    }
}
former_member511960
Participant
0 Kudos

Thanks for the response Saurabh

i tried as per your suggestion but still we are getting the same issue .:(

"dataSources": {
"ZBPE_MAINT_BPE_SRV": {
"uri": "/sap/opu/odata/ZBPE_MAINT_BPE_SRV/",
"type": "OData",

"settings": {
"odataVersion": "2.0",
"localUri": "localService/metadata.xml"
}
}
}
},

KR,

Anil

saurabh_vakil
Active Contributor
0 Kudos

I'm a bit confused as to where are you testing the app - are you testing it from Web IDE or are you testing it from the on-premise gateway server?

former_member511960
Participant
0 Kudos

Hi Saurabh ,

As i mentioned earlier i am running the app locally in Web IDE by click index.html and Run button.

Do you want me to deploy it in SCP ?

KR,

Anil