Skip to Content
0

Data is not coming back from Odata service in UI5 application

Apr 06 at 09:04 AM

180

avatar image

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

debug.png (355.7 kB)
service.png (141.9 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

6 Answers

Best Answer
MEGHAL SHAH Apr 18 at 07:51 AM
0

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
			}
		}
Show 2 Share
10 |10000 characters needed characters left characters exceeded

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

capture.png (225.0 kB)
0

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"/>
0
saurabh vakil Apr 09 at 04:47 AM
0

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.

Show 5 Share
10 |10000 characters needed characters left characters exceeded

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

manifest.txt (2.0 kB)
yfkjn.png (32.1 kB)
0

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"
        }
    }
}
0

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

0

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?

0

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

0
Anil Thammisetty Apr 10 at 05:59 AM
0

Hi Experts,

Any other inputs ?

KR,

Anil

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Apr 10 at 09:23 AM
0

Hi,

Included destinations in neo-app.json file?

Regards,

Gururaj

Show 2 Share
10 |10000 characters needed characters left characters exceeded

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


0
Former Member

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

0
Suriya Pandiyan Apr 12 at 08:05 AM
0

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


dest-scp.jpg (74.8 kB)
destination.jpg (18.4 kB)
path.jpg (24.4 kB)
Share
10 |10000 characters needed characters left characters exceeded
Srinivas Sistu Apr 12 at 10:35 AM
0

Hi,

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

Show 1 Share
10 |10000 characters needed characters left characters exceeded

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


metadata.txt (5.6 kB)
0