

Explore critical topics shaping today’s SAP landscape—from digital transformation and cloud migration to cybersecurity and business intelligence. Each topic is curated to provide in-depth insights, best practices, and the latest trends that help SAP professionals lead with confidence.
Discover how SAP strategies and implementations vary across global markets. Our regional content brings localized insights, regulations, and case studies to help you navigate the unique demands of your geography.
Get industry-specific insights into how SAP is transforming sectors like manufacturing, retail, energy, and healthcare. From supply chain optimization to real-time analytics, discover what’s working in your vertical.
Dive into the most talked-about themes shaping the SAP ecosystem right now. From cross-industry innovations to region-spanning initiatives, explore curated collections that spotlight what’s trending and driving transformation across the SAP community.
Explore critical topics shaping today’s SAP landscape—from digital transformation and cloud migration to cybersecurity and business intelligence. Each topic is curated to provide in-depth insights, best practices, and the latest trends that help SAP professionals lead with confidence.
Discover how SAP strategies and implementations vary across global markets. Our regional content brings localized insights, regulations, and case studies to help you navigate the unique demands of your geography.
Get industry-specific insights into how SAP is transforming sectors like manufacturing, retail, energy, and healthcare. From supply chain optimization to real-time analytics, discover what’s working in your vertical.
Dive into the most talked-about themes shaping the SAP ecosystem right now. From cross-industry innovations to region-spanning initiatives, explore curated collections that spotlight what’s trending and driving transformation across the SAP community.
IDA ALV is designed to perform optimally in a memory computing environment. The class for IDA ALV uses mostly code pushdown (i.e., a lot of processing is done within the SAP HANA database). The IDA ALV is used for displaying a very large number of records and for manipulating such records without causing any memory or performance issues.
Before getting into the details of ALV with IDA, let’s first revisit the traditional ALV, prior to IDA. In classic ALV, the SELECT statement allows the user to fetch data from the database to the application server. The final data to be displayed is stored in an internal table that is linked to the ALV object. The various functions such as sorting, totaling, and subtotaling are carried out on the application server. With traditional ALV, memory consumption issues may occur, and using page up and page down can take considerable time, particularly when a large number of rows and columns is involved.
On the other hand, in the case of ALV with IDA, the various operations such as totaling, subtotaling, sorting, and grouping are done at the SAP HANA database level. The main class used for the display is the CL_SALV_GUI_TABLE_IDA class.
As already mentioned, when you are using the IDA form of ALV, there is no internal table involved. On a single database trip, only so many records as can fit on a single screen (without page down) are fetched from the database. The moment the user presses page down or scroll down, additional rows are fetched from the database. So, if the underlying table has a million records, only 25 or so (corresponding to the screen size) are read into the memory. This results in better consumption of memory than with the traditional ALV, which reads the entire million records into the application server. In the IDA version of ALV, no record is transferred to the application server until it needs to be displayed; the IDA ALV only fetches the data to be shown on the screen at any given instant. This performance is optimized for the SAP HANA database, with which it can work extremely quickly. The ALV IDA exhibits high speed when paging up and down and uses little memory.
Another advantage of the new IDA ALV is that the user does not feel any difference in the functionalities or interface. IDA ALV displays the same buttons and functions as the traditional ALV class CL_SALV_TABLE, as well as the look and feel of the zebra design. The user can add new function buttons, make fields into hotspots, and change the text of column headers. All the buttons are the same and the functions and keyboard shortcuts are the same, so no extra training is required for the user.
It is now time to look at the structure of class CL_SALV_GUI_TABLE_IDA. Figure 1 shows the structure of the class and the main methods it provides.
The commonly used parameters of the various methods are IV_TABLE_NAME—the underlying database table name—and IO_GUI_CONTAINER, the container in which the ALV is to be displayed if it is not full-screen display. The returning parameter of the method is based on the interface type IF_SALV_GUI_TABLE_IDA.
The interface IF_SALV_GUI_TABLE_IDA provides a number of useful methods for displaying and modifying the look and feel of the ALV. Table 1 shows a list of common methods.
|
Method |
Purpose |
|
FIELD_CATALOG |
Provides access to the attributes of displayed fields |
|
SET_SELECT_OPTIONS |
Specifies selection criteria for database access |
|
FULLSCREEN |
Activates full-screen mode for ALV display |
|
DISPLAY_OPTIONS |
Modifies the look (e.g., alternate shading of rows) |
|
CONDITION_FACTORY |
Specifies the parameter conditions for database selection |
|
STANDARD_FUNCTIONS |
Switches standard functions on or off |
|
DEFAULT_LAYOUT |
Changes layout, such as sort and grouping order |
Now let’s see a working example of a typical requirement by generating a very simple ALV output. Suppose you have a table SCARR, and you need to show the data of this table in the form of an ALV.
As mentioned earlier, since the advent of class CL_SALV_GUI_TABLE_IDA you no longer need an internal table or any SELECT statement for fetching data from the database. The data retrieval is done by the new ALV class. You simply specify via parameter IV_TABLE_NAME the name of the table from which the data is to be retrieved. If you do not have any selection criteria or filter criteria and you have to display all the rows of the database table SCARR, the statement in Figure 3 is enough.
cl_salv_gui_table_ida=>create( iv_table_name = 'SCARR')->fullscreen( )->display( ). Figure 3 Output the entire table content The next section shows the steps to take if you have selection options and parameter values involved. It is worth noting that the above line of code displays the ALV in full screen. The output is shown in Figure 4.
my_alv_object->fullscreen( )->display( ). Figure 12 Display ALV The complete coding for this is shown in Figure 13. tables scarr. select-options : s_carr for scarr-carrid . try. data(my_alv_object) = cl_salv_gui_table_ida=>create( iv_table_name = 'SCARR'). data(my_range_table) = new cl_salv_range_tab_collector( ). my_range_table->add_ranges_for_name( iv_name ='CARRID' it_ranges = s_carr[] ). my_range_table->get_collected_ranges( importing et_named_ranges = data(selection_values) ). data(parameters) = my_alv_object->condition_factory( ). data(parameter_value) = parameters->equals( name = 'CURRCODE' value = 'EUR' ). my_alv_object->set_select_options( it_ranges = selection_values io_condition = parameter_value ). my_alv_object->fullscreen( )->display( ). catch cx_salv_db_table_not_supported. catch cx_salv_ida_contract_violation. endtry. Figure 13 Complete coding for the requirement The output of the program is shown in Figure 14.
my_alv_object->field_catalog( )->get_available_fields( IMPORTING ets_field_names = data(displayed_fields) ) . Figure 15 Get the displayed field names This method returns the name of the displayed columns as an internal table (corresponding to parameter ETS_FIELD_NAMES). You have specified the name of the internal table as DISPLAYED_FIELDS. Once this method is called and successful, the four columns displayed are included in the internal table, as shown in Figure 16.
Use a DELETE statement to delete the URL row from the internal table (Figure 17). delete displayed_fields where table_line eq 'URL'. Figure 17 Delete statement Next, use the SET_AVAILABLE_FIELDS method to specify the new set of displayed fields (Figure 18). my_alv_object->field_catalog( )->set_available_fields( exporting its_field_names = displayed_fields ) . Figure 18 Specify a new set of displayed fields Once this is done, you have successfully removed the last column of URL. The changed output is shown in Figure 19.
|
Method |
Function to be Enabled or Disabled |
|
SET_EXPORT_ACTIVE |
Export |
|
SET_PRINT_ACTIVE |
|
|
SET_FILTER_ACTIVE |
Filter |
|
SET_SORT_ACTIVE |
Sort (ascending or descending) |
|
SET_DETAIL_ACTIVE |
Detail |
|
SET_AGGREGATION_ACTIVE |
All aggregations |
|
SET_TEXT_SEARCH_ACTIVE |
Text search |
CL_SALV_GUI_TABLE_IDA=>CREATE_FOR_CDS_VIEW(' ZVW_MY_VIEW' )->fullscreen( )->display( ). Figure 27 Use a CDS view in ALV Display (Note: As in the case of traditional ALV, it is also possible to add your own button on the ALV toolbar. A method TOOLBAR is provided to change the look and feel of the standard toolbar.)

President, Virginia Software Group, Inc.
Founder & Chief Architect, DalRae Solutions
Managing Director, CUVIV UK
Unlimited access to thousands of resources for SAP-specific expertise that can only be found here.
Sign UpAccess exclusive SAP insights, expert marketing strategies, and high-value services including research reports, webinars, and buyers' guides, all designed to boost your campaign ROI by up to 50% within the SAP ecosystem.
Sign UpAlways have access to the latest insights with articles, Q&As, whitepapers, webinars, and podcasts. Gain the inside edge. The SAPinsider Weekly helps you stay SAP savvy. Access exclusive bonus materials, discounts, and more.
Get the NewsletterYour request has been successfully sent