Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Can sqlViewName of CDS view be renamed?

EricYu0912
Product and Topic Expert
Product and Topic Expert
20,889

Hi all,

In CDS view, the first line is defined as

@AbapCatalog.sqlViewName: 'ZVIEW1'

My questions is, can 'ZVIEW1' be renamed?

I tried to rename it but got an error of "it cannot be rename cause it has been shipped".

1 ACCEPTED SOLUTION
Read only

retired_member
Product and Topic Expert
Product and Topic Expert
10,718

No, as documented.

Hi all,

In CDS view, the first line is defined as

@AbapCatalog.sqlViewName: 'ZVIEW1'

My questions is, can 'ZVIEW1' be renamed?

I tried to rename it but got an error of "it cannot be rename cause it has been shipped".

6 REPLIES 6
Read only

retired_member
Product and Topic Expert
Product and Topic Expert
10,719

No, as documented.

Read only

10,718

I would like, that this is made to be possible. The simplest reason is a spelling mistakes which can happen any time.

Read only

Former Member
10,718

Hi Eric,

I encountered the same problem. When you first activated your CDS View, SAP generates an active version in the version database table. Because of that, the CDS Entity and the SQL View have been coupled. When you want to change the SQL View name, SAP does not allow because it is looking at the last active version.

So the steps are:

  1. Make a local copy of the source code.
  2. Delete CDS Data Definition on Eclipse.
  3. Delete all the stored versions from table VRSD. (You can check on SE16N where OBJNAME="ZVIEW")
  4. Create new Data Definition with the copy you made.

Read only

0 Likes
10,718

Thank you!

Read only

0 Likes
5,383

This + DDIF_OBJECT_DELETE to delete the SQL view that had been automatically created

Read only

0 Likes
10,718

Hi Eric,

Its not possible to rename the sql view name once the view is activated.

if u want to change the view name u have to delete the data definition and recreate the data definition with different sql view name