Powered By

Free XML Skins for Blogger

Powered by Blogger

Friday, October 10, 2008

SAP ABAP Class ALV

Class ALV Specification

Classes used:

CL_GUI_ALV_GRID

Example of ALV using Classes

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.

Example Details

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.

No comments:

Archives