‎2007 Sep 28 9:40 PM
Hello Experts,
Please let me know after below select statement will be executed, will t_kdst table will have duplicate records. After this select statement do i need to sort the table and add delete adjacent statement?
SELECT VBELN VBPOS MATNR WERKS STLAN STLNR STLAL FROM kdst INTO CORRESPONDING FIELDS OF TABLE t_kdst
WHERE vbeln in order
and matnr in matnr
and vbpos in item
AND werks IN plant.
Regards,
Preeti
‎2007 Sep 28 10:16 PM
Hello Preeti,
Since you are selection all key fields (primary table key) you won't have duplicate entries in the internal table because the primary table key is always unique.
Only if you leave out one or more key fields on the selected fields list, you could get duplicate entries.
Regards,
Michael
‎2007 Sep 29 7:47 AM
Hi Preeti,
there won't be any duplicate records since your where claue is based on KEY fields...
so no need of sorting and adding adjacent duplicates...
hope this may be usefl...
please reward...
Regards,
Prashant
‎2007 Sep 29 9:55 AM
Preeti,
For the KDST table, a combination of 7 fields forms the primary key. In the Select query's where clause, u have taken only 4 fields of the primary key. Due to the rest of 3 fields, there is a possibility for existing of duplicate entries. Hence you have to use SORT as well as DELETE ADJACENT statement (if you are concerned about records with univque values of the where clause's 4 fields alone).
‎2007 Sep 29 11:14 AM
Hi Preeti,
As you are selecting all 7 primary keys, there is no chance of having duplicate entries in your internal table.
Each entry in the internal table would have a unique primary key combination.
Regards,
Pankaj Sharma
‎2007 Sep 29 4:50 PM
The problem is not <u>duplicate</u> entries; it is <u>missing</u> entries. But the answer is the same; if you are selecting all fields in the primary key, you will have no problem.
Rob