Skip to Content
Former Member
May 08, 2013 at 02:32 PM

DBIF_RSQL_INVALID_RSQL because of routine selection


We have created a generic datasource for extracting a particular huge table from R/3 to BW. Due to the fact that the correspondence table does not have data fields that could use for delta extraction (DFKKOPK), we use an abap routine selection in the infopackage (based on a DSO table which has the header data) and we have enabled the more than 1000 records option for selection. This datasource has been working fine for low data load. Recently it tried to select about 18.500 records but returned the following error in the source system;



Our database is DB6 (DB2 9.7) on AIX system.

The error has to do with the sql statement on ECC system. Having searched in the sap forum i came across the following page, which states that you may overcome the sql statement limitation if you use the "FOR ALL ENTRIES" statement instead.

But this has to do with the way the ECC standard function module process the extraction on the ECC side.

For more information I am enclosing the part of the routine where we define selection for the infopackage.


select FC_OPBEL from /BIC/AZDFKKKO00

into table lt_doc


CREATEDON >= zdate and


read table l_t_range with key

fieldname = 'OPBEL'.

l_idx = sy-tabix.

l_t_range-fieldname = 'OPBEL'.

l_t_range-sign = 'I'.

l_t_range-option = 'EQ'.

loop at lt_doc into l_t_range-low.

append l_t_range .



Is there a way to overcome the sql limitation and be able to proceed with the extraction??

P.S.I am aware of the ALE delta and the extraction based on table join(tables and headers), but due to the fact that we have used the similar logic for DTP extraction (based on selection routine) where we don't have any other option , please provide solutions on how to counter the sql error.