06-25-2007 3:58 PM
Hi Experts,
I hv SQL code like,
<i><b>1 - SELECT bname
INTO TABLE bname_itab
FROM vbak
WHERE ernam IN s_ernam
AND bname NE space
AND auart IN s_auart
AND vkorg IN s_org
and ktokd in s_c_ag
AND vtweg IN s_d_ch
AND spart IN s_div.
2 - SORT bname_itab.
3 - DELETE ADJACENT DUPLICATES FROM bname_itab.</b></i>
So, the 1st statement is, consuming much time, as there 1000's BNAMEs in VBAK.
So,
How to avoide selecting duplicates in the 1st SELECT statement itself?
I mean, only the new/differed BNAMEs shuld b selected!
(so, I dont use 2ns and 3rd stetents any more)
thanq.
06-25-2007 4:02 PM
06-25-2007 4:02 PM
06-25-2007 4:10 PM
Hi srikar,
To read a several entries from the database, use the following:
SELECT [DISTINCT] <cols> ... WHERE ...
If you do not use DISTINCT (<lines> is then empty), the system reads all of the lines that satisfy the WHERE condition. If you use DISTINCT, the system excludes duplicate entries.
The result of the selection is a table. The target area of the INTO clause can be an internal table with a line type appropriate for <cols>. If the target area is not an internal table, but a flat structure, you must include an ENDSELECT statement after the SELECT statement: