Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Display ALV on container on screen.

Hello All,

I am trying to display an internal table in an ALV in a container on screen.

Here is what I am trying to do.

DATA: salv_ref TYPE REF TO cl_salv_table.

DATA: lr_columns TYPE REF TO cl_salv_columns_table.

DATA: data_container TYPE REF TO CL_GUI_CONTAINER.

select stmt in internal table.

call screen 100.  //  a custom container is placed on the screen name = TAB_CONTAINER

---------------------

PBO 100.

CREATE OBJECT data_container

  EXPORTING

    clsid                          =     SPACE " Class ID of This Container

    container_name                 =     'TAB_CONTAINER'

  EXCEPTIONS

    cntl_error                     = 1

    cntl_system_error              = 2

    create_error                   = 3

    lifetime_error                 = 4

    lifetime_dynpro_dynpro_link    = 5

    lifetime_dynpro_illegal_parent = 6

    others                         = 7

  .

IF sy-subrc <> 0.

* MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

*            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

cl_salv_table=>factory(

  EXPORTING

    r_container    =  data_container

  IMPORTING

    r_salv_table   =  salv_ref

  CHANGING

    t_table        = lt_tab_form

).

salv_ref->display( ).

But I am not seeing anything on the screen.

Could you please suggest where I am doing it wrong.

Tags:
Not what you were looking for? View more on this topic or Ask a question