SAP Database - The Unofficial SAP Knowledge Base

Free Business and Tech Magazines and eBooks

Create OO ALV without Container

Print This Post Email This Post Written by rajivsharma.sap on Jul 9th, 2009 | Filed under: ABAP Programs

Guest post by Rajiv

Usually, you will need to create a container in SE51 in order for the OO ALV to be displayed in the container. Now, there is a little work around to it. Check this below ABAP Program to create an ALV without creating the container.

DATA: gr_alvgrid             TYPE REF TO cl_gui_alv_grid.
*----Creating ALV Grid instance
CREATE OBJECT gr_alvgrid
EXPORTING
i_parent          = cl_gui_container=>screen0
EXCEPTIONS
error_cntl_create = 1
error_cntl_init   = 2
error_cntl_link   = 3
error_dp_create   = 4
OTHERS = 5.
IF sy-subrc NE 0.
ENDIF.

Now call the method GR_ALVGRID ofcourse with relevant parameters

CALL METHOD gr_alvgrid->set_table_for_first_display
CALL SCREEN 100.  "<== Just double click and activate the screen.

No related posts.



This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.

Leave a Reply

  • Subscribe to RSS

  • Free Ebooks