Tuesday, October 8, 2013

How to create a control on a dynpro without a container using screen0 SAP ABAP


Hi Folks, 
here an easy nice tip: if you have only one alv or component on your dynpro you can disply it on the full dynpro just using the whole dynpro without using a control container.

You need to create a completely empty dynpro and that's it.


Here is an example:

DATA  lr_alv      TYPE REF TO   cl_gui_alv_grid.
DATA  lt_table  TYPE TABLE OF t529a.

SELECT * FROM t529a INTO TABLE lt_table.


CREATE OBJECT lr_alv
  EXPORTING
    i_parent = cl_gui_container=>screen0.

CALL METHOD lr_alv->set_table_for_first_display
  EXPORTING
    i_structure_name = 'T529A'
  CHANGING
    it_outtab        = lt_t529a

CALL SCREEN 100