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

Help with AMDP procedure - For all Entries

Hi Experts,

I want to write a AMDP procedure by passing an internal table as where condition.

What would be the best approach? Our system is NW 7.4. I have used APPLY FILTER function but it didn't work.

My input internal table looks like this:

Consumer Date Low Date High 1001 01.01.2015 31.12.2016 1002 01.01.2014 30.06.2014

Table in HANA DB

Consumer Date Sales 1001 01.01.2014 10 1001 01.01.2015 10 1001 18.08.2016 10 1002 01.01.2014 10 1002 02.02.2014 10 1002 30.06.2014 10 1002 01.01.2016 10

Output internal Table

Consumer Sum of Sales 1001 20 1002 30

Looping my internal table and getting the sum for each record will work but as you know it is performance killer.

I would be calling this procedure in a BW transformation where data come in package of 50000 records(so my input internal table can contain 50,000 records at a time) .

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Aug 19, 2016 at 10:49 PM

    Hello Sumukan,

    you can solve this with a join between the input parameter table and the database table. E.g.

    lt_res = select t2.consumer, sum(t2.sales)
                from :it_input as t1 inner join "<schema>"."<table>" as t2
                   on t1.consumer = t2.consumer
                   and t1.datelow <=
                   and t1.datehigh >=
                group by t2.consumer;

    Consider that you have to replace the input parameter, schema/table name and column names with your values (cause I don't know it).

    Best Regards,


    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.