Skip to Content
0
Jul 11, 2021 at 07:51 PM

SAP CAP JAVA: How to create CDS Model dynamically?

1164 Views Last edit Jul 11, 2021 at 07:52 PM 2 rev

Hello,

I need to create ODATA service annotations dynamically in our CAP JAVA ODATA V2 Backend. How could I achieve that?
The documentation (CAP Doc) suggests, that it is possible: "Models are processed dynamically at runtime and can also be created dynamically → see also The Nature of Models." ... but the referenced page is empty :(

Here are some more details on our use-case.
In our Frontend (sapui5) we use smartTables that are driven by Odata Annotations.
One important use case is, that we set header names for each table column. Having the ABAP Backend, we could dynamically set these headers without changing the coding. We change it via configuration, refresh the model cache and we saw the new headers in the frontend.

Thank you very much,
Simon