ALV with IDA means SAP List Viewer with Integrated Data Access. In this post you will learn how to create a simple ALV using IDA class.
ALV with IDA is a special version of the List Viewer that enables display of data as ALV from tables having large number of records. The operations like sorting, and filtering can also be performed faster.
ALV vs ALV with IDA
|ALV||ALV with IDA|
|Data Retrieval||Data is retrieved in Internal Table by Program||Only Table name in passed in program. Data retrieval is handled by ALV.|
|Displayed Data||All records from Internal Table are shown||Records which fill the visible area are displayed|
|Scrolling / Sorting / Filtering||Handled at application layer||A new SQL query is triggered every time|
|Memory Consumption||Depends on the size of the Internal Table||Only as per the visible area columns and rows|
|Speed||Time required for all data to be fetched and transferred to ALV||Time required for visible area records to be fetched and transferred|
The class to manage ALV IDA is cl_salv_gui_table_ida. The amazing thing is that a single line of code is enough to display ALV. See: Sample Report SALV_IDA_DISPLAY_DATA_SIMPLE.
cl_salv_gui_table_ida=>create( 'SFLIGHT' )->fullscreen( )->display( ).
Here is how the output looks like.
However, the ALV IDA comes with its own set of restrictions –
- Handling of data that is changed during display is not supported. Data records that are removed during the display are automatically filled by empty lines.
- The Data Display is restricted to a maximum of 2 billion cells.
- All available operations are then executed on the entire data set
- Aggregation of amount fields with currencies or quantities can be displayed when same currency or unit
- Table fields of type STRING should not be used.
- The ready for input status for cells is not supported in IDA ALV.
- IDA-ALV programs cannot be scheduled as background jobs.
However, SALV with IDA is not supported by all versions, so it is best to check whether this is supported in the code.
Below code will also produce same output as above. It will set limit on records displayed to 50 in case setting up max rows is recommended as per db capabilities.
DATA(lo_db_cap) = cl_salv_gui_table_ida=>db_capabilities( ). IF lo_db_cap->is_table_supported( 'SFLIGHT' ). DATA(lo_ida) = cl_salv_gui_table_ida=>create( 'SFLIGHT' ). IF lo_db_cap->is_max_rows_recommended( ). lo_ida->set_maximum_number_of_rows( 50 ). ENDIF. lo_ida->fullscreen( )->display( ). ENDIF.
In following posts of this series, I will discuss how to handle selection screen, column settings, and other such things which we do in usual ALV.
Visit ABAP on HANA series for Tutorials on CDS, AMDP, Eclipse, and ALV IDA.
If you like the content, please subscribe…