1
votes

I am trying to create a OData service that returns user parameters found in the databasde usr05. Those can be accessed by the ABAP statement:

GET PARAMETER ID 'XXX' FIELD YYY.

This means, that basically do not need a key value. In SEGW it is impossible to create an entity type without one though.

The solution of course could be a dummy key field, that is simply ignored in the backend implementation.

Does anyone know a better solution?

Thanks in advance, Eric

1
I think there is no other solution (at least I did not find another way when having this topic). I think it is by design, because GET_ENTITY is used to read one entry from GET_ENTITYSET.dotchuZ
thanks @zYrEx, it s a shame though, especially since you dont always need the sets...Erch

1 Answers

1
votes

it is not a shame it is by design and follows the OData specification. Every entity type must have a key. What you can try to use instead is to use a property that is based on a so called complex type within an entity type that is used for your users. The latter should have a key.

Like the complex type address that is used in the entity type Supplier

https://services.odata.org/OData/OData.svc/$metadata