Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

ALV Tree - Change average value

deiamolina
Contributor
0 Likes
1,089

Hi all,

I want to change the average value. For the follow example the hierarchy has 2 lines but it is a summarize of 13 lines. So the right average is (100.00 + 16.67) / 13

SAP average

Expectation:

I am using:

data: g_tree type ref to cl_gui_alv_tree_simple.

Is it possible to change it?

Regards,

Andréa

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
993

Hi Andrea

yes, it can be change.

In your code,

CALL METHOD tree1->set_table_for_first_display

.....

.....

CHANGING

      it_sort            = gt_sort

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

to change the content of internal table gt_sort, the average will accordingly changed.

hope can help you.

Regards,

Archer

Hi all,

I want to change the average value. For the follow example the hierarchy has 2 lines but it is a summarize of 13 lines. So the right average is (100.00 + 16.67) / 13

SAP average

Expectation:

I am using:

data: g_tree type ref to cl_gui_alv_tree_simple.

Is it possible to change it?

Regards,

Andréa

4 REPLIES 4
Read only

Former Member
0 Likes
994

Hi Andrea

yes, it can be change.

In your code,

CALL METHOD tree1->set_table_for_first_display

.....

.....

CHANGING

      it_sort            = gt_sort

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

to change the content of internal table gt_sort, the average will accordingly changed.

hope can help you.

Regards,

Archer

Read only

0 Likes
993

But I don't want to change the group information. It need to be 2 lines in the report but 13 lines to be used to use to divide.

I can't show 13 lines for it.

What I need to change is the way that SAP is calculation it. Instead of a default way ( h_ftype = AVG ) I do like to write this formula.

Is it possible?

Read only

0 Likes
993

Hi,

Use CL_GUI_ALV_TREE method for creating the Tree, in that create each node by method ADD_NODE. With this method you can do calculation and update while building the ALV Tree.

Just refer the Demo program 'BCALV_TREE_DEMO'.

First get the final output table data.

Loop that table and create each node by using ADD_NODE method.

Thanks & Regards

Bala Krishna

Read only

0 Likes
993

Thanks!