<?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: Regarding ALV in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-alv/m-p/1599299#M269088</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;BTW, the color coding works like this.&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)       *
*                                                               *
* Colour overwriting priority :                                 *
*   1. Line                                                     *
*   2. Cell                                                     *
*   3. Column                                                   *

&lt;/CODE&gt;&lt;/PRE&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, 05 Oct 2006 13:32:16 GMT</pubDate>
    <dc:creator>RichHeilman</dc:creator>
    <dc:date>2006-10-05T13:32:16Z</dc:date>
    <item>
      <title>Regarding ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-alv/m-p/1599296#M269085</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ALL,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to create row color in ALV list display.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to make 1st row as red and remaining rows as green.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Divakar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Oct 2006 13:26:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-alv/m-p/1599296#M269085</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-05T13:26:19Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-alv/m-p/1599297#M269086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi divakar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;chk this link.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_color.htm" target="test_blank"&gt;http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_color.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rgds&lt;/P&gt;&lt;P&gt;anver&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if hlped mark points&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Oct 2006 13:30:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-alv/m-p/1599297#M269086</guid>
      <dc:creator>anversha_s</dc:creator>
      <dc:date>2006-10-05T13:30:27Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-alv/m-p/1599298#M269087</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hopefully you are using the FM and this example will show you how to color the line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

report zrich_0004
       no standard page heading.

type-pools slis.

data: fieldcat type slis_t_fieldcat_alv.

data: begin of imara occurs 0,
      matnr type mara-matnr,
      mtart type mara-mtart,
      maktx type makt-maktx,
      color_line(4) type c,
      tcolor type slis_t_specialcol_alv,  "cell
      end of imara.

data: xcolor type slis_specialcol_alv.

start-of-selection.

  perform get_data.
  perform write_report.


************************************************************************
*  Get_Data
************************************************************************
form get_data.

  imara-matnr = 'ABC'.
  imara-mtart = 'ZCFG'.
  imara-maktx = 'This is description for ABC'.
  append imara.

  imara-matnr = 'DEF'.
  imara-mtart = 'ZCFG'.
  imara-maktx = 'This is description for DEF'.
  append imara.

  imara-matnr = 'GHI'.
  imara-mtart = 'ZCFG'.
  imara-maktx = 'This is description for GHI'.
  append imara.

  loop at imara.

    if sy-tabix = 1.
      imara-color_line = 'C410'.   " color line
    endif.

    if sy-tabix = 2.          "color CELL
      clear xcolor.
      xcolor-fieldname = 'MTART'.
      xcolor-color-col = '3'.
      xcolor-color-int = '1'. "Intensified on/off
      xcolor-color-inv = '0'.

      append xcolor to imara-tcolor.

    endif.

    modify imara.

  endloop.

endform.

************************************************************************
*  WRITE_REPORT
************************************************************************
form write_report.

  data: layout type  slis_layout_alv.

  layout-coltab_fieldname = 'TCOLOR'.
  layout-info_fieldname = 'COLOR_LINE'.

  perform build_field_catalog.

* CALL ABAP LIST VIEWER (ALV)
  call function 'REUSE_ALV_GRID_DISPLAY'
       exporting
            is_layout   = layout
            it_fieldcat = fieldcat
       tables
            t_outtab    = imara.

endform.

************************************************************************
* BUILD_FIELD_CATALOG
************************************************************************
form build_field_catalog.

  data: fc_tmp type slis_t_fieldcat_alv with header line.
  clear: fieldcat. refresh: fieldcat.

  clear: fc_tmp.
  fc_tmp-reptext_ddic    = 'Material Number'.
  fc_tmp-fieldname  = 'MATNR'.
  fc_tmp-tabname   = 'IMARA'.
  fc_tmp-outputlen  = '18'.
  append fc_tmp to fieldcat.

  clear: fc_tmp.
  fc_tmp-reptext_ddic    = 'Material Type'.
  fc_tmp-fieldname  = 'MTART'.
  fc_tmp-tabname   = 'IMARA'.
  fc_tmp-outputlen  = '4'.
  append fc_tmp to fieldcat.

  clear: fc_tmp.
  fc_tmp-reptext_ddic    = 'Material'.
  fc_tmp-fieldname  = 'MAKTX'.
  fc_tmp-tabname   = 'IMARA'.
  fc_tmp-outputlen  = '40'.
  fc_tmp-emphasize = 'C610'.   " color column
  append fc_tmp to fieldcat.

endform.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have an example for the class based also if you need it.&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, 05 Oct 2006 13:31:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-alv/m-p/1599298#M269087</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-10-05T13:31:30Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-alv/m-p/1599299#M269088</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;BTW, the color coding works like this.&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)       *
*                                                               *
* Colour overwriting priority :                                 *
*   1. Line                                                     *
*   2. Cell                                                     *
*   3. Column                                                   *

&lt;/CODE&gt;&lt;/PRE&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, 05 Oct 2006 13:32:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-alv/m-p/1599299#M269088</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-10-05T13:32:16Z</dc:date>
    </item>
  </channel>
</rss>

