Application Development 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: 

Problem in ALV grid grouping table.

Former Member
0 Kudos

Hi all, i'm having a problem using alv grid display. my problem is how to group several columns into one column, so the column will have parent. for example:

-


January

-


Cost

Benefit

Budget

etc

-


I want to group the column like cost, benefit, budget, etc into one parent column which is january. for information i'm using call function reuse_alv_grid_display. Thanks

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Julius,

I don't think what you are trying to achieve will be possible using ALV GRID.

You might want to look at ALV TREE so that can have the display like that. Or have a Grid and SORT it month. In the layout the NO_MERGING should not be set so that month data is not repeated.

regards,

Ravi

Note : please mark the helpful answers.

10 REPLIES 10

Former Member
0 Kudos

Julius,

I don't think what you are trying to achieve will be possible using ALV GRID.

You might want to look at ALV TREE so that can have the display like that. Or have a Grid and SORT it month. In the layout the NO_MERGING should not be set so that month data is not repeated.

regards,

Ravi

Note : please mark the helpful answers.

former_member188685
Active Contributor
0 Kudos

Hi,

you need to use <b>REUSE_ALV_HIERSEQ_LIST_DISPLAY</b>

here you can show based on month .

Regards

vijay

Former Member
0 Kudos

Thank you for your answer, but i need a function to show alv grid, not alv list, is there any way to group the table so that it will based, for example like months, or year.

0 Kudos

Hi,

in that case you can group them using Sort table parameter. you can build the sort table based on month, and the data will be grouped based on month. this is another possibility.

sort-fieldname = 'MONTH'.

sort-up = 'X'.

append sort to it_sort.

pass this IT_sort to alv grid FM.

Regards

Vjay

0 Kudos

Have look at the Demoporgrams

BCALV

You need the demo flight model to get some results. There are examples doing exactly what you want.

0 Kudos

Julius,

In that case, I don't think you have any other option that just sorting the table, like I specified in the first response.

Regards,

Ravi

0 Kudos

Hi,

Check these program...

<b>

BALVST03_GRID</b>

Regards

Vjay

Former Member
0 Kudos

Okay, thanks for ur answer.... that's mean that i cannot group the column at the top of alv, instead i have to sort it and group it based on the column it self.

0 Kudos

Have a look at this: BCALV_TREE_01

0 Kudos

Yes, you add the month also to the same internal table and sort it based on month , using sort table and pass it to ALV grid FM.

Regards

Vjay