‎2006 Nov 30 12:30 PM
Hi Experts,
How can I write a select Statement to select all the fields from REGUP.
With distinct Vendor nos ( LIFNR ) and the condition must check the Addition field LAUFI = XXXX.
Thanks & Regards
Rajendra
‎2006 Nov 30 12:34 PM
Hi
Try as below.
select distinct *
from REGUP
into table itab
where LAUFI = XXXX.
‎2006 Nov 30 12:36 PM
select * from REGUP into itab where LAUF1 = 'XXXX'.
Sort itab by LIFNR.
delete adjacent duplicates from itab comparing LIFNR.
‎2006 Nov 30 12:36 PM
SELECT DISTINCT * FROM REGUP INTO TABLE ITAB WHERE LAUF1 = 'XXXX'.Message was edited by:
chandrasekhar jagarlamudi
‎2006 Nov 30 12:36 PM
hi,
u can use select distinct.
performance wise.
select * from regup into table t_regup where lauf1 = 'XXXX'.
DELETE ADJACENT DUPLICATES FROM t_regup comparing lifnr.
santhosh
‎2006 Nov 30 12:39 PM
Hi,
you can use a select distinct statement (check abap help for examples)
But this would probably be performance unfriendly for the database.
It's probably faster to just select into table.
and place the logic for finding unique lifnrs in the loop.
Or what I always do is download the content of the table to excel and use excel to search for unique records.
Kind regards, Rob Dielemans
‎2006 Nov 30 12:39 PM
Rajendra,
you have no other way. you have to select all the data and use Delete adjacent duplicates. don't forget to sort before using delete adjacent duplicates.
and Option DISTINCT is ruled out on Pooled and cluster tables. since REGUP is not transparent table.
Regards
Vijay
‎2006 Nov 30 12:40 PM
Hi Rajendra,
I think there is no way to have this in a single statement.
The simplest way is to select all rows with condition LAUFI = XXXX.
& thereafter DELETE ADJACENT DUPLICATES...
‎2006 Nov 30 12:41 PM
Hi,
Use this statement
select * from REGUP into table t_regup where lauf1 = 'XXXX'.
Sort itab by lifnr.
delete adjacent duplicates from t_regup comparing LIFNR.
Regards,
Kumar