Application Development 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: 

How to get row name and not column name ALV grid display

former_member203117
Active Participant
0 Kudos
324

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...

1 ACCEPTED SOLUTION

Harsh_Bansal
Contributor
0 Kudos
99

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

2 REPLIES 2

Harsh_Bansal
Contributor
0 Kudos
100

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

Former Member
0 Kudos
99

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.