‎2009 Jul 15 1:03 PM
Hello,
I have the necessity to develo an ALV with two Headers:
EG.
| Plant 1100 | Plant 1600 |
| Date | Value | Qty | Date | Value | Qty |I can't use Hierarchical because it doesn't do this kind of rappresentation; It works only like this:
| Plant 1100 |
| Date | Value | Qty |
| Plant 1600 |
| Date | Value | Qty |Instead I need to display double headers in a single row..
Any suggestion?
Thanks in advanced
Marco
‎2009 Jul 15 1:16 PM
Hi
U should create an internal table for output having all fields twice
DATA BEGIN OF T_OUTPUT OCCURS 0,
DATE_1,
VALUE_1,
QTY_1,
DATE_2
VALUE_2,
QTY_2,
END OF T_OUTPUT.In the first block of flied u can insert the data for the first plant, in the second one u can insert the data of the second plant.
The second header line (the field label) will be managed by ALV, the first line has to be write in TOP-OF-PAGE event:
.FORM TOP_OF_PAGE.
WRITE: SY-VLINE, PLANT1,......
ENDFORM..
Max
‎2009 Jul 15 1:16 PM
Hi
U should create an internal table for output having all fields twice
DATA BEGIN OF T_OUTPUT OCCURS 0,
DATE_1,
VALUE_1,
QTY_1,
DATE_2
VALUE_2,
QTY_2,
END OF T_OUTPUT.In the first block of flied u can insert the data for the first plant, in the second one u can insert the data of the second plant.
The second header line (the field label) will be managed by ALV, the first line has to be write in TOP-OF-PAGE event:
.FORM TOP_OF_PAGE.
WRITE: SY-VLINE, PLANT1,......
ENDFORM..
Max
‎2009 Jul 15 2:04 PM
thanks, but probably It's not enoght because if the user change the dimension of the ALV headers, the top headers doesn't folllow the news lengh..
Probably doesn't exist an integrated solution in ALV.
Marco
‎2009 Jul 15 2:13 PM
Hi
Yes I know
But u can use the event TOP_OF_LIST here you can call the fm REUSE_ALV_LIST_LAYOUT_INFO_GET in order to get the layout status after the user has changed it.
This fm return the catalog table (ET_FIELDCAT) and the layout structure (ES_LAYOUT) where u can pick all information you need to write the header correctly.
I've just done it and it works.
Max