1

I have an SAP CDS View exposed via Gateway and hosted on APIM. This CDS has CRUD operations enabled using @ObjectModel annotations.

One of the key fields from the CDS (SAP table) can be empty as per business process, but when I try to query for this full key via APIM service (with the empty property) I receive 404 - Resource not found:

Query from APIM

The same query works fine inside SAP Gateway:

Same Query directly from SAP Gateway

What should I do in order to APIM understand that this key field can receive empty (or null?) values?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
  • CDS has two types of keys: semantic and technical keys, and both cannot be empty. AFAIK. Give the definition of your CDS view, please – Suncatcher Dec 13 '21 at 13:08
  • Sorry.. Didn't get it! Key fileds can be empty.. I mean on transparent table and also CDS. The keys are the ones used to identify the resource on my request: zbudat, matnr, werks, lgort and charg. Note that charg is a key and it's emtpy. – Felipe Martin Dec 20 '21 at 01:35

2 Answers2

0

It is interesting to see this from the APIM service and gateway query, the result is different given the same query parameter, the only explanation to me is that there is a conversion at ABAP side and this cause no result can be loaded. Can you enable gateway trace at ABAP side to check the exact request when ABAP tries to query data when you use APIM client? Use transaction /IWNFD/TRACES to see the traces for your user at ABAP side.

Regards, Derek

wanderlandderek
  • 376
  • 4
  • 5
0

Thanks for the answers!

We have found out that it might be an APIM mapping issue because when we set an empty key on the path (charg='') we receive a 404 without even reaching SAP Gateway:

Message from APIM with status 404

But when we set this same parameter with a blank / space (charg=' '), it works fine and it finds the entry on S4 table:

Message from SAP with status 200

How do I know it didn't reach S4? First, because the trace doesn't catch anything and second because the 404 message is differente when it comes from S4:

Message from SAP with status 404

Thank you all!

ouflak
  • 2,458
  • 10
  • 44
  • 49