2006 Oct 26 6:18 AM
Hello,
Error reported in R/3 developer trace file:
B *** ERROR => dbtran ERROR (prepare_bulk_cond): FOR ALL ENTRIES statement too big
size = 1577 + n * 14895 <-> max. size = 32000
token count = 165 + n * 14292 <-> max. token count = 32767
marker count = n * 7105 <-> max. marker count = 32767, table='PRPS'
[dbtran.c 14933]
B ***LOG BYK=> current SQL statement exceeds a database limit [dbtran#6 @ 14936] [dbtran 1493 6]
Question:
My select statement uses "for all entries" and got too big. Is this error due to a limitation in our database (in this case UDB) or is this an RSQL (db independent) or ABAP limitation? There's no sql error code.
Thanks,
Greg
Hello,
Error reported in R/3 developer trace file:
B *** ERROR => dbtran ERROR (prepare_bulk_cond): FOR ALL ENTRIES statement too big
size = 1577 + n * 14895 <-> max. size = 32000
token count = 165 + n * 14292 <-> max. token count = 32767
marker count = n * 7105 <-> max. marker count = 32767, table='PRPS'
[dbtran.c 14933]
B ***LOG BYK=> current SQL statement exceeds a database limit [dbtran#6 @ 14936] [dbtran 1493 6]
Question:
My select statement uses "for all entries" and got too big. Is this error due to a limitation in our database (in this case UDB) or is this an RSQL (db independent) or ABAP limitation? There's no sql error code.
Thanks,
Greg
2006 Oct 26 6:45 AM
There is nothing like ABAP limitation in this regard,
Try increasing the memory for your program in your system.
Or add some code to restrict to some n lines of table and repeat this for all entries. you can use a temperary table for the same.
regards,
Sandeep Josyula
*Mark helpful answers !
2006 Oct 26 6:58 AM
The statement looks like this:
select apspnr posid psphi stufe usr10 usr11 aobjnr
belnr refbk refbn refgj blart zlenr wkgbtr
bukrs gjahr cpudt cputm
aworg awtyp kokrs ebeln ebelp buzei budat
gkont poski
into corresponding fields of table t_covp3
from prps as a inner join covp as b
on amandt = bmandt and aobjnr = bobjnr
inner join proj as c on
apsphi = cpspnr
for all entries in t_bkpf2
==> where pspid in r_proj1 and
posid in s_posid and
( stufe = 4 or
stufe = 5 ) and
refbk = t_bkpf2-bukrs and
refbn = t_bkpf2-belnr and
refgj = t_bkpf2-gjahr.
Previously statement worked when 7th line up was:
==> where pspid = t_proj-pspid
I don't know which SAP memory area may change outcome, is "dbtan ERROR" indicative of "RSQL"? Looping through pspid may work but I'm wondering if that can avoided.
2006 Oct 26 7:00 AM
2006 Oct 26 7:07 AM
I believe that there are limits and that your statement has reached them. Try chunking the statement with package size:
data: current_start type sy-tabix value 1.
data: current_end type sy-tabix value 1.
data: pack_size like sytabix value 50000.
data: totrex type sytabix.
describe data itab entries totrex.
loopc = totrex / packsize.
loopc = loopc + 1.
do loopc times.
current_end = current_start + pack_size - 1.
refresh smalltab.
loop at itab from current_start to current_end.
append itab to small_tab.
endloop.
SELECT * INTO TABLE itabout PACKAGE SIZE 20 FROM scarr
for all entries in small_tab
where ..........
current_start = current_start + pack_size.
ENDdo.
............
or for your example:
data: current_start type sy-tabix value 1.
data: current_end type sy-tabix value 1.
data: pack_size like sytabix value 50000.
data: totrex type sytabix.
describe data itab entries totrex.
loopc = totrex / packsize.
loopc = loopc + 1.
do loopc times.
current_end = current_start + pack_size - 1.
refresh t_bkpf_small.
loop at t_bkpf2 from current_start to current_end.
append t_bkpf2 to t_bkpf_small.
endloop.
select apspnr posid psphi stufe usr10 usr11 aobjnr
belnr refbk refbn refgj blart zlenr wkgbtr
bukrs gjahr cpudt cputm
aworg awtyp kokrs ebeln ebelp buzei budat
gkont poski
<b>appending</b> corresponding fields of table t_covp3
<b>PACKAGE SIZE pack_size</b>
from prps as a inner join covp as b
on amandt = bmandt and aobjnr = bobjnr
inner join proj as c on
apsphi = cpspnr
for all entries in <b>t_bkpf_small</b>
where pspid in r_proj1 and
posid in s_posid and
( stufe = 4 or
stufe = 5 ) and
refbk = <b>t_bkpf_small-bukrs and
refbn = t_bkpf_small-belnr and
refgj = t_bkpf_small-gjahr.
current_start = current_start + pack_size.</b>
ENDdo.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |