Skip to Content
author's profile photo Former Member
Former Member

ALV Grid in Screen (using OO)

Cheers everyone.

This is my first posting to the SDN.

I'm trying to display an ALV Grid (using OO) in a screen called with "Call screen 0200 startin at XX YY", to get a popup-style display. My Grid will not show. If i call the screen directly (full screen mode), there are no problems.

I was wondering if it was even possible to display this object in this kind of screen.

My screen is defined as a "normal" screen. I tried with a "modal dialog box" but same result.

This is a 4.6C environment. If anyone has had this problem and could shed some light on what i might be missing, I'd appreciate it.

Thank you.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    Posted on May 11, 2005 at 12:51 PM

    Hello Jester,

    Have a look at the demo program 'BCALV_GRID_AND_POPUP'.

    I think that should help you.

    Cheers,

    Jitendar

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Jitendar.

      I didn't think to look for a demo of this specific problem.

      Thanks a lot.

      I guess it was just the stucture of my program(timing of object creation) because i simply moved code around, and it now works.

      I appreciate it.

      (I hope i attributed the points correctly)

      Jester.

  • Posted on May 11, 2005 at 01:05 PM

    Sure, here is a generic function module that I recently did.

    Create screen 200, set as normal screen, create custom control "ALV_CONTAINER" in the screen.

    
    function z_popup_with_alvgrid.
    *"----------------------------------------------------------------------
    *"*"Global interface:
    *"  IMPORTING
    *"     REFERENCE(ENDPOS_COL) TYPE  I DEFAULT 90
    *"     REFERENCE(ENDPOS_ROW) TYPE  I DEFAULT 22
    *"     REFERENCE(STARTPOS_COL) TYPE  I DEFAULT 10
    *"     REFERENCE(STARTPOS_ROW) TYPE  I DEFAULT 2
    *"     REFERENCE(TEXTLINE1) TYPE  C OPTIONAL
    *"     REFERENCE(TEXTLINE2) TYPE  C OPTIONAL
    *"     REFERENCE(TEXTLINE3) TYPE  C OPTIONAL
    *"     REFERENCE(TEXTLINE4) TYPE  C OPTIONAL
    *"     REFERENCE(TITLE) TYPE  C OPTIONAL
    *"     REFERENCE(FIELDCAT) TYPE  LVC_T_FCAT
    *"  TABLES
    *"      I_ALV
    *"----------------------------------------------------------------------
    
      call screen 0200 starting at startpos_col
                                   startpos_row
                         ending at endpos_col
                                   endpos_row.
    
    endfunction.
    
    ************************************************************************
    *      Module  STATUS_0200  OUTPUT
    ************************************************************************
    module status_0200 output.
    
      set pf-status '0200'.
      set titlebar  '0200' with title.
    
      data: alv_container  type ref to cl_gui_custom_container.
      data: alv_grid       type ref to cl_gui_alv_grid.
    
      data: xfieldcat type lvc_t_fcat.
    
      xfieldcat = fieldcat.
    
    * Create Controls
      create object:
    
         alv_container
                 exporting
                       container_name    = 'ALV_CONTAINER',
    
         alv_grid
                 exporting
                       i_parent          =  alv_container.
    
    *  Set grid for first display
      call method alv_grid->set_table_for_first_display(
          exporting
               i_structure_name       = 'I_ALV'
          changing
               it_outtab       = i_alv[]
               it_fieldcatalog = xfieldcat[] ).
    
    endmodule.
    
    ************************************************************************
    *     Module  USER_COMMAND_0100  INPUT
    ************************************************************************
    module user_command_0200 input.
    
      case sy-ucomm.
        when 'CONTINUE' or 'CANCEL'.
          set screen 0.
          leave screen.
      endcase.
    
    endmodule.
    
    

    Regards,

    Rich Heilman

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 11, 2005 at 01:58 PM

    Hi Jester,

    Instead of using "Call screen" you can use class

    cl_gui_dialogbox_container. This class is a popup container and you can pass it to the i_parent parameter of you ALV grid.

    I used it in similar situation as you are describing.

    There is a good example here:

    http://www.sapgenie.com/abap/controls/splitter.htm

    Hope it helped you,

    Eyal.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Eyal,

      When the object go_toolbar is created, a return code of 1 is occurring. Do you have any idea what might be causing this?

      Thanks

      Bruce

      *----


      • Create Toolbar and set parent to the Splitter container

      *----


      CREATE OBJECT go_toolbar

      EXPORTING

      parent = go_splitter_container

      EXCEPTIONS

      others = 1.

      IF sy-subrc <> 0.

      message e000(zf) with

      'CREATE OBJECT go_toolbar failure'.

      ENDIF.

  • author's profile photo Former Member
    Former Member
    Posted on May 11, 2005 at 01:23 PM

    Hi Jester,

    So it has taken you about 5 months to make your first post? Just Kidding :-). Welcome to SDN and to this forum in particular. Hope you're gonna have some interesting/informative discussions here.

    Regards,

    Anand Mandalika.

    P.S. : It is sort of customary for the newbies to read <a href="/people/mark.finnern/blog/2004/08/10/spread-the-love blog</a>. Have you?

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Anand.

      Yeah, i'm a "long time user, first time poster".

      Thanks for the welcome.

      I read your link, but i don't remember seing the "Reward Message" button next to a reply. I selected the radio button accordingly (problem solved), and i hope this accomplished the reward properly.

      Thanks again.

      Jester

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.