on 04-10-2014 2:18 PM
Hi,
I wrote a procedure on HANA and i want to call via AMDP. As i saw from examples, developers generally writing the content of the procedure here but i wnt to call pre-written HANAprocedure via here.
Is it possible ?
My scenario is like that;
CLASS ZBPC_AMDP_TEST IMPLEMENTATION.
METHOD RUN_PACKAGE BY DATABASE PROCEDURE FOR HDB
LANGUAGE SQLSCRIPT.
call Z_SP_TEST(:IN_A, :IN_B, :IN_C, ET_DATA ) with overview;
ENDMETHOD.
ENDCLASS.
I dont want to put all my select statement here and also it doesnt support local temporary tables.
Is there a way ?
Hi Cekic,
it is no problem calling an other DB Procedure inside AMDP. The only thing you need to take care for is, that the DB procedure is not natively part of the ABAP transport.
So you manually have to take care, that the DB Procedure is available in the subsequent systems if you do a transport (e.g. use the HANA Transport Container).
Cheers
Jens
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am getting a Z_SP_TEST is unknown error.
Should i include anything at the beggining like a prefix ? mybe call :Z_SP_TEST like that ?
Because on SQL i can run via call Z_SP_TEST but on AMDP i get error .
Using database proxy is only way ? i dont want to use database proxy .
I want to call my procedure via AMDP only, because on the backend what proxy method do is using native sql.
You have to use the full path of the location of the procedure - it is probably not in the SAP<SID> schema. And also using quotes will help:
e.g.
call "_SYS_BIC"."system-local.private.TEST_DEMO_A4H/PAID_ON_DATE"(:iv_payment_date, :et_invoice_header, :et_invoice_item, :et_customer_info );
Cheers
Jens
If i drag from the CATALOG direcity (under SAP<SID> ) it creates like this;
CALL "SAPUHP"."Z_SP_TEST"
but system gives error "you can not set default schema SAPUHP excplicitily for this object:Z_SP_TEST"
if i remove SAPUHP, it says objct not found.
If i add SAPUHP here (normally i removed "using" section );
METHOD RUN_PACKAGE BY DATABASE PROCEDURE FOR HDB
LANGUAGE SQLSCRIPT using "SAPUHP".
CALL "Z_SP_TEST"('PARAM1','PARAM2', :ET_DATA )
ENDMETHOD.
ENDCLASS.
call doesnt give error but now it gives "source code is incomplte"
aaaaaaaaaah i will jump from the window there i s a small problem i coulnt see.
Hi Experts,
Still I'm struggling with AMDP Call Database Procedure(SAP Database).
I want to Call Database in my AMDP.
Could you please provide me sample end to end code.
Thanks in Advance...
Regards,
Siva R
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bilen,
how was the procedure Z_SP_TEST created? If...
If the procedure is created via ADBC (or other native SQL tools), you rather create the procedure in a dedicated namespace like /1BCAMDP/ (namespace reserved for generated objects as in you example). However, as Jens already mentioned, you have to take care about the lifecycle of this generated object, i.e. you have to make sure that the generation is performed before you first call your AMDP (especially the target system), otherwise you'll get a runtime error when the AMDP is executed and you try to call the non-existing procedure Z_SP_TEST.
Cheers,
Jasmin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi jasmin hi princess
number 1-2 helpmed me actually i needed this information but couldn't find in any tutorial, i tried as a last chance and it worked
here it is full of tutorials but all contains simple select statements, i dunno why ppl post tutorials about it but SAP already has this simple classes and you can find it in se24.
But as far as i know, if you creade procedures via hana they are not stored in HANA repository ?
Thanks anyway
Hi Bilen,
entirely correct. The ABAP managed database procedures only live in the HANA catalog (same if you use a "CREATE PROCEDURE" statement in the SQLConsole). If you'd like to have HANA content (which is deployed to the _SYS_BIC schema during activation/deployment) you need to do this e.g. via the HANA Studio Modeller perspective.
Cheers,
Jasmin
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.