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

Row Explode (ALV grid)

Former Member
0 Likes
651

Hi,

I have a table that contains rows that are aggregated of more record. This records also are aggregated. What I need is a way that clicking on a row, the row is exploded in its components, and if I click on one of the component, then this also is exploded in its components. It's a two levels of explosion of a row. I would like to know if there are some function could help me. I would like to do it in an ALV grid if possibile.

Thanks

Gabriele

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
511

It is possible to use the ALV subtotal functionality to aggregate based on document numbers, item numbers, etc. Your scenario sounds like it is the same in principle as a sales order->item->schedule line relationship. If no suitable fields for subtotalling exist in the data you are working with then you could add some integer fields to the ALV internal table and use these for subtotalling.

Alternatively, you could maintain an internal table of the detailed data and aggregate into the ALV display table. The program could then react to a double click by reading the detailed data again and not aggregating the row that was just clicked. A description field in the ALV could be used to differentiate between aggregated and detailed rows, possibly using different numbers of asterisks; *, **, ***, etc to indicate the aggregation level.

Regards,

Steve.

2 REPLIES 2
Read only

Former Member
0 Likes
512

It is possible to use the ALV subtotal functionality to aggregate based on document numbers, item numbers, etc. Your scenario sounds like it is the same in principle as a sales order->item->schedule line relationship. If no suitable fields for subtotalling exist in the data you are working with then you could add some integer fields to the ALV internal table and use these for subtotalling.

Alternatively, you could maintain an internal table of the detailed data and aggregate into the ALV display table. The program could then react to a double click by reading the detailed data again and not aggregating the row that was just clicked. A description field in the ALV could be used to differentiate between aggregated and detailed rows, possibly using different numbers of asterisks; *, **, ***, etc to indicate the aggregation level.

Regards,

Steve.

Read only

0 Likes
511

thanks for your help,

can you give me some hints for setting this?

Can you post me some tips for set this working in the grid: I'll give you some detail; i have that complete rows are like that:

KSTAR | CODSPESA | COST | OTHER_FIELDS

the row shown initially is an aggregate of same KSTAR records; so I would like to have something like this:

+ KSTAR | SUM

wher SUM is the sum of COST for each CODSPESA

and clicking on the row:

- KSTAR | SUM

.... + CODSPESA1 | SUM1

.... + CODSPESA2 | SUM2

So the "higher" SUM is the sum of SUM1 and SUM2; clicking again on one component CODSPESA I would have:

- KSTAR | SUM

.... - CODSPESA1 | SUM1

............COST 1

............COST 2

............COST 3

.... + CODSPESA2 | SUM2

So SUM1 is the sum of COST1, COST2 and COST3

I just want to know which are the fields I have to set in catalogue or in the layout for the grid .. also the name of this fields are welcome.

Thanks