<?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: example program for ALV list color coding? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/example-program-for-alv-list-color-coding/m-p/2435177#M544610</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Rob,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if the field EMPHASIZE is set to 'X', the ALV uses a predefined color for highlighting the cloumn. if the character field begins with 'C'(Color code), the remaining number have the following meaning..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;EMPHASIZE = 'CXYZ'&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;C : color code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;X : color number.&lt;/P&gt;&lt;P&gt;X has values 1 to 9.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Y: intensified display on / off.&lt;/P&gt;&lt;P&gt;Y has values 0 and 1, '0' = off and '1' = on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Z : inverse dispaly on / off.&lt;/P&gt;&lt;P&gt;Z has values 0 and 1, '0' = off and '1' = on.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;genaral syntax: wa_orig_fields-EMPHASIZE = 'CXYZ'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;X = 0 in this case color depends on GUI.&lt;/P&gt;&lt;P&gt;Y = 0 means case intensified is OFF.&lt;/P&gt;&lt;P&gt;Z = 0 means inverse is OFF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the color depends on the 'X' value&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OFF or COL_BACKGROUND 0 depends on GUI background&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1     or COL_HEADING          1    grey-blue        headers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2     or COL_NORMAL           2    light grey       list bodies&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3     or COL_TOTAL              3     yellow           totals&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4     or COL_KEY                 4     blue-green     key columns&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5     or COL_POSITIVE         5    green positive  threshold value&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;6     or COL_NEGATIVE       6   red negative      threshold value&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;7      or COL_GROUP           7   violet              Control levels.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for more information on color coding , see the F1 help on FORMAT statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;for sample program follow these links.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/abap/line-color-in-alv-example.htm" target="test_blank"&gt;http://www.sap-img.com/abap/line-color-in-alv-example.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=52107" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=52107&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Ashokreddy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 21 Jun 2007 14:47:13 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-06-21T14:47:13Z</dc:date>
    <item>
      <title>example program for ALV list color coding?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/example-program-for-alv-list-color-coding/m-p/2435172#M544605</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've been looking for an example program (or even a screenshot, actually) that gives an overview of the different color combinations in an ALV list (with the color code 'Cxxx' for: C, 1-9, 0-1, 0-1 )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does someone know if such a program exists?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jun 2007 14:24:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/example-program-for-alv-list-color-coding/m-p/2435172#M544605</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-21T14:24:38Z</dc:date>
    </item>
    <item>
      <title>Re: example program for ALV list color coding?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/example-program-for-alv-list-color-coding/m-p/2435173#M544606</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is the color coding.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

* Colour code :                                                 *
* Colour is a 4-char field where :                              *
*              - 1st char = C (color property)                  *
*              - 2nd char = color code (from 0 to 7)            *
*                                  0 = background color         *
*                                  1 = blue                     *
*                                  2 = gray                     *
*                                  3 = yellow                   *
*                                  4 = blue/gray                *
*                                  5 = green                    *
*                                  6 = red                      *
*                                  7 = orange                   *
*              - 3rd char = intensified (0=off, 1=on)           *
*              - 4th char = inverse display (0=off, 1=on)       *

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich HEilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jun 2007 14:27:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/example-program-for-alv-list-color-coding/m-p/2435173#M544606</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2007-06-21T14:27:27Z</dc:date>
    </item>
    <item>
      <title>Re: example program for ALV list color coding?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/example-program-for-alv-list-color-coding/m-p/2435174#M544607</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Also, check program   demo_list_format_color_1 .  This gives you examples of the combinations as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;RIch Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jun 2007 14:31:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/example-program-for-alv-list-color-coding/m-p/2435174#M544607</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2007-06-21T14:31:25Z</dc:date>
    </item>
    <item>
      <title>Re: example program for ALV list color coding?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/example-program-for-alv-list-color-coding/m-p/2435175#M544608</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;check program  &amp;lt;b&amp;gt;SHOWCOLO&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jun 2007 14:35:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/example-program-for-alv-list-color-coding/m-p/2435175#M544608</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-21T14:35:40Z</dc:date>
    </item>
    <item>
      <title>Re: example program for ALV list color coding?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/example-program-for-alv-list-color-coding/m-p/2435176#M544609</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Following example is for coloring row in alv &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
Add a field in the last as COLOR

data : begin of i_ekko.
        include structure ekko.
data : color(4) type c.
data : end of i_ekko.

in layout

gs_layout-info_fname    = 'COLOR'.

According to your condition allocate the color codes

  loop at i_ekko where &amp;lt; use your where condition&amp;gt;.
    move 'C311' to i_ekko-color.   " &amp;lt;&amp;lt; pass your color code here 
    modify i_ekko index sy-tabix.
  endloop.

then

    call method grid1-&amp;gt;set_table_for_first_display

and pass i_ekko as output table

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;aRs&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jun 2007 14:36:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/example-program-for-alv-list-color-coding/m-p/2435176#M544609</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2007-06-21T14:36:16Z</dc:date>
    </item>
    <item>
      <title>Re: example program for ALV list color coding?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/example-program-for-alv-list-color-coding/m-p/2435177#M544610</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Rob,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if the field EMPHASIZE is set to 'X', the ALV uses a predefined color for highlighting the cloumn. if the character field begins with 'C'(Color code), the remaining number have the following meaning..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;EMPHASIZE = 'CXYZ'&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;C : color code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;X : color number.&lt;/P&gt;&lt;P&gt;X has values 1 to 9.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Y: intensified display on / off.&lt;/P&gt;&lt;P&gt;Y has values 0 and 1, '0' = off and '1' = on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Z : inverse dispaly on / off.&lt;/P&gt;&lt;P&gt;Z has values 0 and 1, '0' = off and '1' = on.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;genaral syntax: wa_orig_fields-EMPHASIZE = 'CXYZ'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;X = 0 in this case color depends on GUI.&lt;/P&gt;&lt;P&gt;Y = 0 means case intensified is OFF.&lt;/P&gt;&lt;P&gt;Z = 0 means inverse is OFF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the color depends on the 'X' value&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OFF or COL_BACKGROUND 0 depends on GUI background&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1     or COL_HEADING          1    grey-blue        headers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2     or COL_NORMAL           2    light grey       list bodies&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3     or COL_TOTAL              3     yellow           totals&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4     or COL_KEY                 4     blue-green     key columns&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5     or COL_POSITIVE         5    green positive  threshold value&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;6     or COL_NEGATIVE       6   red negative      threshold value&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;7      or COL_GROUP           7   violet              Control levels.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for more information on color coding , see the F1 help on FORMAT statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;for sample program follow these links.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/abap/line-color-in-alv-example.htm" target="test_blank"&gt;http://www.sap-img.com/abap/line-color-in-alv-example.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=52107" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=52107&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Ashokreddy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jun 2007 14:47:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/example-program-for-alv-list-color-coding/m-p/2435177#M544610</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-21T14:47:13Z</dc:date>
    </item>
    <item>
      <title>Re: example program for ALV list color coding?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/example-program-for-alv-list-color-coding/m-p/2435178#M544611</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check the below program :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT zsharad_test1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES: ekko.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPE-POOLS: slis. "ALV Declarations&lt;/P&gt;&lt;P&gt;*Data Declaration&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="-----------" /&gt;&lt;P&gt;TYPES: BEGIN OF t_ekko,&lt;/P&gt;&lt;P&gt;ebeln TYPE ekpo-ebeln,&lt;/P&gt;&lt;P&gt;ebelp TYPE ekpo-ebelp,&lt;/P&gt;&lt;P&gt;statu TYPE ekpo-statu,&lt;/P&gt;&lt;P&gt;aedat TYPE ekpo-aedat,&lt;/P&gt;&lt;P&gt;matnr TYPE ekpo-matnr,&lt;/P&gt;&lt;P&gt;menge TYPE ekpo-menge,&lt;/P&gt;&lt;P&gt;meins TYPE ekpo-meins,&lt;/P&gt;&lt;P&gt;netpr TYPE ekpo-netpr,&lt;/P&gt;&lt;P&gt;peinh TYPE ekpo-peinh,&lt;/P&gt;&lt;P&gt;line_color(4) TYPE c, "Used to store row color attributes&lt;/P&gt;&lt;P&gt;END OF t_ekko.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,&lt;/P&gt;&lt;P&gt;wa_ekko TYPE t_ekko.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*ALV data declarations&lt;/P&gt;&lt;P&gt;DATA: fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;gd_tab_group TYPE slis_t_sp_group_alv,&lt;/P&gt;&lt;P&gt;gd_layout TYPE slis_layout_alv,&lt;/P&gt;&lt;P&gt;gd_repid LIKE sy-repid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;*Start-of-selection.&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PERFORM data_retrieval.&lt;/P&gt;&lt;P&gt;PERFORM build_fieldcatalog.&lt;/P&gt;&lt;P&gt;PERFORM build_layout.&lt;/P&gt;&lt;P&gt;PERFORM display_alv_report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp; Form BUILD_FIELDCATALOG&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Build Fieldcatalog for ALV Report&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM build_fieldcatalog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;There are a number of ways to create a fieldcat.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;For the purpose of this example i will build the fieldcatalog manualy&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;by populating the internal table fields individually and then&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;appending the rows. This method can be the most time consuming but can&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;also allow you more control of the final product.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Beware though, you need to ensure that all fields required are&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;populated. When using some of functionality available via ALV, such as&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;total. You may need to provide more information than if you were&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;simply displaying the result&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;I.e. Field type may be required in-order for&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;the 'TOTAL' function to work.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;fieldcatalog-fieldname = 'EBELN'.&lt;/P&gt;&lt;P&gt;fieldcatalog-seltext_m = 'Purchase Order'.&lt;/P&gt;&lt;P&gt;fieldcatalog-col_pos = 0.&lt;/P&gt;&lt;P&gt;fieldcatalog-outputlen = 10.&lt;/P&gt;&lt;P&gt;fieldcatalog-emphasize = 'X'.&lt;/P&gt;&lt;P&gt;fieldcatalog-key = 'X'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;fieldcatalog-do_sum = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;fieldcatalog-no_zero = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;APPEND fieldcatalog TO fieldcatalog.&lt;/P&gt;&lt;P&gt;CLEAR fieldcatalog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;fieldcatalog-fieldname = 'EBELP'.&lt;/P&gt;&lt;P&gt;fieldcatalog-seltext_m = 'PO Item'.&lt;/P&gt;&lt;P&gt;fieldcatalog-col_pos = 1.&lt;/P&gt;&lt;P&gt;APPEND fieldcatalog TO fieldcatalog.&lt;/P&gt;&lt;P&gt;CLEAR fieldcatalog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;fieldcatalog-fieldname = 'STATU'.&lt;/P&gt;&lt;P&gt;fieldcatalog-seltext_m = 'Status'.&lt;/P&gt;&lt;P&gt;fieldcatalog-col_pos = 2.&lt;/P&gt;&lt;P&gt;APPEND fieldcatalog TO fieldcatalog.&lt;/P&gt;&lt;P&gt;CLEAR fieldcatalog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;fieldcatalog-fieldname = 'AEDAT'.&lt;/P&gt;&lt;P&gt;fieldcatalog-seltext_m = 'Item change date'.&lt;/P&gt;&lt;P&gt;fieldcatalog-col_pos = 3.&lt;/P&gt;&lt;P&gt;APPEND fieldcatalog TO fieldcatalog.&lt;/P&gt;&lt;P&gt;CLEAR fieldcatalog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;fieldcatalog-fieldname = 'MATNR'.&lt;/P&gt;&lt;P&gt;fieldcatalog-seltext_m = 'Material Number'.&lt;/P&gt;&lt;P&gt;fieldcatalog-col_pos = 4.&lt;/P&gt;&lt;P&gt;APPEND fieldcatalog TO fieldcatalog.&lt;/P&gt;&lt;P&gt;CLEAR fieldcatalog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;fieldcatalog-fieldname = 'MENGE'.&lt;/P&gt;&lt;P&gt;fieldcatalog-seltext_m = 'PO quantity'.&lt;/P&gt;&lt;P&gt;fieldcatalog-col_pos = 5.&lt;/P&gt;&lt;P&gt;APPEND fieldcatalog TO fieldcatalog.&lt;/P&gt;&lt;P&gt;CLEAR fieldcatalog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;fieldcatalog-fieldname = 'MEINS'.&lt;/P&gt;&lt;P&gt;fieldcatalog-seltext_m = 'Order Unit'.&lt;/P&gt;&lt;P&gt;fieldcatalog-col_pos = 6.&lt;/P&gt;&lt;P&gt;APPEND fieldcatalog TO fieldcatalog.&lt;/P&gt;&lt;P&gt;CLEAR fieldcatalog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;fieldcatalog-fieldname = 'NETPR'.&lt;/P&gt;&lt;P&gt;fieldcatalog-seltext_m = 'Net Price'.&lt;/P&gt;&lt;P&gt;fieldcatalog-col_pos = 7.&lt;/P&gt;&lt;P&gt;fieldcatalog-outputlen = 15.&lt;/P&gt;&lt;P&gt;fieldcatalog-datatype = 'CURR'.&lt;/P&gt;&lt;P&gt;APPEND fieldcatalog TO fieldcatalog.&lt;/P&gt;&lt;P&gt;CLEAR fieldcatalog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;fieldcatalog-fieldname = 'PEINH'.&lt;/P&gt;&lt;P&gt;fieldcatalog-seltext_m = 'Price Unit'.&lt;/P&gt;&lt;P&gt;fieldcatalog-col_pos = 8.&lt;/P&gt;&lt;P&gt;APPEND fieldcatalog TO fieldcatalog.&lt;/P&gt;&lt;P&gt;CLEAR fieldcatalog.&lt;/P&gt;&lt;P&gt;ENDFORM. " BUILD_FIELDCATALOG&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp; Form BUILD_LAYOUT&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Build layout for ALV grid report&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM build_layout.&lt;/P&gt;&lt;P&gt;gd_layout-no_input = 'X'.&lt;/P&gt;&lt;P&gt;gd_layout-colwidth_optimize = 'X'.&lt;/P&gt;&lt;P&gt;gd_layout-totals_text = 'Totals'(201).&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Set layout field for row attributes(i.e. color)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;gd_layout-info_fieldname = 'LINE_COLOR'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;gd_layout-totals_only = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;gd_layout-f2code = 'DISP'. "Sets fcode for when double&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;"click(press f2)&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;gd_layout-zebra = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;gd_layout-group_change_edit = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;gd_layout-header_text = 'helllllo'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;ENDFORM. " BUILD_LAYOUT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp; Form DISPLAY_ALV_REPORT&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Display report using ALV grid&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM display_alv_report.&lt;/P&gt;&lt;P&gt;gd_repid = sy-repid.&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;i_callback_program = gd_repid&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;i_callback_user_command = 'USER_COMMAND'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;i_grid_title = outtext&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;is_layout = gd_layout&lt;/P&gt;&lt;P&gt;it_fieldcat = fieldcatalog[]&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;it_special_groups = gd_tabgroup&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;IT_EVENTS = GT_XEVENTS&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;i_save = 'X'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;is_variant = z_template&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;t_outtab = it_ekko&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;program_error = 1&lt;/P&gt;&lt;P&gt;OTHERS = 2.&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDFORM. " DISPLAY_ALV_REPORT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp; Form DATA_RETRIEVAL&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Retrieve data form EKPO table and populate itab it_ekko&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM data_retrieval.&lt;/P&gt;&lt;P&gt;DATA: ld_color(1) TYPE c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT ebeln ebelp statu aedat matnr menge meins netpr peinh&lt;/P&gt;&lt;P&gt;UP TO 10 ROWS&lt;/P&gt;&lt;P&gt;FROM ekpo&lt;/P&gt;&lt;P&gt;INTO TABLE it_ekko.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Populate field with color attributes&lt;/P&gt;&lt;P&gt;LOOP AT it_ekko INTO wa_ekko.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Populate color variable with colour properties&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Char 1 = C (This is a color property)&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Char 2 = 3 (Color codes: 1 - 7)&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Char 3 = Intensified on/off ( 1 or 0 )&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Char 4 = Inverse display on/off ( 1 or 0 )&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;i.e. wa_ekko-line_color = 'C410'&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;ld_color = ld_color + 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Only 7 colours so need to reset color value&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;IF ld_color = 8.&lt;/P&gt;&lt;P&gt;ld_color = 1.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;CONCATENATE 'C' ld_color '10' INTO wa_ekko-line_color.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;wa_ekko-line_color = 'C410'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;MODIFY it_ekko FROM wa_ekko.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;ENDFORM. " DATA_RETRIEVAL&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jun 2007 14:50:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/example-program-for-alv-list-color-coding/m-p/2435178#M544611</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-21T14:50:30Z</dc:date>
    </item>
    <item>
      <title>Re: example program for ALV list color coding?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/example-program-for-alv-list-color-coding/m-p/2435179#M544612</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, you're all very helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I never paid much attention to the SDN forum and contacted my colleagues for help first, but I'm getting convinced that this is the most helpful community on the web &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thumbs up to all of you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jun 2007 16:07:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/example-program-for-alv-list-color-coding/m-p/2435179#M544612</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-21T16:07:34Z</dc:date>
    </item>
  </channel>
</rss>

