Dynamic ALV Report with Dynamic Columns
I want to create a Dynamic ALV Report, in which the columns of the ALV report would vary according to the data available in the internal table after the Select queries.
Ex: If the internal table (say IT_TAB) contains 5 records then 5 columns would be displayed as output.
If there are 4 records in internal table (say IT_TAB) then 4 Columns ... etc.
And the (Heading) description of the columns would be coming from the internal table IT_TAB itself.
This is part of the field catalog which i am able to handle.
But how do i take care of the Final Internal table (say IT_FINAL) which i have to pass to the FM 'REUSE_ALV_GRID_DISPLAY'.
As the fields of the Final Internal table (say IT_FINAL) have to be declared at the top, which have been fixed and declared once.
And how do i have to assign the correct amount values to the corresponding columns which may vary as per requirement.