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

SAP XI/PI – Invoice Attachment Transfer from ARIBA to VIM

The documents that are connected to the invoice in the Ariba Network system should be transferred to the VIM system via PI Integration as part of the Ariba Supplier Invoice…

Attachments for SAP XI/PI – ARIBA Invoices sent via PI to S/4HANA

Integration with SAP systems has never been more intriguing, especially with Ariba, Workday, Concur, Successfactors, Fieldglass, Hybris, and other satellite cloud solution vendors banging on doors every day. 🙂 I…

Leave a Reply

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

You Missed

SAP XI/PI – Invoice Attachment Transfer from ARIBA to VIM

  • By Varad
  • November 8, 2024
  • 2 views
SAP XI/PI – Invoice Attachment Transfer from ARIBA to VIM

11 Steps to Include a New Field in an Already-Existing SAP LSMW Batch Input Recording

  • By Varad
  • November 6, 2024
  • 2 views

Part 23 of ABAP for SAP HANA. How Can AMDP Be Used to Access Database Schema Dynamically?

  • By Varad
  • November 4, 2024
  • 2 views

S/4HANA VDM 1 Employing CDS Virtual Data Model for Embedded Analytics

  • By Varad
  • November 1, 2024
  • 5 views