<?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: Range Problems in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/range-problems/m-p/1066739#M93497</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why don't you do this before the select statement?&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
APPEND LINES OF: r_ebit3  TO r_ebit2,
                 r_ebit4  TO r_ebit2,
                 r_ebit5  TO r_ebit2,
                 r_ebit6  TO r_ebit2,
                 r_ebit7  TO r_ebit2,
                 r_ebit8  TO r_ebit2,
                 r_ebit9  TO r_ebit2,
                 r_pers   TO r_ebit2,
                 r_occu   TO r_ebit2,
                 r_depre  TO r_ebit2,
                 r_capxe  TO r_ebit2,
                 r_capxn  TO r_ebit2,
                 r_cnets  TO r_ebit2,
                 r_intcn  TO r_ebit2,
                 r_intcc  TO r_ebit2.
and then do your select as
 racct IN r_ebit2.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Consider changing the select statement, it is really big. You may have performance problems too.&lt;/P&gt;&lt;P&gt;Srinivas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 13 Oct 2005 04:03:28 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-10-13T04:03:28Z</dc:date>
    <item>
      <title>Range Problems</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/range-problems/m-p/1066735#M93493</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all, Im having a problem using the range in my select, the problem is that the range contains 114 ranges... after the select statement the program cant retrieve all the data that satisfies my selection criteria using the range. Is there any possibilities to load/generate all values inside the given range? Is there a function module for that because it seems that the program is having a problem comparing the values found in the dbtable against the range since there are a lot of ranges to be check. Pls help. me. below is the program code for select:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT gl_sirid     "Record number of the line item record&lt;/P&gt;&lt;P&gt;         rvers        "Version&lt;/P&gt;&lt;P&gt;         ryear        "Fiscal Year&lt;/P&gt;&lt;P&gt;         rtcur        "Currency Key&lt;/P&gt;&lt;P&gt;         poper        "Posting period&lt;/P&gt;&lt;P&gt;         rbukrs       "Company Code&lt;/P&gt;&lt;P&gt;         rprctr       "Profit center&lt;/P&gt;&lt;P&gt;         racct        "Account number&lt;/P&gt;&lt;P&gt;         hsl          "Amount in transaction currency&lt;/P&gt;&lt;P&gt;         hsl          "Amount in company code currency&lt;/P&gt;&lt;P&gt;         kostl        "Cost Center&lt;/P&gt;&lt;P&gt;         paobjnr      "Profitability Segment Number (CO-PA)&lt;/P&gt;&lt;P&gt;         pasubnr      "Profitability segment changes (CO-PA)&lt;/P&gt;&lt;P&gt;         drcrk        "Debit/Credit&lt;/P&gt;&lt;P&gt;    FROM glpca&lt;/P&gt;&lt;P&gt;    INTO TABLE i_glpca&lt;/P&gt;&lt;P&gt;    WHERE ( rvers EQ c_000v OR        "Actual&lt;/P&gt;&lt;P&gt;            rvers EQ c_001v OR        "Budget&lt;/P&gt;&lt;P&gt;            rvers EQ c_100v OR&lt;/P&gt;&lt;P&gt;            rvers EQ c_200v OR&lt;/P&gt;&lt;P&gt;            rvers EQ c_300v )&lt;/P&gt;&lt;P&gt;      AND ryear EQ v_pyear         "Fiscal year&lt;/P&gt;&lt;P&gt;      AND poper EQ v_pperiod       "Posting year&lt;/P&gt;&lt;P&gt;      AND rbukrs IN r_ccode        "Company code&lt;/P&gt;&lt;P&gt;      AND rprctr IN r_prctr        "Profit center&lt;/P&gt;&lt;P&gt;      AND ( racct IN r_ebit1&lt;/P&gt;&lt;P&gt;      OR    racct IN r_ebit2&lt;/P&gt;&lt;P&gt;      OR    racct IN r_ebit3&lt;/P&gt;&lt;P&gt;      OR    racct IN r_ebit4&lt;/P&gt;&lt;P&gt;      OR    racct IN r_ebit5&lt;/P&gt;&lt;P&gt;      OR    racct IN r_ebit6&lt;/P&gt;&lt;P&gt;      OR    racct IN r_ebit7&lt;/P&gt;&lt;P&gt;      OR    racct IN r_ebit8&lt;/P&gt;&lt;P&gt;      OR    racct IN r_ebit9&lt;/P&gt;&lt;P&gt;      OR    racct IN r_pers&lt;/P&gt;&lt;P&gt;      OR    racct IN r_occu&lt;/P&gt;&lt;P&gt;      OR    racct IN r_depre&lt;/P&gt;&lt;P&gt;      OR    racct IN r_capxe&lt;/P&gt;&lt;P&gt;      OR    racct IN r_capxn&lt;/P&gt;&lt;P&gt;      OR    racct IN r_cnets&lt;/P&gt;&lt;P&gt;      OR    racct IN r_intcn&lt;/P&gt;&lt;P&gt;      OR    racct IN r_intcc )&lt;/P&gt;&lt;P&gt;      AND kokrs EQ c_0030.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Oct 2005 03:50:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/range-problems/m-p/1066735#M93493</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-13T03:50:49Z</dc:date>
    </item>
    <item>
      <title>Re: Range Problems</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/range-problems/m-p/1066736#M93494</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;try with this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;define one more range like r_accounts and populate all the ranges into r_accounts like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND LINES OF r_ebit2 TO r_accounts &lt;/P&gt;&lt;P&gt;APPEND LINES OF r_ebit3 TO r_accounts &lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.....&lt;/P&gt;&lt;P&gt;select..........where racct in r_accounts&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers,&lt;/P&gt;&lt;P&gt;sasi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Oct 2005 03:59:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/range-problems/m-p/1066736#M93494</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-13T03:59:54Z</dc:date>
    </item>
    <item>
      <title>Re: Range Problems</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/range-problems/m-p/1066737#M93495</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;Try to make the all the same type of ranges in one range.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;append lines of r_ebit2 to r_ebit1.&lt;/P&gt;&lt;P&gt;append lines of r_ebit3 to r_ebit1.&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then in select&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select.....&lt;/P&gt;&lt;P&gt;WHERE ....other conditions&lt;/P&gt;&lt;P&gt;AND ( racct IN r_ebit1 ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since you mentioned or in that paranthesis,I hope this should work.&lt;/P&gt;&lt;P&gt;Just make a try.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly reward points by clicking the star on the left of reply,if it helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Oct 2005 04:01:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/range-problems/m-p/1066737#M93495</guid>
      <dc:creator>jayanthi_jayaraman</dc:creator>
      <dc:date>2005-10-13T04:01:28Z</dc:date>
    </item>
    <item>
      <title>Re: Range Problems</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/range-problems/m-p/1066738#M93496</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jason,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try and put all your ranges into one big range.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;eg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
ranges: r_racct for glpca-racct.
....

loop at r_ebit1.
  clear r_racct.
  r_racct-sign   = r_ebit1-sign.
  r_racct-option = r_ebit1-option.
  r_racct-low    = r_ebit1-low.
  r_racct-high   = r_ebit1-high.
  append r_racct.
endloop.

* Do this for allyour ranges... 
....

* Then you can rewrite your query as follows:
SELECT gl_sirid "Record number of the line item record
rvers "Version
ryear "Fiscal Year
rtcur "Currency Key
poper "Posting period
rbukrs "Company Code
rprctr "Profit center
racct "Account number
hsl "Amount in transaction currency
hsl "Amount in company code currency
kostl "Cost Center
paobjnr "Profitability Segment Number (CO-PA)
pasubnr "Profitability segment changes (CO-PA)
drcrk "Debit/Credit
FROM glpca
INTO TABLE i_glpca
WHERE ( rvers EQ c_000v OR "Actual
rvers EQ c_001v OR "Budget
rvers EQ c_100v OR
rvers EQ c_200v OR
rvers EQ c_300v )
AND ryear EQ v_pyear "Fiscal year
AND poper EQ v_pperiod "Posting year
AND rbukrs IN r_ccode "Company code
AND rprctr IN r_prctr "Profit center
AND racct  IN r_racct
AND kokrs EQ c_0030.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS. Kindly assign Reward Points tot he posts you find helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Oct 2005 04:02:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/range-problems/m-p/1066738#M93496</guid>
      <dc:creator>former_member221770</dc:creator>
      <dc:date>2005-10-13T04:02:31Z</dc:date>
    </item>
    <item>
      <title>Re: Range Problems</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/range-problems/m-p/1066739#M93497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why don't you do this before the select statement?&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
APPEND LINES OF: r_ebit3  TO r_ebit2,
                 r_ebit4  TO r_ebit2,
                 r_ebit5  TO r_ebit2,
                 r_ebit6  TO r_ebit2,
                 r_ebit7  TO r_ebit2,
                 r_ebit8  TO r_ebit2,
                 r_ebit9  TO r_ebit2,
                 r_pers   TO r_ebit2,
                 r_occu   TO r_ebit2,
                 r_depre  TO r_ebit2,
                 r_capxe  TO r_ebit2,
                 r_capxn  TO r_ebit2,
                 r_cnets  TO r_ebit2,
                 r_intcn  TO r_ebit2,
                 r_intcc  TO r_ebit2.
and then do your select as
 racct IN r_ebit2.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Consider changing the select statement, it is really big. You may have performance problems too.&lt;/P&gt;&lt;P&gt;Srinivas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Oct 2005 04:03:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/range-problems/m-p/1066739#M93497</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-13T04:03:28Z</dc:date>
    </item>
  </channel>
</rss>

