cancel
Showing results for 
Search instead for 
Did you mean: 

Problem requesting results using 'NULL' where condition in /IWFND/GW_CLIENT

I have a CDS view which is exposed via SADL framework to a GW service.

The CDS view contains a propertie called workOrderWorkCentreId with the following technical details:

Using the GW_CLIENT transaction, when I try to obtain the result set from the entity (= CDS result set) with the condition workOrderWorkCentreId eq 'NULL' no records are displayed. Which is wrong, since the CDS contains records where this field is empty.

GW_CLIENT request:

Did a trace with ST05 to evaluate the SQL request and found this:

Detailed view:

It seems like the SADL framework is building the SQL request considering the field length size in the where condition.

Since the property workOrderWorkCentreId maximum length size is 2 characters, it is truncating the NULL condition to 'nu' resulting in the wrong result set.

I did a quick test with other properties with largest length size and it worked fine.

Any ideas on how to overcome this problem?

Cheers.

Accepted Solutions (0)

Answers (1)

Answers (1)

Pavan_Golesar
Active Participant
0 Kudos

Hi ricardoladeiro,

I understand that you have a CDS which has a field as workOrderWorkCentreId and this is having some records as NULL and you want to fetch these records.

Firstly, I believe that the condition is wrong that you are trying to hit i.e. workOrderWorkCentreId eq 'NULL' . This wont work as Gateway wont be able to parse this keyword that too in single quotes.


Secondly, you mentioned the "CDS contains records where this field is empty" I assume that you may be seeing blank/empty cell in ADT while testing the CDS view output in data preview for that specific field in the record.

Please try single quote (' ') with space to access blank values.

Solution: so url should be looking something like:

workOrderWorkCentreId eq ' '

Hope this helps! 🙂

Cheers

Pavan Golesar

0 Kudos

Hi pavangolesar,

The request condition is just fine.

I was able to achieve my goal by changing the max length size of this property to > 4 chars in the DEFINE method from the *MPC_EXT class. Either way, it looks like a work around solution... The SADL framework should support NULL conditions for any property regardless of the maximum characters size.