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

ALV double HEADERS

Former Member
0 Likes
686

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
580

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

3 REPLIES 3
Read only

Former Member
0 Likes
581

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

Read only

Former Member
0 Likes
580

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

Read only

0 Likes
580

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