<?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: Data selection using select in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-selection-using-select/m-p/897271#M54513</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Samir,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF I were you, I would have used the second approach, i.e., splitting the data into chunks and executing the selects multipletimes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anand Mandalika.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 12 Jan 2005 09:21:26 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-01-12T09:21:26Z</dc:date>
    <item>
      <title>Data selection using select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-selection-using-select/m-p/897270#M54512</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am selecting data from COEP(CO Object: Line Items (by Period)) table, which has huge data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The selection is done using OBJNR field, which is part of secondary index.&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;  SELECT&lt;/P&gt;&lt;P&gt;         objnr&lt;/P&gt;&lt;P&gt;         kstar  "Cost Element&lt;/P&gt;&lt;P&gt;         rbest  "Reference Document Number&lt;/P&gt;&lt;P&gt;         ....&lt;/P&gt;&lt;P&gt;         ....&lt;/P&gt;&lt;P&gt;    INTO CORRESPONDING FIELDS OF TABLE i_covp&lt;/P&gt;&lt;P&gt;    FROM covp&lt;/P&gt;&lt;P&gt;     FOR ALL ENTRIES IN i_kstar&lt;/P&gt;&lt;P&gt;   WHERE lednr EQ c_ledger&lt;/P&gt;&lt;P&gt;     AND objnr IN r_objnr&lt;/P&gt;&lt;P&gt;         .....&lt;/P&gt;&lt;P&gt;         .....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now this since r_objnr can be represented by Cost Center/Internal Orders or WBS. This can be very large.&lt;/P&gt;&lt;P&gt;If I try to run the program using this in foreground or background. It dumps, because the select statement is not able to cope up with this range r_objnr....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are 2 options to solve this problem:&lt;/P&gt;&lt;P&gt;1. Convert r_objnr into an internal table and use "for all entries"&lt;/P&gt;&lt;P&gt;2. There is another option I have seen in one of standard SAP program, where the r_objnr is split into several chunks and select is called repeatedly..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  PERFORM prepare_sel TABLES    r_objnr&lt;/P&gt;&lt;P&gt;                               r_sel_objnr&lt;/P&gt;&lt;P&gt;                      USING    l_index&lt;/P&gt;&lt;P&gt;                      CHANGING l_subrc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  WHILE l_subrc EQ 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT&lt;/P&gt;&lt;P&gt;         objnr&lt;/P&gt;&lt;P&gt;         kstar  "Cost Element&lt;/P&gt;&lt;P&gt;         rbest  "Reference Document Number&lt;/P&gt;&lt;P&gt;         ....&lt;/P&gt;&lt;P&gt;         ....&lt;/P&gt;&lt;P&gt;    INTO CORRESPONDING FIELDS OF TABLE i_covp PACKAGE SIZE 1000&lt;/P&gt;&lt;P&gt;    FROM covp&lt;/P&gt;&lt;P&gt;     FOR ALL ENTRIES IN i_kstar&lt;/P&gt;&lt;P&gt;   WHERE lednr EQ c_ledger&lt;/P&gt;&lt;P&gt;     AND objnr IN r_objnr&lt;/P&gt;&lt;P&gt;         .....&lt;/P&gt;&lt;P&gt;         .....&lt;/P&gt;&lt;P&gt;      ADD 1 TO l_record_counter.&lt;/P&gt;&lt;P&gt;      IF sy-batch IS INITIAL AND&lt;/P&gt;&lt;P&gt;         sy-binpt IS INITIAL.&lt;/P&gt;&lt;P&gt;        PERFORM flash_records_read(sapfgrws)&lt;/P&gt;&lt;P&gt;                  USING l_record_counter.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  endselect.&lt;/P&gt;&lt;P&gt;    ADD 1 TO l_index.&lt;/P&gt;&lt;P&gt;    PERFORM prepare_sel TABLES   r_objnr&lt;/P&gt;&lt;P&gt;                                 r_sel_objnr&lt;/P&gt;&lt;P&gt;                        USING    l_index&lt;/P&gt;&lt;P&gt;                        CHANGING l_subrc.&lt;/P&gt;&lt;P&gt;  ENDWHILE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;Where subroutine prepare_Sel basically picks one record from r_objnr and populates r_sel_objnr.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wanted to know which of these method is better??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jan 2005 09:13:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-selection-using-select/m-p/897270#M54512</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-01-12T09:13:10Z</dc:date>
    </item>
    <item>
      <title>Re: Data selection using select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-selection-using-select/m-p/897271#M54513</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Samir,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF I were you, I would have used the second approach, i.e., splitting the data into chunks and executing the selects multipletimes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anand Mandalika.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jan 2005 09:21:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-selection-using-select/m-p/897271#M54513</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-01-12T09:21:26Z</dc:date>
    </item>
    <item>
      <title>Re: Data selection using select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-selection-using-select/m-p/897272#M54514</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jan 2005 09:39:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-selection-using-select/m-p/897272#M54514</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-01-12T09:39:25Z</dc:date>
    </item>
  </channel>
</rss>

