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

First Experiences with AMDP - Proper Solution Approach?

$
0
0

Hello,

 

Yesterday, I tried to explore how to implement a more complex example with help of AMDP. So the scenario below came into my mind.

 

My Scenario

I want to group the sales order items of the EPM demo by the company, calculate the total of the gross amount and the rates for total gross amount. The interest rates are defined in my own database table.

Therefore I have created a simple database table, which consists of the column validfrom, validto and rate.

rates.png

Please note: This example is not intended to reflect a real business requirement - it is just to explore the capabilities of AMDP. So, maybe the applied formulas can be incorrect.

 

Implementation

At first, I have created a CDS view for calculating the total by joining the tables snwd_bpa, snwd_so_inv_head and snwd_so_inv_item. Then, in the AMDP class I have implemented the SQLScript. In a report the results will be shown.

 

Please have a look at the attached files.

 

My Thoughts / Doubts

I am not sure, if the solution approach of mine is an elegant one: In the AMDP method, I have to iterations over a cursor for the CDS view and another one for the customizing table to calculate the rates. Okay it is really fast, but I think there is a better solution possible. The two iterations with the cursor seems to me a little bit clumsy ... Moreover I assume it breaks the parallelisation.

 

 

Can you please help me out?

 

Thanks in advance.

 

Kind regards,

Stefan


Viewing all articles
Browse latest Browse all 6412

Trending Articles



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