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

select statement dump

Former Member
0 Likes
2,657

Hi,

Am getting dump with the below select statement in ECC 6.0,

where as the same select works fine in 4.7C.

SELECT distinct aebeln abukrs absart alifnr azterm aekorg aekgrp awaers awkurs akdatb akdate aunsez bebelp btxz01 bwerks blgort bbednr bmatkl bidnlf bmeins bbprme bnetpr bpeinh bknttp badrn2 csakto canln1 caufnr cgsber cps_psp_pnr detenr dlpein deindt dwemng dslfdt dmenge

INTO CORRESPONDING FIELDS OF TABLE it_output FROM

( ( ( ekko AS a INNER JOIN ekpo AS b ON aebeln = bebeln )

INNER JOIN ekkn AS c ON bebeln = cebeln and bebelp = cebelp )

INNER JOIN eket AS d ON cebeln = debeln and cebelp = debelp )

WHERE aebeln IN s_ebeln AND alifnr IN s_lifnr AND a~bukrs IN s_bukrs.

Whether I've to add anything addition for select distinct statement in ecc 6.0 or is it obsolette?

can oneone help in this regards?

Thanks,

Ponraj.s.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,351

Poonraj,

Please check out the declaration of it_output structure. There is definitely mismatch between selected fields and table declaration.

Specially for example: Check LGORT field, as if you would have declared it type LGORT then, LGORT itself is structure. you may have to delcare it as LGORT_D.

I hope this will help. otherwise, please provide code about how you define the it_output table.

Regards,

Mahesh

18 REPLIES 18
Read only

Former Member
0 Likes
2,351

Hi Ponraj,

Is it possible to break the three joins using "for all entries", check once.

Mohinder

Read only

ThomasZloch
Active Contributor
0 Likes
2,351

Please provide more info reg. the dump, especially title and section "error analysis".

Thomas

Read only

0 Likes
2,351

Please find the title of the dump,

Runtime Errors DBIF_RSQL_INVALID_RSQL

Exception CX_SY_OPEN_SQL_DB

Date and Time 04.08.2008 11:45:15

Error analysis

An exception occurred that is explained in detail below.

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

in

procedure "GET_OUTPUT_DETAILS" "(FORM)", nor was it propagated by a RAISING

clause.

Since the caller of the procedure could not have anticipated that the

exception would occur, the current program is terminated.

The reason for the exception is:

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

field provided.

I cant break the select statement inot multiple select,bcoz it was simply copied from 4.7C.

what could be the issue?

Thanks,

Ponraj.s.

Read only

0 Likes
2,351

Hi,

Check the below points

1. The selected fields in Select statement and the fields in the target internal table are mismatching.

2. may be field names are same but data type mismatch between the fields in select and internal table.

Regards,

Thirumaran

Read only

0 Likes
2,351

Hi,

This is only dev.server and it consists only few records.

TYPES: BEGIN OF ty_output,

*********Header data*****************************

rectype_line1(1) TYPE c,

rectype_line2(1) TYPE c,

rectype_line3(1) TYPE c,

rectype_line4(1) TYPE c,

ebeln TYPE ebeln,

bukrs TYPE bukrs, "Company Code

bsart TYPE bsart, "Documnet Type

lifnr TYPE lifnr,

zterm TYPE dzterm,

ekorg TYPE ekorg, "Purchase Org

ekgrp TYPE ekgrp, "Purchase grp

waers TYPE waers, "Currency

wkurs TYPE wkurs, "Exchange rate

wkurs1(9) TYPE c,

kdatb TYPE kdatb,

kdate TYPE kdate, "Validity end date

unsez TYPE unsez, "Our Reference

********Line item data***************************

ebelp TYPE ebelp, "po item

txz01 TYPE txz01, "Item Text

werks TYPE werks, "Plant

lgort TYPE lgort_d, "Storage Location

bednr TYPE bednr, "Tracking No

matkl TYPE matkl, "Material group

idnlf TYPE idnlf, "Vendor Material No

meins TYPE meins, "Order unit

bprme TYPE bprme, "Order price unit

netpr TYPE netpr, "Net price

netpr1(11) TYPE c,

peinh TYPE peinh, "Price unit

peinh1(5) TYPE c,

knttp TYPE knttp, "Acc Assgnment

adrn2 TYPE adrn2,

**************G/L Account data***********************

menge2(13) TYPE c, "PO Quantity

sakto TYPE sakto, "GL Acc No

anln1 TYPE anln1, "Main Asset number

aufnr TYPE aufnr, "Order Number

gsber TYPE gsber, "Business Area

ps_psp_pnr(8) TYPE c,

**********Item schedule data*******************************

etenr TYPE etenr,

lpein TYPE lpein, "Delivery date category

eindt TYPE eindt, "Delivery date

menge TYPE menge, "Schedule Quantity

menge1(13) TYPE c,

wemng TYPE wemng,

wemng1(13) TYPE c,

slfdt TYPE slfdt, "Start of Delivery date

END OF ty_output.

DATA : it_output TYPE STANDARD TABLE OF ty_output.

This is my table declaration,pls help me in resolving this issue.

Read only

Former Member
0 Likes
2,351

Hi,

Try to break the query into multiple select...use for all entries.

First on EKKO and EKEN and then for all entries on EKET.

Regards,

Amit R.

Read only

Former Member
0 Likes
2,351

HI,

Fields in the select statement and structure of internal table are mismatching....or declared wrong(data type and length...),

check them once..

Read only

Former Member
0 Likes
2,351

Hi,

This error occurs usually because of mis-spelled of fields in internal table and the one used in select statement,check thoroughly once again the statement and try to avoid such big join.

Thanks

Sudharshan

Read only

Former Member
0 Likes
2,351

Match the structure of it_output with all fields used in Joins.may be some of field in missing in it_output.

pls check

Amit.

Read only

Former Member
0 Likes
2,352

Poonraj,

Please check out the declaration of it_output structure. There is definitely mismatch between selected fields and table declaration.

Specially for example: Check LGORT field, as if you would have declared it type LGORT then, LGORT itself is structure. you may have to delcare it as LGORT_D.

I hope this will help. otherwise, please provide code about how you define the it_output table.

Regards,

Mahesh

Read only

0 Likes
2,351

Hi Guyz,

Thanks for your timing and replies.

I've checked the fields and data type, everything is perfect and moreover there cannot be any chance for mismatching,because the whole program is copied from 4.7 C and pasted .

It works perfectly in 4.7 C but gives dump in ECC6.0.

any guess?

Thanks,

Ponraj.s.

Read only

0 Likes
2,351

> any guess?

yes, one of the database table fields that you are reading has changed its definition from 4.7 to 6.0.

As the others have suggested already, post your internal table declaration here for further analysis. Or even better, do that analysis yourself on a field by field basis, comparing source and target field definition.

Thomas

Read only

0 Likes
2,351
Ponraj,
wrote:I've checked the fields and data type, everything is perfect and moreover there cannot be any chance for mismatching,because the whole program is copied from 4.7 C and pasted .

the only chance of mismatching is when you copy and paste because it consist a human work.

if you did't copy paste than am sure there is no chance fo mismatching.

Read only

Former Member
0 Likes
2,351

Ponraj,

I have tried the select statement in ECC6, and it works fine. Please provide the output table declaration statement.

Regards,

Mahesh Apte

Read only

Former Member
0 Likes
2,351

Hi ponraj,

1. One reason could be if there are MANY entries

in the select option(s) used in the sql query.

s_ebeln s_lifnr s_bukrs.

2. If there are many entries in any of the select option,

then the sql constructucted by the r/3 and sent to the

database becomes very long , exceeding the limits

for this database.

This happens bcos the sql constructed is similar like

and EBELN in ('1', '2', .......'500') etc.

regards,

amit m.

Read only

Former Member
0 Likes
2,351

Hi,

If we don't specify any input for select option then it will fetch all entries from the database table. The number of entries in the data base tables in which you are using this statement may be more. So it will take more amount of time to retrieve the data from all data base tables in which you are using in your select statement of join. Try to give some input for select options.

Thanks & Regards,

Rajani MV.

Read only

Former Member
0 Likes
2,351

Hi Gurus,

This has been resolved when I reassign the fields to

"ebelp like ekpo-ebelp" instead of "ebelp type ebelp" , am not getting dump anymore.

Thanks for youre replies.I've rewarded points.

Thanks,

Ponraj.s.

Read only

0 Likes
2,351

I had the same problem so solved. (Thanks for the update.) I think it's a bug in the ABAP processor - technical it should be the same. - If you declare it through the data type direct or using the table.