<?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: LOOP in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop/m-p/3233302#M771328</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi vijay,&lt;/P&gt;&lt;P&gt;           First u will declare an internal table.In that internal table we have place both the table fileds i.e so23,so26 fileds.&lt;/P&gt;&lt;P&gt;After that we have to inner join and then loop the data.I will send some sample data check it once ok..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of itab occurs 0,&lt;/P&gt;&lt;P&gt;        &lt;/P&gt;&lt;P&gt;            so23 fileds,so23 fileds&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;          end of itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;parameters: p_werks like werks,&lt;/P&gt;&lt;P&gt;                  p_sptag like sptab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select  *&lt;/P&gt;&lt;P&gt;     from sp03 as a &lt;/P&gt;&lt;P&gt;    inner join sp06 as b&lt;/P&gt;&lt;P&gt;   on a&lt;SUB&gt;werks = b&lt;/SUB&gt;werks&lt;/P&gt;&lt;P&gt;   into corresponding fileds of table itab&lt;/P&gt;&lt;P&gt;  where  werks eq p_werks&lt;/P&gt;&lt;P&gt;   and  sptag eq p_aptag.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WE HAVE TO USE THE "ON" CONDITIONS LIKE THIS THERE MUST BE A COMMON FILED FOR BOTH TABLES THE COMMON FILED WE MENTION THERE OK..&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;   code&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Award points if helpful.&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;  Kiran Kumar.G&lt;/P&gt;&lt;P&gt;                &lt;EM&gt;Have a Nice Day..&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 04 Jan 2008 11:38:32 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-01-04T11:38:32Z</dc:date>
    <item>
      <title>LOOP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop/m-p/3233300#M771326</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;In the below code you can see am using two LOOP AT statements.So its taking a long time to execute how can i use only one loop condition and get my desired output.Please help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vijay&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM s023 INTO&lt;/P&gt;&lt;P&gt;CORRESPONDING FIELDS OF TABLE IT_s023 WHERE&lt;/P&gt;&lt;P&gt;WERKS = P_WERKS AND&lt;/P&gt;&lt;P&gt;SPTAG IN P_SPTAG .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM S026 INTO CORRESPONDING FIELDS OF TABLE&lt;/P&gt;&lt;P&gt;IT_S026 WHERE WERKS = P_WERKS AND&lt;/P&gt;&lt;P&gt;SPTAG IN p_sptag .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT IT_S026.&lt;/P&gt;&lt;P&gt;IT_REPORT-ENMNG = IT_S026-ENMNG .&lt;/P&gt;&lt;P&gt;IT_REPORT-SPTAG = IT_S026-SPTAG .&lt;/P&gt;&lt;P&gt;IT_REPORT-MATNR = IT_S026-MATNR .&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;LOOP AT IT_S023.&lt;/P&gt;&lt;P&gt;ADD IT_s023-WEMNG TO Z.&lt;/P&gt;&lt;P&gt;IT_REPORT-WEMNG = IT_S023-WEMNG.&lt;/P&gt;&lt;P&gt;APPEND IT_REPORT.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Jan 2008 11:09:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop/m-p/3233300#M771326</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-04T11:09:27Z</dc:date>
    </item>
    <item>
      <title>Re: LOOP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop/m-p/3233301#M771327</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vijay&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess inside the loop for s026 , you can read the table it_s023 with the primary keys.The only component i can see missing in the key would be DISPO ...i dont know how much this would afftect the read.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards&lt;/P&gt;&lt;P&gt;Shivika&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Jan 2008 11:19:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop/m-p/3233301#M771327</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-04T11:19:42Z</dc:date>
    </item>
    <item>
      <title>Re: LOOP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop/m-p/3233302#M771328</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi vijay,&lt;/P&gt;&lt;P&gt;           First u will declare an internal table.In that internal table we have place both the table fileds i.e so23,so26 fileds.&lt;/P&gt;&lt;P&gt;After that we have to inner join and then loop the data.I will send some sample data check it once ok..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of itab occurs 0,&lt;/P&gt;&lt;P&gt;        &lt;/P&gt;&lt;P&gt;            so23 fileds,so23 fileds&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;          end of itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;parameters: p_werks like werks,&lt;/P&gt;&lt;P&gt;                  p_sptag like sptab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select  *&lt;/P&gt;&lt;P&gt;     from sp03 as a &lt;/P&gt;&lt;P&gt;    inner join sp06 as b&lt;/P&gt;&lt;P&gt;   on a&lt;SUB&gt;werks = b&lt;/SUB&gt;werks&lt;/P&gt;&lt;P&gt;   into corresponding fileds of table itab&lt;/P&gt;&lt;P&gt;  where  werks eq p_werks&lt;/P&gt;&lt;P&gt;   and  sptag eq p_aptag.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WE HAVE TO USE THE "ON" CONDITIONS LIKE THIS THERE MUST BE A COMMON FILED FOR BOTH TABLES THE COMMON FILED WE MENTION THERE OK..&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;   code&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Award points if helpful.&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;  Kiran Kumar.G&lt;/P&gt;&lt;P&gt;                &lt;EM&gt;Have a Nice Day..&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Jan 2008 11:38:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop/m-p/3233302#M771328</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-04T11:38:32Z</dc:date>
    </item>
    <item>
      <title>Re: LOOP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop/m-p/3233303#M771329</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi VIJAY,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     Follow this one i hope it will work.. any syntax errors will come on read statement just change the statement according that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM s023 INTO&lt;/P&gt;&lt;P&gt;CORRESPONDING FIELDS OF TABLE IT_s023 WHERE&lt;/P&gt;&lt;P&gt;WERKS = P_WERKS AND&lt;/P&gt;&lt;P&gt;SPTAG IN P_SPTAG .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM S026 INTO CORRESPONDING FIELDS OF TABLE&lt;/P&gt;&lt;P&gt;IT_S026 WHERE WERKS = P_WERKS AND&lt;/P&gt;&lt;P&gt;SPTAG IN p_sptag .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT IT_S026.&lt;/P&gt;&lt;P&gt;IT_REPORT-ENMNG = IT_S026-ENMNG .&lt;/P&gt;&lt;P&gt;IT_REPORT-SPTAG = IT_S026-SPTAG .&lt;/P&gt;&lt;P&gt;IT_REPORT-MATNR = IT_S026-MATNR .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Read table IT_S023 WITH KEY WERKS = IT_S026-WERKS   &lt;/P&gt;&lt;P&gt;                                       AND SPTAG = IT_SO26-SPTAG&lt;/P&gt;&lt;P&gt;ADD IT_s023-WEMNG TO Z.&lt;/P&gt;&lt;P&gt;IT_REPORT-WEMNG = IT_S023-WEMNG.&lt;/P&gt;&lt;P&gt;APPEND IT_REPORT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Jan 2008 12:06:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop/m-p/3233303#M771329</guid>
      <dc:creator>former_member671008</dc:creator>
      <dc:date>2008-01-04T12:06:59Z</dc:date>
    </item>
    <item>
      <title>Re: LOOP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop/m-p/3233304#M771330</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;AND wont be there in READ statement when you use WITH KEY statement. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Above abapers have provided very good information, please reward them and close the tag if you satisfy with their answers. &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, &lt;/P&gt;&lt;P&gt;Satya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Jan 2008 22:26:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop/m-p/3233304#M771330</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-04T22:26:12Z</dc:date>
    </item>
  </channel>
</rss>

