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

Important T codes for FI GL AR AP

Details of T Codes Accounting for Finances SPRO Put in the IMG OX02 Company Code to Create, Verify, and Delete OX03. Create Business Area Functional Areas for OKBD OB45 Establish…

Dynamically Download Data From Any SAP Table in ABAP-740 – Part 1

A few days ago, one of my SAP BI/BW friends requested a program that would accept any table as input and download it as a file to the local machine.…

Leave a Reply

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

You Missed

Important T codes for FI GL AR AP

  • By Varad
  • December 21, 2024
  • 19 views
Important T codes for FI GL AR AP

Dynamically Download Data From Any SAP Table in ABAP-740 – Part 1

  • By Varad
  • December 20, 2024
  • 13 views
Dynamically Download Data From Any SAP Table in ABAP-740 – Part 1

Error While Setting Up Trusted System RFC

  • By Varad
  • December 19, 2024
  • 11 views
Error While Setting Up Trusted System RFC

 Credit Management T codes in SAP

  • By Varad
  • December 18, 2024
  • 24 views
 Credit Management T codes in SAP

Troubleshooting SAP BD22: Delete Change Pointer Not Picking Correct Processed Messages

  • By Varad
  • December 17, 2024
  • 56 views
Troubleshooting SAP BD22: Delete Change Pointer Not Picking Correct Processed Messages

Working with Shell Scripts in SAP ABAP Environment

  • By Varad
  • December 16, 2024
  • 34 views
Working with Shell Scripts in SAP ABAP Environment