<?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: Internal Table Manipulation in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-manipulation/m-p/996368#M75373</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Pradhiba ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;why did you reward me?&lt;/P&gt;&lt;P&gt;-i've nothing written&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&amp;gt;but now , i think , i've a solution:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT zforum46 .

DATA: BEGIN OF itab ,
f1, f2, f3, f4, f5,
END OF itab.
DATA pos_1 TYPE sy-fdpos.

itab = '01100'.

SEARCH itab FOR '10'."
MOVE sy-fdpos TO pos_1.
ADD 1 TO pos_1.

MOVE '1' TO itab+pos_1(1).
WRITE: / itab.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best regards Andreas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 17 Aug 2005 09:41:28 GMT</pubDate>
    <dc:creator>andreas_mann3</dc:creator>
    <dc:date>2005-08-17T09:41:28Z</dc:date>
    <item>
      <title>Internal Table Manipulation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-manipulation/m-p/996363#M75368</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have an internal tables with 5 fields each of type Char - L1 L2 L3 L4 L5.&lt;/P&gt;&lt;P&gt;I have to make the first occurance of 0 after a non zero value as 1. &lt;/P&gt;&lt;P&gt;Example: if i have the values as 1 0 0 0 0, it s'd be made 1 1 0 0 0. &lt;/P&gt;&lt;P&gt;If 1 1 0 0 0 it s'd be made 1 1 1 0 0. &lt;/P&gt;&lt;P&gt;If 0 1 0 0 0 then it should be made 0 1 1 0 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If i try this using nested IF statements the code becomes more complex.. Is there any other way out.. like using string operations??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, &lt;/P&gt;&lt;P&gt;Pradhiba&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2005 04:51:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-manipulation/m-p/996363#M75368</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-17T04:51:48Z</dc:date>
    </item>
    <item>
      <title>Re: Internal Table Manipulation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-manipulation/m-p/996364#M75369</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;did u tried CP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can you pls post your code here&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2005 04:59:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-manipulation/m-p/996364#M75369</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-17T04:59:02Z</dc:date>
    </item>
    <item>
      <title>Re: Internal Table Manipulation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-manipulation/m-p/996365#M75370</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;The following code will do:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;field-symbols: &lt;/P&gt;&lt;P&gt;  &amp;lt;field1&amp;gt;,&lt;/P&gt;&lt;P&gt;  &amp;lt;field2&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at inttab&lt;/P&gt;&lt;P&gt;    into line_of_inttab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do 4 times.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;   assign component syst-index of structure line_of_inttab&lt;/P&gt;&lt;P&gt;       to  &amp;lt;field1&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   zzl_next_index = syst-index + 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   assign component zzl_next_index of structure line_of_inttab&lt;/P&gt;&lt;P&gt;       to  &amp;lt;field2&amp;gt;.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  if &amp;lt;field1&amp;gt; NE '0' and&lt;/P&gt;&lt;P&gt;     &amp;lt;field2&amp;gt; EQ '0'.&lt;/P&gt;&lt;P&gt;    &amp;lt;field2&amp;gt; = '1'.&lt;/P&gt;&lt;P&gt;    exit.&lt;/P&gt;&lt;P&gt;   endif.&lt;/P&gt;&lt;P&gt;enddo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   modify inttab&lt;/P&gt;&lt;P&gt;         from line_of_inttab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&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;John.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2005 06:42:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-manipulation/m-p/996365#M75370</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-17T06:42:22Z</dc:date>
    </item>
    <item>
      <title>Re: Internal Table Manipulation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-manipulation/m-p/996366#M75371</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Pradhiba,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You try the following code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: BEGIN OF tbl_table1 OCCURS 0,
        f1 TYPE n,
        f2 TYPE n,
        f3 TYPE n,
        f4 TYPE n,
        f5 TYPE n,
      END OF tbl_table1.

DATA: g_index LIKE sy-tabix,
      g_found TYPE c.

FIELD-SYMBOLS: &amp;lt;fs&amp;gt; TYPE n.

START-OF-SELECTION.

  CLEAR tbl_table1.
  tbl_table1-f2 = 1.
  APPEND tbl_table1.

  LOOP AT tbl_table1.
    CLEAR: g_index,
           g_found.

    DO.
      ADD 1 TO g_index.
      ASSIGN COMPONENT g_index OF STRUCTURE tbl_table1 TO &amp;lt;fs&amp;gt;.
      IF sy-subrc NE 0.
        EXIT.
      ENDIF.

* Was there a 1 in the previous field?
      IF g_found = 'X'.

* Yes! Previous field was a 1, now make current field a 1 clear the
* G_FOUND flag and CONTINUE to next field
        &amp;lt;fs&amp;gt; = 1.
        CLEAR g_found.
        CONTINUE.
      ENDIF.

* Current field is a 1, mark the G_FOUND flag!
      IF &amp;lt;fs&amp;gt; = 1.
        g_found = 'X'.
      ENDIF.
    ENDDO.

    MODIFY tbl_table1.
  ENDLOOP.

END-OF-SELECTION.

  LOOP AT tbl_table1.
    WRITE:/ tbl_table1-f1, tbl_table1-f2, tbl_table1-f3, tbl_table1-f4,
            tbl_table1-f5.
  ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2005 07:05:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-manipulation/m-p/996366#M75371</guid>
      <dc:creator>former_member221770</dc:creator>
      <dc:date>2005-08-17T07:05:14Z</dc:date>
    </item>
    <item>
      <title>Re: Internal Table Manipulation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-manipulation/m-p/996367#M75372</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2005 07:29:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-manipulation/m-p/996367#M75372</guid>
      <dc:creator>andreas_mann3</dc:creator>
      <dc:date>2005-08-17T07:29:19Z</dc:date>
    </item>
    <item>
      <title>Re: Internal Table Manipulation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-manipulation/m-p/996368#M75373</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Pradhiba ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;why did you reward me?&lt;/P&gt;&lt;P&gt;-i've nothing written&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&amp;gt;but now , i think , i've a solution:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT zforum46 .

DATA: BEGIN OF itab ,
f1, f2, f3, f4, f5,
END OF itab.
DATA pos_1 TYPE sy-fdpos.

itab = '01100'.

SEARCH itab FOR '10'."
MOVE sy-fdpos TO pos_1.
ADD 1 TO pos_1.

MOVE '1' TO itab+pos_1(1).
WRITE: / itab.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best regards Andreas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2005 09:41:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-manipulation/m-p/996368#M75373</guid>
      <dc:creator>andreas_mann3</dc:creator>
      <dc:date>2005-08-17T09:41:28Z</dc:date>
    </item>
  </channel>
</rss>

