Skip to Content
author's profile photo Former Member
Former Member

Range Problems

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:

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_ebit1

OR racct IN r_ebit2

OR racct IN r_ebit3

OR racct IN r_ebit4

OR racct IN r_ebit5

OR racct IN r_ebit6

OR racct IN r_ebit7

OR racct IN r_ebit8

OR racct IN r_ebit9

OR racct IN r_pers

OR racct IN r_occu

OR racct IN r_depre

OR racct IN r_capxe

OR racct IN r_capxn

OR racct IN r_cnets

OR racct IN r_intcn

OR racct IN r_intcc )

AND kokrs EQ c_0030.

Add a comment
10|10000 characters needed characters exceeded

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Oct 13, 2005 at 03:59 AM

    hi,

    try with this

    define one more range like r_accounts and populate all the ranges into r_accounts like

    APPEND LINES OF r_ebit2 TO r_accounts

    APPEND LINES OF r_ebit3 TO r_accounts

    .

    .....

    select..........where racct in r_accounts

    cheers,

    sasi

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 13, 2005 at 04:01 AM

    Hi,

    Try to make the all the same type of ranges in one range.

    append lines of r_ebit2 to r_ebit1.

    append lines of r_ebit3 to r_ebit1.

    ...

    Then in select

    select.....

    WHERE ....other conditions

    AND ( racct IN r_ebit1 ).

    Since you mentioned or in that paranthesis,I hope this should work.

    Just make a try.

    Kindly reward points by clicking the star on the left of reply,if it helps.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 13, 2005 at 04:02 AM

    Hi Jason,

    Try and put all your ranges into one big range.

    eg.

    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.
    
    

    Hope this helps.

    Cheers,

    Pat.

    PS. Kindly assign Reward Points tot he posts you find helpful.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 13, 2005 at 04:03 AM

    Why don't you do this before the select statement?

    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.
    

    Consider changing the select statement, it is really big. You may have performance problems too.

    Srinivas

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.