2010 Jun 30 10:03 AM
I have a ALV Tree in which I hav the folowing requiment
Suppose I have a table
Prog Standard effectivity
L ST1 aaaaa
L ST1 bbbbbb
L ST1 vvvvvv
R ST1 bbbbbb
But I hav to display it as
-->L ST1 (Header)
aaaaa
bbbbb
vvvvv
-->R ST1 bbbbb (Header) --> as row has single valueHere ---> is the node
As u can see I hav to display first two colunms only in the header row
and next field in child but if row has one value as in case where Prog is R then all the fields are in header
Plz tll me how can I change header content
also in some case i hav to display *** in header for multiple values
I can only see in examples where Header contains Sum of numeric fields
2010 Jul 08 6:40 AM
Hi Nisha
I have already reffered to those programs in detail
but in them only calculations are updated in the header rows e.g adding of all subtree rows in header
but my case is different as u can see in the first post , my columns cannot be added they are alpanumerin and according to their values i have to update in the header.
for example if my column has values
a
b
b
d
then header will be a/b/d
or
a
b
b
then header will be a//b
Or u can say it will have custom values and there is nothing like that in SAP code examples
2010 Jun 30 10:33 AM
Plz Help guys
is it that difficult??
Edited by: Karan Chopra on Jun 30, 2010 8:42 PM
2010 Jul 01 4:52 AM
2010 Jul 01 6:41 AM
you use collect statement in your header...???
show me ur code....!
2010 Jul 01 7:08 AM
I have not used collect statement
the thing is normally on expantion column values are displayed for every child row but I want to display all those values in header only and that is for the columns which are not included in Header Node ...
2010 Jul 01 7:23 AM
ht[http://tinypic.com/r/vxkrva/6|http://tinypic.com/r/vxkrva/6]
This is a link for reference here for first 2 columns values will be displayed in header and for rest it will have ** if it has multiple values and value if it has single value
2010 Jul 01 7:49 AM
Hello,
Please refer to this program BCALV_TEST_HIERSEQ_LIST this should help to solve your requirement of header and item
Please look at the exporting paramters which states the header and item level
i_tabname_header = 'GT_MASTER'
i_tabname_item = 'GT_SLAVE'
and subtotal based on the header data
regards
suresh nair
2010 Jul 01 9:08 AM
2010 Jul 01 10:12 AM
Hi Karan,
Check BCALV_TREE_* programs.
You will easily understand BCALV_TREE_01 program.
Regards,
Nisha Vengal.
2010 Jul 06 11:13 AM
How can I change the data for every header row column in tree ALV
You can see the example in first column.
Plz help ....
Edited by: Karan Chopra on Jul 7, 2010 10:35 AM
2010 Jul 07 2:06 PM
2010 Jul 08 5:38 AM
Hi Karan,
Did you check the program I referred?
Please try to understand how it works.
Let me know incase you dont understand some code.
In ALV tree, you can manipulate each row to be displayed.
All the rows displayed will be part of a internal table.
Depending on how you fill internal table, you can change your output display.
Regards,
Nisha Vengal.
2010 Jul 08 6:40 AM
Hi Nisha
I have already reffered to those programs in detail
but in them only calculations are updated in the header rows e.g adding of all subtree rows in header
but my case is different as u can see in the first post , my columns cannot be added they are alpanumerin and according to their values i have to update in the header.
for example if my column has values
a
b
b
d
then header will be a/b/d
or
a
b
b
then header will be a//b
Or u can say it will have custom values and there is nothing like that in SAP code examples
2010 Jul 08 7:29 AM
Hi Karan,
Each row gets added because of this method call.
call method g_alv_tree->add_node
exporting
i_relat_node_key = p_relat_key
i_relationship = cl_gui_column_tree=>relat_last_child
i_node_text = l_node_text
is_outtab_line = ls_sflight
importing
e_new_node_key = p_node_key.
You have got the power to populate ls_sflight, in whichever way you want.
First, what you need to do is, you need to create an internal table with rows having data similar to your final display.
Then LOOP at that internal table, and add WORK AREA to ALV TREE.
So your internal table should be manipulated as:
Column 1 Column 2
Row 1 a/b/d orange/red/violet
Row 2 a orange
Row 3 b red
Row 4 d violet
You need to write code for getting row 1 (like in this case, write CONCATENATE).
If its to find TOTAL of rows, we have option to provide in fieldcatalog.
Since your case is to populate characters, you need to explicitly pass the header data.
Regards,
Nisha Vengal.
2010 Jul 08 10:24 AM
Hey Nisha
thanks a lot u solved my problem.....!!!
Although I did this yesterday but was doing it a wrong way ...
rewarded u all points ...!!!