Skip to Content
Jun 29, 2022 at 02:48 PM

SAP OData Service - exclude empty filter error


Hello experts,

I got a problem with SAP OData Services (SAP Gateway and CDS Services). If we use a Fiori App with custom fields and try to filter the custom fields with the ‘exclude empty’ filter, it doesn’t work. When I use a Fiori App with a CDS Service and with the filter ‘exclude empty’ the entityset is empty which is not correct. I tried the same with a Fiori App which uses a SAP Gateway Service and the source code throws an exception.

In my Use-Case it´s the standard Fiori App ‘Manage Customer Line Items’. We redefined the SAP standard Gateway Service ‘FAR_CUSTOMER_LINE_ITEMS’ and added two properties to the entity ‘Items’.

If we use the filter ‘exclude empty’ for the two new properties on the Fiori App, the SAP Gateway Service throws an exception. The exception says uncaught_exception.
The error occurs only if we use the filter ‘exclude empty’ every other filter works.

To be more specific, we redefined the method ITEMSET_GET_ENTITYSET in the DPC_EXT class. First, I call the super method in the source code. And the exception occurs in the standard SAP source code when they try to call the method io_tech_request_context->get_filter_expression_tree( ).

When I call the method io_tech_request_context->get_filter_expression_tree( ) in the DPC_EXT class, I can read the filter and use it. My Source Code in the DPC_EXT class works perfectly besides the call of the super method where the exception occurs.

I tried to debug the problem. It looks like the object for the filter (io_tech_request_context) loses the new properties when I call the super method. But the filter string is still correctly.

Can anybody help me with this problem?

Best regards