<?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 ALV cell dynamic zero/space in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-cell-dynamic-zero-space/m-p/3171122#M754603</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear SAP friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is an internal table:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA : BEGIN OF it_rpt_ln,
         doc_type(2),
         days_chck_base  TYPE i,
       END OF it_rpt_ln.
DATA: it_rpt     LIKE TABLE OF it_rpt_ln.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the way to tell the ALV grid  at the runtime that I want it_rpt_ln-days_chck_base   to:&lt;/P&gt;&lt;P&gt;- display value '0'  as  '0'       for row 1.&lt;/P&gt;&lt;P&gt;- display value '0' as Space  for row 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is that if I define the column for this field in the fieldcatalog as &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;lvc_s_fcat-no_zero     = 'X'&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; then the field will be always displayed as space even if the field value is zero.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to display Zero for one cell and Space for another cell on the same column depending on condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We can tell ALV how to color cells by adding a structure field into the Internal Table:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;color_cell   TYPE lvc_t_scol   " Cell color &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We can  tell ALV the style of a specific cell by adding a structure field into the Internal Table:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;cellstyles  TYPE lvc_t_styl     " Cell styles &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But what about zero/space?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please note that:&lt;/P&gt;&lt;P&gt;- field days_chck_base  has to be of TYPE i . Otherwise the Total button will not  work for this column.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you &lt;/P&gt;&lt;P&gt;Tatyana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 Dec 2007 17:28:27 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-12-11T17:28:27Z</dc:date>
    <item>
      <title>ALV cell dynamic zero/space</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-cell-dynamic-zero-space/m-p/3171122#M754603</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear SAP friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is an internal table:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA : BEGIN OF it_rpt_ln,
         doc_type(2),
         days_chck_base  TYPE i,
       END OF it_rpt_ln.
DATA: it_rpt     LIKE TABLE OF it_rpt_ln.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the way to tell the ALV grid  at the runtime that I want it_rpt_ln-days_chck_base   to:&lt;/P&gt;&lt;P&gt;- display value '0'  as  '0'       for row 1.&lt;/P&gt;&lt;P&gt;- display value '0' as Space  for row 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is that if I define the column for this field in the fieldcatalog as &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;lvc_s_fcat-no_zero     = 'X'&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; then the field will be always displayed as space even if the field value is zero.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to display Zero for one cell and Space for another cell on the same column depending on condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We can tell ALV how to color cells by adding a structure field into the Internal Table:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;color_cell   TYPE lvc_t_scol   " Cell color &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We can  tell ALV the style of a specific cell by adding a structure field into the Internal Table:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;cellstyles  TYPE lvc_t_styl     " Cell styles &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But what about zero/space?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please note that:&lt;/P&gt;&lt;P&gt;- field days_chck_base  has to be of TYPE i . Otherwise the Total button will not  work for this column.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you &lt;/P&gt;&lt;P&gt;Tatyana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Dec 2007 17:28:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-cell-dynamic-zero-space/m-p/3171122#M754603</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-11T17:28:27Z</dc:date>
    </item>
    <item>
      <title>Re: ALV cell dynamic zero/space</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-cell-dynamic-zero-space/m-p/3171123#M754604</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please take a look at the quick reference [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a415907]&lt;/P&gt;&lt;P&gt;on topic "Controlling Data Changes" you can see how to modify each cell.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Dec 2007 08:42:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-cell-dynamic-zero-space/m-p/3171123#M754604</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-17T08:42:03Z</dc:date>
    </item>
  </channel>
</rss>

