Skip to Content
1
Jun 16, 2016 at 06:00 PM

SAP gateway, how can I filter on items with padded zeroes?

44 Views

SAP gateway, how can I filter on items with 0 padding?

For example, we expose a list of equipment via an entityset. Equipment numbers are often padded with zeros ( width of 18 ).

If we don't turn off conversion factors in the define method of the model controller extension class (MPC_EXT), we could get 10006798 returned instead of 000000000010006798.

This would show up nicely in our UI. But then if we want to filter and we try to do an odata filter like:

(Equnr eq '10006060') we won't get any rows back.

We need to do (Equnr eq '000000000010006060') to get rows back.

In the gateway we are using get_osql_where_clause. Is there any way to get the where clause working with eq '10006060'?