‎2016 Jul 27 5:43 AM
Hello,
I am creating a CDS view. After I activate the view, i get error that database (defined here --> @AbapCatalog.sqlViewName:) view does not exist.
Pls. let me know if anyone has any inputs.
Thanks.
‎2016 Jul 31 6:43 PM
Hi Kumail,
The annotation "@AbapCatalog.sqlViewName:" is mandatory when you create a CDS entity in Eclipse IDE. It will create CDS database view which can be viewed in SE11.
For more information, please see the documentation
ABAP CDS - Views - ABAP Keyword Documentation
Thanks,
Naga
‎2016 Aug 02 3:29 PM
Hi Saif,
Please provide the name like below. Here 'ZTEST_VIEW' name is going to store in DDIC. We can able to see this view name by using SE11 Tcode. We can only view the view but not support to edit in the se11.
Ex:
@Abapcatalog.sqlViewName: 'ZTEST_VIEW'
Please do let me know if any issue.
Thanks,
Thiru.G
‎2016 Aug 03 7:23 AM
Hi,
Find sample codes below. sqlViewName is mandatory since the new DDL sql view is going to be create at se11 in back of the CDS view. Means that every CDS view would have the sqlViewName at DDIC level.
In the below example the DDL sql view will be created in DDIC under name 'ZTEST_CDS' with fields MANDT, MATERIAl and TEXT. So sqlViewName is always mandatory.
Sample code 1.
@AbapCatalog.sqlViewName: 'ZTEST_CDS'
define view ztest_cds1 as
select from makt
{ matnr as material, maktx as text }
;
Sample code 2.
@AbapCatalog.sqlViewName: 'ZCDS_CURR_VW'
@AbapCatalog.compiler.CompareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Currency conversion'
define view Zcds_Curr with parameters
To_curr:abap.cuky(5) ,
exdate:abap.dats
as select from konp
{ knumh , kschl as condition_type, kbetr, konwa as source_currency,
currency_conversion( Amount => kbetr,
source_currency => konwa,
round => 'X',
target_currency => :to_curr,
exchange_rate_date => :exdate,
error_handling => 'SET_TO_NULL' ) as amount,
:to_curr as currency } where knumh = '0000008169
In sample 2 a DDl sql view will be created at DDIC under name 'ZCDS_CURR_VW' with fields
MANDT
KNUMH
CONDITION_TYPE
KBETR
SOURCE_CURRENCY
AMOUNT
CURRENCY.
Thanks,
Kala L.
‎2016 Aug 29 3:22 PM
Hi Kumail,
@AbapCatalog.sqlViewName annotation is required to create corresponding SE11 object. The object type of this object is "VIEW" and can be checked in table TADIR also.
Any HANA table/view can't be used from AS ABAP if corresponding structure is not present in DDIC. For same, SAP has made this annotation mandatory which creates SE11 view object.
PS: You can ping me on Lync for any issue.
Thanks,
Sumit