Logic to find missing entries

Hello all...i'm new to abap programming and i had a small doubt regarding a logic.
The logic is to obtain missing entries from 2 internal tables by comparing them.
for ex tab1 may contain some entries not present in tab2 and vice-versa.
i want to accomplish this by using only two loops i.e. nested loops. is it possible? pls let me know!
Regards,
Rahul
Message was edited by:
        Rahul Khanna

the following code will just provide you with logic,
imagine the two tables to be itab1 and itab2
and itab3 will have the mismatched values,
see carefully the steps used for code optimization,
the loop is processed only once
REPORT  ZTRIP_TEST.
data: itab1 like table of lfa1 with header line,
itab2 like table of lfa1 with header line,
itab3 like table of lfa1 with header line. "Table to hold mismatch values
data: line1 type i,
line2 type i.
describe table itab1 lines line1.
describe table itab2 lines line2.
sort: itab1,itab2.
if line1 ge line2.
  loop at itab1.
    read table itab2 with key lifnr = itab1-lifnr binary search.
    if sy-subrc ne 0.
      append itab1 to itab3.
    else.
      delete itab2 where lifnr eq itab1-lifnr.
    endif.
  endloop.
  append lines of itab2 to itab3.
else.
  loop at itab2.
    read table itab1 with key lifnr = itab2-lifnr binary search.
    if sy-subrc ne 0.
      append itab2 to itab3.
    else.
      delete itab1 where lifnr = itab2-lifnr.
    endif.
  endloop.
  append lines of itab1 to itab3.
endif.
*Now itab3 will contain mismatched enteries
Reward points if useful, get back in case of query...
Cheers!!!
Message was edited by:
        Tripat Pal Singh

Similar Messages

  • Find missing entries

    Hi,
    I have a table that contains several names like along with some other information.
    alpha1
    alpha2
    beta2
    gamma1
    gamma2
    I wanted to know about some of these entries, so I did a select like this.
    select * from t
    where t.name in ( 'alpha1', alpha2', 'beta1', beta2', 'gamma1', gamma2')
    Now if you look at the data above you will see that beta1 is missing, so obviously the above query does not fetch information about beta1.
    Is there a way to find the missing entries like this through SQL.
    I have a restriction here. I have a readonly access to the database. I log in as schema2 and look at data in schema1. Moreover since this is a production database, I would not like to create any temporary tables in schema2 either. So, any solution has to use only select statements and no DML/DDL.
    Thanks in advance,
    Rajesh

    Hi All!
    2 kuljeet pal singh
    SQL> select * from a2
    SQL> /
    NAME
    alpha
    beta
    delta
    epsilon
    (Missing gamma)
    What show your procedure?
    2 Rajesh
    The temporary table i think is the best solution.
    SELECT * FROM TEMP_TAB_NAME;
    NAME
    alpha
    beta
    gamma
    delta
    epsilon
    SELECT * FROM TEMP_TAB_NAME a
    WHERE NOT EXISTS (SELECT 1 FROM PROD_TABLE_NAME B
    WHERE B.COL_NAME = A.NAME);
    You can use following SQL*Plus script:
    set echo off
    set ver off
    set fee off
    set serveroutput on
    declare
    type tp is varray (30) of varchar2(30);
    tp_tab tp := tp('alpha', 'beta', 'gamma', 'delta');
    var varchar2(30);
    cnt number;
    num number;
    begin
    cnt := tp_tab.count;
    for i in 1..cnt loop
    var := tp_tab(i);
    select count(*)
    into num
    from PROD_TABLE_NAME
    where COL_NAME = var;
    if num = 0
    then
    dbms_output.put_line('Missing '||var);
    end if;
    end loop;
    end;

  • How do I find missing entries in outer join table?

    Hi all,
    I am trying to find records in table1 that are missing in table2.  This is a simple process in SQL, but ABAP is giving me trouble.  I want to do this using an outer join.
    Example:
    Select table1~docnumber
    From table1
    Left Outer Join table2
    On table1docnumber = table2docnumber
    Where table2~docnumber IS NULL.  (the record is missing in table2)
    Note: ABAP gives an error and wants me to use the Having Clause, which is ok, but then ABAP wants me to use Group By, which ok, but then I still get the same syntex error.
    Any thoughts on doing this with the outer join and is null options.  I do not want to select into two internal tables and compare them.

    All,
    I am not trying to do a subquery.  Just a simple outer join where I know some records are missing in the second table.
    Here is the code:
    select eban~banfn
    into table i_delay_banfn
    from eban
    left outer join zsmt_prdelay_upd
    on eban~banfn = zsmt_prdelay_upd~banfn
    where zsmt_prdelay_upd~banfn IS NULL.
    Here is the error message:
    No fields from the right-hand table of a LEFT OUTER JOIN may appear in
    the WHERE condition: "ZSMT_PRDELAY_UPD~BANFN".
    select eban~banfn
    into table i_delay_banfn
    from eban
    left outer join zsmt_prdelay_upd
    on eban~banfn = zsmt_prdelay_upd~banfn
    having zsmt_prdelay_upd~banfn IS NULL.
    Please use code tags
    Edited by: Rob Burbank on Mar 5, 2009 12:20 PM

  • ** MISSING ** entry for owner and object_name in AWR Segment statistics

    Hello,
    I have an AWR report which shows entries like this in the segment statistics section:
    Segments by Physical Reads
        Owner       Tablespace Name          Object Name           Subobject Name   Obj. Type     Logical Reads   %Total
    ** MISSING **   USERS             ** MISSING: 205065/205065   ** MISSING **     UNDEFINED     3,967           2.60
    APP_USER        USERS             SYS_LOB0000123236C00006$$                     LOB           3,747           2.45
    ** MISSING **   USERS             ** MISSING: 205069/205069   ** MISSING **     UNDEFINED     3,521           2.30Is this something I should be worried about?
    If yes, what could be the cause for such an entry?
    My Oracle version:
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    On a RHEL (not sure about the version though)

    Kuljeet Pal Singh wrote:
    whats the value of control_management_pack_access in your database.
    Is this something I should be worried about? i don't see any issue as the missing object also not doing much IO.
    however you may get the detail from v$segment_statistics
    query you may find from below post.
    Top accessed table
    Thanks for the answer, but for what should I query?
    It doesn't show me a segment name, only the text ** MISSING ** which clearly isn't one of my segments.
    I'm not concerned about the I/O it generates, I'm concerned about the fact that there is no segment name in the report.
    Could this be caused by tables/indexes that were created during the snapshot and were no longer available when the report was generated?

  • HP Officejet Pro 8500 A 910 - Missing entry: RunDLLEntry

    Each time I boot up my computer, I get the following error message on the Desktop:
    Error in C:\Program Files\HP\HP Officejet Pro 8500 A 910\bin\HPStatusBL.dll Missing entry: RunDLLEntry
    I can't find this file. I uninstalled the printer and reinstalled it - and still get the message.
    How do I fix it?

    Hi Sunriver10,
    I see you are getting the Error "C:\Program Files\HP\HP Officejet Pro 8500 A 910\bin\HPStatusBL.dll Missing entry: RunDLLEntry" when you boot up your computer.
    I will be happy to help you.
    Hold down the Windows Logo key () on the keyboard and the 'R' to open the run box, type %temp%.
    Delete all files and folders from the temp folder. Choose skip if any pop ups appear saying any of the files could not be deleted.
    Uninstall the software again - Uninstalling the Printer Software.
    When the uninstall has completed restart the computer.
    Follow these steps to reset the registry settings and options for Windows Installer.
    Hold down the Windows Logo key on the keyboard and the 'R' to open the run box
    In the Openbox, type msiexec /unregister, and then click OK.
    Hold down the Windows Logo key on the keyboard and the 'R' to open the run box.
    In the Open box, type msiexec /regserver, and then click OK.
    If you have any difficulty with this step, please use this link to perform it another way.
    Restarting Windows Installer.
    Run Disk cleanup from Accessories\ System Tool <How to Delete files using Disk Cleanup
    Download and install the latest version of Adobe flash player http://www.adobe.com/support/flashplayer/downloads.html
    Restart the computer.
    Do a msconfig and turn off any start up programs and Antivirus Software before running the Wizard.
    Turn then on again after. How to use MSCONFIG.
    Download and run the HP Printer Install Wizard for Windows.
    The HP Printer Install Wizard for Window was created to help Windows 7, Windows 8, and Windows 8.1 users download and install the latest and most appropriate HP software solution for their HP Printer.
    Please let me know if this does resolve the issue.
    Thank you for posting on the HP Forums.
    Have a great day.
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos Thumbs Up" on the right to say “Thanks” for helping!
    Gemini02
    I work on behalf of HP

  • Missing entry in table T043G

    While entering AR receipts with either of the following menu I am getting the message that' missing entry in table T043G'. I am trying to find more details of it , but could not...
    Easy Access Menu:  Accounting &#61614; Financial accounting &#61614; Accounts receivable &#61614; Document entry &#61614; Incoming payment
    Easy Access Menu:  Accounting &#61614; Financial Accounting &#61614; Accounts receivable &#61614; Account &#61614; Clear
    Can some one tell what the issue could be .
    Thanks.
    Venkat.

    You havent setup the tolerance limit.
    IMG -> Controlling -> Internal order -> Budgeting and availability control -> Define tolerance limit for availability control.
    IMG -> Financial Accounting -> Financial Accounting Global Settings -> Document -> Line item -> Define tolerance group for employees
    IMG -> Financial Accounting -> Accounts Receivable and Accounts Payable -> Business Transactions -> Outgoing Payments -> Manual Outgoing Payments -> Define Tolerances (Vendor)
    IMG -> Financial Accounting/ General Ledger Accounting/ Business Transactions/ Open Item Clearing/ Clearing Differences/ Define Tolerance Groups for G/L Accounts
    IMG -> Materials Management -> Logistics Invoice Verification -> Invoice Blocking -> Set Tolerance Limits
    And you need to assign the tolerance limit to the company as well.

  • Missing entries in primary key column

    I want to find out the missing entries in column which is primary key column. Please give me the query.
    Thanks

    I want to find out the missing entries in column which is primary key columnPlease eleborate this a little, If you talking about null values hosted by primray key column, tell me, how's it possible?
    hare krishna
    Alok

  • "Open VI Reference" Option "Prompt user to find missing subVIs"

    I am using "Open VI Reference" to dynamically load a VI. For the "option" control of the "Open VI Reference" node, I pass "0x10" or "10" in hexadecimal, which supposedly "prompt user to find missing subVIs." Nevertheless, I don't get a prompt message dialog when I intentionally pass an invalid or missing VI path. Instead I just get an Error Code 7. What does this option "Prompt user..." suppose to do?

    Make sure you set the properties on the integer input into the “options” control to the “Open VI Reference” to be a Hexadecimal format (right-click on the “options” control input, select Format and Precision…, then select Hexadecimal). Now, if you re-run your VI and wire in a VI with a missing subVI, the Open VI Reference will appear with a dialog that will prompt you to browse to the missing subVI. This is exactly the same message LabVIEW displays when it attempts to open a VI and cannot find its subVIs.
    I’ve attached a simple example program to demonstrate. Enter the path to the “number extractor.vi” as the VI to open. You should see a dialog prompt appear asking for the “Search 1D Array – Complete.vi”.
    Hope this helps!
    Attachments:
    openVIRefExample.zip ‏20 KB

  • Error: java.util.zip.ZipException: missing entry name

    Does anybody know how to solve the following error? I got this error when I was trying to update files in my CVS.
    OracleJSP: oracle.jsp.parse.JspParseException: Line # 2, <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
    Error: java.util.zip.ZipException: missing entry name
    Thanks

    Hi,
    I get the same exception while reading a ZIP file. The size if the ZIP file is just 82KB but I am reading it over FTP not sure if it makes any difference. I am using JDK 1.4.2_05. Here is the code I am trying to execute.
    public class TestFTP {
    public static void main( String[] argv ) throws Exception {
    String inboundPath = "/transfer/inbound/";
    FTPClient ftp = new FTPClient();
    ftp.connect("123");
    ftp.login( "123", "123" );
    ftp.changeWorkingDirectory(inboundPath);
    FTPFile[] zipFiles = ftp.listFiles("*.zip");
    TelnetClient telnetClient;
    for(int i=0;i<zipFiles.length;i++){   
    System.out.println(zipFiles.getName());
    ZipInputStream zis = new ZipInputStream(ftp.retrieveFileStream(zipFiles[i].getName()));
    for (ZipEntry entry = zis.getNextEntry(); entry != null; entry = zis.getNextEntry()){           
    System.out.println(entry.getName());
    The error message is
    java.util.zip.ZipException: invalid entry size (expected 10291 but got 10233 bytes)
         at java.util.zip.ZipInputStream.readEnd(ZipInputStream.java:367)
         at java.util.zip.ZipInputStream.read(ZipInputStream.java:141)
         at java.util.zip.ZipInputStream.closeEntry(ZipInputStream.java:91)
         at java.util.zip.ZipInputStream.getNextEntry(ZipInputStream.java:69)
         at test.TestFTP.main(TestFTP.java:41)
    Exception in thread "main"
    Please let me know if you were able to fix the problem.
    Thanks

  • 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!

  • The system could not find any entries that are relevant to costing.

    plz give the solution ,its urgent
    Message no. CK060
    Diagnosis
    The system could not find any entries that are relevant to costing.
    System Response
    The system did not cost the object.
    Procedure
    Check whether the following objects should be flagged as relevant to costing:
    Items in the BOM
    Display BOM
    Operations in the routing
    Control key in the routing
    1. Look at the message log.
    2. Check whether a quantity was specified in the confirmation.

    hi,
    iam facing the problem while creating the
    stnadard cost estimate ck11n
    the system prompts the following message
    confirmation
    Logistics - General (LO)
    Information from the vendor to the recipient about the status of the purchase order.
    The term confirmation covers different types of information from the vendor to the customer, such as order, loading or transportation confirmation and the shipping notification.
    If materials planning takes place without a confirmation, planning can only be based on the delivery dates and quantities in the purchase order. In contrast, confirmations make it possible for the customer to plan the materials more precisely because between the purchase order and planned delivery date, more reliable information has become available.
    Logistics - General (LO)
    Communication sent by a vendor to a customer regarding the status of a purchase order.
    The term "confirmation" (short for "vendor confirmation") is an umbrella term for various types of information provided by a vendor to a customer, including order acknowledgments, loading or transport confirmations and shipping notifications.
    If the customer's materials planning and inventory control system does not work with confirmations, it can only refer to the delivery dates and quantities set out in the purchase order. The use of confirmations, on the other hand, makes the materials planning and inventory control process more precise, since between the PO date and the planned delivery date the customer receives increasingly reliable information about the pending arrival of ordered goods.
    Treasury Management (TR-TM)
    After concluding a financial transaction, a confirmation of the related contract data is sent to the relevant business partner. Confirmations can be printed or sent electronically directly from the R/3 System. Confirmation forms are defined via the correspondence type.
    Logistics - General (LO)
    Part of order monitoring, this documents the processing status of operations or sub-operations. In the SAP System, a distinction is made between partial and final confirmations.
    A final confirmation is used to determine
    at which work center the operation should be carried out
    who has carried out the operation
    the quantities of yield and scrap quantities that have been produced
    the size of the standard values required for the actual operation
    Materials Management (MM)
    Communication from a vendor to a customer providing information on the status of a purchase order.
    As used in this sense, the term "confirmation" can cover a number of different documents, such as order acknowledgment, loading confirmation, or shipping notification. Also termed "order acceptance/fulfillment confirmation".
    If the materials planning and control system operates without such confirmations, it can only work on the basis of the delivery dates and quantities in the purchase order. Confirmations, on the other hand, enable the customer to plan more exactly. In the period between the issue of the PO and the planned delivery date he is provided with more up-to-date and increasingly reliable information on the expected delivery.
    Project System (PS)
    A confirmation is a part of network control. It documents the state of processing for network activities and activity elements. There are two types of confirmations in the R/3 System: partial and final confirmations.
    A confirmation is used to record:
    the work center where the activity was carried out
    the person who carried out the activity
    the yield and scrap produced in an activity
    the actual values for the standard times
    Intellectual Property Management (CRM-IM-IPM)
    A report made by the licensee and defined in the rights sale contract on sales volumes or other quantities (such as audience figures for a film) during a period.
    Receiving (ECO-BBP-REC)
    An electronic document that combines the functions of goods receipts and service entry sheets. By creating a confirmation:
    Vendors can confirm that they have fulfilled their orders
    Employees can confirm the goods and services they ordered via their shopping baskets
    Central goods recipients can confirm the goods and services ordered by employees for whom they are responsibleconfirmation
    Logistics - General (LO)
    Information from the vendor to the recipient about the status of the purchase order.
    The term confirmation covers different types of information from the vendor to the customer, such as order, loading or transportation confirmation and the shipping notification.
    If materials planning takes place without a confirmation, planning can only be based on the delivery dates and quantities in the purchase order. In contrast, confirmations make it possible for the customer to plan the materials more precisely because between the purchase order and planned delivery date, more reliable information has become available.
    Logistics - General (LO)
    Communication sent by a vendor to a customer regarding the status of a purchase order.
    The term "confirmation" (short for "vendor confirmation") is an umbrella term for various types of information provided by a vendor to a customer, including order acknowledgments, loading or transport confirmations and shipping notifications.
    If the customer's materials planning and inventory control system does not work with confirmations, it can only refer to the delivery dates and quantities set out in the purchase order. The use of confirmations, on the other hand, makes the materials planning and inventory control process more precise, since between the PO date and the planned delivery date the customer receives increasingly reliable information about the pending arrival of ordered goods.
    Treasury Management (TR-TM)
    After concluding a financial transaction, a confirmation of the related contract data is sent to the relevant business partner. Confirmations can be printed or sent electronically directly from the R/3 System. Confirmation forms are defined via the correspondence type.
    Logistics - General (LO)
    Part of order monitoring, this documents the processing status of operations or sub-operations. In the SAP System, a distinction is made between partial and final confirmations.
    A final confirmation is used to determine
    at which work center the operation should be carried out
    who has carried out the operation
    the quantities of yield and scrap quantities that have been produced
    the size of the standard values required for the actual operation
    Materials Management (MM)
    Communication from a vendor to a customer providing information on the status of a purchase order.
    As used in this sense, the term "confirmation" can cover a number of different documents, such as order acknowledgment, loading confirmation, or shipping notification. Also termed "order acceptance/fulfillment confirmation".
    If the materials planning and control system operates without such confirmations, it can only work on the basis of the delivery dates and quantities in the purchase order. Confirmations, on the other hand, enable the customer to plan more exactly. In the period between the issue of the PO and the planned delivery date he is provided with more up-to-date and increasingly reliable information on the expected delivery.
    Project System (PS)
    A confirmation is a part of network control. It documents the state of processing for network activities and activity elements. There are two types of confirmations in the R/3 System: partial and final confirmations.
    A confirmation is used to record:
    the work center where the activity was carried out
    the person who carried out the activity
    the yield and scrap produced in an activity
    the actual values for the standard times
    Intellectual Property Management (CRM-IM-IPM)
    A report made by the licensee and defined in the rights sale contract on sales volumes or other quantities (such as audience figures for a film) during a period.
    Receiving (ECO-BBP-REC)
    An electronic document that combines the functions of goods receipts and service entry sheets. By creating a confirmation:
    Vendors can confirm that they have fulfilled their orders
    Employees can confirm the goods and services they ordered via their shopping baskets
    Central goods recipients can confirm the goods and services ordered by employees for whom they are responsible

  • I just update itunes for latest version. Now I can't open it on win 7- 64 bits. I get an erro: Cant find the entry point of the procudere sqlite_wal_checkpoint.. Windows error 127.. help!!!

    I just update itunes for latest version. Now I can't open it on windows 7- 64 bits. I get an erro: Cant find the entry point of the procudere sqlite_wal_checkpoint.. Windows error 127. What can I do...???

    How did you fix this?

  • Finding missed sequence numbers and rows from a fact table

    Finding missed sequence numbers and rows from a fact table
    Hi
    I am working on an OLAP date cube with the following schema:
    As you can see there is a fact transaction with two dimensions called cardNumber and Sequence. Card dimension contains about three million card numbers. 
    Sequence dimension contains a sequence number from 0 to 255. Fact transaction contains about 400 million transactions of those cards.
    Each transaction has a sequence number in 0 to 255 ranges. If sequence number of transactions of a card reaches to 255 the next transaction would get 0 as a sequence number.
    For example if a card has 1000 transactions then sequence numbers are as follows;
    Transaction 1 to transaction 256 with sequences from 0 to 255
    Transaction 257 to transaction 512 with sequences from 0 to 255
    Transaction 513 to transaction 768 with sequences from 0 to 255
    Transaction 769 to transaction 1000 with sequences from 0 to 231
    The problem is that:
    Sometimes there are several missed transactions. For example instead of sequence from 0 to 255, sequences are from 0 to 150 and then from 160 to 255. Here 10 transactions have been missed.
    How can I find all missed transactions of all cards with a MDX QUERY?
    I really appreciate for helps

    Thank you Liao
    I need to find missed numbers, In this scenario I want the query to tell the missed numbers are: 151,152,153,154,155,156,157,158,159
    Relative transactions are also missed, so I think it is impossible to get them by your MDX query
    Suppose this:
    date
    time
    sequence
    20140701
    23:22:00
    149
    20140701
    23:44:00
    150
    20140702
    8:30:00
    160
    20140702
    9:30:00
    161
    20140702
    11:30:00
    162
    20140702
    11:45:00
    163
    As you can see the sequence number of the last transaction at the 20140701 is 150
    We expecting that the first transaction of the next day should be 151 but it is 160. Those 10 transactions are totally missed and we just need to
    find missed sequence numbers

  • 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

  • Property or method to find missing fonts...

    Hi Everyone,
    Is there any direct property or method to find missing fonts in EPS doucments in Illustrator CS4 like we do in InDesign. I have tried this by doing comparison of document fonts and application fonts to get missing fonts but it won't work.
    Any help would be appreciatable. Thanks in advance.
    Regards
    Thiyagu

    Have you tried a search of this forum… Im sure I posted a work around to this… The simple answer is NO not in the Illustrator DOM you can however read the file as text and the stuff you want is in the Illustrator file comments…

Maybe you are looking for