‎2008 Nov 27 11:56 AM
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
‎2008 Nov 27 11:58 AM
HI,
Check the field sequence,length andf type in select statement and internal table both should match.
‎2008 Nov 27 12:00 PM
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
‎2008 Nov 27 12:01 PM
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.
‎2008 Nov 27 1:28 PM
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
‎2008 Nov 27 2:06 PM
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.
‎2008 Nov 27 2:27 PM
Hi,,
Its working because of the INTO CORRESPONDING FIELDS and not because of the FOR ALL ENTRIES...
Regards...!!..
‎2008 Nov 27 3:06 PM
>
> 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
‎2008 Nov 27 3:57 PM
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