SAP-samples / hana-opensap-cloud-2020

Exercise materials for openSAP courses targeted to application developers, SAP HANA developers, Cloud Application Programming Model developers, and SAP Business Technology Platform developers.
https://open.sap.com/courses/hana7
Apache License 2.0
77 stars 46 forks source link

Currency files (hdbview etc.) are missing after cds build #34

Closed schoesa closed 3 years ago

schoesa commented 3 years ago

Like commented on youtube, the currency files (hdbview etc.) are note created after doing a cds build. Link to my repo: https://github.com/schoesa/hana-opensap-cloud

Any ideas whats wrong in my code? Appreciate your help.

jung-thomas commented 3 years ago

The issue seems to be that your data model isn't complete yet. Although you referenced the reusable type of Currencies and even extended it, you aren't referencing it anywhere else inside your model except via the aspect. But the aspect is abstract - meaning it doesn't generate a database object. You need to apply that abstract to something in your data module. Otherwise CAP will prune that Currencies reuse object out of the compile as not needed. As soon as I added the Amount aspect to an entity, then your project also generates the hdbtable for Currencies entity as well: image

schoesa commented 3 years ago

Hi Thomas, thanks for quick response. It makes sense, that the files will only be generated when extending/using them in a entity. The weird thing was only that I followed your youtube tutorial and the files were generated before you used them (11:48).

jung-thomas commented 3 years ago

That is possible. I did record that last year and there have been some improvements to the CDS compiler since then. It has probably gotten smarter about pruning unused, but referenced model objects since then.

schoesa commented 3 years ago

Ok thanks. I know it's a completely different topic, but my HANA Cloud Trial instance needs approx.. 20 minutes to startup after it's stopped over night automatically. Is this normal? I created a brand new trial like described in your other tutorial.

jung-thomas commented 3 years ago

20 minutes is a big long although perhaps not totally outside expectations depending upon what region you are using (some are more crowded than others) and how much other load there is at a particular time. Now I use the US region of the BTP trial. I started my HANA Cloud trial instance this morning and timed it and it was 2 minutes and 45 sections to start up. I would say 5 minutes or less is normal.

schoesa commented 3 years ago

Europe (Frankfurt) and I am from Germany Bamberg 😢