cancel
Showing results for 
Search instead for 
Did you mean: 

Call calculation view inside a ABAP CDS view

shyam_uthaman
Participant

Hi All,

We are on S4HANA 1709 and wanted to read a HANA live calculation view inside an ABAP CDS view.

What I am looking for is something like the below to run

@AbapCatalog.sqlViewName: 'SQL_VIEW_NAME' @AbapCatalog.compiler.compareFilter: true

@AccessControl.authorizationCheck: #CHECK

@EndUserText.label: 'HANA'

define view ZCDS_TOHANA as select from "_SYS_BIC"."ZCUSTOM/ChangeRequestHeader"

{ field1, field2

}

What's the best way to read this view? I don't think select from _SYS_BIC will work.

Please let me know your suggestions.

Shyam

Accepted Solutions (1)

Accepted Solutions (1)

ssurampally
Active Contributor
0 Kudos

I do not think you can access database artifacts directly ABAP CDS, you have to bring that view into ABAP layer first and use it in CDS view.

You can refer to these documents,

https://blogs.sap.com/2018/06/27/accessing-native-hana-tables-in-s4-abap-cds-views-analytics/

https://blogs.sap.com/2018/05/24/abap-dictionary-external-views-for-overcoming-abap-cds-views-limiti...

shyam_uthaman
Participant
0 Kudos

Hi Sree,

I tried the second URL and it worked.

I did have to convert all VARCHAR datatypes in native HANA to NVARCHAR to support the creation of DB view in S4HANA.

Thanks for these links.

Shyam

0 Kudos

Does it also mean that we cannot use ABAP CDS View in Hana View right?

Answers (3)

Answers (3)

former_member187192
Participant
0 Kudos

Best way is to call your HANA View in CDS view of type Table Function.

Now, you can use this table function in CDS view.

With Dictionary External view issue is it doesn't work with Input parameters defined in HANA views but Table function does.

Best Regards,

Mayank Jaiswal

dmitry_kuznetsov1
Active Participant
0 Kudos

Gets, a simple recommendation by SAP:

1. choose one way of development - ABAP CDS or HANA CalcViews.

2. Follow your choice

P.s. in S/4HANA, obviously, your choice is ABAP CDS, in SoH you can still find out yourself...

Cheers,

_________________

Dmitry Kuznetsov

BI Consulting

ssurampally
Active Contributor
0 Kudos

hi, a SQL view is generated in HANA DB for every ABAP CDS view, so you can use the SQL view in HANA modeling or ETL.