Thursday, September 18, 2008

ALV Grid in 3 Steps without Screen Painter

DATA: l_alv TYPE REF TO cl_gui_alv_grid,
lt_sflight TYPE TABLE OF sflight.
SELECTION-SCREEN BEGIN OF SCREEN 1001 .
SELECTION-SCREEN END OF SCREEN 1001.
SELECT * FROM sflight INTO TABLE lt_sflight.
* Creation of the ALV object, when we use cl_gui_container=>screen0 as
*parent, the ALVGrid control will
* automatically use the full screen to display the grid, NO CONTAINER
*DEFINITION IS REQUIRED !
CREATE OBJECT l_alv EXPORTING i_parent = cl_gui_container=>screen0.
* calling the display of the grid, the system will automatically create
*the fieldcatalog based
* on the table name you pass in parameter
CALL METHOD l_alv->set_table_for_first_display
EXPORTING i_structure_name = 'SFLIGHT'
CHANGING it_outtab = lt_sflight.
DATA p_text(5) TYPE c." LENGTH 5.
DO 2 TIMES.
WAIT UP TO '0.5' SECONDS.
p_text(3) = sy-index.
p_text+3 = '%'.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
percentage = sy-index
text = p_text.
ENDDO.
CALL SELECTION-SCREEN 1001." STARTING AT 8 8 ENDING AT 85 22.

1 comment:

Unknown said...

Hello

This is interesting.
I executed this.
but it doesn't show in fullscreen mode.


Should it be full like in a browser or MS Excel fullscreen mode ?


thx anyway

Powered By Blogger