<?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: Read table and if statements in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-and-if-statements/m-p/9692238#M1768263</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;LOOP AT table1 INTO struc1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; IF struc1-existing = 'False' OR&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; struc1-existing IS INITIAL.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; READ TABLE table2 INTO struc2 WITH KEY article = struc1-article.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; struc1-existing = struc2-existing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ENDIF.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ENDIF.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above piece of code should do the trick.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 04 Sep 2013 11:44:35 GMT</pubDate>
    <dc:creator>kakshat</dc:creator>
    <dc:date>2013-09-04T11:44:35Z</dc:date>
    <item>
      <title>Read table and if statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-and-if-statements/m-p/9692237#M1768262</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have 2 DSO containing information about some articles as following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table 1&lt;/P&gt;&lt;TABLE border="1" cellpadding="0" cellspacing="0" style="border: none;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="border: solid windowtext 1.0pt; background: #95B3D7; padding: 0 5.4pt 0 5.4pt;" valign="top" width="307"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;&lt;STRONG&gt;Article&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border: solid windowtext 1.0pt; border-left: none; background: #95B3D7; padding: 0 5.4pt 0 5.4pt;" valign="top" width="307"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;&lt;STRONG&gt;Exisiting&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border: solid windowtext 1.0pt; border-top: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="307"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;AAA&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="307"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;True&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border: solid windowtext 1.0pt; border-top: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="307"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;BBB&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="307"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;False&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border: solid windowtext 1.0pt; border-top: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="307"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;CCC&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="307"&gt;&lt;P align="center"&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P align="center"&gt;&lt;/P&gt;&lt;P&gt;Table 2&lt;/P&gt;&lt;TABLE border="1" cellpadding="0" cellspacing="0" style="border: none;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="border: solid windowtext 1.0pt; background: #E5B8B7; padding: 0 5.4pt 0 5.4pt;" valign="top" width="307"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;&lt;STRONG&gt;Article&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border: solid windowtext 1.0pt; border-left: none; background: #E5B8B7; padding: 0 5.4pt 0 5.4pt;" valign="top" width="307"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;&lt;STRONG&gt;Exisiting&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border: solid windowtext 1.0pt; border-top: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="307"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;AAA&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="307"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;True&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border: solid windowtext 1.0pt; border-top: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="307"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;BBB&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="307"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;True&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border: solid windowtext 1.0pt; border-top: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="307"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;CCC&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="307"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;False&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In table 1 I have to consolidate information upcoming from the 2 tables and compare the field existing with the following conditions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For each article:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If one of the values in field existing for an article is initial, then take the value not initial (e.g Article AAA)&lt;/P&gt;&lt;P&gt;If the values contained for the same article are different in the 2 tables then take the value true (e.g Article BBB)&lt;/P&gt;&lt;P&gt;At the end my table 1 will be as this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="0" cellspacing="0" style="border: none;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="border: solid windowtext 1.0pt; background: #92D050; padding: 0 5.4pt 0 5.4pt;" valign="top" width="307"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;&lt;STRONG&gt;Article&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border: solid windowtext 1.0pt; border-left: none; background: #92D050; padding: 0 5.4pt 0 5.4pt;" valign="top" width="307"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;&lt;STRONG&gt;Exisiting&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border: solid windowtext 1.0pt; border-top: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="307"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;AAA&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="307"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;True&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border: solid windowtext 1.0pt; border-top: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="307"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;BBB&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="307"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;True&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border: solid windowtext 1.0pt; border-top: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="307"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;CCC&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="307"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;False&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess that I have to use a read table with key article statement, but I have issues with abap syntax.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your support.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Amine&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Sep 2013 11:06:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-and-if-statements/m-p/9692237#M1768262</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-09-04T11:06:05Z</dc:date>
    </item>
    <item>
      <title>Re: Read table and if statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-and-if-statements/m-p/9692238#M1768263</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;LOOP AT table1 INTO struc1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; IF struc1-existing = 'False' OR&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; struc1-existing IS INITIAL.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; READ TABLE table2 INTO struc2 WITH KEY article = struc1-article.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; struc1-existing = struc2-existing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ENDIF.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ENDIF.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above piece of code should do the trick.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Sep 2013 11:44:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-and-if-statements/m-p/9692238#M1768263</guid>
      <dc:creator>kakshat</dc:creator>
      <dc:date>2013-09-04T11:44:35Z</dc:date>
    </item>
    <item>
      <title>Re: Read table and if statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-and-if-statements/m-p/9692239#M1768264</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Amine,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;buy a good Abap book, it's always very easy what you are asking. You will win time !&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;Fred&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Sep 2013 12:13:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-and-if-statements/m-p/9692239#M1768264</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2013-09-04T12:13:09Z</dc:date>
    </item>
    <item>
      <title>Re: Read table and if statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-and-if-statements/m-p/9692240#M1768265</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Kumar.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Amine&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Sep 2013 12:15:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-and-if-statements/m-p/9692240#M1768265</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-09-04T12:15:58Z</dc:date>
    </item>
    <item>
      <title>Re: Read table and if statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-and-if-statements/m-p/9692241#M1768266</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Frederic,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I learned too many intersting things in this forum &lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_macro jive_emote" src="https://community.sap.com/1735/images/emoticons/happy.gif"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Amine&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Sep 2013 12:17:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-and-if-statements/m-p/9692241#M1768266</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-09-04T12:17:47Z</dc:date>
    </item>
    <item>
      <title>Re: Read table and if statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-and-if-statements/m-p/9692242#M1768267</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kumar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will just add a sort statement by Article before the read table statement to have an efficient code.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Thanks.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Amine&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Sep 2013 12:30:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-and-if-statements/m-p/9692242#M1768267</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-09-04T12:30:02Z</dc:date>
    </item>
    <item>
      <title>Re: Read table and if statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-and-if-statements/m-p/9692243#M1768268</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Amine,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Please try this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;LOOP &lt;SPAN class="L0S52"&gt;AT &lt;/SPAN&gt;table1 &lt;SPAN class="L0S52"&gt;INTO &lt;/SPAN&gt;wa_table1 &lt;SPAN class="L0S52"&gt;WHERE &lt;/SPAN&gt;existing &amp;lt;&amp;gt; ‘true’&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &lt;SPAN class="L0S52"&gt;READ &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;TABLE &lt;/SPAN&gt;table2 &lt;SPAN class="L0S52"&gt;INTO &lt;/SPAN&gt;wa_table2 &lt;SPAN class="L0S52"&gt;WITH &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;KEY &lt;/SPAN&gt;artical &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;wa_table1&lt;SPAN class="L0S70"&gt;-&lt;/SPAN&gt;artical&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &lt;SPAN class="L0S52"&gt;CHECK &lt;/SPAN&gt;sy&lt;SPAN class="L0S70"&gt;-&lt;/SPAN&gt;subrc &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;&lt;SPAN class="L0S32"&gt;0&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &lt;SPAN class="L0S52"&gt;AND&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;wa_table2&lt;SPAN class="L0S70"&gt;-&lt;/SPAN&gt;existing &lt;SPAN class="L0S52"&gt;IS &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;NOT &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;INITIAL&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; wa_table1&lt;SPAN class="L0S70"&gt;-&lt;/SPAN&gt;existing &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;wa_table2&lt;SPAN class="L0S70"&gt;-&lt;/SPAN&gt;existing&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &lt;SPAN class="L0S52"&gt;MODIFY &lt;/SPAN&gt;table1 &lt;SPAN class="L0S52"&gt;FROM &lt;/SPAN&gt;wa_table1&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN class="L0S52"&gt;ENDLOOP&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards &lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_macro jive_emote" src="https://community.sap.com/1735/images/emoticons/happy.gif"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Sep 2013 12:30:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-and-if-statements/m-p/9692243#M1768268</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-09-04T12:30:28Z</dc:date>
    </item>
    <item>
      <title>Re: Read table and if statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-and-if-statements/m-p/9692244#M1768269</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if you made a sort&amp;nbsp; add a BINARY SEARCH option (for big table)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fred&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Sep 2013 12:31:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-and-if-statements/m-p/9692244#M1768269</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2013-09-04T12:31:42Z</dc:date>
    </item>
    <item>
      <title>Re: Read table and if statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-and-if-statements/m-p/9692245#M1768270</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;I guess the following code will be more generic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort b by x.&lt;/P&gt;&lt;P&gt;loop at a into wa.&lt;/P&gt;&lt;P&gt;read table b into wb where x = wa-x binary search.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&amp;nbsp; wc-x = wb-x.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if wb-y = wa-y.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; wc-y = wb-y.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; elseif wb-y NE wa-y.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; wc-y = 'TRUE'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; elseif NOT wb-y IS INITIAL and wa-y IS INITIAL.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; wc-y =&amp;nbsp;&amp;nbsp; wb-y.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; elseif NOT wa-y IS INITIAL and wb-y IS INITIAL.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; wc-y =&amp;nbsp;&amp;nbsp; wa-y.&lt;/P&gt;&lt;P&gt;&amp;nbsp; endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND wc To C.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Sep 2013 16:22:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-and-if-statements/m-p/9692245#M1768270</guid>
      <dc:creator>mayur_priyan</dc:creator>
      <dc:date>2013-09-30T16:22:51Z</dc:date>
    </item>
    <item>
      <title>Re: Read table and if statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-and-if-statements/m-p/9692246#M1768271</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Amine,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since you are reading the table with a key, you would better create a hashed table with a unique key and then read&amp;nbsp; with table key.&amp;nbsp; The larger the table gets, the higher the performance gain for a hashed table.&amp;nbsp; The rule I use is quite simple :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Hashed table : If I have a unique key and need a single record&lt;/LI&gt;&lt;LI&gt;Sorted table : if I do a nested loop, if I don't have a unique key or if you need to perform a for all entries with the table (then also preferably a sorted table with unique key).&lt;/LI&gt;&lt;LI&gt;Standard table : if I don't need to read the table or loop over it with a where-clause, if the table is really small&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't use binary search.&amp;nbsp; A sorted table works the same and if you forget to sort the table before you use binary search, your result might be wrong.&amp;nbsp; In case you need differents sorts on one table, use secondary indexex.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Freek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Sep 2013 19:02:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-and-if-statements/m-p/9692246#M1768271</guid>
      <dc:creator>freek_cavens2</dc:creator>
      <dc:date>2013-09-30T19:02:50Z</dc:date>
    </item>
    <item>
      <title>Re: Read table and if statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-and-if-statements/m-p/9692247#M1768272</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;Select article&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; existing&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from table1 into t_table1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select article&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; existing&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from table2 into t_table2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for all entries in t_table1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where article = t_table1-article.&lt;/P&gt;&lt;P&gt;loop at t_table1.&lt;/P&gt;&lt;P&gt;&amp;nbsp; here you can use the read statement and check whether the value initial and both exisisting values&lt;/P&gt;&lt;P&gt;are different and set accordingly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Oct 2013 04:06:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-and-if-statements/m-p/9692247#M1768272</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-10-01T04:06:56Z</dc:date>
    </item>
  </channel>
</rss>

