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

Push Buttons on application toolbar.

Hi,

I have a alv report and now I need to add 2 push buttons on the application tool bar for this report.

Can you please tell me how to proceed on this.

Thanks

Neelima.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Oct 17, 2006 at 06:54 PM

    Hi,

    if you are using functionmodule REUSE_ALV_GRID_DISPLAY, then you have to

    I_CALLBACK_PF_STATUS_SET..

    1. First create the ststus using set pf-status 'ZSTAT01' and then remove set pf-status statment.

    2. assgine the created PF-status to g_formname_pf_status.

    3. In the user-command, you can handle code.

    DATA: g_formname_pf_status TYPE slis_formname.

    g_formname_pf_status = 'ZSTAT01',

    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

    EXPORTING

    i_callback_program = g_repid

    i_callback_pf_status_set = g_formname_pf_status

    ..............

    .................

    is_layout = gs_layout

    it_fieldcat = gt_fieldcat[]

    TABLES

    t_outtab = output_tab

    EXCEPTIONS

    program_error = 1

    OTHERS = 2.

    Thanks,

    Ramakrishna

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Venkata Ramisetti

      Hi Rama krishna,

      I tried it. Now I am getting Select all and Deselect all buttons, but I am not able to get my third button Remove. How should I get it and it is taking lot of time to get the output screen.

      I am sending my include, can you please check, if I am doing any thing wrong.

      Also I am getting lot of other buttons with my include. How to get rid of them.

      Thank you

      Neelima.

      
      data:
        g_variant              like  disvariant.          "variants
      type-pools:  slis.                                "Global types
      data: s_alv_layout_cat          type slis_layout_alv.
      data: s_alv_print_cat           type slis_print_alv.
      * ALV field catalog
      data: it_alv_field_cat type slis_fieldcat_alv occurs 0 with header line,
            S_FIELDCATALOG type slis_fieldcat_alv occurs 0 with header line,
            i_fieldcat type slis_fieldcat_alv occurs 0 with header line,
            w_fieldcat like line of i_fieldcat.        "ALV FieldCat WorkArea
      * ALV sort catalog
      data: it_alv_sort_cat type slis_sortinfo_alv occurs 0 with header line.
      * ALV event catalog
      data: it_alv_event_cat type slis_alv_event occurs 0 with header line.
      data: t_list_top_of_page type slis_t_listheader.
      
      DATA: g_formname_pf_status TYPE slis_formname.
      
      form sub_alv_routines.
      * Populate the layout catalog for alv
        perform alv_layout.
      * Populate the event catalog for alv
        perform alv_events.
      * Populate the print catalog for alv
        perform alv_print.
      endform.                 "sub_alv_routines
      
      g_formname_pf_status = 'ZSTAT01'.
      
      form sub_call_alv_grid tables lt_output.
      
      * Call ALV display
        call function 'REUSE_ALV_GRID_DISPLAY'
             exporting
                  i_callback_program      = sy-cprog
                  i_callback_pf_status_set = g_formname_pf_status
                  is_layout               = s_alv_layout_cat
                  i_callback_user_command = 'USER_COMMAND'
                  it_fieldcat             = it_alv_field_cat[]
      *           it_sort                 = it_alv_sort_cat[]
                  i_save                  = 'A'
                  is_variant              = g_variant
                  it_events               = it_alv_event_cat[]
                  is_print                = s_alv_print_cat
                  i_grid_title            = text-t01
             tables
                  t_outtab                = lt_output
             exceptions
                  program_error           = 1
                  others                  = 2.
      
      *  if sy-subrc <> 0.
      *    message e048. "Error executing func. module REUSE_ALV_LIST_DISPLAY
      *  endif.
      
      
      endform.                    " sub_call_alv_grid
      
      form alv_layout.
      
      * Enable striped output display if user wants
        s_alv_layout_cat-zebra                = 'X'.
      * Optimize column width if user wants
        s_alv_layout_cat-colwidth_optimize    = 'X'.
        s_alv_layout_cat-box_fieldname        = 'CHECK'.
        s_alv_layout_cat-no_input             = 'X'.
      *  if p_lines = 'X'.
      *    s_alv_layout_cat-no_vline           = ' '.
      *  else.
      *    s_alv_layout_cat-no_vline           = 'X'.
      *  endif.
        s_alv_layout_cat-no_colhead           = ' '.
        s_alv_layout_cat-lights_condense      = 'X'.
        s_alv_layout_cat-info_fieldname       = 'ALV_COLOR'.
        s_alv_layout_cat-confirmation_prompt  = 'X'.
        s_alv_layout_cat-detail_popup         = 'X'.
        s_alv_layout_cat-detail_initial_lines = 'X'.
      
      endform.                    " alv_layout
      
      form alv_events.
      * Declare event catalog for page headers
        clear it_alv_event_cat.
        it_alv_event_cat-name = 'TOP_OF_PAGE'.
        it_alv_event_cat-form = 'TOP_OF_PAGE'.
        append it_alv_event_cat.
      
      * Declare event catalog for report footers
        clear it_alv_event_cat.
        it_alv_event_cat-name = 'END_OF_LIST'.
        it_alv_event_cat-form = 'END_OF_LIST'.
      *  append it_alv_event_cat.
      
      endform.                    " alv_events
      
      form alv_print.
      * Declare print catalog for statistics page
        s_alv_print_cat-no_print_listinfos = 'X'.
      
      endform.                    " alv_print
      
      
      form alv_build_fieldcat  using lt_output  l_repid.
      
      
      *DATA: S_FIELDCATALOG type SLIS_T_FIELDCAT_ALV occurs 0.
      
        call function 'REUSE_ALV_FIELDCATALOG_MERGE'
             exporting
                i_program_name         = l_repid
                i_internal_tabname     = lt_output
      *         I_CLIENT_NEVER_DISPLAY = 'X'
                i_inclname             = l_repid
             changing
                ct_fieldcat            = it_alv_field_cat[]
            exceptions
                 inconsistent_interface = 1
                 program_error          = 2
                 others                 = 3.
      
        if sy-subrc <> 0.                    "something went wrong...
          message id sy-msgid type sy-msgty number sy-msgno
                  with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          exit.
        endif.
      
        s_fieldcatalog-checkbox = 'X'.
        s_fieldcatalog-edit = 'X'.
      
      
      endform.                    " ALV_BUILD_FIELDCAT
      

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.