cancel
Showing results for 
Search instead for 
Did you mean: 

Consuming Odata Service using WEB IDE?

vamsilakshman_pendurti
Active Participant
0 Kudos

Hi Experts,

I want to display my OData service data into UI5 Application using WEB IDE Tool in this i am using SAP UI5 Application Template for displaying my data.

Designing of UI5 is done and Column Headings are displaying , OData connectivity process is also done...(Binding process is also done with the DB Fields)

But Data is not displaying... Coding is as follows


VIEW.js:

Controller.js:

Here in Controller.js i implemented the logic using different ways by seeing in SCN posts and all...

finally i un-comment the 2nd box coding and execute the code ....

output will be displayed with Headers which i mentioned in VIEW.js file...but binding content was not displayed...

404 error is coming Data not found...


give me any solution for this...almost i referred all SCN posts regarding this but i didn't get any solution....

where i did mistake...please give me any idea..

Thanks,

Vamc

vamsilakshman_pendurti
Active Participant
0 Kudos

Hi

When i take WORKLIST Template from WEB IDE and assign my OData service link and run the application...

Now i got the error as shown below...

{
"message": "HTTP request failed",
"headers": [],
"statusCode": 504,
"statusText": "Gateway Timeout",
"responseText": "<html><head><title>Error report</title></head><body><h1>HTTP Status 504 - Socket connection timed out for host https://XXX.XXX.XX.XXX:XXXX. Reason: Read timed out (local port 53954 to address 127.0.0.1 (localhost), remote port 20001 to address 127.0.0.1 (localhost))</h1></body></html>"
}

Thanks,

Vamc

Accepted Solutions (0)

Answers (4)

Answers (4)

praveensap
Explorer
0 Kudos

Hi Vamsi,

Could you please share how you solved this issue?

Thanks & Regards,

Praveen

0 Kudos

Check in network tab what is the service URL which is been called.

It may help you.whether you are calling a correct url for fetching the data.

capture.png

Sharathmg
Active Contributor
0 Kudos

Debug and check if the model is loaded into the variable oModel.

If not, then either there should be an error or no data returned from the service.

Regards,

Sharath

vamsilakshman_pendurti
Active Participant
0 Kudos

Hi,

Model is loaded successfully but out put is not getting for my template SAPUI5 Application Template.

Individually i execute this OData into my GW Client and Link in the browser aswell ....there it is working perfectly...

But In WEB IDE i am not getting the output...

i developed one project with ECLIPSE with the same OData service...there i get the data into my table control... But in my WEB IDE i am unable to get....

Error in DOM as shown below pic:

where did i mistake...unable to find out....

Thanks,

Vamc

jamie_cawley
Advisor
Advisor
0 Kudos

Your model service url should probably be ending with /Y_CUST01_TS, so when you do the binding the url is correct. As it is now when your are binding the url it is calling would be /Y_CUST01_TS/Customers/Customers, which you should be able to see in the browser dev tools. You may want to setup a project with a Master Detail template to see how this is defined.

Regards,

Jamie

SAP - Technology RIG

vamsilakshman_pendurti
Active Participant
0 Kudos

Hi Jamie,

Thanks for the reply...

Actually i tried with that one also

"/TRG_System/sap/opu/odata/sap/Y_CUST01_TSRV"

...but same result ( No Data Found ).

Is there any other way to follow for design the project with SAPUI5 Application Template in WEB IDE

Thanks,

Vamc

jamie_cawley
Advisor
Advisor
0 Kudos

In addition to fixing the paths, in the onInit replace

sap.ui.getCore().setModel(oModel);

with

this.getView().setModel(oModel);

Regards,

Jamie