Application Development 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: 

CDS View - consuming HANA artifact (calculation view generated by BW)

Former Member
0 Kudos

Hi,

Can I consume a calculation view in a CDS view like below? If not, how should I then do it?

@AbapCatalog.sqlViewName: 'Z_Cds_Test_12345'

@EndUserText.label: 'CDS View on generated view for NCTT2000'

define view Z_Cds_Test_Nctt2000_Gen_View as select from "_SYS_BIC"."system-local.bw.bw2hana/NCTT2000" {

    CALMONTH,

    AMOUNT   

}

At least when I try I get an error:

Description Resource Path Location Type

Table _SYS_BIC does not exist or is not active Z_CDS_TEST_NCTT2000_GEN_VIEW (ABAP DDL Source) [D32] Z_CDS_TEST_NCTT2000_GEN_VIEW Unknown ABAP Syntax Check Problem

Thanks in advance, kr

Torben

1 ACCEPTED SOLUTION

amol_samte
Contributor
0 Kudos

Hi Torben,

We had gone through same scenario which has to be later used in ALV IDA, in such case we have created external view based on hana view and used in CDS view.

Another way you can directly access hana view inside AMDP and can be reusable.

-Amol

9 REPLIES 9

jasmin_gruschke
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Torben,
no, this is currently not possible - CDS views are database independent which contradicts with the feature you'd like to use.

You can create an external view on top of the HANA artefact (if it has a representation in the HANA content) or you can (preferred option) consume the view in an ABAP Managed DB procedure.

Cheers,
  Jasmin

0 Kudos

Hello Jasmin,

I want to consume external view in CDS view. Is this possible, as it's not allowing me.

Your details response really helpful.

Regds, Palas

0 Kudos

Hello Jasmin,

I was working on couple of LIVE views (ex. "_SYS_BIC"."sap.hba.ecc/WorkCenterCapacity"). I converted this into external view and while trying to consume it in CDS view it's showing an generic error ( ‘An error occurred while creating view <ZXXXX> in the database.’).

Few more scenarios I tried:

1. While using DDIC view in CDS, it's working.

2. While converting customized HANA view to external view, I can consume the same external view to CDS without any error.

3. Even encapsulating Live view into HANA view and using that converted ext view to CDS- throwing same generic error.

Not sure what is the special about those external view converted from LIVE view directly or indirectly.

Can you please put some light on it?

0 Kudos

Hello Jasmin,

I was working on couple of LIVE views (ex. "_SYS_BIC"."sap.hba.ecc/WorkCenterCapacity"). I converted this into external view and while trying to consume it in CDS view it's showing an generic error ( ‘An error occurred while creating view <ZXXXX> in the database.’).

Few more scenarios I tried:

1. While using DDIC view in CDS, it's working.

2. While converting customized HANA view to external view, I can consume the same external view to CDS without any error.

3. Even encapsulating Live view into HANA view and using that converted ext view to CDS- throwing same generic error.

Not sure what is the special about those external view converted from LIVE view directly or indirectly.

Can you please put some light on it ?

amol_samte
Contributor
0 Kudos

Hi Torben,

We had gone through same scenario which has to be later used in ALV IDA, in such case we have created external view based on hana view and used in CDS view.

Another way you can directly access hana view inside AMDP and can be reusable.

-Amol

0 Kudos


Hi Amol,

thanks.

I went for the AMDP approach as it would be a higher maintenence effort when using an external view as it would have to be maintained when the calculation view changes.

Furthermore I got errors when I try to generate a external view (7.40 SP5) on top of a calculation view that has been generated by the system on top of a InfoCube in BW. Should would have to build my own which wouldn't make sense when I can use a AMDP instead straight off on the calculatation view generated by BW.


ex of the error, "Field 0CALMONTH does not begin with a letter (please check)null"

Thanks for your support.

KR

Torben

0 Kudos


Hi Torben,

While creating external view, in calculation view should not be contain any field start with other than letter.

Just rename the field 0CALMONTH either copy it and give new name at infocube level.

or

At the time of calculation view creation, create new calculated column which contain 0CALMONTH start with letter and use it new field instead of using 0CALMONTH at semantic level.

-Amol Samte

0 Kudos

Hi Amol,

I know that the fields shouldn't start with a number in a external view - however it makes no sense to start changing objects in the InfoCube in order to make an external view in hana that then can be consumed in a CDS view, when we instead can use the AMDP approach and consuming the automatically generated calculation view for the InfoCube directly in the AMDP.

So we have gone for the AMDP approach - it will give less overhead in this case

Thanks for your inputs.

KR

Torben

0 Kudos

Hello Amol,

I'm trying to do the same, consuming a external view in CDS but not allowing the same.

Can you please tell me how to do the same ?

Thanks Palas