<?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: Can anyone please check the code in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/can-anyone-please-check-the-code/m-p/1147270#M116525</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&lt;/P&gt;&lt;P&gt;LOOP AT DATA_PACKAGE&lt;/P&gt;&lt;P&gt;ENDLOOP,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you are appending DATA_PACKAGE.&lt;/P&gt;&lt;P&gt;You are looping DATA_PACKAGE and appending same record to the same internal tabke.This should not be the case. At the end you will get duplicate records for which atleast one IF condition is satisfied in DATA_PACKEGE internal table. Instead APPEND IT_ZCONDTYP is more meaningful. &lt;/P&gt;&lt;P&gt;SELECT given by Max will be better as that will bring entire data in one shot. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And one more thing is before reading table IT_ZCONDTYP using BINARY SEARCH sort IT_ZCONDTYP. Else you will not get the correct result out of READ statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ramesh.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 Jan 2006 01:28:13 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-01-20T01:28:13Z</dc:date>
    <item>
      <title>Can anyone please check the code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/can-anyone-please-check-the-code/m-p/1147268#M116523</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;I am new to ABAP.Can anyone help me wih this code&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;The following code is in start routine&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;LOOP AT DATA_PACKAGE.&lt;/P&gt;&lt;P&gt;SELECT /BIC/ZPACTGY /BIC/ZMPIINIR FROM /BIC/PZCONDTYP&lt;/P&gt;&lt;P&gt;           INTO IT_ZCONDTYP&lt;/P&gt;&lt;P&gt;           WHERE /BIC/ZCONDTYP = DATA_PACKAGE-/BIC/ZCONDTYP.&lt;/P&gt;&lt;P&gt;IF ( IT_ZCONDTYP-/BIC/ZPACTGY Eq 'VVR12' OR&lt;/P&gt;&lt;P&gt;          IT_ZCONDTYP-/BIC/ZPACTGY Eq 'VVR13' or&lt;/P&gt;&lt;P&gt;          IT_ZCONDTYP-/BIC/ZPACTGY Eq 'VVR14' or&lt;/P&gt;&lt;P&gt;          IT_ZCONDTYP-/BIC/ZPACTGY Eq 'VVV10' or&lt;/P&gt;&lt;P&gt;          IT_ZCONDTYP-/BIC/ZMPIINIR Eq 'Y' or&lt;/P&gt;&lt;P&gt;          ( IT_ZCONDTYP-/Bic/zcondtyp ge 'Y100'&lt;/P&gt;&lt;P&gt;          and IT_ZCONDTYP-/Bic/zcondtyp le 'Y199' ) ).&lt;/P&gt;&lt;P&gt;     APPEND DATA_PACKAGE.&lt;/P&gt;&lt;P&gt;     ENDIF.&lt;/P&gt;&lt;P&gt;endselect.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;what I am trying to accomplish is I want my data which is in the internal table to satisfy the following conditions. and place it in internal table .(or whatever is correct)&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;IT_ZCONDTYP-/BIC/ZPACTGY Eq 'VVR12' OR&lt;/P&gt;&lt;P&gt;          IT_ZCONDTYP-/BIC/ZPACTGY Eq 'VVR13' or&lt;/P&gt;&lt;P&gt;          IT_ZCONDTYP-/BIC/ZPACTGY Eq 'VVR14' or&lt;/P&gt;&lt;P&gt;          IT_ZCONDTYP-/BIC/ZPACTGY Eq 'VVV10' or&lt;/P&gt;&lt;P&gt;          IT_ZCONDTYP-/BIC/ZMPIINIR Eq 'Y' or&lt;/P&gt;&lt;P&gt;          ( IT_ZCONDTYP-/Bic/zcondtyp ge 'Y100'&lt;/P&gt;&lt;P&gt;          and IT_ZCONDTYP-/Bic/zcondtyp le 'Y199' ) ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;and read this from another transfer routine&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;CLEAR RESULT.&lt;/P&gt;&lt;P&gt;READ TABLE IT_ZCONDTYP WITH KEY&lt;/P&gt;&lt;P&gt;/BIC/ZCONDTYP = COMM_STRUCTURE-/BIC/ZCONDTYP&lt;/P&gt;&lt;P&gt;      BINARY SEARCH.&lt;/P&gt;&lt;P&gt;IF SY-SUBRC EQ 0.&lt;/P&gt;&lt;P&gt;  RESULT = IT_ZCONDTYP-/BIC/ZCONDTYP.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;This is mostly related to BW.So if someone can give their opinion on how to achieve this I will be very grateful.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;Kal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2006 23:53:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/can-anyone-please-check-the-code/m-p/1147268#M116523</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-19T23:53:27Z</dc:date>
    </item>
    <item>
      <title>Re: Can anyone please check the code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/can-anyone-please-check-the-code/m-p/1147269#M116524</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 can't understand what you really want to do:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can try to use this code instead of your:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Check if there are some hit in the table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;IF NOT DATA_PACKAGE[] IS INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT /BIC/ZPACTGY /BIC/ZMPIINIR FROM /BIC/PZCONDTYP&lt;/P&gt;&lt;P&gt;INTO TABLE IT_ZCONDTYP&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN DATA_PACKAGE&lt;/P&gt;&lt;P&gt;WHERE /BIC/ZCONDTYP = DATA_PACKAGE-/BIC/ZCONDTYP&lt;/P&gt;&lt;P&gt;  AND ( /BIC/ZPACTGY Eq 'VVR12' OR&lt;/P&gt;&lt;P&gt;        /BIC/ZPACTGY Eq 'VVR13' or&lt;/P&gt;&lt;P&gt;        /BIC/ZPACTGY Eq 'VVR14' or&lt;/P&gt;&lt;P&gt;        /BIC/ZPACTGY Eq 'VVV10' or&lt;/P&gt;&lt;P&gt;        /BIC/ZMPIINIR Eq 'Y'    or&lt;/P&gt;&lt;P&gt;        ( /Bic/zcondtyp ge 'Y100'&lt;/P&gt;&lt;P&gt;          /Bic/zcondtyp le 'Y199' ) ).&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;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jan 2006 00:07:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/can-anyone-please-check-the-code/m-p/1147269#M116524</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-20T00:07:11Z</dc:date>
    </item>
    <item>
      <title>Re: Can anyone please check the code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/can-anyone-please-check-the-code/m-p/1147270#M116525</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&lt;/P&gt;&lt;P&gt;LOOP AT DATA_PACKAGE&lt;/P&gt;&lt;P&gt;ENDLOOP,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you are appending DATA_PACKAGE.&lt;/P&gt;&lt;P&gt;You are looping DATA_PACKAGE and appending same record to the same internal tabke.This should not be the case. At the end you will get duplicate records for which atleast one IF condition is satisfied in DATA_PACKEGE internal table. Instead APPEND IT_ZCONDTYP is more meaningful. &lt;/P&gt;&lt;P&gt;SELECT given by Max will be better as that will bring entire data in one shot. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And one more thing is before reading table IT_ZCONDTYP using BINARY SEARCH sort IT_ZCONDTYP. Else you will not get the correct result out of READ statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ramesh.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jan 2006 01:28:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/can-anyone-please-check-the-code/m-p/1147270#M116525</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-20T01:28:13Z</dc:date>
    </item>
  </channel>
</rss>

