‎2005 Nov 29 9:10 AM
I have recently started working with classes.
Can any let me know about cl_gui_container class and the usage of screen0 to screen9 as existing in the attributes of those class.
‎2005 Nov 29 9:29 AM
AMIT KHARE
CL_GUI_CONTAINER contains Abstract Container for GUI Controls.
SCREEN0 can be used for Building ALV Grid. While using this, NO CONTAINER DEFINITION IS REQUIRED ! in ALV.
Sample Code:
DATA: l_alv TYPE REF TO cl_gui_alv_grid,
lt_sflight TYPE TABLE OF sflight.
SELECT * FROM sflight INTO TABLE lt_sflight.
CREATE OBJECT l_alv EXPORTING i_parent = cl_gui_container=>screen0.
CALL METHOD l_alv->set_table_for_first_display
EXPORTING i_structure_name = 'SFLIGHT'
CHANGING it_outtab = lt_sflight.
Create an EMPTY screen, put NOTHING in the layout
CALL SCREEN 100
Thanks
Kam
‎2005 Nov 29 9:29 AM
1. Create Container to display the ALV Grid.
For this use,
Data W_Container type scrfname value 'CONTAINER'.
here you have to create the CONTAINER in the layout.
2. Next create Custom container and pass this container.
This will be the place where we can display the datas
data W_custom_contnr type ref to cl_gui_custom_container.
Create object w_Custom_Contnr
exporting
Container_Name = W_CONTAINER.
3. then create Grid where we chave to place the custom container.
data W_Grid type ref to cl_gui_alv_grid.
create object for this.
Create Object w_Grid
exporting
I_Parent = w_Custom_Contnr.
In this Grid we can display the Table values.
CALL METHOD w_grid->set_table_for_first_display
This function module you have to pass fieldcat and internal table.