<?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: Help reg select statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-reg-select-statement/m-p/6280124#M1388110</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;You can do one thing: When you are using "For All Entries:",  just check in dubugging mode whether the data is coming into your internal table for the second and 3rd table and also check in the 2nd and 3rd table, whether entries exists or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And also, if it is taking more time using "For All Entries", tries to sort your 1st internal table based on the field on which you are fetching the data from 2nd and 3rd table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hopes, it will solve ur problem, otherwise tell me exactly wht r u doing, might be you require little bit modification&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards&lt;/P&gt;&lt;P&gt;Sachin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 26 Oct 2009 12:11:43 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-10-26T12:11:43Z</dc:date>
    <item>
      <title>Help reg select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-reg-select-statement/m-p/6280121#M1388107</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;My internal table itab  in my function module contains 3 fields from 3 different tables. Fetching data for the first field is directly fm db table. For the other 2 fields i need to fetch values in such a way that&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; LOOP AT itab.&lt;/P&gt;&lt;P&gt;      SELECT field2  FROM table INTO itab for all entries in itab WHERE fieldx  EQ itab-fieldx.&lt;/P&gt;&lt;P&gt;        APPEND itab.&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;When i use such statements, time taken is considerably long enough so i tried replacing with "FOR ALL ENTRIES".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But even then its taking long time to execute.&lt;/P&gt;&lt;P&gt;Moreover i'm not able to get the values of the other 2 fields in my output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using move  statement to fill the final table in the function module.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pls can anyone help me to solve this issue.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Oct 2009 11:15:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-reg-select-statement/m-p/6280121#M1388107</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-26T11:15:32Z</dc:date>
    </item>
    <item>
      <title>Re: Help reg select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-reg-select-statement/m-p/6280122#M1388108</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;Using FOR ALL ENTRIES is always encouraged compared to writing SELECT within LOOP. If using FOR ALL ENTRIES is also taking time, it depends on the table on which you are querying and if you have used all the primary keys in the where conditions of the select statement. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If all the three tables are linked, its better to use a INNER JOIN select query which will populate the final internal table directly&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vikranth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Oct 2009 11:19:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-reg-select-statement/m-p/6280122#M1388108</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-26T11:19:55Z</dc:date>
    </item>
    <item>
      <title>Re: Help reg select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-reg-select-statement/m-p/6280123#M1388109</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;Thanks for your reply. I even tried inner join and even dat s also not populating my final table. Pls can someone guide me to get the values in my final table. I'm using statements like the following to fill my final table tablelist.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT itab.&lt;/P&gt;&lt;P&gt;      MOVE: itab-fieldx TO tablelist-fieldx.&lt;/P&gt;&lt;P&gt;      MOVE: itab-fieldy TO tablelist-fieldy.&lt;/P&gt;&lt;P&gt;     APPEND tablelist.&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Revathi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Oct 2009 11:57:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-reg-select-statement/m-p/6280123#M1388109</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-26T11:57:39Z</dc:date>
    </item>
    <item>
      <title>Re: Help reg select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-reg-select-statement/m-p/6280124#M1388110</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;You can do one thing: When you are using "For All Entries:",  just check in dubugging mode whether the data is coming into your internal table for the second and 3rd table and also check in the 2nd and 3rd table, whether entries exists or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And also, if it is taking more time using "For All Entries", tries to sort your 1st internal table based on the field on which you are fetching the data from 2nd and 3rd table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hopes, it will solve ur problem, otherwise tell me exactly wht r u doing, might be you require little bit modification&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards&lt;/P&gt;&lt;P&gt;Sachin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Oct 2009 12:11:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-reg-select-statement/m-p/6280124#M1388110</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-26T12:11:43Z</dc:date>
    </item>
    <item>
      <title>Re: Help reg select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-reg-select-statement/m-p/6280125#M1388111</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Revathi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do the following steps:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a) Select fileld1 field2 from table tablename into table ITAb where field1 in Select-option or parameter&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;b) sort itab by field1, field2 ( primary keys of the table)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;c) if not itab[] is initial .&lt;/P&gt;&lt;P&gt;        select field1 field2 from table tablename into table itab1 for all entries in itab where fields eq itab-field1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          select field1 field2 from table tablename into table itab2 for all entries in itab where fields eq itab-field1.&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;d) sort itab1 by field1 field2&lt;/P&gt;&lt;P&gt;e) sort itab2 by field1 field2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;f) process the data into final table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;move-corresponding itab to it_final(it_final is final intenral table)&lt;/P&gt;&lt;P&gt;read table itab1 with key fieild1 = itab-field1&lt;/P&gt;&lt;P&gt;if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;move-corresponding itab1 to it_final&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table itab2 with key fieild1 = itab-field1&lt;/P&gt;&lt;P&gt;if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;move-corresponding itab2 to it_final&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;append it_final.&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;This will take all your values to final table and you can display the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IHope it will work for you. Any doubts, please feel free to ask.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If your problem get resolved, please let me know.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Sachin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Oct 2009 12:22:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-reg-select-statement/m-p/6280125#M1388111</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-26T12:22:09Z</dc:date>
    </item>
    <item>
      <title>Re: Help reg select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-reg-select-statement/m-p/6280126#M1388112</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sachin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply. I'm writing a program with the following code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT itab3.&lt;/P&gt;&lt;P&gt;    MOVE-CORRESPONDING itab3 TO itab.&lt;/P&gt;&lt;P&gt;    READ TABLE itab6 WITH KEY field1 = itab3-field1.&lt;/P&gt;&lt;P&gt;    IF sy-subrc EQ 0.&lt;/P&gt;&lt;P&gt;      MOVE-CORRESPONDING itab6 TO itab.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;    APPEND itab.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT itab.&lt;/P&gt;&lt;P&gt;    READ TABLE itab2 WITH KEY field2 = itab-field2.&lt;/P&gt;&lt;P&gt;    IF sy-subrc EQ 0.&lt;/P&gt;&lt;P&gt;      MOVE-CORRESPONDING itab2 TO itab.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    READ TABLE itab1 WITH KEY field4 = itab-field3.&lt;/P&gt;&lt;P&gt;    IF sy-subrc EQ 0.&lt;/P&gt;&lt;P&gt;      MOVE-CORRESPONDING itab1 TO itab.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    APPEND itab.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; I dint use sort statement. I'm just using select and loop statements. Itab is not getting populated with the second loop in the code.&lt;/P&gt;&lt;P&gt;So i could not populate my final table final_itab fm dis itab. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pls can anyone help me to get the required output or provide some useful suggestions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Revathi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Oct 2009 10:24:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-reg-select-statement/m-p/6280126#M1388112</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-30T10:24:08Z</dc:date>
    </item>
    <item>
      <title>Re: Help reg select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-reg-select-statement/m-p/6280127#M1388113</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
LOOP AT itab.
READ TABLE itab2 WITH KEY field2 = itab-field2.
IF sy-subrc EQ 0.
MOVE-CORRESPONDING itab2 TO it_final. " it_final instead of itab
APPEND it_final. " add this
ENDIF.

READ TABLE itab1 WITH KEY field4 = itab-field3.
IF sy-subrc EQ 0.
MOVE-CORRESPONDING itab1 TO it_final. " it_final instead of itab
APPEND it_final. " add this
ENDIF.

*APPEND itab. " remove this
ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Oct 2009 10:30:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-reg-select-statement/m-p/6280127#M1388113</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-30T10:30:49Z</dc:date>
    </item>
  </channel>
</rss>

