ALV Report on SAP HANA: Opportunities and Challenges, Part XX, ABAP for SAP HANA

Everyone has been swept away by the SAP HANA Storm. According to a SAP study, over a thousand clients were already using S/4HANA. Therefore, all practitioners working on SAP would need to learn how to swim in HANA, if not now then tomorrow.

ABAPer, who programs ALV Reports every other week, is the only remaining SAP Practitioner after selection.Have you ever considered the pros and cons of designing an ALV report in SAP using the HANA Suite and Database?We would attempt to tell tales from both the HANA period and the pre-HANA era in this piece.

The Cockroaches of the SAP world are ALV Reports; they would endure through all evolutionary stages.

The foundation, starting point, or roots of an ALV in HANA World are the same as they were in a traditional database—that is, SELECTION-SCREEN. Unfortunately, as soon as we see this, we usually jump to some assumptions. There must be selection screen blocks, radio buttons, checkboxes, and other elements on the screen.This is unfortunate since, on the one hand, Fiori Launchpads provide vibrant, dynamic screens with apps that improve User Experience (UX) via SAP UI5, and, on the other hand, classic ALVs.

Instead of whining about it, we should keep in mind that clients (still) want ALV reports that resemble typical T-Code output, like ME2N (quoting because that’s the need I received).

How can we (ABAPers) live happy, fulfilling lives? Including HANA in the mix results in improved performance, which is more crucial, and somewhat easier coding.

The “Code Push Down” or “Code to Data (Database) Paradigm” notion is the only thing that can be blamed for the performance increase. Have you heard about it anywhere? Never say “no.” We are currently on part twenty of our HANA ABAP Series.

This is the turning point. IDA is one option, or one might use CDS View in conjunction with AMDP (if needed). Although IDA is far simpler to use than AMDP, neither program can take the place of the other. They each have a part to perform. I will discuss the benefits and distinctions between IDA and CDS in my upcoming article.

Therefore, we have the following for ALV in HANA:

  • Screen of Selection
  • Data in CDS +/- AMDP is available.

What comes next? Simply join them.

  1. Adding CDS view entries to the selection screen criteria.

Step three is a little more difficult. Here, we have numerous opportunities once more.

We’ve now limited it to:

  1. Screen of Selection
  2. Data in CDS +/- AMDP is available.

using AMDP to apply selection screen criteria to CDS view entries, importing just necessary entries into the AS layer, and then using OOPs to continue with the standard SALV factory class.

Technical Details

  1. Conversion of Dynamic “WHERE CLAUSE” from Select-Options:

The first challenge would be to integrate the select choices into AMDP after the standard selection screen is constructed. We have the following snippet of code to help us achieve that:

DATA(lv_where) = cl_shdb_seltab=>combine_seltabs(

it_named_seltabs = VALUE #(

( name = ‘MATNR’ dref = REF #( so_matnr[] ) )

( name = ‘EBELN’ dref = REF #( so_ebeln[] ) )

) ).

cl_shdb_seltab=>combine_seltabs(

EXPORTING

it_named_seltabs = VALUE #(

( name = ‘MATNR’ dref = REF #( so_matnr[] ) )

( name = ‘EBELN’ dref = REF #( so_ebeln[] ) )

)

RECEIVING

rv_where = DATA(lv_where) ).

2. Making use of AMDP‘s dynamic

 where clauseUsing the where clause presents the next task. SAP AS 7.40 and later versions have a capability called “APPLY FILTER.” The lv_where clause created previously is supplied to the ip_filters AMDP method parameter.

In summary:

By utilizing HANA Studio and HANA DB, we can benefit from the following opportunities and advantages:

  • Better Performance because most data fetching, aggregations, sums, and averages are handled at the HANA database and there is code push down.
  • Custom naming of the ALV output fields can be done dynamically on the fly by utilizing CDS.
  • AMDP dynamic SELECT queries depending on user input and material maintained in the database (e.g., if the database has the columns City and Country, we may use the CASE statement to determine whether the user’s input city is the capital or not).

It can be rather helpful for an outer join if we need to skip the current field values.

There might still be performance problems if we use CDS Views to extract data into the AS layer (despite if CDS artifacts will still deliver good performances, nevertheless the improper usage of CDS can backfire).

To see a glimpse of the real code that illustrates all of the aforementioned and IDA, please wait for the next article. Thus, please pay attention and become habana-tized.

We would now like to speak with you.

Kindly share your thoughts, anecdotes, and brief remarks below.

Salesforce course with placement in Pune

Robotic Process Automation (RPA): A Comprehensive Guide to Implementation and Success

Related Posts

Apply SAP is Google Map API Free to find the latitude and longitude of any location.

SAP is Google Map API Free never ceases to amaze us. Even after working for over ten years, a new project or client may have particular requirements that call for…

Part XI: ABAP on SAP HANA. Are Open SQL and Native SQL rivals?

To put Native Syntax briefly: Telling an ABAPer that they are not the true SQL developer would not sit well with them.ABAPers don’t often work with Native SQL, after all.For…

Leave a Reply

Your email address will not be published. Required fields are marked *

You Missed

ALV Report on SAP HANA: Opportunities and Challenges, Part XX, ABAP for SAP HANA

  • By Varad
  • October 21, 2024
  • 2 views

Apply SAP is Google Map API Free to find the latitude and longitude of any location.

  • By Varad
  • October 18, 2024
  • 3 views

Part XI: ABAP on SAP HANA. Are Open SQL and Native SQL rivals?

  • By Varad
  • October 17, 2024
  • 2 views

SAP Fiori App: An ABAPer’s The Beginning

  • By Varad
  • October 15, 2024
  • 2 views
SAP Fiori App: An ABAPer’s The Beginning

Part I of the SAP Fiori Tutorial: System Validation, setup, and Configuration

  • By Varad
  • October 14, 2024
  • 3 views
Part I of the SAP Fiori Tutorial: System Validation, setup, and Configuration

Part II of the SAP Fiori Tutorial: End-to-End Fiori App Development

  • By Varad
  • October 12, 2024
  • 2 views
Part II of the SAP Fiori Tutorial: End-to-End Fiori App Development