<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Dynamically format colors in lists in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-format-colors-in-lists/m-p/1300966#M158399</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To color a report, you must use...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
FORMAT COLOR X.
FORMAT COLOR OFF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where 'X' is a number going from 0 to 7...If I'm not wrong -:P&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Blag.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 26 Apr 2006 13:41:27 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-04-26T13:41:27Z</dc:date>
    <item>
      <title>Dynamically format colors in lists</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-format-colors-in-lists/m-p/1300964#M158397</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would like to dynamically set a color for a single in a list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ie rather than code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If var = 'x'. write l_field color col_negative.&lt;/P&gt;&lt;P&gt;elseif var = 'y' write l_field color col_total.&lt;/P&gt;&lt;P&gt;elseif var = 'z' write l_field color col_group.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to code it as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: l_color(10) type c.&lt;/P&gt;&lt;P&gt;if l_var = 'x'.&lt;/P&gt;&lt;P&gt;move 'col_negative' to l_color.&lt;/P&gt;&lt;P&gt;elseif l_var = 'y' move 'col_total to l_color.&lt;/P&gt;&lt;P&gt;elseif l_var = 'z' move 'col_group' to l_color.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;write: l_field color l_color.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The color command does not seem to like being passed a variable, rather it has to be told explicitly what the color should be set at.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way around this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Apr 2006 13:35:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-format-colors-in-lists/m-p/1300964#M158397</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-26T13:35:55Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically format colors in lists</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-format-colors-in-lists/m-p/1300965#M158398</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No, like you say: the color command does not support passed variables.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Apr 2006 13:40:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-format-colors-in-lists/m-p/1300965#M158398</guid>
      <dc:creator>LucianoBentiveg</dc:creator>
      <dc:date>2006-04-26T13:40:58Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically format colors in lists</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-format-colors-in-lists/m-p/1300966#M158399</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To color a report, you must use...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
FORMAT COLOR X.
FORMAT COLOR OFF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where 'X' is a number going from 0 to 7...If I'm not wrong -:P&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Blag.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Apr 2006 13:41:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-format-colors-in-lists/m-p/1300966#M158399</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-26T13:41:27Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically format colors in lists</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-format-colors-in-lists/m-p/1300967#M158400</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your replies. I suspected that I could not pass a variable to the color command - you have confirmed that for me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Apr 2006 13:44:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-format-colors-in-lists/m-p/1300967#M158400</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-26T13:44:00Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically format colors in lists</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-format-colors-in-lists/m-p/1300968#M158401</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check this report...You might find it helpfull:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT Z_ATG_DUMMY.

DATA I TYPE I VALUE 0.
DATA COL(15) TYPE C.

WRITE:/9 'INTENSIFIED ON',27 'INTENSIFIED OFF',48 'INVERSE'.

SKIP 2.

WHILE I &amp;lt; 8.

  CASE I.
    WHEN 0. COL = 'COL_BACKGROUND '.
    WHEN 1. COL = 'COL_HEADING '.
    WHEN 2. COL = 'COL_NORMAL '.
    WHEN 3. COL = 'COL_TOTAL '.
    WHEN 4. COL = 'COL_KEY '.
    WHEN 5. COL = 'COL_POSITIVE '.
    WHEN 6. COL = 'COL_NEGATIVE '.
    WHEN 7. COL = 'COL_GROUP '.
  ENDCASE.

  FORMAT INTENSIFIED COLOR = I.

  WRITE: /(4) I, AT 7 SY-VLINE,
  COL, SY-VLINE,
  COL INTENSIFIED OFF, SY-VLINE,
  COL INVERSE.

  I = I + 1.

ENDWHILE.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Blag.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Apr 2006 13:57:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-format-colors-in-lists/m-p/1300968#M158401</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-26T13:57:03Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically format colors in lists</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-format-colors-in-lists/m-p/1300969#M158402</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Alvaro,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for that, but what I am trying to do is a little complicated. When a user clicks on a field in a list I want to change the color of that field depending on the field value. To achieve this I am using the command&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODIFY CURRENT LINE FIELD FORMAT itab-field&lt;/P&gt;&lt;P&gt;COLOR COL_KEY INTENSIFIED ON.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It would be much neater if I could achieve this by passing a variable to the "color" command but it seems this is not possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To make things even more complicated I have to get the fieldname which has been clicked on using "get_cursor". The "format" part of the above command will also not accept a variable so it seems this too will have to be hard coded.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Apr 2006 14:16:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-format-colors-in-lists/m-p/1300969#M158402</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-26T14:16:41Z</dc:date>
    </item>
  </channel>
</rss>

