<?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: need logic in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-logic/m-p/3818133#M918294</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;In READ statement you can not use the logical operators.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Better you take two internal tables one is to fill the records those having the BWTAR as blank and second one is to fill the records those are having some value for BWTAR field. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So that you can write READ statement for both of the internal tables as shown below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt; read table itab1 with key matnr = itab-matnr bwkey = itab-bwkey bwtar = ' '.&lt;/P&gt;&lt;P&gt;if sy-subrc ne 0.&lt;/P&gt;&lt;P&gt; read table itab2 with key matnr = itab-matnr bwkey = itab- bwkey.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 21 May 2008 09:03:21 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-05-21T09:03:21Z</dc:date>
    <item>
      <title>need logic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-logic/m-p/3818129#M918290</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;I have a loop containing material number, bwkey , bwtar.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And for the combination of material number and bwkey, we could find two records for different bwtar.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;one record whose bwtar would be empty and &lt;/P&gt;&lt;P&gt;other record whose bwtar will hold some value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The issue is, now while looping into the loop, am using the read stmt with the combination of material number and bwkey.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And i want to pick first the record whose bwtar holds some value.and next if i dont find bwtar which holds value, then i need to look for bwtar which is empty..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please help us with the logic:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table with combination of matnr&amp;amp;bwkey&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If material has a bwtar&lt;/P&gt;&lt;P&gt;	then i need this record&lt;/P&gt;&lt;P&gt;else &lt;/P&gt;&lt;P&gt;	 then i need to take record whose bwtar is empty.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 May 2008 08:51:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-logic/m-p/3818129#M918290</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-21T08:51:25Z</dc:date>
    </item>
    <item>
      <title>Re: need logic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-logic/m-p/3818130#M918291</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;U can loop and read twice.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table with combination of matnr&amp;amp;bwkey &amp;amp; bwtar &amp;lt;&amp;gt; space.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;use the record.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;read table with combination of matnr&amp;amp;bwkey &amp;amp; bwtar = space&lt;/P&gt;&lt;P&gt;if sy-subrc = 0&lt;/P&gt;&lt;P&gt;use the record.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 May 2008 08:55:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-logic/m-p/3818130#M918291</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-21T08:55:42Z</dc:date>
    </item>
    <item>
      <title>Re: need logic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-logic/m-p/3818131#M918292</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi naveena,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You do like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort itab by matnr bwkey bwtar decending.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at it_some.&lt;/P&gt;&lt;P&gt;read table itab with key matnr = it_some-matnr&lt;/P&gt;&lt;P&gt;                                  bwkey = it_some-bwkey.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;then do the process....&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will get all the value entries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Madan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 May 2008 08:59:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-logic/m-p/3818131#M918292</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-21T08:59:18Z</dc:date>
    </item>
    <item>
      <title>Re: need logic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-logic/m-p/3818132#M918293</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Naveena,&lt;/P&gt;&lt;P&gt;Then u have to sort ur itab accordingly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT itab ASCENDING BY matnr bwkey DESCENDING by bwtar.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP at table.&lt;/P&gt;&lt;P&gt;READ with matnr and bwkey&lt;/P&gt;&lt;P&gt;if sy-subrc is initial.&lt;/P&gt;&lt;P&gt;do ur processing&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;do ur second processing.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;Vinod.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 May 2008 09:01:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-logic/m-p/3818132#M918293</guid>
      <dc:creator>vinod_vemuru2</dc:creator>
      <dc:date>2008-05-21T09:01:07Z</dc:date>
    </item>
    <item>
      <title>Re: need logic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-logic/m-p/3818133#M918294</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;In READ statement you can not use the logical operators.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Better you take two internal tables one is to fill the records those having the BWTAR as blank and second one is to fill the records those are having some value for BWTAR field. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So that you can write READ statement for both of the internal tables as shown below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt; read table itab1 with key matnr = itab-matnr bwkey = itab-bwkey bwtar = ' '.&lt;/P&gt;&lt;P&gt;if sy-subrc ne 0.&lt;/P&gt;&lt;P&gt; read table itab2 with key matnr = itab-matnr bwkey = itab- bwkey.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 May 2008 09:03:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-logic/m-p/3818133#M918294</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-21T09:03:21Z</dc:date>
    </item>
  </channel>
</rss>

