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: 

Short dump in Select statement

Former Member
0 Kudos
254

Hi All!

The following statement is giving a short dump because number of values in the ranges r_objectid is 6120

SELECT objectid

changenr

udate

FROM cdhdr

INTO CORRESPONDING FIELDS OF TABLE t_cdhdr

WHERE objectclas EQ 'EINKBELEG'

AND objectid IN r_objectid.

How to avoid this shortdump?

Thanks n Regards,

Harkamal

1 ACCEPTED SOLUTION

Former Member
0 Kudos
159

Hi,

There is limit in the where condition to process the select query.

Split your range and use in select appending the internal table.

Try this logic.

report test.

ranges : r_objectid for cdhdr-objectid,

r_objectid1 for cdhdr-objectid .

Data count type i.

data t_cdhdr like cdhdr occurs 0 with header line.

Loop at r_objectid into r_objectid1.

append r_objectid1.

count = count + 1.

if count >= 500.

SELECT objectid

changenr

udate

FROM cdhdr

appending CORRESPONDING FIELDS OF TABLE t_cdhdr

WHERE objectclas EQ 'EINKBELEG'

AND objectid IN r_objectid.

clear count.

endif.

endloop.

if count < 500.

SELECT objectid

changenr

udate

FROM cdhdr

appending CORRESPONDING FIELDS OF TABLE t_cdhdr

WHERE objectclas EQ 'EINKBELEG'

AND objectid IN r_objectid.

endif.

Hope this helps.

10 REPLIES 10

Former Member
0 Kudos
159

Maximum number of values shoulb be around 2500 only

anversha_s
Active Contributor
0 Kudos
159

hi,

there is a limit for number of entries in ranges

rgds

anver

Former Member
0 Kudos
159

Put the select under the TRY CATCH block like this :

data OREF type ref to CX_ROOT.

data TEXT type STRING.

try.

*select statement

endtry.

catch CX_ROOT into OREF.

TEXT = OREF->GET_TEXT( ).

if not TEXT is initial.

write / TEXT.

endif.

Former Member
0 Kudos
159

hi,

There is a limit to the no of entries in Ranges given in SELECT statement.

Check this link

Regards,

Sailaja.

Message was edited by: Sailaja N.L.

Former Member
0 Kudos
160

Hi,

There is limit in the where condition to process the select query.

Split your range and use in select appending the internal table.

Try this logic.

report test.

ranges : r_objectid for cdhdr-objectid,

r_objectid1 for cdhdr-objectid .

Data count type i.

data t_cdhdr like cdhdr occurs 0 with header line.

Loop at r_objectid into r_objectid1.

append r_objectid1.

count = count + 1.

if count >= 500.

SELECT objectid

changenr

udate

FROM cdhdr

appending CORRESPONDING FIELDS OF TABLE t_cdhdr

WHERE objectclas EQ 'EINKBELEG'

AND objectid IN r_objectid.

clear count.

endif.

endloop.

if count < 500.

SELECT objectid

changenr

udate

FROM cdhdr

appending CORRESPONDING FIELDS OF TABLE t_cdhdr

WHERE objectclas EQ 'EINKBELEG'

AND objectid IN r_objectid.

endif.

Hope this helps.

Former Member
0 Kudos
159

HI,

may be the sturucture of ur internal table is diff compare to <b>cdhdr</b>.

Regards,

kishore.

Former Member
0 Kudos
159

Hi,

try below logic,

1) sort t_objectid sign option low high.

2) delete adjacent duplicates from r_objectid comparing

all fields.

3) declare select-option :s_objectid fro cdhdr-objectid no-display.

s_objectid[] = r_objectid[].

SELECT objectid

changenr

udate

FROM cdhdr

INTO CORRESPONDING FIELDS OF TABLE t_cdhdr

WHERE objectclas EQ 'EINKBELEG'

<b>AND objectid IN s_objectid.</b>

<b>or</b>

loop at r_objectid.

SELECT objectid

changenr

udate

FROM cdhdr

INTO CORRESPONDING FIELDS OF appending TABLE t_cdhdr

WHERE objectclas EQ 'EINKBELEG'

AND objectid = r_objectid-low.

delete r_objectid.

endloop.

Regards

amole

Former Member
0 Kudos
159

Hi harkmal,

1. We can do like this.

Then it won't give error.

I usually do like this.

2. a) first select all records

(without filteration of r_objecid)

b) Then

Loop at t_cdhdr

if objecit not in r_objectid.

delete t_cdhdr.

endif.

endloop.

regards,

amit m.

Former Member
0 Kudos
159

Better option will be giving the date range in the selection screen and restricting the values accoring to that date range.

SELECT objectid

changenr

udate

FROM cdhdr

INTO CORRESPONDING FIELDS OF TABLE t_cdhdr

WHERE objectclas EQ 'EINKBELEG'

AND objectid IN r_objectid

<b>and UDATE in r_date.</b>

Regards,

Prakash.

Former Member
0 Kudos
159

Hi try this code

REPORT ztest10000.

TABLES: cdhdr.

DATA: BEGIN OF t_cdhdr OCCURS 0,

objectid TYPE cdhdr-objectid,

changenr TYPE cdhdr-changenr,

udate TYPE cdhdr-udate,

END OF t_cdhdr.

PARAMETERS: objectc LIKE cdhdr-objectclas.

PARAMETERS: objecti LIKE cdhdr-objectid.

RANGES: objectclass_range FOR cdhdr-objectclas OCCURS 1,

objectid_range FOR cdhdr-objectid OCCURS 1.

IF objectc IS NOT INITIAL.

MOVE: objectc TO objectclass_range-low.

objectclass_range-sign = 'I'.

IF objectc CA '*+'.

objectclass_range-option = 'CP'.

ELSE.

objectclass_range-option = 'EQ'.

ENDIF.

APPEND objectclass_range.

ENDIF.

***range for OBJECTID

IF objecti IS NOT INITIAL.

MOVE objecti TO objectid_range-low.

objectid_range-sign = 'I'.

IF objecti CA '*+'.

objectid_range-option = 'CP'.

ELSE.

objectid_range-option = 'EQ'.

ENDIF.

APPEND objectid_range.

ENDIF.

SELECT changenr INTO TABLE t_cdhdr FROM cdhdr WHERE objectclas IN objectclass_range AND

objectid IN objectid_range .

LOOP AT t_cdhdr.

WRITE: / t_cdhdr-objectid,

30 t_cdhdr-changenr.

ENDLOOP.

This code is working for me.

If helpful pls reward me points.

Regards

Manas Ranjan Panda