2012 Jan 06 10:29 AM
How to get row name and also column name in ALV grid display?
My alv output will look something like this...
Actual Estimate Budget Actual Estimate Budget
Gross Production - Zinc
Net Production - Zinc
Cathode Production
The Gross Production - Zinc , Net Production - Zinc, Cathode Production are constant (row Names) so are actual, estimate etc..in the column.
Any help will be deeply appreciated...
2012 Jan 06 11:21 AM
Hi Tushar,
In the type declaration of internal table (which you will use to display data),
you should declare first field as a character field and fill it manually with your constants.
Then it will be displayed as row name.
Column name you can simply display by specifying in Fieldcatalog.
Regards,
Harsh Bansal
2012 Jan 06 11:21 AM
Hi Tushar,
In the type declaration of internal table (which you will use to display data),
you should declare first field as a character field and fill it manually with your constants.
Then it will be displayed as row name.
Column name you can simply display by specifying in Fieldcatalog.
Regards,
Harsh Bansal
2012 Jan 06 12:43 PM
Rows are identified by a number. ..you get the index of the row when you handle an event importing row . You would then need to read that particular row into a structure, or point to it with a field symbol, using index row-number-value, like:
an event receiver:
definition:
methods:
handle_double_click
for event double_click of cl_gui_alv_grid
importing e_row e_column.
. . .
implementation:
method handle_double_click.
read table itab into ls_itab index e_row.
. . .
handle the data
endmethod.
Then, you would need to evaluate the data values, to determine what kind of row you had. I would probably add a column that was described in the field catalog as technical and not displayed, that contained some kind of one or two character indicator that I could use to understand what was in the row,
like H1 - header row, GP, NP, CP, etc., for the row values.