SAP provides two different ways to incorporate SAP ALV into your reports or programs which need to deal with tabular data. They are mentioned below:
Using REUSE_ALV_* function modules
SAP offers some easy to use function modules using which different kinds of ALV grid can be displayed from your program. These function modules provide a very simplified programming approach to use SAP ALV to display and work with tabular data. All such function modules can be found under the Function group SALV & SLVC_FULLSCREEN in the package (development class) SLIS. These function modules provide an easy & simple to program way of using SAP ALV, but on the other hand compromise with some advanced functionalities and gives lesser flexibility to the programmer. Still, this is the easiest way to program SAP ALV for simple reports and applications where the main purpose of report/ program is to display a tabular result.
There are four different forms of SAP ALV exposed through reuse function modules in order to cater different kinds of data display requirements.
(A) Simple ALV list
This form of ALV is used to display single table display. All the function modules in the above mentioned function group SALV with prefix REUSE_ALV_LIST_ belong to this form of ALV e.g. REUSE_ALV_LIST_DISPLAY, REUSE_ALV_LIST_LAYOUT_INFO_SET, REUSE_ALV_LIST_SELECTIONS_SET etc. This form of ALV outputs a single list on one complete screen. There’s a very limited possibility to control the layout of this output screen.
Simple SAP ALV List
(B) Hierarchical sequential ALV list
This form of ALV lists is used to display 2 tables of data which form a 2-step hierarchy. The main function module to display this kind of ALV is REUSE_ALV_HIERSEQ_LIST_DISPLAY in function group SALV. There are some more function modules in function group SALV with prefix REUSE_ALV_HS_ belonging to this form of ALV. Typical to REUSE_ALV_* method of using ALV, it has a very limited possibility to control the layout of this output screen.
Hierarchical Sequential ALV List
(C) Block ALV List
This form of ALV lists is used to display multiple independent tables. All the function modules in above mentioned function group SALV having prefix REUSE_ALV_BLOCK_ belong to this form of ALV. Block ALV list is used to display multiple ALV lists on the same output screen one after another.
Block ALV List
(D) ALV Grid
This is the new generation of ALV replacing classical list formats mentioned above with grids. It’s used for the purpose similar to simple lists, but overtakes simple lists in terms of better usability, more in-built functionalities and look & feel. All the function modules related to this form of ALV can be found under function group SLVC_FULLSCREEN of package SLIS.
Using ABAP Class CL_GUI_ALV_GRID
This method of programming ALV grid runs on Control framework & is based on ABAP Objects. It gives 100% control of programming ALV to the developers. You can use this method to work with ALV similar to other screen elements and also freely add other screen elements on the same screen along with ALV. The main ABAP Class involved in this method is CL_GUI_ALV_GRID.
Multiple ALV Grids & Tree on same screen using CL_GUI_ALV_GRID method
I would be explaining important aspects of each of these methods to work with the SAP ALV in detail in my following posts.