cancel
Showing results for 
Search instead for 
Did you mean: 

$filter is not working in OData URL

former_member188554
Participant
0 Kudos

Hello Team,

I have one issue in CRM My Appointment App.

In this App tile i have to display Number of Open Appointments.

so i have used this URL ,

/sap/opu/odata/sap/CRM_APPOINTMENT_SRV/AppointmentSet/?$filter=StatusTxt eq 'Open'

But here i am not able to see only 'Open' Appointments. It will display all appointments.

I have checked in gateway Service Builder , the filed StatusTxt is filterable.

Can you please help me on this?

Accepted Solutions (0)

Answers (6)

Answers (6)

Pavan_Golesar
Active Participant

It seems that you are dealing with standard CRM Appointment app,

Hence I'd suggest you to debug the code in DPC_EXT as the OData service returns all types likewise OPEN, Completed, etc.

-PG

0 Kudos

Is this issue solved now? I am getting a similar filter query issue

sas3
Explorer
0 Kudos

Hi Deborshi,

The query you are using is correct.
/sap/opu/odata/sap/CRM_APPOINTMENT_SRV/AppointmentSet/?$filter=StatusTxt eq 'Open'

Now, you have to check whether the filter condition you have written in your DPC_EXT is on 'Open' text. Any case mismatch will not fetch data. Also, it is important to know what error you are getting. If you are getting a correct response then probably something is wrong with your method coding.

Regards,

Saswata

ashwin_narayan
Participant
0 Kudos

Hi Deborishi,

The filter looks fine to me. Can you please check the StatusTxt value? Is it supposed to be Open or is there a different value or difference in case (upper/lower).

Good Luck !!

Thanks,

Ashwin

former_member188554
Participant
0 Kudos

Hello Ashwin,

The values are coming as 'Open' ,'Completed' etc

I have checked also 'open'. But no result.

0 Kudos

Hi Deborshi,

Try removing forward slash '/' after your entityset and try again it will work. Like below

/sap/opu/odata/sap/CRM_APPOINTMENT_SRV/AppointmentSet?$filter=StatusTxt eq 'Open'

former_member188554
Participant
0 Kudos

Hi Vivek,

I have already used this. But its not working.

das_shubhashish
Explorer
former_member227918
Active Contributor
0 Kudos

Hi,

try putting $count before ?$filter, for example,

......./$count?$filter=......

former_member188554
Participant
0 Kudos

Hello Akhilesh,

for this URL

/sap/opu/odata/sap/CRM_APPOINTMENT_SRV/AppointmentSet/?$filter=StatusTxt eq 'Open'

All type of status are coming (like Open,Completed ).

This URL is not working properly.

former_member227918
Active Contributor
0 Kudos

since filterable is already checked,

1) sometime it takes time to update metadata and apply newly changes (filterable) if you have changed recently, you should wait till get the metadata updated or you can try clearing caches n all.

2) you can check the backend code.

former_member188554
Participant
0 Kudos

Hi ,

I have checked in backend code. There are no code available for the filed StatusTxt .

So , i think we should enhance the backend code.

former_member227918
Active Contributor
0 Kudos

Yes, do code respectively..