Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 8419

How to remove { "results":... } tag in Entity Sets of OData GET JSON ?

$
0
0

Hi Experts,

 

I have build OData service in Gateway 7.4 SP5.

The service is basically to call Backend RFC calls and has associations to build Master-Detail pagination model

 

I was trying to consume the service in json format in SAPUI5.

The service when appended with ...&$format=json, the response body is as follows.

 

==========================================

 

{

  "d": {

  "results": [{

  "__metadata": {

  "id": "

  .

  .

  .

  },

  "Year": "2014",

  "Company": "SAP",

  "EntitySet1": {

  "results": [{

  "__metadata": {

  "id": "

  .

  .

  .

  },

  "Country": "USA",

  "Recordid": "1100",

 

 

  }]

  },

  "EntitySet2": {

  "results": [{

  "__metadata": {

  "id": "

  .

  .

  .

  },

  "Rowid": "0001",

  "Currency": "USD",

  "EntitySet3": {

  "__deferred": {

  .

  .

  .

==========================================================

 

I would like to remove the {"results" : tags from every EntitySets and would like to get the data as follows.

-------------------------------------------------------------

{

  "d": {

  "results": [{

  "__metadata": {

  "id": "

  .

  .

  .

  },

  "Year": "2014",

  "Company": "SAP",

  "EntitySet1": {

     "Country": "USA",

  "Recordid": "1100",

  }

  "EntitySet2": {

     "Rowid": "0001",

  "Currency": "USD",

  "EntitySet3": {

  .

  .

 

---------------------------------------------------------------------------------------

 

 

I have already gone through the following links but not able to find a solution to get a cleaner Json format of the OData service.

Posting data in Json format in OData services

Deep entity in JSON

 

Since we are in the latest version and SP, dont know if there any latest SAP notes as well.

Is there any config or DPC method implementation to omit "results" tags.

Please help me.

 

Thanks!

Praveen


Viewing all articles
Browse latest Browse all 8419

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>