‎2008 Oct 16 12:54 PM
Hi All,
I have written a SELECT statement as follows in my code.
select budat pernr aufnr vornr from AFRU
into corresponding fields of table it_vornr
for all entries in it_cats_tmp
where budat = it_cats_tmp-workdate
and pernr = it_cats_tmp-pernr
and aufnr = it_cats_tmp-rnplnr.
The table IT-CATS_TMP is having around 3000+ lines.
When control moves to this statement, the system is throwing Runtime error or its taking around 30 minutes time to execute.
If i query the same table (AFRU) in SE11 for the same set of conditions, the table displays relevent data immediately.
What might be the reason for this delay/Runtime Error?
Shall i need to change the syntax for better performance?
Your guidelines are highly appreciated......
Regards
Pavan
‎2008 Oct 16 12:56 PM
‎2008 Oct 16 12:56 PM
‎2008 Oct 16 12:58 PM
Hi
Don't use into corresponding fields .
insted of this define ITAB having only fields ur have written in select statement. and keep sequence in ITAB and SELECT similar.
like as u have now : budat pernr aufnr vornr
Regards
Sachin
‎2008 Oct 16 1:02 PM
what is the order of your fields in the internal table it_vornr
just show the definition of the it_vornr.
‎2008 Oct 16 1:06 PM
Always avoid using 'into corresponding fields' instead declare a internal table as your requirment including only the field in the table that you want as also said by others:
select budat pernr aufnr vornr from AFRU
into table it_vornr
for all entries in it_cats_tmp
where budat = it_cats_tmp-workdate
and pernr = it_cats_tmp-pernr
and aufnr = it_cats_tmp-rnplnr.With luck,
Pritam.
‎2008 Oct 16 1:06 PM
Hi
1. Try to put WHERE conditions for KEY FIELDS.
Solution: Create a RANGE for the key fields & put that in SELECT Query.
DATA: gr_rueck TYPE RANGES OF afru-rueck.
SELECT .. WHERE rueck IN gr_rueck.2. Avoid using CORRESPONDING FIELDS OF TABLE in SELECT.
Solution: Change internal table fields ORDER.
TYPES:
BEGIN OF TY_VORNR,
budat TYPE ..
pernr TYPE ..
aufnr TYPE ..
vornr TYPE ..
... " Other fields
END OF TY_VORNR.
SELECT .. INTO TABLE IT_VORNR ...
‎2008 Oct 16 1:06 PM
Hi pavan,
Do not use "INTO CORRESPONDING FIELDS".Instead use the following code ;-
select budat pernr aufnr vornr from AFRU
into table it_vornr
for all entries in it_cats_tmp
where budat = it_cats_tmp-workdate
and pernr = it_cats_tmp-pernr
and aufnr = it_cats_tmp-rnplnr.-Goodluck,
Bhumika
‎2008 Oct 16 3:51 PM
‎2008 Oct 16 4:28 PM
hi ,
chek ur internal table it_vornr . Should not be empty .
regards
Neetesh