简体   繁体   中英

Two-level column headings in ALV or any other grid layout?

To illustrate what I want:

|         Category A            |         Category B            |  C  |
|     A.A       |      A.B      |      A.A      |      A.B      |     |
| A.A.A | A.A.B | A.B.A | A.B.B | B.A.A | B.A.B | B.B.A | B.B.B |     |

I need a header that looks somewhat like this and I was wondering if there's a way to do it other than manually WRITE each line. :D

Based on my experience, you can't do "multi-layer" header in ALV Grid. But this can be done with simple list using WRITE statements which gives you more control on how to display the data.

But of course you have to do all the functions like Sort, Filter and so on by yourself.

The best way is to stick with ALV Grid and just Sub-categorize your data with columns just as Harmut suggested. You can sort them by this sub-category column so it will look like grouped together in the ALV Grid

Depending on the scenario, you might be able to bend the XXL API to generate the list in Excel. Try executing the demo program XXLFTEST and have it export the results to a pivot table - maybe you could use this? Other than that, I know of no control that is able to do this. You could WRITE the stuff yourself, of course, or you could try to persuade the users to have the hierarchy on the vertical axis and use a standard column tree...

In your question you illustrated the data by categories. In my eyes this looks quite normal, you have pivot data and want that displaying in a kind of hierarchy. ALV Grid has a very cute technique to Sort an Group your data - even subtotals are possible. Then you can have easily a multi-layered construction with Category A, B, Category AA, AB, BA, BB, and so on. Please give further details on your business needs.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM