2021 Feb 03 4:06 AM
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.
2021 Feb 03 6:42 AM
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
2021 Feb 03 7:45 AM
Thank Gaurav. Is there a way to call the AMDP method directly into the program without using CDS (Like by chaging the method declatation)?
2021 Feb 03 8:23 AM
AMDP is not restricted to reading data through CDS views. This is an unnecessary complication.
2021 Feb 03 8:23 AM
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.
2021 Feb 03 8:31 AM
Thanks Matthew, Can you help me know how to use SFLIGHT for calling the hdbtable.
2021 Feb 03 9:01 AM
2021 Feb 03 10:11 AM
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.
2021 Feb 03 1:11 PM
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
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |