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

dbtran ERROR (prepare_bulk_cond)

Former Member
0 Likes
848

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

4 REPLIES 4
Read only

Former Member
0 Likes
662

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 !

Read only

Former Member
0 Likes
662

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.

Read only

0 Likes
662

Correction: "dbtran ERROR (prepare_bulk_cond)"

Read only

former_member186741
Active Contributor
0 Likes
662

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.