Application Development 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: 

error when inserting into a internal table

Former Member
0 Kudos

hello.

I get the fowolling error.

An exception occurred that is explained in detail below.

The exception, which is assigned to class 'CX_SY_OPEN_SQL_DB', was not caught

and

therefore caused a runtime error.

The reason for the exception is:

In a SELECT access, the read file could not be placed in the target

field provided.

Either the conversion is not supported for the type of the target field,

the target field is too small to include the value, or the data does not

have the format required for the target field.

I did a join of 5 table and it is inseting into an interal table wich tpye is al the fields that i am pulling from the other tables. can someone please help. thanks

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi david ,

Did you use INTO CORRESPONDING FIELDS OF TABLE ?

If you have not used that , use it or please send the code.

Regards

Pinaki

11 REPLIES 11

Former Member
0 Kudos

Hi david ,

Did you use INTO CORRESPONDING FIELDS OF TABLE ?

If you have not used that , use it or please send the code.

Regards

Pinaki

former_member585060
Active Contributor
0 Kudos

Hi,

Use INTO CORRESPONDING FIELDS OF TABLE it_itab as Pinaki sujjested, not just INTO TABLE it_itab.

Regards

Bala Krishna

Former Member
0 Kudos

Performance wise its not suggested to use CORRESPONDING FIELDS so better take care of the fields u are selecting into table by having the structure of internal table exactly like the fields u are selecting, in the same order.

ex:



types: begin of ty_vbap,
           vbeln  type vbeln,
           posnr type posnr,
          end of ty_vbap.

data: it_vbap type standard table of ty_vbap.

select vbeln posnr into table it_vbap from vbap where ...

кu03B1ятu03B9к

Former Member
0 Kudos

Hi David,

It seems like structure of internal table which you have declared is different than the fields which are getting fetched from Select...Join query.

If possible paste your internal table declaration and select....join query

thank you

Former Member
0 Kudos

Hi,

Please check the types of the fields in the declaration of an internal table.Also make sure the sequence of fields in the internal table is similar to the sequence of fields in select query.There might be mismatch in the sequence.

Edited By tejaswini Khante

Former Member
0 Kudos

This error comes because of if the int. table whta u definde and the fileds u r selecting is not matchinf.

So u can avoid this using,

1. from table Into corresponding fields of ,

or declare a struce of required fileds and itab of that structure

then selct the fileds in the same order from the db table into itab.

regards

Former Member
0 Kudos

Join on 5 tables , is not a good practice.

Try to avoid it and your problem will be solved.

Former Member
0 Kudos

Problem usually arise when their is a mis-match in some of the fields used in join.

may be due to different types in different tables.

matt
Active Contributor
0 Kudos

Unless you post the SELECT statement and the definition of the internal table, how can you expect specific help?

Former Member
0 Kudos

Hi,

Actually join amonmg more than 3 tables is not a good practice.

Try to avoid it.

And as a reason of this runtime error I can say that , The structure of the internal table which you are using as a target and the order of fields which you are fetching from 5 tables must not same.

please use this

Select -


into corresponding fields of

<internal-table name>

.

This will cdertainly solve your problem..

Former Member
0 Kudos

Hi David,

Let us know your select query and structure of internal table, then only we can help you in this.

From your explaination it seems that there are type mismatch between the selected fields and structure of internal table.