ABAP ALV with Integrated Data Access on HANA

    9
    14426

    Hello everyone, in this ABAP in Eclipse tutorial, we are going to learn about new version of SAP ABAP List Viewer.

    ALV with Integrated Data Access

    In short we call it as ALV with IDA. SAP has revamped the classical ALV to this version to leverage the capabilities of in-memory computing of SAP HANA.

    How it works?

    Classical ABAP ALV

    In classical ALV we write SELECT queries to get the set of data from database to application layer.

    All the data processing logic happens in application layer and finally the data is stored in internal table and then this final internal table is used in ALV to display the data.

    All UI operations like grouping,sorting,aggregation and paging are also done in application layer itself on selected data.

    ABAP ALV with IDA

    But, in ALV with Integrated Data Access( aka ALV with IDA ) only selected data is sent to the UI to display the data.

    All other operations like grouping,sorting,aggregation and paging are performed in SAP HANA database, by this the data sent to the application layer is reduced.

    ALV with IDA

    To start developing the abap alv report using ALV with IDA we need to get familiar with class CL_SALV_GUI_TABLE_IDA. There are 3 methods available in this class.

    1. CREATE    –   Create ALV with integrated data access (IDA)
    2. CREATE_FOR_CDS_VIEW  – Create ‘ALV with IDA’ for Core Data Services(CDS)
    3. DB_CAPABILITIES  – Capabilities supported by current DB

    In this tutorial we use the method CREATE to display the ALV. So lets get started.

    We assume you know how to create an ABAP program in Eclipse, if you don’t click here to know and a prerequisite to go with this tutorial.

    Step-by-Step Procedure

    1. Create an ABAP program in Eclipse by providing the Name and Description.Click on Next.

    New ABAP Program

    2. In the Selection of Transport Request window, choose the transport request. As we are saving the program in $TMP package in our case no transport request is required.Click on Finish.

    Selection of Transport Request

    3. In this tutorial, i am displaying the data of products in ALV using ALV with IDA from single table. Below is the ABAP code to create and display ALV with IDA.

    REPORT zdemo_alv_ida.
    
    DATA: lo_alv TYPE REF TO if_salv_gui_table_ida.
    
    cl_salv_gui_table_ida=>create(
      EXPORTING
        iv_table_name                  = 'SNWD_PD'    "Name of table for database access
    *    io_gui_container               =     "Container for ALV display
    *    io_calc_field_handler          =     "IDA API: Handler for calculated fields
      RECEIVING
        ro_alv_gui_table_ida           =  lo_alv   "ALV with integrated data access (IDA)
    ).
    *  CATCH cx_salv_db_connection.    "
    *  CATCH cx_salv_db_table_not_supported.    "
    *  CATCH cx_salv_ida_contract_violation.    "
    
    * Display ALV
    lo_alv->FULLSCREEN( )->display( ).

    4. What we have written in the above step. If you clearly look at the code, i have not used any SELECT query and Internal table to get the data from database into application layer.Instead we pushed this code to HANA database with Integrated Data Access class and this way of development paradigm is called Code Push Down.

    5. Copy and paste the code. Save and activate the ABAP program.Now execute the ABAP program to see the output.The output will look like below.

    ALV with IDA OutputUsing ALV with IDA,  we can display the ALV in two ways

    1. Full Screen  – We showed this method in this tutorial
    2. In-Container display – Create a custom container and display the ALV inside the container.You can use the importing parameter IO_GUI_CONTAINER in the CREATE method to achieve this.

    Know Constraints

    • Hierarchical or Tree structures, Sequential lists is not possible with ALV with IDA.

    You have successfully created an ALV using ALV with Integrated Data Access on HANA. In our next tutorial we will explore the full features of ALV with IDA.

    Check out all tutorials on ABAP with IDA here.

    Please stay tuned to us for ABAP on HANA and ABAP in Eclipse tutorials.Please feel free to comment and let us know your feedback. You feedback will keep us alive.

    Thank you.

    9 COMMENTS

    1. Hi Gurus,

      This is nice tutorial. I have two questions here.

      1. What is the purpose of developing ABAP reports in eclipse. How user will check these reports. Since users use ECC or Lumira as presentation layer?

      2. This tutorial and other tutorials show ABAP coding in HANA studio/eclipse. However what if I want to utilize this Push down mechanism in ECC 6.0 end. I am an ABAPer with knowledge of HANA however I am not getting how will ECC leverage benefit of HANA. I am having some reports in ECC which takes lots of time for execution. I also have HANA DB. Now how will I make my code optimize and efficient with the help of HANA. Thanks in advance.

      • Hi Shiv,

        1. We can develop reports both on ECC and eclipse. Its just the new development approach given by SAP to use eclipse. Users still access the reports from ECC.

        2. If you Suite on HANA or S4HANA system you can leverage code push down in HANA

        Thanks,
        Akash

    2. Hi Team ,

      Its very nice tutorial , but can u make me clear :
      i want to know if we use Eclipse , it means that we are writing our code in directly HANA DB ?
      and i also want to know in the above tutorial , where can i filter my data , suppose i want only few fields .
      Thanks ,
      Praveen Bindla.
      09030760681.

    LEAVE A REPLY

    Please enter your comment!
    Please enter your name here