How to extend standard CDS views

0
527

Dear SAPLearners, in the blog post we will learn on how to extend standard CDS Views using Eclipse ABAP Development Tools(ADT).

Given some client/business requirements we may have to extend standard CDS views to add extra fields.

Also Read: How to find all standard and custom CDS views in the system

CDS View Extensions

A CDS view is extended by creating a new DDL source with DDL statement EXTEND VIEW.

As we know for every DDL source we have 2 corresponding dictionary objects created: “The CDS View and the SQL View”.

So when you extend a CDS view, there will be two corresponding objects created: “The CDS view extension and an Append View”.

In this example i will be using standard CDS view “SEPM_SDDL_SALESORDER_HEAD” and add 3 new fields. Lets see the steps to extend a standard CDS view.

CDS view development and extensions is done using Eclipse ABAP Development Tools(ADT).

Step-by-Step Procedure

Launch the Eclipse ABAP Development Tools.

In your ABAP project, select the relevant package in the Project Explorer.

Right-click on the package and choose: New – Other ABAP Repository Object – Core Data Services – Data Definition to open the creation wizard.

Enter the Name and the Description for the CDS view extension. Choose Next.

Assign a transport request, if prompted and choose Next.

Select the Extend View template and choose Finish.

In DDL source code editor, enter the necessary information for names of the append view, the original CDS view and for the actual view extension like below.

In the above CDS view source code, i have extended the view: SEPM_SDDL_SALESORDER_HEAD with three new fields: overall_status, payment_terms and payment_method

Save and activate the newly created CDS view extension.

After successful activation, check the DDL SQL Append View “ZD_EXTENDAPPND” in SE11 transaction.

Additional fields are added to original CDS view using append view

Now that, we have created CDS view extension lets check the output of the original CDS view using Data Preview

Congrats!! you have successfully extend standard CDS view using EXTEND VIEW.

Please feel free to comment and let us know your feedback. Subscribe for more updates

If you liked it, please share it! Thanks!

LEAVE A REPLY

Please enter your comment!
Please enter your name here