DATA: lcl_alv TYPE REF TO cl_gui_alv_grid, t_flights TYPE STANDARD TABLE OF FLIGHTS. SELECT * FROM flights INTO TABLE t_flights. CREATE OBJECT lcl_alv EXPORTING I_PARENT = cl_gui_container=>screen0. CALL METHOD lcl_alv->set_table_for_first_display EXPORTING I_STRUCTURE_NAME = 'FLIGHTS' CHANGING IT_OUTTAB = t_flights. CALL SCREEN 100.
This is a simple example of the class ALV, we do not need to create, in this case, a field catalog because we are using the whole table of FLIGHTS and we will show all the fields that this table contains, we do this at the
I_STRUCTURE_NAME = 'FLIGHTS' statement.
The CL_GUI_ALV_GRID constructor needs the I_PARENT parameter to define where it will be show, in the example we set the entire screen to place the ALV.
- An Easy Reference For ALV Grid Control, Serdar Simsekler: a very useful and detailed documentation about CL_GUI_ALV_GRID
- Using ALV for List Display, Barbara Neumann
- ALV Object Model - Simple 2D Table - The Basics, Rich Heilman
- ALV Object Model - Simple 2D Table - Event Handling, Rich Heilman
- SAP List Viewer - The New Programming Model in SAP NetWeaver 04, introduces Object-oriented ALV wrapper (SAP contribution)
- ALV Object Model - Hierarchical Sequential List - The Basics, (SAP contribution by Rich Heilman, October 2006)
- 7 Steps to create OOPS ALV(for beginners) - by Jayanthi Jayaraman
- Z_TRANPORT_ORDERS - by Alvaro Tejada Galindo