Skip to Content

Calling ALV grid in class method

Is it possible to call a ALV grid display in a class~method.

I thought, I would call a screen and make a ALV grid display using the control frame work,it is no possible to call screen inside a method.

Then i tried to avoid calling the screen..

data: dockingleft type ref to cl_gui_docking_container,
        alv_left    type ref to cl_gui_alv_grid,
        repid type syrepid.

  repid = sy-repid.


  check dockingleft is initial.

  create object dockingleft
              exporting repid     = repid
                        dynnr     = sy-dynnr
                        side      = dockingleft->dock_at_left
                        extension = 1700.

  create object alv_left
                exporting i_parent = dockingleft .

  call method alv_left->set_table_for_first_display
      exporting
           i_structure_name       = 'SMESG'
      changing
           it_outtab       = TSMESG[]
  EXCEPTIONS
      INVALID_PARAMETER_COMBINATION = 1
      PROGRAM_ERROR                 = 2
      TOO_MANY_LINES                = 3
      others                        = 4.

This doesn't seem to invoke the ALV grid. Any suggestions ?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on Oct 29, 2008 at 04:21 PM

    Yes, use the CL_SALV_TABLE class instead. It is OO based, and you do not have to create a screen.

    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/eac1fa0b-0e01-0010-0990-8530de4908a6

    Regards,

    Rich Heilman

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 29, 2008 at 04:18 PM

    Hi,

    You need to call you custom screen with custom container like the following

      create object g_docking_container_1
        exporting
          repid     = g_repid
          dynnr     = '100'      "Place the custom container in 100
          extension = 1700
          side      = cl_gui_docking_container=>dock_at_left.
    
    then
    
      call method alv_left->set_table_for_first_display
    
    

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 30, 2009 at 02:32 PM

    how did u solve this Shareen ?

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.