Sei sulla pagina 1di 4

Handle Dumps in Range

If we have 20000+ records in the range then the Select query Might give dump.
An Example Select Query:

The issue here is the use of RANGE on the part of the WHERE clause. There is no
issue if your range is just about less than a thousand records. But if your range
consist of about more than 20K or more, then you may get
DBIF_RSQL_INVALID_RSQL dump. The number of records that can be saved in a
range without giving dump may vary depending on the system and the memory
allocated.
Solution 1: To solve the issue above, one solution to implement is the use of FOR
ALL ENTRIES. Be sure to declare your internal table as a standard table and not as
a range. As we cannot use 2 FOR ALL ENTRIES statement in a single SELECT
Query so we have to use it one by one.

Solution 2: Another better solution is to use FM RSDS_RANGE_TO_WHERE. This


function module returns a dynamic where clause in which it is of type string. Then
the returning value of the FM will be passed into the SELECT statement in which it is
declared as dynamic.
Refer to the below sample code:
First step is to populate an internal table I_RANGE using Range tableRA_BELNR.

Pass this Internal table to the below FM that will create a Dynamic where clause.

After passing the Range table I_RANGE (For example 2 rows ) to the FM
RSDS_RANGE_TO_WHERE the output G_WHERE will be like this :

If user Input range with values LOW and HIGH in table I_RANGE then the output
variable G_WHERE will be like this:

NOTE: For using this Remember to fill table I_RANGE with OPTION = BT

Potrebbero piacerti anche