Quantcast
Channel: SCN : Discussion List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 6412

No data found exception handling in AMDP

$
0
0

HI All,

 

I have seen numerous discussions on handling of exception handling for "No data found", but I am stuck in strange problem.

 

I have the following AMDP:

 

Method GET_COUNT by database PROCEDURE FOR HDB LANGUAGE SQLSCRIPT

    options READ-ONLY using Alpha Beta Gamma.

 

    begin

    declare V_SPC integer := 0;

    declare V_REL integer := 0;

 

DECLARE EXIT HANDLER FOR SQL_ERROR_CODE 1299

begin

        SELECT COUNT( IND_ID ) INTO V_SPC FROM Alpha AS A

                          INNER JOIN Beta AS B ON

                          A.INN_ID = B.INN_ID

                          GROUP BY IND_ID

                          having IND_ID = :IV_VAR;

end;

 

DECLARE EXIT HANDLER FOR SQL_ERROR_CODE 1299

begin

        SELECT COUNT( INN_ID ) INTO V_REL FROM Gamma

                          WHERE IND_ID = :IV_VAR;

end;

 

         EV_COUNT := :V_SPC + :v_rel;

        end;

 

  endmethod.

 

Now I wish to call this in loop from a program. When I was not doing error handling my program was dumping. When I did error handling then I am only getting 0 back. Where am I going wrong.

 

loop at lt_var assigning <fs_var>.

            call method lo_amdp->ge_count( exporting iv_var = <fs_var>-field1

                importing ev_count = lv_count ).

            write:10(5) lv_count.

endloop.

 

Regards

 

Shadab


Viewing all articles
Browse latest Browse all 6412

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>