2013 Aug 06 11:43 AM
Hello Techies ,
Am facing an issue while executing a select query where clause .
Select fieldvalue INTO TABLE me->t_values FROM zvlv_index
WHERE logid IN t_logid
AND fieldid = n_field group by fieldvalue.
in test system when i execute its running fine and i have observed tht records in table tht being used in WHERE clause are 6008 .
in prod system when i execute its giving DUMP and i have observed tht records in table tht being used in WHERE clause is 10244.
and i heard tht if there are more than 10k records in WHERE clause then it can give dump.
i got EXCEPTION CLASS : CX_SY_OPEN_SQL_DB
ERROR NAME : DBIF_RSQL_INVALID_RSQL.
Hello Techies ,
Am facing an issue while executing a select query where clause .
Select fieldvalue INTO TABLE me->t_values FROM zvlv_index
WHERE logid IN t_logid
AND fieldid = n_field group by fieldvalue.
in test system when i execute its running fine and i have observed tht records in table tht being used in WHERE clause are 6008 .
in prod system when i execute its giving DUMP and i have observed tht records in table tht being used in WHERE clause is 10244.
and i heard tht if there are more than 10k records in WHERE clause then it can give dump.
i got EXCEPTION CLASS : CX_SY_OPEN_SQL_DB
ERROR NAME : DBIF_RSQL_INVALID_RSQL.
2013 Aug 06 12:08 PM
Hi Praveen,
could you make an SQL trace, get the exact SELECT statement that is called by your program and give it ?
maybe you make a group by on a field not present in a select ...
regards
Fred
2013 Aug 06 12:16 PM
Range table when used in Select..IN format has a size limit, governed by server memory.
My system gives dumps if range table has 2000+ records.
You can change select query to Select..for all entries in.. format to avoid dump.
2013 Aug 06 12:51 PM
Hi manish ,
i tried like this ...
If not t_logid[] is initial.
sort t_logid.
select fieldvalue into table me->t_values from zvlv_index
for all entries in t_logid
where logid = t_logid-low
and fieldid = n_field.
2013 Aug 06 2:32 PM
Are you still getting the SHort dump after this select query?
What was the Short Dump Exception name?
The Select Query with For All Entries looks good.
2013 Aug 06 12:22 PM
Hi Praveen
as there are 10000+ records in t_logid, it is going to dump
use for all entries in t_logid in the select statement to avoid the dump
-Srini
2013 Aug 06 12:30 PM
2013 Aug 06 12:32 PM
Hi Praveen,
Your understanding is correct. In the where clause if you use ranges using IN statement, SAP system provides a dump if the number of records in range object is more than 9999 entries.
You can see that the same thing happens when you try to provide more than 9999 entries in SE16.
The best option is to change the code to use for all entries instead of using IN.
Thanks and Regards,
Sriranjani Chimakurthy.
2013 Aug 06 12:40 PM
Hi Praveen,
In that case break the where condition values into two tables and write two select queries.
Thanks,
Govind
2013 Aug 06 3:48 PM
Hello Govind ,
i did not got your answer , canyou come with an elaborate explanation taking exmple of my code which i had written previously.
2013 Aug 06 4:32 PM
Hi Praveen,
If you have an option to write FOR ALL ENTRIES then better to go for it.
If you dont have an option and need to fetch all the records using where condition table which contain more than 9999 records in your case it is 10244. Then break that values into two internal table one contains 9999 reords and second one 245 recods( Sum is 10244). And write two select queries and appending into single table.
Thanks,
Govind
2013 Aug 07 9:13 AM
Hellooo, you cannot name an exact number like 9999 here, as I keep saying and saying. Depending on the length of each criteria, you might start seeing the dump with less or more entries.
It is the resulting size of the SQL statement that matters.
Here we only know that it works with 6008 and dumps with 10244 entries. The "limit" can be anywhere inbetween.
Thomas
2013 Aug 07 11:53 AM
Hello govind,
i got your answer , but when am trying that am not getting ,
we have to use package keyword or how we need to break internal table into two ?
2013 Aug 07 2:46 PM
Hi Praveen,
You can write following statement in order to break into two tables.
APPEND LINES OF <t_logid> FROM 1 TO 100 TO <t_logid1>.
APPEND LINES OF <t_logid> FROM 1 TO 100 TO <t_logid2>.
And then you can write two select queries. In second query write APPENDING TABLE <t_values>.
This is not good method. But if you have to complete your requirement then go for it. As developer we can fullfill requirement in any method.
Thanks,
Govind
2013 Aug 08 10:10 AM
Govind Battul wrote:
This is not good method. But if you have to complete your requirement then go for it. As developer we can fullfill requirement in any method.
Well, this sort of thinking is a major cause for follow-on problems during support and maintenance. A little more sustainability cannot hurt.
Thomas
2013 Aug 06 12:52 PM
Hello techies,
am new to abap and i dont have much idea how to use for all entries .
can you post how to use it ?
2013 Aug 06 2:47 PM
Hi Praveen,
A simple example you need to get material and its description for a report.
select matnr from mara into table it_mara.
if it_mara is not initial.
select maktx from makt into table it_makt
for all entries in it_mara
where matnr = it_mara-matnr.
endif.
it means for all the materials you fetched from mara table you will get the description from makt table.
Possiblities of error.
Check whether the structure declared for int table and the order in select are same.
if you can't find out from the above inputs then it might be the cause.
Check and revert for further queries.
Thanks,
Dinesh.
2013 Aug 06 3:35 PM
Hello Dinesh ,
Can elaborate your line saying :
"check whether the structure declared for internal table and order in select are same" ?
2013 Aug 06 4:05 PM
Hi Praveen,
See the int table decln
types : begin of ty_mara,
matnr type mara-matnr,
ersda type mara-ersda,
ernam type mara-ernam,
end of ty_mara.
data it_mara type table of ty_mara.
select ersda mara ernam from mara into it_mara.
here the sequence declared in structure and used in select are different..
also in select use fields in order as they are in the table.
these two will also lead to dump.
Thanks,
Dinesh.
2013 Aug 06 2:53 PM
2013 Aug 06 3:01 PM
Hi Praveen,
For all entries is like this:
if lt_itab is not initial.
select fieldvalue
from dat_table
into lt_inttable
for all entries in lt_itab
where sel_field = lt_itab-sel_field.
if sy-subrc eq 0.
endif.
endif.
2013 Aug 08 10:28 AM
Hi,
Please do a search in SCN for the statement DBIF_RSQL_INVALID_RSQL. Your problem will be resolved. I cannot allow this thread to be active further as there are lot of basic contents piling up ( Exception to Thomas 😉 )
As you are new to ABAP please use F1 help for learning or use transaction ABAPDOCU.
Thread locked.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |