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 Grid Control

Former Member
0 Likes
566

Hi there,

I'm making a report program that shows data in the form of object oriented ALV Grid. Since the standard Totals button is not suitable for me (because in order to calculate the average, it includes the zeroes in the columns, and I've been asked not to do that) I've added a new toolbar button which performs that function adding a new row at the end with the total values. But what I want to do now, is to make that row to display in yellow and the numbers in bold letter (just like the way the standard does it). And if it's possible, I'd like to the column separators not to show.

I've being trying to use the layout feature. I added a column to the table shown by the ALV Control, named 'COLOR', and then I created the Layout table adding a row with the value 'COLOR' in the 'INFO_FNAME' field, but I've had no results.

Any ideas?

3 REPLIES 3
Read only

Former Member
0 Likes
542

Hi,

STEP 1:

LVC_S_LAYO-INFONAME = 'COLOR'.

STEP 2:

Set color values :

Ex:

ITAB-COLOR = 'C311'.

You can pass different color values in LOOP According to condition

STEP3:

CALL METHOD o_grid->set_table_for_first_display

is_layout = LVC_S_LAYO

[Alv Color|https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/coloring%252ba%252brow%252band%252bcolumn%252bin%252balv%252b(OOPS)]

Regards,

Gurpreet

Read only

Former Member
0 Likes
542

Hi,

you can set colors of columns but you cannot merge columns, so this is impossible to create one row at the end which will be displayed as a standard total line.

Marcin

Read only

uwe_schieferstein
Active Contributor
0 Likes
542

Hello Jose

Regarding colouring you may have a look at my sample report ZUS_SDN_ALV_CELL_STYLE_2 in thread

Regards Uwe