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: 

Get Error log back in AMDP

0 Kudos

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

1 ACCEPTED SOLUTION

amol_samte
Contributor
0 Kudos

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

8 REPLIES 8

amol_samte
Contributor
0 Kudos

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

0 Kudos

Thanks Amol.

How will I get the success messages exported ?

0 Kudos

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

0 Kudos

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

0 Kudos

Hi,

Can you explain me, what kind of success message are you getting while executing something..

-Amol S

0 Kudos

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

0 Kudos

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

0 Kudos

Thanks Amol.

We can do that also, that will be an extra select in our routine. But no issues.

Regards,

Vaibhav