cancel
Showing results for 
Search instead for 
Did you mean: 

cap call OData Service generated by key-user-tools

former_member624584
Participant
0 Kudos

Hi guys,

With the app custom business object (which is part of the key user tools) I created an object and let a OData Service be generated. The OData Service is called 'TBUSINESSOBJECT_CDS'. I want to connect cap to the generated service, which is working for the complete dataset (i.e. for all entries in the database table) but it is not working for a single entry.

When checking the metadata (uri/.../TBUSINESSOBJECT_CDS/$metadata) they key is 'SAP_UUID'. Hence, I would assume that the url to a single entry ends with (uri.../TBUSINESSOBJECT_CDS/xJSSxTBUSINESSOBJECT(SAP_UUID=000...000)). Unfortunately from the service I see that a call to a single entry looks like the following (uri.../TBUSINESSOBJECT_CDS/xJSSxTBUSINESSOBJECT(guid'000...000')).

The problem is, that cap creates the url for the single entry with SAP_UUID (i.e. the second link above), which is correct in my opinion. However, I'm wondering why the generated OData Service wants to be called with 'guid' instead of 'SAP_UUID' for a single entry and is there a way to change it?
Also I'm wondering if there is a nice workaround for cap (e.g. to call the service manually with axios, if it is possible)?

P.S. I used the key user tools on an s/4hana on-premise system.

Cheers,
Thorsten

Accepted Solutions (0)

Answers (1)

Answers (1)

sergei-u-niq
Active Contributor

if there is only one key, you can omit the keys name, so xJSSxTBUSINESSOBJECT(value) would be perfectly valid

guid'...' is the syntax for specifying a guid => check odata-version-2-0/overview/, Chapter 6

so basically, it is the same as

xJSSxTBUSINESSOBJECT(SAP_GUID=guid'...')

former_member624584
Participant
0 Kudos

ah ok, and since the generated service is in oData v2 I have to provide the guid attribute in the request.