<?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: Modifying internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-internal-table/m-p/3137556#M745633</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Self&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 Dec 2010 03:53:08 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-12-09T03:53:08Z</dc:date>
    <item>
      <title>Modifying internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-internal-table/m-p/3137554#M745631</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; I facing problem to display alv report as per the requirement given below. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am having 54 columns( I mean fields) cocerning to quantity.  &lt;/P&gt;&lt;P&gt;  1. And  whenever if   any column  does'nt contains at least one record( I mean record i.e., quantiy = 0) ,then we need to replace all 0 quantities with spaces .&lt;/P&gt;&lt;P&gt;2. But whenever the left side and right side columns of the middle one contains at least one record and middle one does not contains  all zeros( I mean no single record exist), then we should not replace all zeros with replaces,these remains same.&lt;/P&gt;&lt;P&gt;Ex:  Let us assume that F1, F2, F3, F4, F5, F6, F7, F8, F9, F10 are the columns for the quantity fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If  F2 contains all zero's but F1 and F3 contains at least single record each, then we should not replace all zero's with  spaces. So, we need to look up the adjustent columns values also.&lt;/P&gt;&lt;P&gt;All the Coulumns values depends on the each other.I got a bit confustion please let me if solution for this with piece of code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;raju&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Dec 2007 06:09:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-internal-table/m-p/3137554#M745631</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-08T06:09:51Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-internal-table/m-p/3137555#M745632</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Prakash&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The solution to your problem is a simple additional structural variable where you store the evaluation results of your data itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;(1) Evaluate your data itab.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TYPES: BEGIN OF ty_s_flag.
TYPES: flag1    TYPE abap_bool.
TYPES: flag2    TYPE abap_bool.
...
TYPES: flag54  TYPE abap_bool.
TYPES: END OF ty_s_flag.

DATA:
  ld_idx2   TYPE i,
  ld_idx3   TYPE i,
  ls_flag    TYPE ty_s_flag.

FIELD-SYMBOLS:
  &amp;lt;ld_fld&amp;gt;   TYPE any,
  &amp;lt;ld_flag&amp;gt; TYPE any,
  &amp;lt;ld_flag1&amp;gt; TYPE any,
  &amp;lt;ld_flag2&amp;gt; TYPE any,
  &amp;lt;ld_flag3&amp;gt; TYPE any.

LOOP AT lt_data INTO ls_data.

   DO.
     ASSIGN COMPONENT syst-index OF STRUCTURE ls_data TO &amp;lt;ld_fld&amp;gt;.
     IF ( syst-subrc NE 0 ).
       EXIT.
     ENDIF.

     ASSIGN COMPONENT syst-index OF STRUCTURE ls_flag TO &amp;lt;ld_flag&amp;gt;.  

     IF ( &amp;lt;ld_fld&amp;gt; &amp;gt; 0 ).  " quantity &amp;gt; 0
        &amp;lt;ld_flag&amp;gt; = 'X'.    " column sy-index contains quantity &amp;gt; 0
     ENDIF.      

   ENDDO.

ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;(2) Evaluate the flags.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DO 52 TIMES.  " 52 = 54 - 2
  ld_idx2 = syst-index + 1.
  ld_idx3 = syst-index + 2.

   ASSIGN COMPONENT syst-index OF STRUCTURE ls_flag TO &amp;lt;ld_flag1&amp;gt;.  
   ASSIGN COMPONENT ld_idx2     OF STRUCTURE ls_flag TO &amp;lt;ld_flag2&amp;gt;.
   ASSIGN COMPONENT ld_idx3     OF STRUCTURE ls_flag TO &amp;lt;ld_flag3&amp;gt;.

   IF ( &amp;lt;ld_flag1&amp;gt; = ' '    AND
         &amp;lt;ld_flag2   = ' '   AND
         &amp;lt;ld_flag3&amp;gt; = ' ' ).
"    middle column &amp;amp; left and right column do not contain any value &amp;gt; 0, then
"    replace 0 value in middle column with SPACE

     LOOP AT lt_data INTO ls_data.
       ASSIGN COMPONENT ld_idx2 OF STRUCTURE ls_data TO &amp;lt;ld_fld&amp;gt;.
       &amp;lt;ld_fld&amp;gt; = space.
     ENDLOOP.     
   ENDIF.&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;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Dec 2007 21:30:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-internal-table/m-p/3137555#M745632</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2007-12-08T21:30:52Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-internal-table/m-p/3137556#M745633</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Self&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Dec 2010 03:53:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-internal-table/m-p/3137556#M745633</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-12-09T03:53:08Z</dc:date>
    </item>
  </channel>
</rss>

