ALV Report - TECHNICAL GYAN GURU https://technicalgyanguru.com All SAP information on 1 place Fri, 20 Sep 2024 11:16:20 +0000 en-US hourly 1 https://wordpress.org/?v=6.6.2 https://technicalgyanguru.com/wp-content/uploads/2024/04/cropped-cropped-technical--32x32.png ALV Report - TECHNICAL GYAN GURU https://technicalgyanguru.com 32 32 ALV Report on SAP HANA: Opportunities and Challenges, Part XX, ABAP for SAP HANA https://technicalgyanguru.com/alv-report-on-sap-hana-opportunities-and-challenges-part-xx-abap-for-sap-hana/?utm_source=rss&utm_medium=rss&utm_campaign=alv-report-on-sap-hana-opportunities-and-challenges-part-xx-abap-for-sap-hana https://technicalgyanguru.com/alv-report-on-sap-hana-opportunities-and-challenges-part-xx-abap-for-sap-hana/#respond Mon, 21 Oct 2024 07:30:00 +0000 https://technicalgyanguru.com/?p=5213 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…

The post ALV Report on SAP HANA: Opportunities and Challenges, Part XX, ABAP for SAP HANA first appeared on TECHNICAL GYAN GURU.

]]>

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

The post ALV Report on SAP HANA: Opportunities and Challenges, Part XX, ABAP for SAP HANA first appeared on TECHNICAL GYAN GURU.

]]>
https://technicalgyanguru.com/alv-report-on-sap-hana-opportunities-and-challenges-part-xx-abap-for-sap-hana/feed/ 0 5213