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 display a row in a different color than others in a column?

Former Member
0 Kudos

Hi ,

Suppose I have this format

0

0

1

0

2

0

0

then, how can I display 1&2 in different color than 0's? please help....

1 ACCEPTED SOLUTION

Former Member
0 Kudos

if it is a simple report then

loop at itab.

if itab-value = 0.

format color 3.

write : itab-value.

format color off.

else.

format color 5.

write : itab-value.

format color off.

endif.

endloop.

regards

shiba dutta

6 REPLIES 6

Former Member
0 Kudos

Hi ,

You want to implement this in ALV or reports.

If it is reports use the command FORMAT COLOR n .

Regards

Arun

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

Check using if condition,whether the value is zero.If so,display it with one color.Otherwise,use someother color.

Check this link.

http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/format.htm

Former Member
0 Kudos

in write statement itself u can specify the color u wants to have to that output.

eg.

write : var color 3.

Former Member
0 Kudos

if it is a simple report then

loop at itab.

if itab-value = 0.

format color 3.

write : itab-value.

format color off.

else.

format color 5.

write : itab-value.

format color off.

endif.

endloop.

regards

shiba dutta

Former Member
0 Kudos

Hi,

Where are you trying to implement?

Regards

Sunil

santhosh_patil
Contributor
0 Kudos

Hi,

If it is ALV display u can do this ....

Check the option in the layout

<b> info_fieldname</b>

value set: SPACE, internal output table field name

whole list record can be colored individually using a color code

in a column of the internal output table for the record. Assign the

name of the field containing the color code to this parameter.

The internal output table field must be of type CHAR(3).

The code must have the following syntax: 'Cxy':

Note: the color of the key columns is not affected.

In ALV list output each row can be colored by using the field INFO_FIELDNAME in the fieldcatlog . To do this in the output internal table (which is passed to the ALV display ) one must maintain extra field like ‘rowcol’.

To color a row , rowcol field must contain the value like 'Cxy':

C = color (all codes must start with 'C')

x = color number ('1'-'9')

y = bold ('0' = off, '1' = on).

After this the field INFO_FIELDNAME must be assigned with the name of the filed which contains the color code. ( info_fieldname = ‘ROWCOL’ ).

-


santhosh