cancel
Showing results for 
Search instead for 
Did you mean: 

Get Data from oData usin ajax with parameter

former_member275924
Active Participant
0 Kudos

Hi expert ,

I want to retrieve the data from odata and want to set the value in table after changing eg. aggregation , conversion... .

I use the Get type of $.ajax . I can retrieve the data and put it to array after that I can manipulate the data .

But there is the problem , I don't want to retrieve all data from odata. I set the selection filed as parameter and want to retrieve the data that based on parameter . Although I set the data as parameter , It doesn't work and retrieve all data .

Could you please check my logic and give me any advice .

Best Regards,

Phyo

ajax-get.txt

Accepted Solutions (1)

Accepted Solutions (1)

maheshpalavalli
Active Contributor

you shouldn't send the parameters in the body, try passing them in the URL as a filter as shown in the example below:

https://www.odata.org/documentation/odata-version-2-0/uri-conventions/

And any reason why are you not using odatamodel?

https://sapui5.hana.ondemand.com/#/api/sap.ui.model.odata.v2.ODataModel/methods/read

BR

Mahesh

former_member275924
Active Participant
0 Kudos

Hi maheshkumar.palavalli

Thanks for your reply .

Now I use odatamodel and it can be solved . The main problem that I can't pass the parameter is cause by odata .

When I create odata , there is no logic to retrieve the data with parameter .

Best Regards,

Phyo

Answers (0)