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

Read Hana table into ABAP program

4,878

Hi Experts,

We having a HANA hdbtable in a different schema. I want to get the table data into an internal table of ABAP program.

We are using a latest ABAP and help me how we can achive this.

Hi Experts,

We having a HANA hdbtable in a different schema. I want to get the table data into an internal table of ABAP program.

We are using a latest ABAP and help me how we can achive this.

8 REPLIES 8
Read only

GK817
Active Contributor
0 Likes
3,531

Hi Praven,

You can use the AMDP to read data through CDS views and then you can put a select on CDS view to get it into an internal table.

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

Gaurav

Read only

0 Likes
3,531

Thank Gaurav. Is there a way to call the AMDP method directly into the program without using CDS (Like by chaging the method declatation)?

Read only

matt
Active Contributor
0 Likes
3,531

AMDP is not restricted to reading data through CDS views. This is an unnecessary complication.

Read only

matt
Active Contributor
3,531

You can use AMDP to create methods in a class that are callable from ABAP. The methods contain SQL Script. You do not have to use CDS views.

Simple example here (SAP Help) based on dealing with SFLIGHT directly from in HANA.

Read only

0 Likes
3,531

Thanks Matthew, Can you help me know how to use SFLIGHT for calling the hdbtable.

Read only

GK817
Active Contributor
0 Likes
3,531

You are right Matthew

Read only

0 Likes
3,531

Hi Matthew/Gaurav,

I can using only ABAP dictionary tables after USING statement. Can you help how I can select the data of hdbtable and pass as a return to to the AMDP class.

Read only

matt
Active Contributor
0 Likes
3,531

I don't have time to check. Or a HANA database for that matter...

Two alternatives:

1. Call a HANA stored procedure from the amdp class.

2. CL_SQL_STATEMENT and associated classes/methods (also known as ADBC).See here https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenadbc_query_abexa.htm This is far more flexible than an AMDP