cancel
Showing results for 
Search instead for 
Did you mean: 

System query options $orderby etc error for sap.m.Table bindItem method

rauf_shaikh
Active Participant
0 Kudos

I am trying to bind an OData Service to a sap.m.Table using bindItem method as follows:

closingBalanceTable.bindItems("/CreditSocietyStatementSet('2014')",new sap.m.ColumnListItem({

       cells: [

         new sap.m.Text({

          text : "{TotContriOpenBal}"

         }),

         new sap.m.Text({

          text : "{TotContriOpenBal}"

         })

       ]

  }));

its throwing following error:

{"error":{"code":"005056A509B11EE1B9A8FEC11C23378E","message":{"lang":"en","value":"System query options '$orderby,$skip,$top,$skiptoken,$inlinecount,' are not allowed in the requested URI"}}}


OData Service returns only single element as follows response:


<content type="application/xml">

<m:properties>

<d:IFyear>2014</d:IFyear>

<d:TotContriCloseBal>53726.00</d:TotContriCloseBal>

<d:TotContriDepContri>0.00</d:TotContriDepContri>

<d:TotContriOpenBal>53726.00</d:TotContriOpenBal>

<d:UnitCode/>

</m:properties>

</content>

Accepted Solutions (0)

Answers (2)

Answers (2)

kammaje_cis
Active Contributor
0 Kudos

Rauf,

As Jason said you should change your URI to "/CreditSocietyStatementSet" from "/CreditSocietyStatementSet('2014')"

rauf_shaikh
Active Participant
0 Kudos

Hi Krishna,

Thanks for you advice.But OData service is being developed by other team and if I go with "/CreditSocietyStatementSet" then service will not work, throws error.Based upon the Input(2014 in this case) details are being fetched from the back end..any suggestion for this situation?

jmoors
Active Contributor
0 Kudos

The problem is that you are binding to a table, if your odata serevive only ever returns a single entity, I suggest you consider displaying with different a control(s).

regards,

Jason

kammaje_cis
Active Contributor
0 Kudos

Table's items/rows can only be bound to a collection. As Jason said, if you expect to show only one entry, then it will not be in a table isn't it? If you think you are going to get more entries, then ask the OData service team to return the same entry for /CreditSocietyStatementSet as well, so that you can use it for binding.

Other workound which I do not recommend is to store the output into a Json array and bind the table with that.

rauf_shaikh
Active Participant
0 Kudos

Hi Krishna

As Jason and you are suggesting I will try binding with other control,but can you please explain how to store the output into a JSON array/object.Till now I am binding entity sets with controls I have not handled the entity set response in any way If you how to store the response then that will be very helful for me in my future developments.
Any exmaple links?

jmoors
Active Contributor
0 Kudos

Hi,

Looks like your oData service is returning an individual entity, rather than an entityset, the orderby etc can only be used against an entity set.

Regards,

Jason

rauf_shaikh
Active Participant
0 Kudos

Hi Jason,

Thanks for your observation, you are right OData service is returning an individual entity.

Can you advice how should I go ahead in this situation? Is there any other way I can go ?