on 01-30-2019 9:31 AM
Hi there,
we use structured types in our HANA CDS definitions like:
type LABCOLORTYPE {
L: Decimal(25,5);
A: Decimal(25,5);
B: Decimal(25,5);
}
in different entities:
Entity Color {
key id: PRIMKEYTYPE;
materialnumber: String(20) not null;
labcolor: LABCOLORTYPE not null;
...
};
Now we expose that table as OData Service:
"my.db::color.Color"
as "Color"
navigates (....;
Everything works well and the table is exposed as OData Service, but an integration with SAP Cloud Integration is not possible (EdmTypeException). The generate object names for structured types contain a dot (e.g. labcolor.L). The dot is not allowed in names according to OData specification.
Is there a way to avoid the dot in names in the generated OData Service? It seems that there is no way to map the dot to something like underscore (_) and I don't want to remove all structured types.
(We use the HANA service in SCP Neo.)
Any help is welcome!
Thanks.
Karsten
Actually the view is valid for write operations as long as you use an exit to perform the write.
But this is really the only choice if you want to use CDS and structured types. Of course you could just not use structured types. Or not use CDS at all. These are all options.
But also long as you use structured types the generated element names must be prefixed in such a way to ensure uniqueness. From the OData side it will simply expose whatever the DB has. We discussed but ultimately decided not to implement some kind of translation in the OData layer. Instead if you want to use the DB as your source you must ensure you only use names and constructs that would be compatible with OData. This means views or avoid this structured element feature.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Put a CDs view on top of the entity and use the view as your source in OData. From the view you can alias the column names.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Correct me if I'm wrong; but this will not solve our issue
The view can be used for read operations, but is not valid for write operations. In addition this will generate a lot of boilerplate views and every time I change the entities I have to adjust the views.
Isn't better a better way to 'work-a-round' that issue.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.