How to delete duplicates of some specific fields in internal table

i am having internal table of it_ekko.
in that i am having some data of PO no, Line Item,IR value and IR qty......
i am having data like below.
PO                        Line Item   IR Value    IR QTY 
200310051          0010         1500           4500
200310051          0010        1500           4500
200310052         0010           0                   0
200310052          0010       0               0
now where ever IR value and IR qty is present i wanted that to display only once against that PO and line item
i wanted like below
PO                        Line Item   IR Value    IR QTY 
200310051          0010         1500           4500
200310051          0010            0              0
200310052         0010             0                0
200310052          0010            0               0
Field names for IR value and IR Qty are Menge2 and dmbtr2.
How to do that.........
I cant use
Delete adjacent duplicates of it_ekko by ebeln = wa_ekko-ebeln and
                                                                      ebelp = wa_ekko-ebelp.
because i wanted that po and same line items , how many times it is like that only.....
in it_ekko table i only wanted to delete duplicates of menge2 and dmbtr2.
Pls suggest the code

sort itab by po item ascending.
loop at itab into wa.
at new wa-item.
if wa-qty1 ne 0 and wa-qty2 ne 0.
move wa to wa_final.
append wa_final to i_final.
endat.
endloop.
or
loop at itab into wa.
at new wa-item.
if wa-qty1 ne 0 and wa-qty2 ne 0.
write wa.
endat.
endloop.
make sure that the qty1 and qty2 is not character type , then in control statement it will replaced by *.

Similar Messages

  • How to add the contents of a field of internal table.

    Hello Everybody,
    How to sum up the individual field from a internal table. Like i have a internal table that has menge field , I need to sum up the menge field for each matnr..
    exm : for each matnr there are 5 menge entries, I need to add all the menge fields and shud be put against the matnr .
    Thanks,

    Hi Khaleel,
    One more option is using the "collect" statement.....
    imagine in the internal table itab..we have 2 fields only..
    MATNR,MENGE,
    we have 2 internal tables itab1 and itab2...
    loop at itab1.
    collect itab1 to itab2.
    endloop.
    Action performed is ...for the same MATNR...menge gets added and saved as a single record...When matnr changes...new record is Appended
    another case is we have 3 fields in internal table
    MATNR,UNIT,MENGE
    imagine we hane the records
    Material1 KG  100
    Material1 LT   20
    Material1 LT   200
    MAterial2 KG 100
    in this case...the output will be
    Material1 KG 100
    Material1 LT  220
    MAterial2 KG 100
    Reason is that the fields before the addable value is checked for similarity..
    here field UNIT is also checked and also MATNR before adding up....
    Hope it gave you some alternative idea to proceed with....
    Reward if helpful
    Regards
    Byju

  • How to delete duplicate value in movement type 541 & 542(alv report)

    hi experts,
    i have some problem in alv report,
    input we can give some movement type for ex(101,102,541,542, etc)
    how to delete duplicate value in 541 and 542.
    regards
    gunasekaran.

    Try:
    Delete adjacent duplicates from ITAB comparing FIELD1, FIELD2.
    to do this the ITAB must be Sorted first.!

  • How to delete duplicate photos on ipod touch, NOT in camera roll

    how to delete duplicate photos on ipod touch, NOT on camera roll

    What do you mean?
    Do you have duplicates in one album? If so how did that album get on the iPod?
    If yo mean yo have them in different albums then what specific albums and how did those albums get on the iPod?

  • Does anyone know how to delete duplicate photographs will it affect photostream

    Does anyone know how to delete duplicate photographs I seem to have so many, is this anything to do with photostream as I have an ipad as well. I have over 7000 photos and find it impossible to find them all. When I first got Apple 9 years ago there was a drop down menu that found all duplicates which you could then delete but that was taken off at some point. I would be really gratful for some help i am not savvy with the technical side of computing.

    For dealing with duplicates in iPhoto check out Duplicate Annihilator or Decloner or iPhoto Duplicate Cleaner or  iPhoto Library Manager

  • My family put multiple devices on the icloud, and I need to know how to manage duplicate entries.  Specifically contacts.  If I fix the contact list on my pc will it push the info out to the other devices and maintain it correctly?

    My family put multiple devices on the icloud, and I need to know how to manage duplicate entries.  Specifically contacts.  If I fix the contact list on my pc will it push the info out to the other devices and maintain it correctly?

    All devices signed into the same iCloud account will finish up with the same contacts. Of course if prior to joining iCloud two family members each had an entry for Uncle Fred, then you will finish up with two contact cards for Uncle Fred, and so on. If you tidy this up on your computer then the changes will propagate to everyone else.

  • How to delete duplicate records in 10 G.

    how to delete duplicate records in 10 G.

    --Here is one way to do it using a second table 
    create table temp1
    (col1 char(1));
    --Table created.
    insert into temp1 (col1) values('A');
    insert into temp1 (col1) values('B');
    insert into temp1 (col1) values('B');
    --1 row created.
    --1 row created.
    --1 row created.
    create table temp2 as select distinct * from temp1;
    --Table created.
    --now you have a second table with no duplicates
    --truncate your old table
    truncate table temp1;
    --Table truncated.
    --and reload it with data from the new table
    insert into temp1 select * from temp2;
    --2 rows created.
    --then drop the temp2 table
    drop table temp2

  • HT204406 How to delete duplicate songs from Libary without deleting them from play list or other devices

    How to delete duplicate songs from libary without deleting them from playlist or other devices

    I'm with you verm71; it's not entirely clear how Apple is expecting you to manage this.  I'm going on vacation soon and want to clean up my phone so that it's nice and empty for the new pictures.  There doesn't seem to be a way to do this without losing your pictures in the new Photos as well.  If imported, it's impossible to see which is the Cloud version and which is the Local version.  It's very annoying.
    I've also noticed in iPhoto you used to have the ability to locate the original of the picture inside the photo database.  That option is not provided in Photos, making finding the original extremely difficult.
    It seems to be a great, well-oiled system.  But I would love to know how Apple envisions the typical workflow for archiving...

  • How to delete duplicate pictures from Photo Library

    How to delete duplicate pictures from Photo Library in iPhone 3G 16 giga?

    The only way to delete photos from the photo library is by the same way the photos were transferred to your iPhone - via the iTunes sync process.
    Are you saying a photo or all photos transferred to your iPhone via the iTunes sync process are duplicated in your iPhone's Photo Library without being duplicated in the folder on your computer where these photos are stored?

  • How to Delete duplicates rows without using rowid/distinct.

    How to delete duplicates rows present in a table without using rowid or even distinct.

    How about:
    SQL> SELECT * FROM t1;
             A          B
             1          2
             2          3
             1          2
             4          4
             4          4
             4          4
    SQL> DELETE FROM t1
      2  WHERE (a, b) IN (SELECT a, b FROM t1
      3                   GROUP BY a, b
      4                   HAVING COUNT(*) > 1) and
      5        rownum = 1;
    1 row deleted.
    SQL> /
    1 row deleted.
    SQL> /
    1 row deleted.
    SQL> /
    0 rows deleted.
    SQL> SELECT * FROM t1;
             A          B
             2          3
             1          2
             4          4Although, if I was asked a similar question with all those restrictions, my first response would be along the lines of: Is this question indicative of the way I will have to work if I join this company? If so, there is no point answering because I wouldn't touch this job with a ten foot pole.

  • HT5043 How to delete duplicate photos

    how to delete duplicate photos in iphoto

    iPhoto has no built-in duplicate detector. You can spot duplicates by sorting your photos by title or date, or use third-party applications like iPhoto Library Manager, Duplicate Annihilator, Photo Sweeper.
    Old Toad has published a great list of apps that can screen your iPhoto Library for duplicates, see this link:
    Re: How can I search for duplicate photos in iPhoto libraries?
    My favourite is Photo Sweeper, because it lets me stay in control of what will be deleted, shows all metadata, lets me define the criteria for marking duplicates, and can recognise duplicates of different sizes, based on histograms or pixel maps.  PhotoSweeper

  • How can i find duplicate rows in a field of a table

    hi all,
    how can i able to find duplicate values in a field of a table????
    Regards

    test@ORA92>
    test@ORA92> with x as (
      2    select 1 as p, 'a' as q from dual union all
      3    select 1 as p, 'b' as q from dual union all
      4    select 2 as p, 'c' as q from dual union all
      5    select 3 as p, 'd' as q from dual union all
      6    select 3 as p, 'e' as q from dual union all
      7    select 3 as p, 'd' as q from dual
      8  )
      9  select p, q,
    10  case row_number() over (partition by p order by q)
    11    when 1 then null
    12    else 'Duplicate value: '||p||' of column p'
    13  end as msg
    14  from x;
             P Q MSG
             1 a
             1 b Duplicate value: 1 of column p
             2 c
             3 d
             3 d Duplicate value: 3 of column p
             3 e Duplicate value: 3 of column p
    6 rows selected.
    test@ORA92>
    test@ORA92>
    test@ORA92>cheers,
    pratz

  • How to delete duplicate E-MAIL addresses in "TO" on top of new message

    How to delete duplicate E-MAIL addresses in the "TO" box on the top of the new mewssage file

    Hi Steven,
    Highlight one & hit Delete key.

  • Comparing workareas excluding some specific fields

    Hi all gurus,
    a silly question, I know, anyway: in my requirement I have to compare different workareas in a loop cycle with a model workarea. The aim is to identify if a workarea in a loop differs from the model workarea except for some specific fields.
    In example; the workarea A has 100 fields, and I assume that this workarea is equal to the model one (B)  if all the fields in A contain the same value that corrisponding field have in B except for fields 'guid' and 'p_guid', which can contain different values.
    So, A is EQ to B if the other 98 fields are filled with the same values.
    Actually I can build a sequence of comparing condition:
    IF A-field1 EQ B-field1 AND A-field2 EQ B-field2 ...
    that's quite time-wasting and I wonder if there's a better solution to compare in the above described way.... a sort of exclusion for the compare operation maybe?
    Sorry, I get that this is probably a very basic question, anyway I searched a bit without results.
    Thanks in advance.

    If you could change the definition of data type then this comparision can be done in single statement.
    See example below.
    TYPES : BEGIN OF ty_d ,
              col01 TYPE char01 ,
              col02 TYPE char01 ,
              col98 TYPE char01 ,
            END OF ty_d .
    TYPES : BEGIN OF ty_dd .
    INCLUDE TYPE ty_d AS d .    "this will enable to refer all COL01.. COL98 by name 'd'
    TYPES : guiid TYPE char05 ,
    END OF ty_dd .
    DATA : ls_dd1 TYPE ty_dd ,
           ls_dd2 TYPE ty_dd .
    ls_dd1-col01 = 'A' .
    ls_dd1-col02 = 'B' .
    ls_dd1-col98 = 'C' .
    ls_dd2-col01 = 'A' .
    ls_dd2-col02 = 'B' .
    ls_dd2-col98 = 'C' .
    IF ls_dd1-d = ls_dd2-d .
      WRITE 'EQUAL' .
    ELSE.
      WRITE 'NOT EQUAL'.
    ENDIF.
    ls_dd2-col01 = 'D' .
    IF ls_dd1-d = ls_dd2-d .
      WRITE / 'EQUAL' .
    ELSE.
      WRITE / 'NOT EQUAL'.
    ENDIF.

  • How to move field symbol internal table to internal table with header line?

    Dear all,
    hi...hereby i would like to ask how i can move field symbol internal table to a internal table?
    as i know field symbol internal table is without header line..
    so, may i know how to do this....to move field symbol internal table to internal table which consist of header line and field and record will same as field symbol internal table...in additional, my field symbol internal table is dynamic table mean everytime will have flexible columns..?
    Please advise...
    Thanks
    Regard,
    ToToRo.
    Edited by: @ToToRo@ on Aug 20, 2009 6:16 AM

    Hello,
    Try this way:
    If both the type of internal tables are same then you can directly assign dynamic internal table to static internal table.
    itab = <itab>.
    Suppose you have field symbol internal table <itab> which is different in structure from ITAB.
    Now, you can create <wa> as follow:
    FIELD-SYMBOLS <wa>.
    DATA wa TYPE REF TO DATA.
    CREATE DATA wa TYPE LINE OF <itab>.
    ASSIGN wa->* to <wa>.
    This way your work area is read.
    Using [ASSIGN COMPONENT|http://help.sap.com/saphelp_nw04/helpdata/EN/fc/eb3923358411d1829f0000e829fbfe/content.htm] syntax you can read required component of <wa>.
    Finally you can use that value to load static internal table.
    You can also refer to my thread on [Dynamic table|Re: Creating Dynamic table].
    Hope this helps!
    Thanks,
    Augustin.
    Edited by: Augustarian on Aug 20, 2009 10:06 AM

Maybe you are looking for

  • Combinding Resources in the FIM Portal Navigation Bar

    We have two different OUs for computers in our AD that have the same attributes. Server and Workstation, there is no attribute that indicates if the computer is a server or a workstation. My solution was to create two different MAs, AD Server MA and

  • New BlackBerry Desktop Manager software for Mac

    Let me know if there is a better "BlackBerry" forum to ask these questions -- but just wondering if this software will backup Address Book on my Mac to my BlackBerry without erasing everything I've already entered into the Blackberry by hand the past

  • Help: Enforce phone number format through DB trigger

    Hi, I am trying to create a trigger in DB that will alter any phone number insert or update into a standard format as (xxx) xxx-xxxx. For example, 1. if user attempts to insert 123-456-7890, the trigger will alter it as (123) 456-7890 2. if user atte

  • How to get IUserContext from IUser ?

    Hello All, I am trying to get the IUserContext object from IUser object. I found a very easy method com.sapportals.portal.prt.session.IUserContext userContext= request.getUser(); which will give IUserContext object. What I am trying to do is to get t

  • External services - IV before GR

    Hi gurus, we need to deactivate the GR-Based Invoice Verification (GR-bsd IV) in a purchase order with External Services because we need to do IV before GR. The system doesn't allows to uncheck this field and returns this message: Service-based invoi