‎2007 Apr 03 7:01 AM
hi experts:
in one case : select ** ** ** into table tab
from **
for all entries in t_tab
where ** = t_tab-**
and *** in ('1','2').
second case: select ** ** ** into table tab
from **
for all entries in t_tab
where ** = t_tab-**
and ' *** = '1' or ***= '2' '.
thirs case : select ** ** ** into table tab
from **
for all entries in t_tab
where ** = t_tab-**
and *** between '1' and '2'.
last case : select ** ** ** into table tab
from **
for all entries in t_tab
where ** = t_tab-**.
delete tab where *** > 2.
which case is the best??
Message was edited by:
chen xinrong
‎2007 Apr 03 11:30 AM
hi chen,
all these selects will be taking almost same time to execute. but the last case doesnt restrict the entires, ie it checks against only one field.the last case depends of the size of the table too.
and also check if the internal table (itab) has duplictae entries for the fields gefore using for all entries and check if the table is intial or not.
regards,
madhu
‎2007 Apr 03 7:19 AM
Hi,
Based on your requirement you can mention the where condition.
If u want the records which have that filed values both 1 and 2 then u should give
= 1 and
= 2.
If u want either 1 or 2 then
= 1 or
= 2.
If u don't want both 1 and 2 value records then
Delette t_tab where ******* = 1 and
= 2.
your using the forall entries os you should chekc the table t_tab have the data or not. Otherwise performance will go down.Better to not use 'NO' operator in select statement.
Hope this helps you, reply for queries, Shall post you the updates.
Regards.
Kumar. .
‎2007 Apr 03 7:19 AM
You can try it yourself by using transaction SE30 (Runtime analysis). Click on button "Tips and Tricks" and fill in the code and run it.
regards,
Hans
Please reward all helpful answers !!!!!
‎2007 Apr 03 7:21 AM
Hi,
I think the best is case one.
select ** ** **
into table tab
from **
for all entries in t_tab
where ** = t_tab-**
and *** in ('1','2').
But, please cek t_tab first:
Check t_tab[] is not initial.
Regards,
‎2007 Apr 03 11:30 AM
hi chen,
all these selects will be taking almost same time to execute. but the last case doesnt restrict the entires, ie it checks against only one field.the last case depends of the size of the table too.
and also check if the internal table (itab) has duplictae entries for the fields gefore using for all entries and check if the table is intial or not.
regards,
madhu