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

Runtime error for select statment in COEP table

Former Member
0 Likes
3,375

select KOKRS

          BELNR

          BUZEI

         OBJNR

        WTGBTR

        WRTTP

        VERSN

FROM COEP INTO TABLE GT_COEP

FAE GT_PRPS

OBJNR EQ GT_PRPS1-OBJNR

AND WRTTP = '4'

vERSN = '0'.

SHOT DUMP--In select access,the read file could not be placed in the target firld provide. either the convesion is not supported for the type of target field,the target field is too small to include the value or the data doses not have the format required for the target field. I already check all the possible ways by which i can avoid it but still gatting the error.

Thanks,

Sam

16 REPLIES 16
Read only

Former Member
0 Likes
2,688

Hello,

check :

1. dataelement in database table match with your structure in se38????

2.

KOKRS

BELNR

  BUZEI

  OBJNR      

WTGBTR

WRTTP

VERSN

          these all fields are present in your structure???

3. your structure must be like that:

types: begin of ty,

KOKRS type data element,  -> this data element must be same with database....

BELNR type  "        "

  BUZEI

  OBJNR      

WTGBTR

WRTTP

VERSN

end of ty.

hope problem will be solved..

Thanks

SAbyasachi

Read only

Former Member
0 Likes
2,688

Hello..

do you use where clause in select statement???

select f1 f2 from <database table> into table it where f1 = '   '  and  f2 eq something...

Hope you understand....

Thanks

Sabyasachi

Read only

0 Likes
2,688

Hello Sabya,

1-data element is correctly match.

2-all field are same as str.

3-also same

Yes ,i mention where clause objnr eq gt_prps-objnr

in st22 the error point is starting of select statment.

i m Really confused ,i thing its problem with the memory of internal table .

Regard's

SAm

Read only

0 Likes
2,688

Hello,

    can you post your complete code??

Thanks

Sabyasachi

Read only

0 Likes
2,688

Hi,

It seems issue in the structure declaration.

Please check whether fields declared in structure are of the same data type or not?

Your structure should be like this.

TYPES: BEGIN OF TY_COEP,

               KOKRS     TYPE COEP-KOKRS ,

               BELNR      TYPE COEP-BELNR ,

               BUZEI        TYPE COEP-BUZEI ,

               OBJNR      TYPE COEP-OBJNR ,

               WTGBTR   TYPE COEP-WTGBTR ,

               WRTTP      TYPE COEP-WRTTP ,

               VERSN      TYPE COEP-VERSN ,

            END OF TY_COEP,

sometime due to copy paste some data type declaration mismatches and gives this error.

Regards,

Amit

Read only

uppu_narayan
Active Participant
0 Likes
2,688

hi sam rath,

    i didnt understand your code can you plz put the complete code together. try using "into corresponding fields of table"

thanks and regards,

narayan

Read only

0 Likes
2,688

Hello

use of "into corresponding fields of table" decreases performance......dont you know this????

Thanks

Sabyasachi

Read only

0 Likes
2,688

hi

    i know that use of into corresponding fields of table hits your performance, but then like it helps you identifying what exactly the problem can be............and as far as performance issue is concern it hits your performance only in the case of table with large number of entries and why sap would come up this sort of syntax..........

Read only

matt
Active Contributor
0 Likes
2,688

Sabyasachi Karforma wrote:

Hello

use of "into corresponding fields of table" decreases performance......dont you know this????

Thanks

Sabyasachi

Don't you know that this isn't necessarily the case. It used to be taught in the older courses, but nowadays is not - because the kernel is continually being improved.  For example, see this discussion here: https://scn.sap.com/thread/1714070

Read only

0 Likes
2,688

Hello

yess, thanks for your reply...but one more question to you that ..

types: begin of ty,

          f1 type char10,

          f2 type char15,

          end of ty.

data: it type standard table of ty initial size 0,

         wa type ty.

select f1 f2 from......

if we use this sequence in our coding then no need to use into corresponding fields of syntax..

if we maintain our sequence then no need to use of this statement.....

i think i am right......in one of my report i used into corresponding fields of....but when i delete this then i noticed that run time is decreases......for that reason am telling.......

Thanks

Sabyasachi

Read only

matt
Active Contributor
0 Likes
2,688

If you read the post I linked to you can see it isn't a hard and fast rule.

Read only

ThomasZloch
Active Contributor
0 Likes
2,688

Yes, please disclose how you declared GT_COEP, and post the actual code of the SQL statement. Anything else is just confusing.

By the way, here is some research about INTO CORRESPONDING:

Thomas

Read only

0 Likes
2,688

Hello ,

really its a very good documenent.......i appreciate your effort.... good Job thomas....

Thanks

Sabyasachi

Read only

0 Likes
2,688

Hello Thomas,

in your document what is the difference between point 1 and point 3 ??  any runtime issues between 2 cases?

Thanks

Sabyasachi

Read only

0 Likes
2,688

Hi All,

Thanks sabya,Thomas,matthewuppn,amit, issue solved.

Closed.

Read only

0 Likes
2,688

Point 3 was included just for completeness sake (it doesn't make much sense to use a field list, INTO CORRESPONDING and a target structure that contains just the selected fields). The main point was to show that there is no performance difference between 1 and 2.


Thomas