cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

CI odata adapter: Edm.Guid 'Wrong literal format for literal'

DamianKolasa
Participant
0 Likes
845

Hello,

 

I'm building an iFlow using oData adapters (v2) in integration suite. When trying to update (PUT) the record adapter returns error:

com.sap.it.rt.adapter.http.api.exception.HttpResponseException: An internal server error occured: Wrong literal format for literal: 'f5cc9649-59ab-1[...]'

I tried to workaround this problem by:

  • using batch (same error);
  • changing local edmx file and GUID type field from Edm.Guid to Edm.String and using guid'f5cc9649-59ab-1[...](remote validation fails with Cannot convert guid'f5cc9649-...' to java.util.UUID
  • Playing with Resource Path in adapter's config - changing it to ${property.path} and setting hardcoded value: entityName(GuID=guid'f292992-aaaa-...') but same metadata validation

GUID is defined as:

<Key>
<PropertyRef Name="GuID"/>
</Key>
<Property Name="GuID" Type="Edm.Guid" Nullable="false" sap:display-format="UpperCase" sap:label="UUID" sap:quickinfo="16-byte UID in 32 chars (hexadecimal)" sap:updatable="false"/>

And using it manually (postman) is possible and works. I found that CI produces incorrect requests (in batch), skiping 'guid' part in key definition. Example batch requests, looks like this:

PUT entityName(GuID='f5cc9649-59ab-1[...]') HTTP/1.1

 instead of (which would work):

PUT entityName(GuID=guid'f5cc9649-59ab-1[...]') HTTP/1.1

So either key validation fails in adapter or (with batch) in backend. How to make it work? I tried sap.support and adapter's configuration but there's nothing about such problems. 

Here's my payload I'm testing with:

<entitySetName>
<entityName>
<GuID>f5cc9649-59ab-1[...]</GuID>
<ProcessedAt>1990-01-26T06:40:03.02</ProcessedAt>
</entityName>
</entitySetName>

And adapter's config:

DamianKolasa_0-1750839970961.png

 

 

Accepted Solutions (0)

Answers (2)

Answers (2)

Phos
Discoverer
0 Likes

@DamianKolasa try passing the guid'f5cc9649-59ab-1[...]' literal to the /batchParts/batchChangeSet/batchChangeSetPart/uri of your batch OData request payload. I had a similar sort of a requirement where I had to pass the datetime'YYYY-MM-DDT00...' literal as an encoded URI component for a MERGE call. It worked for me. 

You can also refer to Batch Operation in OData V2 Adapter in SAP Cloud P... - SAP Community @ariel_martinez3 comment on this blog where they have faced a similar issue that you are facing with the guid literal. As per their comments it seems like populating the uri component of the batch payload fixed the issue for them.

DamianKolasa
Participant
0 Likes

Hi @Phos

Thanks for a tip, but still it doesn't work.  I think it may be sth wrong with odata itself (maybe GUID is not supported in adapters, as a key)...

Damian

PriyankaChak
SAP Champion
SAP Champion
0 Likes

Hi,

Could you use HTTP adapter instead of ODATA? I faced the similar issue a few years back and used HTTP adapter to mitigate the issue.

Regards,

Priyanka