on 05-02-2014 11:08 AM
Hello All,
I have one entityset - ResourceSet. I am sending Resources List in this set. Along with this I need to send the total count of resources in the list , in a separate field. I need to pas this number to UI5 App.
I have created a BAPI , which gives the output as Resources Table and one export parameter RCOUNT ( which has the resources Count)
When I map this to query operation how ever how to map this global field ?
Regards,
Sheetal
Hi,
you just need to add /$count to your entityset which will give count of entries. no need of additional coding.
Regards,
Chandra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry I did not understood.
if you are querying like /sap/opu/odata/sap/ZGW_SRV/ResourceSet then it will give you output of resource table. now if you try with /sap/opu/odata/sap/ZGW_SRV/ResourceSet/$count then it will provide you number of resources.
You need not to do separate coding for returning counts.
additionally, if you want count to be displayed in output, you can have that field defined in entity and set the value. I will refer my blog and accordingly you can go for code based implementation of entityset ie. query operation.
Regards,
Chandra
Hi Sheetal,
In your .....DPC_EXT class GET_ENTITYSET method for the specified entity, please fill the ES_RESPONSE_CONTEXT-inlinecount to get this global value in your entitylist and this will only come once not with every entity. Then try adding $inlinecount to your entityset GET request as follows:
http://services.odata.org/OData/OData.svc/Products?$inlinecount=allpages
Best regards,
Aakash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.