SAP List Viewer previously called ABAP List viewer is the New Object Oriented API providing simplified programming, Error Robustness and has a Unified object model for all flavours(Grid, Tree etc.,). ALV Programs are very easy to write when you know few basic facts about them. There are many Functions modules provided by SAP to handle different tasks.
Typically, all the ALV Reporting ends up into two different Categories.
- Create Field catalogue & Events to display Top of Page/End of Page
- Call the relevant ALV Function Module OR CL_SALV_TABLE or CL_GUI_ALV* classes.
Call the relevant ALV Classes or Function modules
Having the right ALV class is very important for the right purpose, check the below examples to get started to use the correct one.
- Easy reference master guide for ALV
- Create alv in a popup
- How to display ALV without a Container – Container is a must if you are using any of the CL_GUI_ALV* classes unless you want to use CL_SALV_TABLE class.
- ALV with a user defined menu
- Generate ALV list for any table structure dynamically
- ALV Tree Reports going up to 6 levels
- ALV with editable F4 values – Editable F4 with an added confirmation box to display before save.
- ALV Hierarchical sequential display list – ALV code for hierarchical sequential list display(single child). List of SAP tables as the parent node with interactive features(as a pop up) and List of fields as the child node with interactive features too(as a pop up).
- Drag and Drop functions
- List of tables – This simple abap program displays the list of abap programs used by a program and lists them in ALV.
- List of Dictionary Objects – This program displays the list of Dictionary Objects used by a transaction.
- ALV using old function modules which displays list of Infotypes and list of local objects
- End user guide for ALV
Create Field Catalogue
First thing to do is decide all the fields you want to display in the grid. Make a list and fill all these reporting fields in the internal table IT_FIELDCAT. You need to add these field to get the minimal working; col_pos, fieldname,tabname, seltext_m,outputlen & key.
- col_pos = Column Position
- fieldname = Field Name
- tabname = Table name or Internal table Name.
- seltext_m = Field Description
- outputlen = Output Length
ALV report which displays the contents of the table T006 (as a docking container in the bottom) along with the editable ALV which contains the ALV field catalogue table structure. With the available toolbar options of the editable ALV in the output, user can change the field catalogue as per his requirement. When the user clicks ‘SUBMIT’,the display of the ALV with table T006 gets modified and customised accordingly to the user’s requirement.
Download the program(Editable fieldcatalogue for output in ALV).