08-10-2016 6:30 AM
Hi,
I am creating SQL views in AMDP via ABAP.
Can you please let me know how to get back any error or success messages, that gets generated in HANA Console.
Thanks,
Vaibhav Goel
08-10-2016 8:13 AM
Hello,
You can get error handling in below way..
TRY.
"Your AMDP Method
CATCH cx_amdp_error INTO lx_amdp_error."Exceptions
DATA(lw_text) = lx_amdp_error->get_text( ).
MESSAGE lw_text TYPE 'E'.
ENDTRY.
Successfully execution of AMDP without exceptions that means success.
Also you can get export success result in exporting parameter in AMDP.
-Cheers,
Amol S
08-10-2016 8:13 AM
Hello,
You can get error handling in below way..
TRY.
"Your AMDP Method
CATCH cx_amdp_error INTO lx_amdp_error."Exceptions
DATA(lw_text) = lx_amdp_error->get_text( ).
MESSAGE lw_text TYPE 'E'.
ENDTRY.
Successfully execution of AMDP without exceptions that means success.
Also you can get export success result in exporting parameter in AMDP.
-Cheers,
Amol S
08-10-2016 5:58 PM
08-10-2016 7:24 PM
Hello,
Without any exceptions itself its an success.
But if you are expecting success message like table get created some number of entries or else.
Then and only then you have to write it a script with exporting parameter.
OK. Let me explain you with an example.
Suppose you are developing AMDP method for inserting a single entry in table. If it successfully inserted in table then you can export the result in exporting parameter. Based on what type of result you are looking for and you can decide whether its successful or.....
If its fails or any error occurs can be able to capture with exception block.
I am assuming you know HDB procedures and ABAP Object
Do I need to elaborate more??
Cheers,
Amol S
08-10-2016 8:16 PM
Thanks Amol.
I am kind of new to HANA having some basic knowledge.
If you can elaborate a bit more, that will be really helpful.
I am looking for something which can capture the HANA console log messages whether be success or errors.
Errors as you mentioned we can catch in exception - I will try that.
Thanks,
Vaibhav
08-12-2016 8:02 AM
Hi,
Can you explain me, what kind of success message are you getting while executing something..
-Amol S
08-12-2016 5:49 PM
Hi Amol,
Basically, I will be using this for DDL like creating SQL views dynamically from ABAP using AMDP.
SO, messages like.. SQL View got created successfully.. can we capture these messages ?
Thanks,
Vaibhav
08-13-2016 4:22 PM
Ok got it...
If any error occurs it will get captured in AMDP exception.
If without error create_view(your complete statement)executed in AMDP after create_view statement you can write a query on "VIEWS" table where view name.
If you get count that means its executed and same thing you can put in exporting parameter for success message...
I guess you got complete and clear idea now...
-Amol S
08-15-2016 7:17 PM
Thanks Amol.
We can do that also, that will be an extra select in our routine. But no issues.
Regards,
Vaibhav