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.
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).