Open juliax00 opened 5 years ago
Hi @juliax00 ,
My opinion is that the consumption views don't not 100% required for such small cases. Thus, for example, if you want to get a material unit, you can just select it from I_Material
without creating a specific consumption view.
But on another hand, very rare the app only needs to read some plain data like in the example above. Normally you want to process this data and read some data from other sources. In this case, you can group these reads into a solid model in CDS layer, and then read the data, that 100% fulfills the program needs.
So be reasonable and don't over-complicate the data model, but also try to group a chain of database reads into a single model, that can prepare this data on the DB layer.
The idea of 'Consumption View' is it creates a User Consumable/Many other 3rd party consumable view. 'Consumption View' gets process through 'OLAP' engine built withing S4 system and provide different end user formatting option. If your target is to consume the outcome of any view fro a ABAP Code, you don't really need a consumption view.
So to cut sort 'Consumption View' is only required for 'Analytical'/'Reporting' application.
Now come to point why we build COMPOSITE view on top of BASIC View? There is strict rule that you can not build a Consumption View on top of Basic View. Consumption view joins/(association) multiple basic views keeping all its defined properties(annotation) of each field intact. Where as if you use raw join statement for joining multiple tables/views, you will loose the properties defined for each fields in the lower level view, and you need to redefine them.
Hello everyone,
you write "Use Basic Views instead of direct access to database tables in CDS Views. Create Basic CDS View when you create a new database table and want to access its data in CDS.".
At our company, we are currently defining best practices for our developments - we have two possible approaches:
strict procedure according to the VDM: Each application has its own Consumption View, which is based on Composite Views, which are based on Basic Views. Basic Views are based on data base tables. It is not allowed to consume data (select in ABAP Coding) directly from Basic Views. For database tables, Basic Views should always be created directly.
basic idea follwing the VDM: If only less data is needed that is already available in the Basic Views, an Consumption View does not have to be created (for example: select serial numbers for all equipments). It can be selected directly from the Basic View. So the data consumption does not have to base strictly on Consumption Views.
What is your opinion on these two scenarios? Please elaborate. Unfortunately we did not find a SAP source that says that you can / should select from Basic Views.
Thank you and regards Julia