06-25-2008 2:54 PM
Hi,
how can I findout how many items there are
that means with abap code.
Show me the number of unique number ?
In this case we have 8 differntly items
and not 20 .
Rgds
Ertas
00000000000000000007
00000000000000000007
00000000000000000007
00000000000000000008
00000000000000000008
00000000000000000008
00000000000000000009
00000000000000000009
00000000000000000010
00000000000000000011
00000000000000000012
00000000000000000013
00000000000000000013
00000000000000000013
00000000000000000014
00000000000000000014
00000000000000000014
00000000000000000014
00000000000000000014
00000000000000000014
06-25-2008 2:56 PM
hi
frist sort this and
then use At New
let u have internal table itab1 and this fielr is Field1
now first
sort itab by field1
now
loop at itab
at new field1
PUt ur code here
endloop.
<REMOVED BY MODERATOR>
Cheers
Snehi
Edited by: snehi chouhan on Jun 25, 2008 3:57 PM
Edited by: Alvaro Tejada Galindo on Jun 25, 2008 4:39 PM
06-25-2008 2:56 PM
move data to another internal table
DATA W_LINES type n.
I_DATA2[] = I_DATA[]
SORT I_DATA
DELETE ADJACENT DUPLICATES FROM I_DATA COMPARING ALL FIELDS.
DESCRIBE TABLE I_DATA2[] LINES W_LINES.
06-25-2008 2:56 PM
hi
frist sort this and
then use At New
let u have internal table itab1 and this fielr is Field1
now first
sort itab by field1
now
loop at itab
at new field1
PUt ur code here
endloop.
<REMOVED BY MODERATOR>
Cheers
Snehi
Edited by: snehi chouhan on Jun 25, 2008 3:57 PM
Edited by: Alvaro Tejada Galindo on Jun 25, 2008 4:39 PM
06-25-2008 2:59 PM
Hi
u can use the command
delete adjacent duplicates comparing <the field name>
say for example your list contains sales order(vbeln) and item number(posnr)
and u need an uniqueue entry
use
sort <internal table> by vbeln posnr
delete adjacent duplicates comparing vbeln and posnr.
06-25-2008 3:02 PM
hi,
do this way ...
sort itab by <field>.
delete adjacent duplicates of itab comparing <field>.
describe table itab lines v_lines.
06-25-2008 3:02 PM
Hi Ertas,
Use mentioned code:
Loop at ITAB.
AT NEW PERNR.
WRITE:/ ITAB-PERNR.
ENDAT.
ENDLOOP.
<REMOVED BY MODERATOR>
Edited by: Alvaro Tejada Galindo on Jun 25, 2008 4:39 PM
06-26-2008 2:21 AM
Hi..
Delete adjacent dublicate entries from the table.
else use at new.
06-26-2008 4:57 AM
Hi,
We need to first sort all entries in internal table and then delete duplicates from that table.
Say F1 is the field.
SORT ITAB BY <F1>.
DELETE ADJACENT DUPLICATES OF ITAB COMPARING <F1>.
Hope this helps you.
Plz reward if useful.
Thanks,
Dhanashri.
06-26-2008 5:21 AM
First sort the internal table with a key and then delete adjacent duplicates from it.
06-26-2008 5:45 AM
Hi,
first create one variable with type i,
then use delete adjacent on the internal table.
then use describe statement to find number of records in that table.
ex:-
data:vlines type i.
delete adjacent duplicates from itab[] comparing all fields.
describe table itab lines v_lines.
Regards,
venkat n