cancel
Showing results for 
Search instead for 
Did you mean: 

Using filter expression in oData

Former Member
0 Kudos

hi All,

      I am creating an odata service for read all requests which having same AppPernr (Perner of approver) value. I am trying to use filter in this but it is not working... Data type of AppPernr is PERSNO (NUMC 😎

When i am using following url its giving entire table values without any filteration:

http://xxx.xx.xx.xx:xxxx/sap/opu/odata/sap/ZGW_MOB_EXPMGMT_SRV/RequestListEntitySet?$filter=AppPernr eq '00040010'

And When I am using url as :

http://povspacnwg.lntuniverse.com:8000/sap/opu/odata/sap/ZGW_MOB_EXPMGMT_SRV/RequestListEntitySet?$f... eq 40010

its giving me error as:

<ERROR_INFO>Invalid parametertype used at function 'eq' (Position: 10)</ERROR_INFO>

- <ERROR_RESOLUTION>

  <SAP_NOTE>See SAP Note 1797736 for error analysis</SAP_NOTE>

  <LINK_TO_SAP_NOTE>https://service.sap.com/sap/support/notes/1797736</LINK_TO_SAP_NOTE>

  </ERROR_RESOLUTION>

Please help me in solving this issue.

Thanks and Regards,

Harshada

Tags were edited by: jitendra kansal

Accepted Solutions (0)

Answers (3)

Answers (3)

vijaybhaskarraju_vegesana
Active Participant
0 Kudos

Hi Harshada,

You are saying that, the below URI works fine and it gives table output, Can you check by putting breakpoint in your RFC or DPC_EXT where ever your custom code implemeted ans see how the data is fetched in your backend.

http://xxx.xx.xx.xx:xxxx/sap/opu/odata/sap/ZGW_MOB_EXPMGMT_SRV/RequestListEntitySet?$filter=AppPernr eq '00040010'


If you want to display only AppPernr field in the response, you can add select filter to your URI


http://xxx.xx.xx.xx:xxxx/sap/opu/odata/sap/ZGW_MOB_EXPMGMT_SRV/RequestListEntitySet?$filter=AppPernr eq '00040010'&$select=AppPernr



Regards,

Vijay V

AshwinDutt
Active Contributor
0 Kudos

Hello,

Please refer Chandra's blog  which will help u in accomplishing :

U can also use mapping in GW which will implement the appropriate Read/Query as well.

Code will be generated by GW frame work itself. i.e., SEGW ( GW service Builder Tool )

Regards,

Ashwin

ChandraMahajan
Active Contributor
0 Kudos

Hi,

Have you implemented logic for filter in get_entityset method of class DPC_EXT class?

Regards,

Chandra

Former Member
0 Kudos

Hi,

     No i haven't implemented that. Actually this Netweaver Gateway and oData creation part is new for me. So can you please assist me in that.

Thanks & Regards,

Harshada