Tuesday, January 24, 2012

ABAP: Display ALV without creating screens/containers


In traditional approach we always define a container areas and then pout the ALV in this container.
But the same can also be achieved by making use of static methods of container classes.
e.g
Data lr_grid type ref to cl_gui_alv_grid.

  CREATE OBJECT lr_grid
      EXPORTING
           i_parent = cl_gui_custom_container=>screen0.
                        or cl_gui_container=>default_screen.
 " instead of creating custom container you can use standard screens

lr_grid->set_table_for_first_display( .... ).

This is a simple example and you can do lot more stuff with standard functions or think of using SALV.

Cheers,
Sandeep

1 comment: