Hello gurus!
I have the following issue on our development system.
We have a GW service that implements an EntitySet. The URL contains a $filter instruction that once SAP catches it, it looks like this:
/sap/opu/odata/sap/TEST_SERVICES_SRV/TrimSet?$filter=ChannelId eq '20' and TrimCatId eq 'BASE' and CombinedId eq 'DR3^DTXL2211111111' and GaugeId eq '24' and (ColorId eq 'WWTC' or ColorId eq 'BARE')
Also very important: both the ABAP data elements and the Entity Properties field lengths matches.
ChannelId (max. length = 2) ==> CHANNEL_ID CHAR 2
CombinedId (max. length = 20) ==> PROFILE_PSYSTEM CHAR 20
ColorId (max. length = 5) ==> COLOR_CODE CHAR 5
Once we jump into the debugger, the IO_TECH_REQUEST_CONTEXT input parameter for TRIMSET_GET_ENTITYSET method has an attribute MR_REQUEST (deep structure) which contains TECHNICAL_REQUEST-FILTER_STRING which value matches the $filter expression in the URL
( ( ( ( ( ChannelId eq '20' ) and ( TrimCatId eq 'BASE' ) ) and ( CombinedId eq 'DR3^DTXL2211111111' ) ) and ( GaugeId eq '24' ) ) and ( ( ColorId eq 'WWTC' ) or ( ColorId eq 'BARE' ) ) )
But the issue is that, if we want to get the $filter values as SELECT-OPTION, the internal table FILTER_SELECT_OPTIONS in the MR_REQUEST deep structure already has the values but truncated:
ChannelId | Standard Table[1x4(20)] |
TrimCatId | Standard Table[1x4(20)] |
CombinedId | Standard Table[1x4(20)] |
GaugeId | Standard Table[1x4(20)] |
ColorId | Standard Table[2x4(20)] |
ChannelId gets truncated from '20' to '2'
SIGN | OPTION | LOW |
I | EQ | 2 |
CombinedId gets truncated from 'DR3^DTXL2211111111' to 'DR3^DTXL22'
SIGN | OPTION | LOW |
I | EQ | DR3^DTXL22 |
And both ColorId get truncated as well:
SIGN | OPTION | LOW |
I | EQ | WWT |
I | EQ | BAR |
We have implemented the following note but the issue was not fixed:
2245413 - Truncated filter values
Symptom
The filter value of a property type STRING or XSTRING might be truncated.
Reason and Prerequisites
Program error in the metadata handling
Solution
Apply this SAP note to your backend system.
After having applied this SAP note, you have to cleanup the metadata cache on your gateway system via transaction /IWFND/CACHE_CLEANUP and also your backend system via transaction /IWBEP/CACHE_CLEANUP.
https://websmp130.sap-ag.de/sap/support/notes/convert2pdf/0002245413?sap-language=EN
The curious thing is that if we set the max. length to 0 (zero) in the Entity definition, the values are not truncated anymore. Which it is the workaround i have to do while we get this fixed.
Has anyone else experienced this issue??
Thanks in advanced!!