Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Dump after execution of select statement..

Former Member
0 Likes
6,460

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.

21 REPLIES 21
Read only

FredericGirod
Active Contributor
0 Likes
3,242

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

Read only

Former Member
0 Likes
3,242

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.

Read only

0 Likes
3,242

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.

Read only

0 Likes
3,242

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.

Read only

Former Member
0 Likes
3,242

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

Read only

swen_hettstedt2
Explorer
0 Likes
3,242
Read only

Former Member
0 Likes
3,242

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.

Read only

Former Member
0 Likes
3,242

Hi Praveen,

In that case break the where condition values into two tables and write two select queries.

Thanks,

Govind

Read only

0 Likes
3,242

Hello Govind ,

                      i did not got your answer , canyou come with an elaborate explanation taking exmple of my code which i had written previously.

Read only

0 Likes
3,242

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

Read only

0 Likes
3,242

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

Read only

0 Likes
3,242

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 ?

Read only

0 Likes
3,242

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

Read only

0 Likes
3,242

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

Read only

Former Member
0 Likes
3,242

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 ?

Read only

0 Likes
3,242

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.

Read only

0 Likes
3,242

Hello Dinesh ,

                    Can elaborate your line saying :

"check whether the structure declared for internal table and order in select are same"  ?

Read only

0 Likes
3,242

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.

Read only

ThomasZloch
Active Contributor
0 Likes
3,242

The limit is not any exact number of records in selection criteria, but the size of the resulting SQL statement in KB:

Thomas

Read only

Former Member
0 Likes
3,242

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.

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
3,242

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.