‎2009 Mar 25 1:42 PM
I am trying to execute this sentence :
SELECT PERNR
BEGDA
ZZCPRENDA
ZZDPRENDA
ZZTPRENDA
ZZPROV from ZPREN_EMP_FUNC into (wa_entr-n_pers,
wa_entr-frecog,
wa_entr-cod_prenda,
wa_entr-descrip,
wa_entr-tall_r,
wa_entr-origen)
where subty = '0003' and begda >= ran_f-low and begda <= ran_f-high
and pernr in num_per.
But It gives me and SQL error 'Error in module RSQL of the database interface'.
It is all because of the num_per table. It contains 3001 regs.
How can I solve it ? Should I modify the maximum size of the SQL statement ? or even the space??
Thanks in advance.
‎2009 Mar 25 1:44 PM
Yes for an SQL statement a range can only have a finite number of entries.
You need to use the FOR ALL ENTRIES command instead.
‎2009 Mar 25 11:02 PM
Hi,
check this OSS note 13607. It describes how SAP rewrites OpenSQL statement with ranges into SQL query for DB server and why there is technical limitation of number of items in range. You can try to use FOR ALL ENTRIES or split you select into more select where you will split your range into smaller chunks.
Cheers