Toolbar of ALV hierachy tree cumulates separators at the end

Hi all,
I'm using an ALV hierarchy tree on a dynpro with dynamic subscreens, where each subscreen adds one or two buttons to the standard ALV toolbar. These buttons are separated by a separator. Now the user can reset the screen with the subscreen and in this case the buttons are deleted.
Adding the buttons and deleting the buttons work fine except that there's still a separator remaining at the end of the toolbar. If I repeat the operation, there are two separators at the end and so one.  What more, the separators are not in table M_TABLE_BUTTON.
What am I missing here ?
Thank for your every provided answer or help ...

While googling I came across this method [CL_GUI_CFW=>UPDATE_VIEW|http://help.sap.com/saphelp_nw04/helpdata/en/e0/9424f7f16e11d2bdd8080009b4534c/content.htm] of the control framework class. Honestly i have never tried this method!
Maybe u can try this. Try calling this method at the right place after u reset an instance.
- Jose

Similar Messages

  • Extra trailing element separators at the end of POC segment

    Hi,
    When running through a 860 EDI file received from the Trading Partner through the Oracle B2B Editor Analyzer Wizard, we are encountering parsing error:
    There are extra trailing element separators at the end of POC segment. Segment POC is defined in the guideline at position 010.
    This error was detected at:
    Segment Count: 23
    Characters: 956 through 957
    The error is possibly occurring due to null elements at the end of the POC segment. However, the Trading Partner mentions that they cannot alter this behaviour in their translator behavior not to insert null elements.
    Is their any way of resolving this issue when we import the document through Oracle B2B?
    Regards,
    Balu

    Hi Balu,
    We are also facing a similar problem. Can you please detail us on how you were able to resolve it.
    Looking forward for your response!!
    Thanks,
    Karan

  • How to Hide rows in ALV without affecting total sum at the end of table?

    Hi,
    I need some help in hiding particular rows in an ALV Grid without affecting the total sum at the end of the table. I am trying to hide the rows that have negative quantities, but I still need those values so that the user can still compute for the total sums. Can anyone help? Thanks.
    Joseph

    Hi,
    Hopw this way you can hide the rows in the GRID.
    DATA:
      ld_column      TYPE lvc_fname,
      ld_hide          TYPE abap_bool.
    FIELD-SYMBOLS:
      <ls_entry>     TYPE any,
      <ld_fld>         TYPE any.
      ld_column = 'COL_1'.  " column which you want to suppress if everything is zero
      ld_hide     = abap_true.  " = 'X';  default hide column
      LOOP at <gt_outtab> ASSIGNING <ls_entry>.
        ASSIGN COMPONENT (ld_column) OF STRUCTURE <ls_entry> TO <ld_fld>.
        IF ( <ld_fld>   > 0 ).
          ld_hide = abap_false.  " display column because at least single value > 0
          EXIT.  " leave LOOP
        ENDIF.
      ENDLOOP.
      READ TABLE gt_fcat INTO ls_fcat
                           WITH KEY fieldname = ld_column.
      IF ( syst-subrc = 0 ).
        ls_fcat-no_out = ld_hide.
        MODIFY gt_fcat FROM ls_fcat INDEX syst-tabix.
      ENDIF.
    hop you will get the total with for those columns too.
    Regards,
    Madhavi

  • Toolbar buttons in ALV column tree

    Dear Experts,
    Currently a report is being displayed using 2 custom container and class CL_GUI_ALV_COLUMN_TREE in a single screen Screen 100.
    Funtions like Select all, Deselect All, Expand All, Colapse all are in the GUI status of this Screen 100.
    <b>Q1</b>. Is it possible to have buttons on the container itself (instead of having it in the GUI status of Scr. 100) and have the above funtions work for ALV column tree .
    <b>Q2.</b> There exists a check box in each row of the node in both the containers which is meant for comparing data between two containers.
    e.g the user Checks one row of the first container (ALV tree output) and another in 2nd container and press Compare button which is present in Scr 100 GUI status.
    When the ckeck box is selected the rows are being selected, this is done in CheckBoX Change event of CL_GUI_ALV_COLUMN_TREE. Now when the Deselect ALL button is clicked rows are getting deselected but check marks are not getting cleared from the check box.
    How can the check box be cleared when we press Deselect All button which is in GUI Status of Scr 100.?
    Thanks n Regards

    Hello Mahesh
    Assuming that you are dealing with class
    CL_GUI_ALV_TREE (because I cannot find class CL_GUI_ALV_COLUMN_TREE) sample report BCALV_TREE_04 shows how to add a button to the toolbar.
    The crucial points can be found in routine CHANGE_TOOLBAR: 
    form change_toolbar.
    * §1.Get toolbar instance of your ALV Tree.
    * When you instantiate an instance of CL_GUI_ALV_TREE the constructor
    * of the base class (CL_ALV_TREE_BASE) creates a toolbar.
    * Fetch its reference with the following method if you want to
    * modify it:
      call method g_alv_tree->get_toolbar_object
              importing
                  er_toolbar = g_toolbar.
      check not g_toolbar is initial. "could happen if you do not use the
                                      "standard toolbar
    * §2.Modify toolbar with methods of CL_GUI_TOOLBAR:
    * add seperator to toolbar
      call method g_toolbar->add_button
              exporting
                  fcode     = ''
                  icon      = ''
                  butn_type = cntb_btype_sep.
    * add Standard Button to toolbar (for Delete Subtree)
      call method g_toolbar->add_button
              exporting
                  fcode     = 'DELETE'
                  icon      = '@11@'
                  butn_type = cntb_btype_button
                  text      = ''
                  quickinfo = text-901.   "Delete subtree
    endform.
    Regards
      Uwe

  • Toolbar for ALV tree

    Hi All,
    I am populating data in ALV tree format using cl_gui_column_tree class methods. Now I want to have standard ALV functionality on top of my tree. How to acheive this?
    Appreciate your help on the same.
    Thanks & regards,
    Prakash Ghantasala

    Tree is not having a table structure,so the standard ALV toolbar is of logically  no use and hence is not provided along with it.
    Yet you can do R&D .To get the std ALV gui status you can copy the the gui status SALV_TABLE_STANDARD of program SALV_METADATA_STATUS

  • ALV .  How to remove the sort buttons on toolbar in ALV report?

    Hi,experts
      As you know, in default case , the alv report will display two sort buttons(ascending ,descending) on its toolbar , So How to remove the sort buttons on toolbar in ALV report?
      Thanks for your help .

    Hi guixin,
    1. Before calling REUSE_ALV_LIST_DISPLAY
    2. Write this code :
    data : excl type SLIS_T_EXTAB.
    data : exclwa type SLIS_EXTAB.
    exclwa = '&OUP'.
    append exclwa to excl.
    exclwa = '&ODN'.
    append exclwa to excl.
    3. Then while calling the FM,
       pass this parameter also .
    IT_EXCLUDING     = excl
    It will work fantastic.
    regards,
    amit m.

  • How to download the ALV Hierchial Tree Data to an Excel sheet.

    Hi All,
    Can any body please let me ,if there is any possibility to know How to download the ALV Hierchial Tree Data to an Excel sheet.
    If yes, please let me know how could this can b acheived.
    Regards,
    Rohini.

    Hi Rohini
    There is no such functionality provided by SAP to download ALV Tree Hierarichal Tree into excel sheet .
    If you had this kind of senario then i can propose one solution create two radio buttons one is to display in ALV Tree Format and the other is classical report which you can download it for futher process
    Regards
    Hitesh Batra

  • Regarding excel download from ALV report tree

    Hi Experts,
    I have a ALV report tree program. In that i need the functionality to download report output in excel file.
    Can any body suggest how can i achieve download to excel functionality in it.
    Any useful suggestion will be appreciated.
    Thanks in advance,
    Akash

    The data for the tree exist in the NODE table in a different format. So, even you download that table, it will not be downloaded in the TREE format. So, the user will not be able to understand the data unlike the case of a ALV GRID.
    Whether it is a TREE / GRID, ultimately its the data of a internal table, that gets downloaded. But in case a TREE, we don't have the data in a straight forward way . i thnk it is not possible . i am not sure too for this .

  • Adding 'FIND' functionality in toolbar of ALV Web Dynpro ABAP

    Hi Friends,
    I need to know whether we can add FIND functionality in toolbar of ALV display. If yes than which class will help in that, or do i need to code it.
    Pls help on this.
    Regards,
    Saud

    Hi Saud,
        If you mean that you need to highlight the Field-Value then, you can use Set Focus On A Table Cell .
    You can use the method REQUEST_FOCUS_ON_VIEW_ELEM of if_wd_view.
    For this, you can see this post --
                               How to set focus on a specific UI field at the start of an application?
    Further, you have to design 'find input-screen', submitting which will set focus on the cell that contains requested value.
    This way, you can add ( or somehow, simulate ) the Functionality of FIND, although not per se.
    Thanks.
    Kumar Saurav.

  • ALV Simple Tree: How to customize sum levels?

    Hi,
    I have the following issue:
    I use the ALV Simple Tree to display a hierarchy. In this hierarchy one element is the currency of the values I want to display. Therefore the currency might not be the top-level of the hierarchy and as a consequence the tree/table looks like this:
    Region/Curr. | Amount 1 | Currency
    EUROPE       | 2000     | ***
    - EUR       | 1000     | EUR
    - USD       | 1000     | USD
    -> Different currencies are added with no respect to currency rates or the likes. Only the currency field is filled with stars.
    Question: How can I prevent sums for a tree level?
    The hierarchy is flexible, so I require a dynamic solution (for example if there are two levels before the currency or none).
    If anyone got a link to the documentation for the Simple Tree (or something like that), I would also really appreciate it!
    Kind Regards,
    Robert

    Hi
    I'm using OOP ALV.
    data: t_fieldcat TYPE STANDARD TABLE OF lvc_s_fcat,
             wa_fieldcat TYPE lvc_s_fcat.
    *populate field cat
      wa_fieldcat-col_pos = 2.
      wa_fieldcat-tabname = 'ITAB'.
      wa_fieldcat-fieldname = 'DB name of teh field Amount1'.
      wa_fieldcat-do_sum = 'X'.
      wa_fieldcat-coltext = 'Amt'.
      APPEND wa_fieldcat TO t_fieldcat.
    CALL METHOD o_grid->set_table_for_first_display
        CHANGING
          it_outtab                     = itab
          it_fieldcatalog             = t_fieldcat
          it_sort                        = t_sort
    regards,
    manju

  • Drag And Drop in ALV Column Tree

    Hello All,
    Can anyone tell me the method used for  a drag and drop in a column tree....
    i found it for a simple tree but not for a column tree.....
    thanks in advance....
    Regards,
    Praveen

    Check the links -
    drag drop required for alv column!
    drag and drop in a tree
    Drag&Drop within the Tree
    Drag&Drop within a tree
    Drag and drop in ALV tree
    Regards,
    Amit
    Reward all helpful replies.

  • ALV OO TREE in a function module

    Hi everybody,
    Probably somebody can help me with this. I am trying to create an ALV OO TREE and I am following one of the examples that is in the system (BCALV_TREE_SIMPLE_DEMO) because it is more or less what I need. The problem I have is that I need to create a function module that contains this ALV_TREE so the import of this FM would be the table with the info, and as I saw I need to use PBO and PAI to create it with objects because if not it doesn't work, it doesn't show anything. I just create a report to test it, but now I need to create the FM, does anybody knows how to do it without this PBO and PAI or just with it but using the function module to create the ALV view?
    Thanks very much

    Hello,
    Check this link:
    Web Services-Based Connectivity
    look for article  Creating an ALV Grid in 3 lines. Maybe it will help you.
    Regards,
    Marcin

  • Toolbar in alv display using oops alv

    i have written code for displaying toolbar in alv display using oops, but it is not displaying please find the below code and let me know reason.
    *& Report  ZTRANSFER_ORDER2                                            *
    REPORT  ZTRANSFER_ORDER2   .
    *& Report  ZTRANSFER_ORDER                                             *
       TABLES:sflight.
       TYPE-POOLS : icon.
      * G L O B A L   I N T E R N  A L   T A B L E S
    CLASS lcl_event_receiver DEFINITION DEFERRED.
    types : begin of ty_mara,
            matnr type matnr,
            mtart type mtart,
            mbrsh type mbrsh,
            matkl type matkl,
            bismt type bismt,
            meins type meins,
            end of ty_mara.
      DATA: t_mara type STANDARD TABLE OF ty_mara.
      * G L O B A L   D A T A
       DATA: ok_code LIKE sy-ucomm,
             g_wa_mara type ty_mara.
        DATA : t_fcat type LVC_T_FCAT.
      DATA  : l_VAR TYPE disvariant.
      DATA :  gs_layout type lvc_s_layo.
      * Declare reference variables to the ALV grid and the container
    G L O B A L   D A T A
      DATA: ok_code LIKE sy-ucomm.
    Declare reference variables to the ALV grid and the container
       DATA:
         go_grid             TYPE REF TO cl_gui_alv_grid,
         go_custom_container TYPE REF TO cl_gui_custom_container.
      data :  it_toolbar  TYPE stb_button,
      event_receiver TYPE REF TO lcl_event_receiver.
      * S T A R T - O F - S E L E C T I O N.
       START-OF-SELECTION.
        CALL SCREEN 100   .
    *CLASS lcl_event_receiver DEFINITION.
    CLASS lcl_event_receiver DEFINITION.
    PUBLIC SECTION.
        CLASS-METHODS:
    *handling toolbar for interactive
         handle_toolbar
            FOR EVENT toolbar OF cl_gui_alv_grid
                IMPORTING e_object e_interactive,
    *handling menu button
         handle_menu_button
            FOR EVENT menu_button OF cl_gui_alv_grid
                IMPORTING e_object e_ucomm,
    *On click of the menu button
        handle_user_command
            FOR EVENT user_command OF cl_gui_alv_grid
                IMPORTING e_ucomm.
        PRIVATE SECTION.
        ENDCLASS.
    CLASS lcl_event_receiver IMPLEMENTATION.
    METHOD handle_toolbar.
    handle toolbar
    CLEAR it_toolbar.
    MOVE 'DETAIL' TO it_toolbar-function.
        MOVE icon_detail TO it_toolbar-icon.
        MOVE 2 TO it_toolbar-butn_type.
        APPEND it_toolbar TO e_object->mt_toolbar.
        ENDMETHOD.                    "handle_toolbar
        METHOD handle_menu_button.
    handle own menubuttons
        IF e_ucomm = 'DETAIL'.
          CALL METHOD e_object->add_function
            EXPORTING
              fcode = 'DISPLAY'
              text  = 'DISPLAY'.
        ENDIF.
      ENDMETHOD.                    "handle_menu_button
      METHOD handle_user_command.
    *On click
        CASE e_ucomm.
          WHEN 'DISPLAY'.
            MESSAGE 'Menu Clicked' TYPE 'I'.
        ENDCASE.
      ENDMETHOD.                           "handle_user_command
    ENDCLASS.                    "lcl_event_receiver IMPLEMENTATION
      *&      Module  USER_COMMAND_0100  INPUT
      MODULE user_command_0100 INPUT.
        CASE ok_code.
          WHEN 'EXIT'.
            LEAVE TO SCREEN 0.
        ENDCASE.
      ENDMODULE.                 " USER_COMMAND_0100  INPUT
      *&      Module  STATUS_0100  OUTPUT
       MODULE status_0100 OUTPUT.
        sET PF-STATUS 'STATUS'.
    Create objects
         IF go_custom_container IS INITIAL.
           CREATE OBJECT go_custom_container
             EXPORTING container_name = 'ALV_CONTAINER'.
           CREATE OBJECT go_grid
             EXPORTING
               i_parent = go_custom_container.
           PERFORM load_data_into_grid.
         ENDIF.
       ENDMODULE.                 " STATUS_0100  OUTPUT
      *&      Form  load_data_into_grid
       FORM load_data_into_grid.
    Read data from table SFLIGHT
         SELECT matnr mtart mbrsh matkl bismt meins
           FROM mara
           INTO corresponding fields of TABLE t_mara.
       PERFORM fld_cate changing T_fcat.
        l_var-report = sy-repid.
      gs_layout-grid_title = 'Analysis Report'.
    gs_layout-NO_TOOLBAR = 'X'.
    gs_layout-BOX_FNAME = 'Selection'.
    Load data into the grid and display them
            caLL METHOD go_grid->set_table_for_first_display
            EXPORTING
            i_structure_name = 'S_MVKE'
              i_save          = 'A'
               is_variant       = l_var
                is_layout             = gs_layout
           CHANGING
             it_outtab        = t_mara[]
             it_fieldcatalog  = t_fcat.
      endform.
    *&      Module  pai  INPUT
          text
    MODULE pai INPUT.
    data: l_valid type c.
       clear ok_code.
       break-point.
       ok_code = sy-ucomm.
           CASE ok_code.
           WHEN 'EXIT'.
             LEAVE TO SCREEN 0.
           WHEN 'BACK'.
             call method go_grid->check_changed_data
                 importing
                    e_valid = l_valid.
            loop at t_mara into g_wa_mara.
            endloop.
         ENDCASE.
    ENDMODULE.                 " pai  INPUT
    *&      Form  fld_cate
          text
         <--P_T_FCAT  text
    FORM fld_cate  CHANGING P_T_FCAT  TYPE lvc_t_fcat.
    DATA : s_fcat type LVC_S_FCAT .
    REFRESH: t_fcat.
      CLEAR s_fcat.
    s_fcat-fieldname = 'BOX1'.
    s_fcat-coltext =   'Box1'.
    s_fcat-seltext =   'Box1'.
    s_fcat-CHECKBOX = 'X'.
    s_fcat-EDIT = 'X'.
    APPEND s_fcat TO P_T_FCAT.
      CLEAR s_fcat.
      s_fcat-row_pos = 1.
      s_fcat-col_pos = 1.
      s_fcat-fieldname = 'MATNR'.
      s_fcat-ref_field = 'MATNR'.
      s_fcat-ref_table = 'T_MARA'.
      s_fcat-coltext =   'Material'.
      s_fcat-seltext =   'Material'.
    s_fcat-EDIT = 'X'.
      APPEND s_fcat TO P_T_FCAT.
      CLEAR s_fcat.
       s_fcat-row_pos = 2.
      s_fcat-col_pos = 2.
      s_fcat-fieldname = 'MTART'.
      s_fcat-ref_field = 'MTART'.
      s_fcat-ref_table = 'T_MARA'.
      s_fcat-coltext =   'Material type'.
      s_fcat-seltext =   'Material type'.
      APPEND s_fcat TO P_T_FCAT.
    CLEAR s_fcat.
    s_fcat-fieldname = 'BOX2'.
    s_fcat-coltext =   'Box2'.
    s_fcat-seltext =   'Box2'.
    s_fcat-CHECKBOX = 'X'.
    s_fcat-EDIT = 'X'.
    APPEND s_fcat TO P_T_FCAT.
      CLEAR s_fcat.
      s_fcat-row_pos = 3.
      s_fcat-col_pos = 3.
      s_fcat-fieldname = 'MBRSH'.
      s_fcat-ref_field = 'MBRSH'.
      s_fcat-ref_table = 'T_MARA'.
      s_fcat-coltext =   'Industry Sector'.
      s_fcat-seltext =   'Industry Sector'.
      APPEND s_fcat TO P_T_FCAT.
      CLEAR s_fcat.
        s_fcat-row_pos = 4.
      s_fcat-col_pos = 4.
      s_fcat-fieldname = 'MATKL'.
      s_fcat-ref_field = 'MATKL'.
      s_fcat-ref_table = 'T_MARA'.
      s_fcat-coltext =   'Material Group'.
      s_fcat-seltext =   'Material Group'.
      APPEND s_fcat TO P_T_FCAT.
      CLEAR s_fcat.
        s_fcat-row_pos = 5.
      s_fcat-col_pos = 5.
      s_fcat-fieldname = 'BISMT'.
      s_fcat-ref_field = 'BISMT'.
      s_fcat-ref_table = 'T_MARA'.
      s_fcat-coltext =   'Old material number'.
      s_fcat-seltext =   'Old material number'.
      APPEND s_fcat TO P_T_FCAT.
      CLEAR s_fcat.
        s_fcat-row_pos = 6.
      s_fcat-col_pos = 6.
      s_fcat-fieldname = 'MEINS'.
      s_fcat-ref_field = 'MEINS'.
      s_fcat-ref_table = 'T_MARA'.
      s_fcat-coltext =   'Base Unit of Measure'.
      s_fcat-seltext =   'Base Unit of Measure'.
      APPEND s_fcat TO P_T_FCAT.
    CLEAR s_fcat.
    s_fcat-fieldname = 'BOX3'.
    s_fcat-coltext =   'Box3'.
    s_fcat-seltext =   'Box3'.
    s_fcat-CHECKBOX = 'X'.
    s_fcat-EDIT = 'X'.
    APPEND s_fcat TO P_T_FCAT.
    ENDFORM.                    " fld_cate                     .

    MOVE 2 TO it_toolbar-butn_type.
    Try changing the 2 (menu) to 0 (button) and see if that helps
    also you need to set the event handler after you create your alv object
    set handler handle_toolbar for [whatever object is called].
    Edited by: Kev Mycock on Jul 24, 2008 7:59 AM

  • Setting the ALV Hierarchy tree with grid line between the columns and rows

    Hi Experts,
    I would like to ask if there is any suggestion on setting the ALV hierarchy tree to be separated by grid line between the columns and rows just like how it is display the same way in normal ALV grid.
    Thanks in advance.

    Hi Lin,
    The requirement which you have stated is not possible.
    Lin,
    Also i have a query regarding BADI ZME_PROCESS_REQ_CUST, which you had raised on SDN. You have marked the question as solved/answered.
    Changing the data of a customize field in purchase requisition
    Could you please let me know, the steps you did to update the screen fields through the BADI.
    I would really appreciate your reply, because i am facing exactly the same problem which you have mentioned.
    Thanks,
    Best regards,
    Prashant

  • How to Hide Scroll Bars in Hierachy Tree?

    Hi!
    How to Hide Scroll Bars in Hierachy Tree?
    Thanks!

    when I populate the Tree Item with populate_tree(). I get a hierarchical tree. when the tree populates, two scroll bars (on it right and bottom) are displayed. Can I hide them?

Maybe you are looking for