Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Screen and Classes.

amit_khare
Active Contributor
0 Likes
445

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.

2 REPLIES 2
Read only

Former Member
0 Likes
301

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

Read only

Former Member
0 Likes
301

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.