11-25-2009 6:25 AM
Hi All,
I have written the following query on COAS view in my code:
SELECT aufnr bukrs INTO TABLE gt_aufnr
FROM coas
WHERE
aufnr IN r_aufrm AND
auart IN s_auart AND
autyp = c_autyp_01 AND
kokrs = c_kokrs_mbca.
When records in range r_aufrm are too many like 6000 or so it gives me a run time error on this query - DBIF_RSQL_INVALID_RSQL. Error description says size of select query is large.
Question : Is this bug coming because I am using the view. If i select the records on table AUFK (only table on which the view is created), will it rectify the problem?? I am asking this because it's in production and I cant make any change and test then and there.
Note: the range r_aufrm contains two types of records for AUFNR - 1. with sign GE and others with sign LE. So I cannot use for all entries. If I still can, please tell me how?
Thanks a looot!
Waiting for the response,
Navita
11-25-2009 9:01 AM
Thanks All!!
I think, this range limit has caused the problem. Range limit is 999 records.
Just one question I have. At runtime when I check the number of entries in r_aufrm in the query, I get 6000 entries. So, does it allow 6000 records to enter the range variable even if it has a limit of 999. Is it the case that, in select query only it will throw a dump if records in range exceed 999??
SELECT aufnr bukrs INTO TABLE gt_aufnr
FROM coas
WHERE
aufnr IN r_aufrm AND
auart IN s_auart AND
autyp = c_autyp_01 AND
kokrs = c_kokrs_mbca.
Please clear my doubt.
Thanks a lot for ur help!!!!
Navita
11-25-2009 6:29 AM
I know that range table has a restriction of number of entries it can hold, I had a similar scenario before, where I had to get rid of ranges and find out another solution...
the problem is number of entries in ranges.... give a lesser load in ranges it will work, with out dump.
11-25-2009 7:25 AM
Try it with AUFK table as you can also use the AUFNR field as one of the keys.
11-25-2009 8:10 AM
Hi ,
You should avoid Ranges if number of records are many,
Try this 1. Use database table AUFK directly instead of view.
2. Try to avoid range by fetch of all the record in internal table and later you can delete the extra records from internal table based on your condition).
Hope it help you.
11-25-2009 9:01 AM
Thanks All!!
I think, this range limit has caused the problem. Range limit is 999 records.
Just one question I have. At runtime when I check the number of entries in r_aufrm in the query, I get 6000 entries. So, does it allow 6000 records to enter the range variable even if it has a limit of 999. Is it the case that, in select query only it will throw a dump if records in range exceed 999??
SELECT aufnr bukrs INTO TABLE gt_aufnr
FROM coas
WHERE
aufnr IN r_aufrm AND
auart IN s_auart AND
autyp = c_autyp_01 AND
kokrs = c_kokrs_mbca.
Please clear my doubt.
Thanks a lot for ur help!!!!
Navita
11-25-2009 9:06 AM
Yes.
What you can do is cehck no. of entries in try is r_aufrm and then break the select accordingly using OPEN CURSOR .
11-25-2009 9:09 AM
11-26-2009 5:03 PM
The limit isn't 999 records, it is what the database can digest in KByte for one single SQL statement, so it varies e.g. based on the length of the range field.
The usual workaround would be using FOR ALL ENTRIES with an internal table instead of the range.
Thomas