02-22-2007 1:05 PM
Hi ,
can u pls let me know
DELETE ADJACENT DUPLICATES FROM i_mat.
this should be within the LOOP and Endloop.
02-22-2007 1:06 PM
Hi,
NO.
This should be out of Loop.
Just after selecting data into int table use this.
Regards,
Anji
02-22-2007 1:08 PM
Hi Prakash,
This is not with in the loop but you need to Sort the Internal table before using this Delete Adjacent Statment
Regards
Sudheer
02-22-2007 1:08 PM
<b>outside the loop.</b>
DATA OFF TYPE I.
DATA: BEGIN OF LINE,
COL1 TYPE I,
COL2 TYPE C,
END OF LINE.
DATA ITAB LIKE STANDARD TABLE OF LINE
WITH NON-UNIQUE KEY COL2.
LINE-COL1 = 1. LINE-COL2 = 'A'. APPEND LINE TO ITAB.
LINE-COL1 = 1. LINE-COL2 = 'A'. APPEND LINE TO ITAB.
LINE-COL1 = 1. LINE-COL2 = 'B'. APPEND LINE TO ITAB.
LINE-COL1 = 2. LINE-COL2 = 'B'. APPEND LINE TO ITAB.
LINE-COL1 = 3. LINE-COL2 = 'B'. APPEND LINE TO ITAB.
LINE-COL1 = 4. LINE-COL2 = 'B'. APPEND LINE TO ITAB.
LINE-COL1 = 5. LINE-COL2 = 'A'. APPEND LINE TO ITAB.
OFF = 0.
PERFORM LIST.
DELETE ADJACENT DUPLICATES FROM ITAB COMPARING ALL FIELDS.
OFF = 14.
PERFORM LIST.
DELETE ADJACENT DUPLICATES FROM ITAB COMPARING COL1.
OFF = 28.
PERFORM LIST.
DELETE ADJACENT DUPLICATES FROM ITAB.
OFF = 42.
PERFORM LIST.
FORM LIST.
SKIP TO LINE 3.
LOOP AT ITAB INTO LINE.
WRITE: AT /OFF LINE-COL1, LINE-COL2.
ENDLOOP.
ENDFORM.
02-22-2007 1:09 PM
Hi Prakash,
Try to use the Delete inside the select and endselect itself while getting the data into the internal table.
Regards,
Mallik.
02-22-2007 1:10 PM
hi prakash,
u need to write it outside loop....endloop.
example...
if not it_vbrk[] is initial.
delete adjacent duplicates from it_vbrk comparing vbeln.
endif.
regards,
priya.
02-22-2007 1:16 PM
Hi Prakash,
It should be before the loop and should have been sorted on the key fields that u r going to use in COMPARING clause.
Regards,
Phani.