Handling Internal-table inside AMDP.
While developing AMDP class there must be a situation like how to handle internal table inside AMDP.
Well below is the example for that in short and sweet manner.
Before moving forward let’s see an overview of AMDP and other intresting stuff is
ABAP Managed Database Procedures – Introduction
Accessing tables from different schema through AMDP.
Call AMDP(ABAP Managed Database Procedure) Inside AMDP Method
Scenario :- 1.Suppose you have Airline code(Carrid) and connection number(Connid) in an internal table based on that you need to fetch data from inside AMDP.
AMDP Definition :
AMDP Implementation :
Calling AMDP In Program :
Hope this will help,
Thanks & Regards,
just a short comment to clarify for those new to AMDPs. In the SQLScript coding, so in the AMDP implementation, the objects it_sflight and et_flight_dtl are *not* internal tables. What technically happens, is that the AMDP runtime creates temporary tables for your tabular input/ouput parameters, which contain the data of the ABAP internal tables during runtime. This also means, that the data is copied from the ABAP layer to the DB layer and vice versa. This is something you have to keep in mind from a performance perspective. So my advice of precaution - when you use AMDPs for code pushdown and you use this pattern, keep also in mind that you don't do "data pushdown" by means of transferring a lot of data from internal tables to HANA and vice versa.
Its very good suggestion and explained in very good manner.
I have read document and have a little confusion.
AMDP Method Code looks like a FAE functionality in ABAP. As you said as a precaution, transferring huge amount of ITAB data to HANA DB causes performance issue. In case if we want transfer the huge amount of the data to achieve Code Push down, AMDP is not suitable?
Thanks and Regards,
I see you are an AMDP expert - maybe you have a hint for me, or a good connection to the development team 🙂
With 7.52 you have the possibility to use ABAP macros in the source of the SQL procedure as described here. This is very good to save the redundant definition of types:
What I would like to achieve is to declare a table type in ABAP (where you can have all the goodies like INCLUDE, automatic generation etc.), and have the corresponding table type created on SQL side by the AMDP framework, and finally reference that in SQL to set type of a 'local' variable in SQL. Sometimes this is required, because implicit typing is error prone.
According to the SQL script reference you can do:
The issue is just that there is no table type, because AMDP does not replicate any tables from ABAP to SQL except the ones used as the input/output parameters of the AMDP procedures. Creating the table type manually is then again manual work.
Something like (attention - pseudocode!)
could really be a killer-beast 🙂
Or, possibly a simpler solution - by annotating the table type itself for use in the database, sothing like (attention - pseudocode!)
Commenting on a blog post with the interest to receive answers to specific questions related to issues, is not a good idea. Instead, please ask your question in the SAP Community Q&A forum: https://answers.sap.com/questions/ask.html Once you provide details to your question, it increases the chance that active community members tracking questions will help providing answers.
thanks for the advise, what would be the best way to handle huge aumount of data. I guess pattern with select in the database would be even worst.
as always "it depends" especially on the use case, hard to give a general advice ;-).
thanks for answering, i have around 600 K rows and i have to do a lot of calculation in an internal table!