Part#5. CDS View Extension | SAP Blogs

WRITTEN BY: supportmymoto.com STAFF

SAP gives a number of customary CDS view associated to every useful module and in addition throughout a challenge implementation you’ll create tons of CDS customized views.  For the reason that CDS views are simply digital information fashions, it would be best to reuse the view created in a single challenge or for one object to a different challenge/object.  Let’s assume you created a CDS view with 5 fields on TABLE A and for one more state of affairs in a unique challenge you want 8 fields from the identical TABLE A.  So as a substitute of making new CDS view from scratch, we will use the idea of CDS View extension and re-use the earlier view we created and lengthen it with 3 new fields.

  1. Create a CDS view with Template ‘Lengthen View’

 

 

Under is the default view generated;

 

Now add the SQL view identify and different properties;

  1. SQL View identify: ZSQL_EXTEND_VIEW
  2. Let’s lengthen the view we created earlier than: ZCDS_BASIC_VIEW. This might be an ordinary view as effectively.  Any view which you want to lengthen with new fields.
  3. Hit CTRL + SPACE to see the fields which you want to lengthen with. This may use the datasource/desk used within the view we’re extending i.e. desk SFLIGHT in our case.

Add the fields you want to lengthen and ‘Activate’ the view.

 

Hit F8 and examine the output.  You’ll be able to see that the three new fields can be found on this view along with all different fields of the view we prolonged;

See also  Benefits of Ceramic Tiles for Home

Hit F8 and examine the output.  You’ll be able to see that the three new fields can be found on this view along with all different fields of the view we prolonged;

 

In abstract, we seemed on the re-usability idea on this weblog publish, which is essential to cut back the event effort and to comply with the Greatest SAP Practices as effectively.  As a substitute of making from scratch, it’s extremely essential to learn about SAP delivered customary CDS views to re-use them in your challenge to satisfy particular enterprise necessities.

My subsequent weblog publish will probably be about:

Half# 6. Parameters in a CDS view : Discover ways to filter information in a CDS view

 

Observe me for upcoming weblog posts: Sanjeev Kumar

Continue to learn..

SK

 

NOTE : Please do not copy - https://supportmymoto.com

Leave a Reply