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

ALV List Problem: No GUI status

Hi,

I m displaying output in list ALV using the FM REUSE_ALV_LIST_DISPLAY.

I am not getting any GUI status(Buttons for ALV on application toolbar).

Please let me know what could be the problem..

Regards

Shiva

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 22, 2008 at 10:38 AM

    hi,

    give me ur code...

    just that function module call

    call 'REUSE....

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 29, 2008 at 06:21 AM

    hi,

    show me the code, and just check whether you have passed

    form ZF_PF_STATUS_SET using rt_extab type slis_t_extab.

    set pf-status 'your menu status'.

    endform. " ZF_PF_STATUS_SET

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 29, 2008 at 07:39 AM

    shiva,

    You have to add all your buttons .

    So,

    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

    EXPORTING

    i_callback_program = ws_repid

    i_callback_pf_status_set = 'GUI_STAT1'

    i_callback_user_command = 'STAT'

    is_layout = gs_layout

    it_fieldcat = i_fieldcat[]

    it_sort = wa_sort1

    TABLES

    t_outtab = i_zaw_pol_plan.

    IF sy-subrc <> 0.

    ENDIF.

    FORM gui_stat1 USING rt_extab TYPE slis_t_extab.

    SET PF-STATUS 'STANDARD' EXCLUDING rt_extab.

    ENDFORM.

    double click on status "STANDARD".

    aplication toolbar add all Fcodes in those columns.

    activate it.

    These are the few codes

    &CRB &CRL &CRR &CRE &OUP &ODN &ALL

    &SAL &ILT &XPA &OMP &UMC &OL0 &NFO

    &SUM

    Don't forget to reward if useful....

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 29, 2008 at 02:48 PM

    Using OO it's actually much easier.

    Simply in a PBO module code something like

    set pf-status '001'.
      set titlebar '000' with screen_title.
    

    You will need to display your grid also in the PBO

    I use something like this

    
    import <dyn_table> from memory id 'dawggs'.
    import i_gridtitle from memory id 'i_gridtitle'.
    import  i_edit from memory id 'i_edit'.
     import i_opt from  memory id 'í_opt'.
    import  it_fldcat from  memory id 'it_fldcat'.
    i_object = <zogzilla>.
    call method i_object->display_grid
      exporting
        i_gridtitle = i_gridtitle
        i_edit  = i_edit
        i_zebra = i_zebra
        i_opt = i_opt
        g_fldcat = it_fldcat
        g_outtab = <dyn_table>
       changing
         it_fldcat = it_fldcat
         gt_outtab = <dyn_table>.
    

    In the PAI routine code the functions from your status / interface you created (via SE41). These are different from the GRID toolbar --these are the standard SAP screens.

    
    module user_command_0100 input.
      case sy-ucomm.
        when 'BACK'.
          leave to screen 0.
        when 'EXIT'.
          leave program.
        when 'RETURN'.
          leave program.
        when others.
      endcase.
    

    Now you can also create your own GRID toolbar as well

    in the constructor define your events I'm using my own grid handling class but the variable grid1 is a type ref to cl_gui_alv_grid.

    
    method constructor .
    create object grid_container1
            exporting
    *           container_name = 'CCONTAINER1'.
        container_name = cfname.
        create object  grid1
           exporting
              i_parent = grid_container1.
        set handler z_object->on_user_command for grid1.
        set handler z_object->on_toolbar for grid1.
        set handler z_object->handle_data_changed for grid1.
        set handler z_object->handle_data_changed_finished for grid1.
        set handler z_object->on_dubbelklik for grid1.
        set handler z_object->on_hotspot for grid1.
        call method grid1->register_edit_event
            exporting
               i_event_id = cl_gui_alv_grid=>mc_evt_enter.
      endmethod
    
    

    The on toolbar event

    method on_toolbar .
    type-pools icon.
     clear ls_toolbar.
         move  0 to ls_toolbar-butn_type.
         move 'EXCEL' to ls_toolbar-function.
         move  space to ls_toolbar-disabled.
         move  icon_xxl to ls_toolbar-icon.
         move 'Excel' to ls_toolbar-quickinfo.
         move  'EXCEL' to ls_toolbar-text.
         append ls_toolbar to e_object->mt_toolbar.
        perform   toolbar  in program (caller) if found
         using e_object.
    
    * ...
    endmethod.
    
    

    In the application program add some extra buttons

    
    form toolbar using e_object type ref to cl_alv_event_toolbar_set.
    
    
      data: ls_toolbar type stb_button.
    
      type-pools icon.
    
    * Append separator
      clear ls_toolbar.
      move 3 to ls_toolbar-butn_type.
      append ls_toolbar to e_object->mt_toolbar.
    * Append refresh
      clear ls_toolbar.
      move 'ZPREA' to ls_toolbar-function.
      move icon_generate  to ls_toolbar-icon.
      move text-006 to ls_toolbar-quickinfo.
      move text-006 to ls_toolbar-text.
      move ' '            to ls_toolbar-disabled.
      append ls_toolbar   to e_object->mt_toolbar.
    
    * Append separator
      clear ls_toolbar.
      move 3 to ls_toolbar-butn_type.
      append ls_toolbar to e_object->mt_toolbar.
    
    * Append separator
      clear ls_toolbar.
      move 3 to ls_toolbar-butn_type.
      append ls_toolbar to e_object->mt_toolbar.
    * Append refresh
      clear ls_toolbar.
      move 'ZIMME'        to ls_toolbar-function.
      move icon_transport to ls_toolbar-icon.
      move text-010       to ls_toolbar-quickinfo.
      move text-010       to ls_toolbar-text.
      move ' '            to ls_toolbar-disabled.
      append ls_toolbar   to e_object->mt_toolbar.
    endform.
    
    
    

    Now in your ON_USER_COMMAND method in the class

    just add the FCODES of the toolbar functions you've added for example

    
    method on_user_command .
    *        FOR EVENT before_user_command OF cl_gui_alv_grid
    *        IMPORTING
    *          e_ucomm
    *          sender
    case e_ucomm.
    
    
          when 'EXIT'.
            leave program.
          when 'EXCEL'.
           call method me->download_to_excel.
          when 'SAVE'.
          when 'PROC'.
            call method me->process.
          when 'REFR'.
            call method me->refresh.
            when 'SWITCH'.
            call method me->switch.
           when 'TEST'.
            call method me->get_cell.
        endcase.
    
    * ...
    endmethod.
    
    

    Do it all with OO -- it's easy.

    FORGET THE OLD SLIS FUNCTION MODULES EVER EXISTED.

    Cheers

    jimbo

    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.