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: 

How in AMDP SQL can I use an input table to delete rows from HANA table NOT in ECC?

Former Member
0 Kudos

I am creating CRUD functions for a table in HANA that is NOT an ECC table.

The Create(using insert into), Read(using select from), and Update(using update) but the

delete from schema.hanatable where schema.hanatable.field1 = :it_inputtable.feild1

and schema.hanatable.field2 = :it_inputtable.feild2

and schema.hanatable.field3 = :it_inputtable.feild3;

Does not work (tried several variations)

It works if I only match on one field but the table has four fields as the key

delete from schema.hanatable where schema.hanatable.field1 = (select field1 from :it_inputtable where schema.hanatable.field1 = :it_inputtable.feild1

and schema.hanatable.field2 = :it_inputtable.feild2

and schema.hanatable.field3 = :it_inputtable.feild3

How in AMDP SQL can I use an input table to delete the matching rows from a HANA table that is NOT in ECC DDL so I can't use normal ABAP?

3 REPLIES 3

horst_keller
Product and Topic Expert
Product and Topic Expert
0 Kudos

This question does not belong to ABAP Development but to Hana Development.

There is no AMDP SQL.

AMDP manages procedures written in SQLScript, but it is purely Hana what happens inside.

https://help.sap.com/viewer/de2486ee947e43e684d39702027f8a94/2.0.00/en-us

Former Member
0 Kudos

Answers like this is why I hesitate to ever use SAP.com and it's variations to try to get help.

There are no TAGS for AMDP or for the SQLSCRIPT that works in AMDP.

The answers in HANA refer to SQLSCRIPT used in HANA stored procedures and does not work the same in AMDP process procedures.

As of 7.5 I think, you can write SQLSCRIPT in an AMDP procedure for HDB. I have Two development projects that update HANA tables using SQLSCRIPT written in AMDP methods. These are ABAP development projects in ADT and do not call HANA procedures.

The document you point to vaguely describes HANA SQLSCRIPT I guess but since that syntax does not work when put into an AMDP process I assumed that there was a different kind of SQLSCRIP for AMDP.

I can do the delete passing one record at a time I just wanted to pass the internal table.

horst_keller
Product and Topic Expert
Product and Topic Expert
0 Kudos

I hesitated to comment on this at all, but well ...

"Answers like this is why I hesitate to ever use SAP.com and it's variations to try to get help."

Hmm, OK, maybe you can find alternate facts elsewhere.

"The answers in HANA refer to SQLSCRIPT used in HANA stored procedures and does not work the same in AMDP process procedures."

Why do you think so? An AMDP procedure is a HANA stored procedure. AMDP is a framework that creates such procedures (same as ABAP Dictionary creates data base tables) on HANA and allows you to call them from ABAP. But once created, technically it is a
HANA stored procedure.

"I have Two development projects that update HANA tables using SQLSCRIPT written in AMDP methods. These are ABAP development projects in ADT and do not call HANA procedures."

Wrong. When you call a AMDP method from ABAP, the ABAP runtime environment calls the HANA procedure (internally using ADBC).

"The document you point to vaguely describes HANA SQLSCRIPT"

Well, this is the official HANA SQLScript documentation. If you don't like it, discuss it under HANA development or open an incident. Under ABAP Development, you are welcome to complain about the ABAP documentation.

"but since that syntax does not work when put into an AMDP process"

That should not be the case, see above.

"I assumed that there was a different kind of SQLSCRIP for AMDP"

No, there isn't. There are some additional checks, but once created, see above ...

By the way (from the AMDP documentation):

In SQL Script, tabular parameters are handled as temporary database tables. An internal table passed...