Skip to Content

Entity with binary key in a SAP Gateway Service

Jul 11, 2017 at 02:28 PM


avatar image

Hello everyone,

I just created a SAP Gateway Service with an entity, which uses a GUID (ABAP type RAW 16) as key (like “00155DEDEF921ED7919022D2200320C3”).

In all request responses that key seems to be converted to a base64 representation like “ABVd7e+SHteRkCLSIAMgww==” which results in the following problem:

If I start a new request for one single entity like /sap/opu/odata/sap/MY_GATEWAY_SERVICE/EntityTypeSet(‘ABVd7e+SHteRkCLSIAMgww==’) I receive the following error message: “Invalid key predicate type for 'KEY'. Expected type is 'Edm.Binary'“.

The only valid request seems to be /sap/opu/odata/sap/MY_GATEWAY_SERVICE/ EntityTypeSet(binary'00155DEDEF921ED7919022D2200320C3'), which uses the hex representation of the guid.

However, as I always get the base64 representation of the guid in all request responses I have no idea how to create valid requests.

Can anyone help me and explain how to use GUIDs as key.

Thanks in advance and best regards,
Michael Liermann

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers