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

program terminated

Former Member
0 Likes
1,815

Hi all,

I have a RE program when i execute it i found run time error cause the retrieve data is too large

this is the run time error analysis

An exception occurred that is explained in detail below.

The exception, which is assigned to class 'CX_SY_OPEN_SQL_DB', was n

and

therefore caused a runtime error.

The reason for the exception is:

The SQL statement generated from the SAP Open SQL statement violates

restriction imposed by the underlying database system of the ABAP

system.

Possible error causes:

o The maximum size of an SQL statement was exceeded.

o The statement contains too many input variables.

o The input data requires more space than is available.

o ...

You can generally find details in the system log (SM21) and in the

developer trace of the relevant work process (ST11).

In the case of an error, current restrictions are frequently display

in the developer trace.

and this select statement it make a run time error

SELECT bkbldat bktcode zfserpc bkgjahr bkbelnr zfportf

FROM bkpf AS bk

INNER JOIN zrefidoc AS zf

ON bkbukrs = zfbukrs

AND bkgjahr = zfgjahr

AND bkbelnr = zfdocno

into TABLE gt_bkpf

WHERE zf~bukrs = p_bukrs

AND intreno IN intreno

and zf~portf in ps_portf.

thank's for your help.

regards,

Ahmed Elmasry

8 REPLIES 8
Read only

Former Member
0 Likes
1,032

HI,

Check the field sequence,length andf type in select statement and internal table both should match.

Read only

former_member404244
Active Contributor
0 Likes
1,032

Hi,

try with into corresponding fields of

SELECT bkbldat bktcode zfserpc bkgjahr bkbelnr zfportf

FROM bkpf AS bk

INNER JOIN zrefidoc AS zf

ON bkbukrs = zfbukrs

AND bkgjahr = zfgjahr

AND bkbelnr = zfdocno

into corresponding fields of TABLE gt_bkpf

WHERE zf~bukrs = p_bukrs

AND intreno IN intreno

and zf~portf in ps_portf.

also cehck the internal table structure gt_bkpf have all the fields that u r fecthing from db table..

Regards,

Nagaraj

Read only

Former Member
0 Likes
1,032

Hi Ahmed,

Just check the sequence of the fields in internal table and sequence in select statement is matching or not. Also check whether there types are similar or not..

Regards,

Nitin.

Read only

Former Member
0 Likes
1,032

Hi,

I too got the same error. This is because of the range which we use in select query. When the range is very high SAP cannot bulid the SELECT in NATIVE sql and throws this exception. For your select the problem may be because of the statement AND intreno IN intreno i am not sure, please check this one. The only solution is to have a FOR ALL ENTRIES instead of IN operator.

Hope this helps.

Thanks,

Srinath S

Read only

Former Member
0 Likes
1,032

I GET A SOLUTION

i used for all entries with another inernal table who retrieve all contracts and make a condition by intreno

select bkbldat bktcode zfserpc bkgjahr bkbelnr zfportf

from bkpf as bk

inner join zrefidoc as zf

on bkbukrs = zfbukrs

and bkgjahr = zfgjahr

and bkbelnr = zfdocno

into corresponding fields of table gt_bkpf

for all entries in gt_vicncn

where intreno = gt_vicncn-intreno

and zf~bukrs = p_bukrs

and zf~portf in ps_portf.

Read only

0 Likes
1,032

Hi,,

Its working because of the INTO CORRESPONDING FIELDS and not because of the FOR ALL ENTRIES...

Regards...!!..

Read only

0 Likes
1,032

>

> Its working because of the INTO CORRESPONDING FIELDS and not because of the FOR ALL ENTRIES...

Zero - I believe you analysis is essentially incorrect.

If you look at the dump, you'll see that it is complaining about the size of the WHERE, not the structure of the table.

Rob

Read only

Former Member
0 Likes
1,032

No No

i tried INTO CORRESPONDING FIELDS at first it make a run time error

but when i tried FOR ALL ENTRIES it run very good.

thank's for all