2006 Oct 09 10:21 AM
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
2006 Oct 09 10:28 AM
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.
2006 Oct 09 10:23 AM
2006 Oct 09 10:24 AM
2006 Oct 09 10:26 AM
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.
2006 Oct 09 10:26 AM
2006 Oct 09 10:28 AM
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.
2006 Oct 09 10:39 AM
HI,
may be the sturucture of ur internal table is diff compare to <b>cdhdr</b>.
Regards,
kishore.
2006 Oct 09 10:39 AM
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
2006 Oct 09 10:42 AM
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.
2006 Oct 09 10:44 AM
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.
2006 Oct 09 11:12 AM
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