cancel
Showing results for 
Search instead for 
Did you mean: 

SAP BW on Hana - complex logic using AMDP

0 Kudos

Hello,

I've read several interesting BW on Hana transformation blogs by several authors, but I could not find any blog that performs complex transformation

We've complex routines in the END routine that use source_package, transform and create result packages.

I'm looking for some sample code that uses loop and loop, if else conditions, field symbols etc. Can anyone share piece of code that uses complex code that reads intTAB and produce outTab? Thank you for your help.

Accepted Solutions (1)

Accepted Solutions (1)

former_member380694
Discoverer
0 Kudos

Hi William,

there are several examples of usage of loops, cursors, if/endif etc. in the SQLScript reference on SAP Help Portal. But it is clearly pointed out, that you have to avoid using imperative logic as far as possible. The reason: imperative logic cannot be parallelized as functional.

As you can see in SAP Tutorials (e.g. https://www.sap.com/developer/tutorials/xsa-sqlscript-anonymous.html ) SQLScript can be used to solve quite difficult tasks.

In ABAP you normally do one “heavy” select in the beginning of your program and then process the data locally using variables and internal tables.

In AMDP Transformation/Stored procedure you have to use SELECT as more as possible.You use SELECT to select data from database table, and then you use SELECT to do some transformation with data retrieved from database (e.g. format strings using string functions https://sapstudent.com/hana/sql-string-functions-in-sap-hana ), and then you might aggregate the data still using SELECT statement. You are building some sort of pipeline.

Regards,

Nikolay

Answers (3)

Answers (3)

0 Kudos

Hi Nikolay,

Your information indeed helped !. I've a follow up question for you. In SQLSript, Select command can use both SAP provided and custom created functions.

Can I develop custom function (table,scalar) in HANA Studio and call in select command? Do you advise to NOT do this for performance reason?

If you say yes to create custom Function, then could you please outline some steps that needs to be taken to implement the function and to transport to QA->Prod. AMDP can be transported via transport system. But I suspect we need to import and export the functions separately and provide access rights!

Thank you kindly for your generous help. Much appreciated!.

Regards,

William

0 Kudos

Hi Nikolay,

Your answer truly helped . I'm going to read up on that.

Thank you kindly,

William.

0 Kudos

Hi,

Any help please

regards