Skip to Content
author's profile photo Former Member
Former Member

Can we write the HANA code in ABAP BADI's?

Hi Experts,

please guide me whether can we add the HANA code in ABAP BADI's? actually i got one performance issue with nested loops.

Ex: i have two internal tables with 5k records in both and have to consider every record for processing from both internal tables by nested loop( so 5k * 5k = 25000000 times) in Dev system. Somebody told me that by using HANA code we can reduce this issue.

please advise me how to overcome this issue in ABAP.



Add comment
10|10000 characters needed characters exceeded

2 Answers

  • Posted on Jan 19, 2016 at 03:41 PM

    To generic question to answer, let us know what you are trying to achieve in the loops.

    Did you mean you want to use Native SQL ?



    Add comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 21, 2016 at 07:57 AM

    what those loops are doing ? Are you trying to create a combination table ?

    if just reading, it is not that much i am doing similar one with 100K-1million row tables.

    better post your logic here, i am sure you can optimize it with hash tables , primary-secondary indexes.

    If you are going to implement same logic in HANA it may take longer aswell unless you execute in 1 select statement by cross join.

    Add comment
    10|10000 characters needed characters exceeded

    • first lets remove your select * which is inside the loops and put outside of the loop.

      Never read anything inside a loop 😀. probably hundred thousands-millions of select statement is going to db side.

      to make a quick test. remove the select statement (i mean comment it ) and run the code, so lets see the minimum possible time that the code can run. later we can optimize.

      lets assume without select (just comment the line ) program finish in 2 min, so after moving select to outside of the loop and reading the records with either read table or looping from a hash table, we can let it finish in 2 min 30 sec or 3 min depending on the number of records on the last table.