Quantcast
Channel: SCN: Message List - ABAP Development
Viewing all articles
Browse latest Browse all 10425

Change header value - ALV tree

$
0
0

Hi All,

 

I need to change the header value that I changed to be a average value. The point is that The Total comm is the number of many lines summarized. Do actually instead of 2 lines I actually have 13. 1 in the 1st alv line and 12 in the 2nd alv line. (*** PLEASE CHECK ATTACH**) I need to count 116.67  / 13. That is the avarage that I expect to show in the value header.

 

Objects used for this alv tree:

 

Class: G_TREE type ref to CL_GUI_ALV_TREE_SIMPLE

 

class lcl_tree_event_receiver definition.

 

   public section.

 

     methods:

     on_add_hierarchy_node

               for event on_add_hierarchy_node of cl_gui_alv_tree_simple

                     importing grouplevel

                               index_outtab.

 

endclass.

 

class lcl_tree_event_receiver implementation.

 

   method on_add_hierarchy_node.

     data ls_outtab_line type tab_type.

     ls_outtab_line-prozact  = '2.00'. "#EC NOTEXT

     call method g_tree->set_hierarchy_data

             exporting

                 is_outtab_line = ls_outtab_line.

   endmethod.

 

endclass.


-*-*-*-*-*-*-*-*-*-*-*-*


create object g_tree

     exporting

         i_parent              = l_custom_container

         i_node_selection_mode =

                               cl_gui_column_tree=>node_sel_mode_multiple

         i_item_selection      = 'X'

         i_no_html_header      = ''

         i_no_toolbar          = ''

     exceptions

         cntl_error                   = 1

         cntl_system_error            = 2

         create_error                 = 3

         lifetime_error               = 4

         illegal_node_selection_mode  = 5

         failed                       = 6

         illegal_column_name          = 7.

 

* create info-table for html-header

   data: lt_list_commentary type slis_t_listheader,

         l_logo             type sdydo_value.

   perform build_comment using

                  lt_list_commentary

                  l_logo.

 

* repid for saving variants

   data: ls_variant type disvariant.

   ls_variant-report = sy-repid.

 

* register events

   perform register_events.

 

* create hierarchy

   call method g_tree->set_table_for_first_display

     exporting

       it_list_commentary = lt_list_commentary

       i_logo             = l_logo

       i_background_id    = 'ALV_BACKGROUND'

       i_save             = 'A'

       is_variant         = ls_variant

     changing

       it_sort            = gt_sort

       it_outtab          = it_data

       it_fieldcatalog    = fieldcat.

 

* expand first level

*  CALL METHOD g_tree->expand_tree

*    EXPORTING

*      i_level = 1.

 

* optimize column-width

   call method g_tree->column_optimize

     exporting

       i_start_column = g_tree->c_hierarchy_column_name

       i_end_column   = g_tree->c_hierarchy_column_name.


-*-*-*-*-*-*-*

 

 

Is it possible to change the avarage value?!

 

Thanks,

Andréa


Viewing all articles
Browse latest Browse all 10425

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>