Skip to Content
author's profile photo Former Member
Former Member

How to display a row in a different color than others in a column?

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 11, 2007 at 04:43 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 11, 2007 at 04:38 AM

    Hi ,

    You want to implement this in ALV or reports.

    If it is reports use the command FORMAT COLOR n .

    Regards

    Arun

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 11, 2007 at 04:41 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 11, 2007 at 04:42 AM

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

    eg.

    write : var color 3.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 11, 2007 at 04:44 AM

    Hi,

    Where are you trying to implement?

    Regards

    Sunil

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 11, 2007 at 04:44 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.