Internal table - how to find double entries ?

HI,
im using an internal table with
field1
field2
field3
field4
field5
where field1 and field2 are key fields.
how can i find out duplicate(same key) entries with a select or read or loop?
thx,
gordon

hi
declare one more table of like that
as
let the table u have is tab1
now
data: record type i.
sort tab1 by field1 field2.
loop at tab1.
record  = sy-index +1.
read table tab1 from index record where key field1 =  tab1-field1
and
field2 =  tab1-field2.
if sy-subrc = 0
write : 'This is duplicate record'.
endif.
endloop.
Cheers
Snehi

Similar Messages

  • How to find latest entry in the table according to time

    how to find latest entry in the table according to the time
    is there any function module to do so
    \[removed by moderator\]
    Regards
    Shashi
    Edited by: Jan Stallkamp on Aug 25, 2008 4:39 PM

    Hi,
    If you want to read the entry from an internal table,
    sort the internal table in the descending order by the time and
    delete adjacent duplicates by comparing the fields other than time and the internal table will have the latest record.
    Suggestion: instead of only time try to have one more field called date with the time combination
    Regards,
    Ramesh

  • How to print a graph in which internal table has more than 32 entries?

    hiii experts
    i am trying to make a line graph using 'gfw_pres_show' function module.
    but in report internal table has more than 32 entries
    so how can i print a graph having more than 32 entries?

    Hi ricky_lv,
    According to your description, there is main report and subreport in it, when the subreport spans across multiple pages, you want to show column headers on each page. If that is the case, we can set column headers visible while scrolling in main report.
    For detail information, please refer to the following steps:
    In design mode, click the small drop down arrow next to Column Groups and select Advanced Mode.
    Go to your Row Groups pane, click on the first static member.
    In properties grid, set FixData to True.
    Set RepeatOnNextPage to True.
    Here is a relevant thread you can reference:
    https://social.technet.microsoft.com/Forums/en-US/e1f67cec-8fa3-4c5d-86ba-28b57fc4a211/keep-header-rows-visible-while-scrolling?forum=sqlreportingservi
    The following screenshots are for your reference:
    If you have any more questions, please feel free to ask.
    Thanks,
    Wendy Fu
    If you have any feedback on our support, please click
    here.
    Wendy Fu
    TechNet Community Support

  • In which table we can find service entry sheet no to find the actual cost

    In which table we can find service entry sheet no to find the actual cost of External service
    Service code,     Service description      Quantity     UOM,     Vendor,     Cost

    Hi,
    Total Actual Material Cost - Sum up the total cost ENWRT against the AUFNR in the table RESB and display in the report
    Total Actual External Service Cost - Provide the field AUFNR in the table EKKN and get the Purchasing document field EBELN & apply this field data in table EKPO get field NETPR and display in the out put
    For link between operation & order - Selection criterion is the order number (Field AUFNR table AUFK). The content of field AUFPL has to be used afterwards as selection criterion in the table AFVC. The selection field in this table is again AUFPL and display the field LTXA1..
    Kuber

  • Why we need internal tables how it has its own significance for its purpose

    we can maintain tables in oracle also and some other features .but how internal tables differ from them in its functioning

    u2022 In ABAP/4, you work mainly with tables. Tables are the essential data structures in the R/3 System. Long-life data is stored in relational database tables.
    u2022 Besides database tables, you can create internal tables which exist only during the runtime of your program. ABAP/4 provides various operations for working with internal tables. You can, for example, search for, append, insert, or delete lines.
    u2022 The number of lines in an internal table is not fixed. Depending on requirements, the system increases the size of internal tables at runtime.
    u2022 You can use internal tables to perform table calculations on subsets of database tables. For example, you can read a certain part of a database table into an internal table (see Reading Data into an Internal Table).
    From the internal table, you can then calculate totals or generate a ranked list.
    In ABAP/4, you can distinguish between internal table data types, which define the structure of internal tables, and internal table data objects, which are the actual internal tables and can be filled with data. An internal table data type is an abstract definition of a data structure which can be used to declare data objects as internal tables.
    u2022 Another use for internal tables is reorganizing the contents of database tables according to the needs of your program. For example, you can read data relevant for creating a telephone list from one or several large customer tables into an internal table. During the runtime of your program, you can then access this list directly without having to perform a time-consuming database query for each call.
    Table type
    The table type determines how ABAP will access individual table entries. Internal tables can be divided into three types:
    Standard tables have an internal linear index. From a particular size upwards, the indexes of internal tables are administered as trees. In this case, the index administration overhead increases in logarithmic and not linear relation to the number of lines. The system can access records either by using the table index or the key. The response time for key access is proportional to the number of entries in the table. The key of a standard table is always non-unique. You cannot specify a unique key. This means that standard tables can always be filled very quickly, since the system does not have to check whether there are already existing entries.
    Sorted tables are always saved sorted by the key. They also have an internal index. The system can access records either by using the table index or the key. The response time for key access is logarithmically proportional to the number of table entries, since the system uses a binary search. The key of a sorted table can be either unique or non-unique. When you define the table, you must specify whether the key is to be UNIQUE or NON-UNIQUE. Standard tables and sorted tables are known generically as index tables.
    Hashed tables have no linear index. You can only access a hashed table using its key. The response time is independent of the number of table entries, and is constant, since the system access the table entries using a hash algorithm. The key of a hashed table must be unique. When you define the table, you must specify the key as UNIQUE.
    I hope it helps.
    Have a look at below link for details:
    [Internal Tables|http://help.sap.com/saphelp_nw70/helpdata/en/fc/eb35de358411d1829f0000e829fbfe/frameset.htm]
    Best Regards,
    Vibha
    Please mark all the helpful answers

  • EMERGENCY: Need to flashback table, how to find SCN for a time before update happened?

    Hi all,
    I've got a new database 11G, I've not used flashback before, but my retention time is a day...I have a time that the developer did a massive update to a table to corrupt it.
    How do I find the SCN for that time so I can attempt to flashback that table?
    Thank you,
    cayenne

    Thank you..I also found this works:
    SQL> select timestamp_to_scn(to_timestamp('20140103152000','YYYYMMDDHH24MISS')) scn from dual;
           SCN
      98344246
    Well that might NOT work all of the time. But that is just what Oracle does when you give it a timestamp to flashback to: it converts the timestamp to an SCN and then restores data based on that SCN.
    See Flashback Table in the SQL Language doc
    http://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_9012.htm
    TO TIMESTAMP Clause
    Specify a timestamp value corresponding to the point in time to which you want to return the table. The expr must evaluate to a valid timestamp in the past. The table will be flashed back to a time within approximately 3 seconds of the specified timestamp.
    That 'approximately 3 seconds' accuracy is due to that conversion to SCN - Oracle uses its internal table.
    SCN is accurate if you know it but you usually don't.
    Read, and heed, these warnings in the advanced app dev guide
    http://docs.oracle.com/cd/B28359_01/appdev.111/b28424/adfns_flashback.htm
    Guidelines for Oracle Flashback Query
      If a possible 3-second error (maximum) is important to Oracle Flashback Query in your application, use an SCN instead of a timestamp. See General Guidelines for Oracle Flashback Technology.
    General Guidelines for Oracle Flashback Table
      To query past data at a precise time, use an SCN. If you use a timestamp, the actual time queried might be up to 3 seconds earlier than the time you specify. Oracle Database uses SCNs internally and maps them to timestamps at a granularity of 3 seconds.
         For example, suppose that the SCN values 1000 and 1005 are mapped to the timestamps 8:41 AM and 8:46 AM, respectively. A query for a time between      8:41:00 and 8:45:59 AM is mapped to SCN 1000; an Oracle Flashback Query for 8:46 AM is mapped to SCN 1005.
         Due to this time-to-SCN mapping, if you specify a time that is slightly after a DDL operation (such as a table creation) Oracle Database might use an SCN      that is just before the DDL operation, causing error ORA-1466.

  • If empty internal table in select for all entries what is the result?

    In select all entries statement , if empty internal table is there then  what is the result.

    Hello,
    If the table is empty then it will select all the records table....
    To aviod this u have check the body of the itab.
    If not itab[] is intial.
    select * ....
    endif.
    I useful reward.
    Vasanth

  • Internal table oerations using for all entries

    Hi folks
    I want to display an output of
    SO number, SO Date( from VBAK) ,
    SO Item, SO item category (from VBAP) ,
    MAterial no., MAt type (from MARA)
    Using 3 internal tables for each table fields and applying FOR ALL ENTRIES and populating a final output table say I_output.
    Can u please give me a SAMPLE CODE on this.
    I wont forget to reward points
    Regards,RAM

    hi
    pls see the following code...
    DATA: BEGIN OF it_vbak OCCURS 0,
          vbeln TYPE vbeln,
          erdat TYPE sy-datum,
          END OF it_vbak,
          BEGIN OF it_vbap OCCURS 0,
          vbeln TYPE vbeln,
          posnr TYPE posnr,
          matnr TYPE matnr,
          pstyv TYPE pstyv,
          END OF it_vbap,
          BEGIN OF it_mara OCCURS 0,
          matnr TYPE matnr,
          mtart TYPE mtart,
          END OF it_mara,
          BEGIN OF it_final OCCURS 0,
          vbeln TYPE vbeln,
          erdat TYPE sy-datum,
          posnr TYPE posnr,
          matnr TYPE matnr,
          pstyv TYPE pstyv,
          mtart TYPE mtart,
          END OF it_final.
    SELECT vbeln erdat INTO TABLE it_vbak FROM vbak.
    IF NOT it_vbak[] IS INITIAL.
      SELECT vbeln posnr matnr pstyv INTO TABLE it_vbap FROM vbap
      FOR ALL ENTRIES IN it_vbak WHERE vbeln = it_vbak-vbeln.
      IF NOT it_vbap[] IS INITIAL.
        SELECT matnr mtart INTO TABLE it_mara FROM mara
        FOR ALL ENTRIES IN it_vbap WHERE matnr = it_vbap-matnr.
      ENDIF.
    ENDIF.
    LOOP AT it_vbak.
      MOVE-CORRESPONDING it_vbak TO it_final.
      LOOP AT it_vbap WHERE vbeln = it_vbak-vbeln.
        READ TABLE it_mara WITH KEY matnr = it_vbap-matnr.
        MOVE-CORRESPONDING it_vbap TO it_final.
        MOVE-CORRESPONDING it_mara TO it_final.
        APPEND it_final.
      ENDLOOP.
    ENDLOOP.
    thx
    pavan
    **pls reward for helpful answers

  • Using 3 internal table how we will create join

    how we will make join by takin data from 3 internal table , plz tell me in details?

    assume that 3 itabs have a common fld1 
    and we r joining all3 into 4th ,  itab4
    loop itab1.
    read table itab2 with key fld1 = itab1-flad1.
    read table itab3 with key fld1 = itab1-flad1.
    move corresponding fields from itab1 to itab4.
    move corresponding fields from itab2 to itab2.
    move corresponding fields from itab3 to itab2.
    append itab4
    clear itab1, itab2 itab3, itab4.
    endloop
    now itab4 contains all the join flds
    Reward if useful

  • Process chain tables - how to find process chains

    I have an info cube; I want to know what are the process chains that are loading data into this info cube; how to find it using the tables? I want to know the specific rspc table to get this information
    thanks
    rajan

    Hello,
    RSPCCHAIN   Process chain details
    use this table ..
    Regards,

  • How to find the entries of component windows?

    Hello together!
    I have a problem. I built up a new ui component with several windows and views. But there was an issue with one of my new windows. After creating a new one it was not displayed in the list of the component structure browser. So I decided to create it again. That was the fault, but the issue was the same - not displayed. So I closed all of my gui windows and opened a new one. After accessing to the component browser for my individual component via /nbsp_wd_cmpwb I got a dump!
    ITAB_DUPLICATE_KEY
    Now there are two entries with the same key.
    So I want to find those entries in order to delete die second one, but where can I find it?
    Thank you very much!
    Marcus

    Fixed it!
    Found it with transaction SE80, BSP Appl 'MyBSP..'.
    Deleted the line in the XML File.
    Now it works fine!

  • How to find delete entries in custom table

    Hi,
    We have a custom table with table maintenance in Production. Some one deleted all the entries from the table. Can you please let me know how to retreive the old entries from the table and how to check who deleted the entries.
    Thanks
    Rama

    hi rama,
    Please refer to the below given link,
    [http://help.sap.com/saphelp_nw70/helpdata/en/43/0510abcda521abe10000000a1553f6/content.htm]
    I think it will sove ur problem,
    Reward points if usefull,
    Thanks,
    Kalyan.

  • ASE 15.7 how to find data entry using table page nr

    Hi,
    I am looking for a dbcc () to get data when I know page number from a table
    Thank you

    Hi Isabella,
    What your asking is not supported by SAP .. although you can achieve the result by using dbcc page:
    http://wiki.scn.sap.com/wiki/display/SYBASE/DBCC+page
    The only problem is that the data is in binary format so you have to format it by yourself to a readable format.
    Regards,
    Adam

  • ADF table: How to find out which rows were modified by the user

    Hi,
    I am using ADF table to display data that can be modified by the user (ReadOnly = false in the input text). I need to find out which rows were modified by the user, and only update (persist) those rows in the database.
    Is there an easy way to find out which rows were modified by the user.
    I am NOT particularly concerned with which columns were modified as I would update the entire row (if any data in that row is modified).
    I am using Oracle JDeveloper version 11.1.1.3.
    Thanks,
    Ash K

    Thanks Timo.
    I am using ADF Data Control (which are created from Web Service proxy) to display/update the data.
    In the backing bean, the operation that is invoked at the time persisting data is as follows:
    public void commitOperation {
    BindingContainer bindings = getBindings();
    OperationBinding operationBinding = bindings.getOperationBinding("operationA");
    DCIteratorBinding dciter = (DCIteratorBinding)bindings.get("someIterator");
    for(int i=0; i<dciter.getViewObject().getEstimatedRowCount(); i++)
    Row row=dciter.getRowAtRangeIndex(i);
    SomeObject someObject= new SomeObject ();
    someObject.setAttr1(row.getAttribute("Attrbute1").toString());
    someObject.setAttr2(row.getAttribute("Attribute2").toString());
    objectList.add(someObject);
    operationBinding.getParamsMap().put("param1", objectList);
    ResultObject result = (ResultObject) operationBinding.execute();
    Inside the for loop (or any other place in the backing bean), I would like to figure out if the row was modified by the user. Please let me know if how to get that. If ADF provides this automatically, that would be GREAT.
    Thanks,
    Ash K

  • Moving data between tables (how to find out if the 2nd table is empty)

    Hi,
    I have 2 tables, and I'm copying records from one table to another.
    I've followed the Wiki: [https://www.sdn.sap.com/irj/sdn/wiki?path=/display/vc/movingdatabetween+tables]
    So far, everything works ok.
    Here is my question: how do I get the number of records passed?
    I mean, how do I know the number of rows in the 2nd table? (Remember that this number is variable, because it depends on how many rows I've inserted and deleted on the 2nd table).
    I've tried to achieve that using a data store with a numeric field, but I couldn't find the way to increment/decrement the numeric field on data store, and insert/delete the row on table at the same time .
    All I want is to find out if the 2nd table is empty or not.
    Any ideas to solve this?
    Thanks in advance!
    Help will be point-rewarded.
    Marcelo

    Hi Ahmed
    thanks for your reply, it was very helpful!! (I've assigned points to you)
    However the user can add twice or more times the same row... so the counter doesn't reflect the real number of rows in the 2nd table.
    I've partially solved this also using a data store with a parameter called key_list, where I add (I mean, concatenate) the key field for the selected row.
    So, if I have a table with 4 rows with key fields "key1", "key2", "key3", the parameter key_list would get "key1;key2;key3".
    So far, it's ok. But when I remove a row previosly added.... I can't remove the key from the key_list parameter. (I mean, from 2nd table I choose to remove the "key2" row, but I don't know how also remove the key name from the key_list)
    I hope be clearly enough.
    Any help will be really appreciated and point-rewarded.
    Thanks again.
    Best Regards
    PS: is there any way of "mark" a row that has been added to the 2nd table? I mean, using (for example) a hidden boolean field named "added", that becomes true when the selected row is added to the 2nd table.

Maybe you are looking for

  • How to map a context attribute to an input field

    Hi, I am new to CRM 2007 UI.I have a table control view on my screen and records are filled in this table when an user enters a value in an input field and presses enter.My bsp page looks something like this. <%@page language="abap" %> <%@extension n

  • Export Options not displaying in Object Style Options panel

    Hi, I'm trying to create an object style for decorative images as artefacts and set that style for export to PDF, but in the Object Style Options panel the Export Options settings (which I've seen before, bottom left of the panel) are not displayed.

  • LKM mix up in ODI 10.1.3.5.5

    Hello everyone I have written 2 LKMs in ODI 10.1.3.5.5, both of them are SQl to SQL LKMs. Every now and then, (and I don't know how to reproduce this problem) The sql statement of one LKM is replaced by the sql of the other lkm. Can somebody tell me

  • SC challan

    Hi, While creating SC challan using J1IF. An error is coming ''No number ranges maintained for series group 111''. i ve maintained for J_1I57FC object in t code SNUM fpr series group 111. Is there any more objects for which number range has to be mai

  • I would like to use Safari AND firefox, how can I achieve that?

    For certain things I need to be able to use Safari and would like to know if you can help me to do that without getting rid of Firefox. Thanks, Bneeds