Find the difference between previous row value

Hi All,
I have a Property Rent Review table which holds the last rent update done on a property.
I need to be able to compare the rent change (%) at any interval for a property. - so the query should allow to pull the property rent at 2 or more points in time and I need a view that shows % increase or decrease between the 2 dates.
Generally the dates would be 3 months apart (qtrly) but I would like to be able to enter my own dates in case I want to run monthly / annually or compare “before” and “after” the  Rent Review.
Below is a sample data
TenantCode PropCode Rent Charged  Rent Change Date
31163        2469         157.68                 6/01/2014
31163        2469         160.69                16/06/2014
31163        2469         162.65                 1/12/2014
51428        2469         162.65                 10/12/2014
50824        3174         160.69                 28/03/2014
50824        3174         160.69                 4/04/2014
50111        3174         149.5                  21/05/2014
50695        3852         256.5                 24/01/2014
50695        3852         327.87               10/03/2014
50695        3852         256.6                 31/03/2014
50804        3865         278.48               18/03/2014
50779        3865         236.67               21/05/2014
50804        3865         237.82               31/07/2014
51135        3865         237.82               21/08/2014
51135        3865         165.69               12/09/2014
51135        3865         230.15               17/11/2014

Hi Diegoctn,
Your query work perfectly. But can we get the view as Patricks view below
With
CTE
AS
SELECT
ROW_NUMBER()OVER
(PARTITIONBYProp_Code
ORDERBYDATE_CHANGED_SQL)ASSeq,
FROM
R23
SELECT
c1.PROP_CODE,c1.TENANT_NUMB,c1.TOT_DEB_VAL,c1.DATE_CHANGED_SQL,(c1.TOT_DEB_VAL
-c2.TOT_DEB_VAL)*100.0/NULLIF(c2.TOT_DEB_VAL,0) 
AS[Rent(%)]
FROM
CTE c1
LEFT
JOINCTE
c2
ON
c1.PROP_CODE
=c2.PROP_CODE
AND
c1.Seq
=c2.Seq
+1
Where
c1.PROP_CODE
='1587'

Similar Messages

  • How to find the difference between 2 time values in Java

    hi all,
    i have 2 time values
    String time1="6:20";
    String time2="21:30"
    How to find the difference between 2 times in Java?
    pls help
    thanx in advance....

    Calculating Java dates: Take the time to learn how to create and use dates
    Working in Java time: Learn the basics of calculating elapsed time in Java
    Formatting a Date Using a Custom Format
    Parsing a Date Using a Custom Format

  • How to find the difference between 2 rows in a table

    Hi all
    I have a table say emp which has only 2 rows
    emp
    empno name age sex deptno
    1 X 20 M 10
    2 Y 21 M 20
    The output should be
    empno name age deptno
    1 X 20 10
    2 Y 21 20
    Since the sex are same , so it is not included in the output.
    thanks
    Hari

    Hi there rajkumar,
    Although your lead solution is more elegant than the one presented below,
    I believe the complete answer it would be:
    with mytable as (
    SELECT ROW_NUMBER() OVER (ORDER BY EMPNO) POS, Z.* FROM (
    select 1 empno, 'X' name, 20 age, 'M' sex, 10 deptno from dual
    union
    select 2, 'Y', 21, 'M', 20 from dual) Z
    SELECT
    DECODE(A.EMPNO,B.EMPNO,NULL,A.EMPNO) EMPNO,
    DECODE(A.NAME,B.NAME,NULL,A.NAME) NAME,
    DECODE(A.AGE,B.AGE,NULL,A.AGE) AGE,
    DECODE(A.SEX,B.SEX,NULL,A.SEX) SEX,
    DECODE(A.DEPTNO,B.DEPTNO,NULL,A.DEPTNO) DEPTNO
    FROM
    (SELECT * FROM mytable WHERE POS = 1) A,
    (SELECT * FROM mytable WHERE POS = 2) B
    UNION
    SELECT
    DECODE(B.EMPNO,A.EMPNO,NULL,B.EMPNO) EMPNO,
    DECODE(B.NAME,A.NAME,NULL,B.NAME) NAME,
    DECODE(B.AGE,A.AGE,NULL,B.AGE) AGE,
    DECODE(B.SEX,A.SEX,NULL,B.SEX) SEX,
    DECODE(B.DEPTNO,A.DEPTNO,NULL,B.DEPTNO) DEPTNO
    FROM
    (SELECT * FROM mytable WHERE POS = 1) A,
    (SELECT * FROM mytable WHERE POS = 2) B
    Your query indeed returns NULL in the column for which values are the same, but still, you get just the first row.
    Anyway, the question is how to dinamically select the columns that hold NULL values, in the newly generated result. Because i believe the request is like this, if column holds equal values on both rows, then don't select the column (maybe i'm wrong).
    If this is the case then just by one sql it will not solve your problem, it needs to be more, with sqlplus and some other scripts checking the values in the columns, if it's not null then set an operator, and in the end (in sqlplus)
    select operator1, operator2 etc. from mytable.
    Hope it helps,
    Michael.
    [All the above presented is based on the fact that you shall always have TWO rows to be compared, having more or less it will fail!]
    Message was edited by:
    kjt

  • Need to find the Difference between two table

    Hello ,
    I have stucked in program as below scenario:-
    I have two tables of huge data of same structure in a same schema.I need to find the difference exact values in tables.
    By using MINUS we can find the difference between two table ,i need to find the what exact difference in the there values with colunm and value at that column.
    Example TableA
    Col1 col2 col3 col4 col5.... col50
    10 ABC 2001 EE 444 TT
    40 XYZ 3002 RR 445 TT3
    80 DEF 6005 YY 446 YY8
    TableB
    Col1 col2 col3 col4 col5.... col50
    10 ABC 2001 EE 444 TT
    40 XYZ 3002 RR 445 TT3
    81 DEF 6005 Yu 447 YY8
    I need to the out put like this :-
    The Diffence between two table is
    TableA.COL1=80 TableB.Col1=81, Different
    TableA.Col4=YY TableB.col4=Yu,Different
    TableA.Col5=446TableB.col5=447,Different
    Please suggest me to write the pl/sql program for the same
    thanx in advance
    KK

    Thanx friends for all your efforts
    I have a sample code for the same,this will compare the two tables for single row in each table .
    what r the modification needed for the multiple rows of values in the two tables??
    Please suggest!!
    CREATE OR REPLACE PROCEDURE test_compare
    IS
    TYPE t_col
    IS
    TABLE OF VARCHAR2 (30)
    INDEX BY PLS_INTEGER;
    l_col t_col;
    j NUMBER := 0;
    l_sql VARCHAR2 (2000);
    col1 VARCHAR2 (30);
    col2 VARCHAR2 (30);
    val1 NUMBER;
    val2 NUMBER;
    status VARCHAR2 (30);
    CURSOR c1
    IS
    SELECT column_id, column_name
    FROM all_tab_columns
    WHERE table_name = 'TEST1';
    BEGIN
    FOR i IN c1
    LOOP
    j := j + 1;
    l_col (j) := i.column_name;
    END LOOP;
    FOR k IN 1 .. j
    LOOP
    l_sql :=
    'SELECT '
    || ''''
    || l_col (k)
    || ''''
    || ', '
    || 'TEST2.'
    || l_col (k)
    || ', '
    || ''''
    || l_col (k)
    || ''''
    || ', '
    || 'TEST1.'
    || l_col (k )
    || ', '
    || 'DECODE(TEST2.'
    || l_col (k)
    || ' -TEST1.'
    || l_col (k)
    || ', 0, ''NO CHANGE'', ''CHANGED'') FROM TEST2, TEST1';
    EXECUTE IMMEDIATE l_sql INTO col1, val1,col2, val2, status;
    IF status = 'CHANGED'
    THEN
    DBMS_OUTPUT.put_line( 'TEST2.'
    || col1
    || '='
    || val1
    || ', TEST1.'
    || col2
    || '='
    || val2
    || ', '
    || status);
    END IF;
    END LOOP;
    EXCEPTION
    WHEN OTHERS
    THEN
    DBMS_OUTPUT.put_line ('Error:- ' || SQLERRM);
    END;
    /

  • Query to find the difference between the last date and the second to the last date

    Hi all,
    Hope all is well.
    I am working on the following problem because I am trying to improve my MS SQL skills. But I am stuck at the moment and I wonder if you could provide some assistance please. Here is the issue:
    Table 1: Dividends
    divId
    ExDate
    RecordDate
    PayDate
    Amount
    Yield
    symId
    1
    2013-02-19
    2013-02-21
    2013-03-14
    0.23
    0.00000
    3930
    2
    2012-11-13
    2012-11-15
    2012-12-13
    0.23
    0.00849
    3930
    3
    2012-08-14
    2012-08-16
    2012-09-13
    0.20
    0.00664
    3930
    4
    2012-05-15
    2012-05-17
    2012-06-14
    0.20
    0.00662
    3930
    5
    2012-02-14
    2012-02-16
    2012-03-08
    0.20
    0.00661
    3930
    6
    2011-11-15
    2011-11-17
    2011-12-08
    0.20
    0.00748
    3930
    7
    2011-08-16
    2011-08-18
    2011-09-08
    0.16
    0.00631
    3930
    8
    2011-05-17
    2011-05-19
    2011-06-09
    0.16
    0.00653
    3930
    9
    2011-02-15
    2011-02-17
    2011-03-10
    0.16
    0.00594
    3930
    10
    2010-11-16
    2010-11-18
    2010-12-09
    0.16
    0.00620
    3930
    11
    2010-08-17
    2010-08-19
    2010-09-09
    0.13
    0.00526
    3930
    12
    2010-05-18
    2010-05-20
    2010-06-10
    0.13
    0.00455
    3930
    13
    2010-02-16
    2010-02-18
    2010-03-11
    0.13
    0.00459
    3930
    Table 2: Tickers
    symId
    Symbol
    Name
    Sector
    Industry
    1
    A
    Agilent Technologies Inc.
    Technology
    Scientific & Technical Instruments
    2
    AA
    Alcoa, Inc.
    Basic Materials
    Aluminum
    3
    AACC
    Asset Acceptance Capital Corp.
    Financial
    Credit Services
    4
    AADR
    WCM/BNY Mellon Focused Growth ADR ETF
    Financial
    Exchange Traded Fund
    5
    AAIT
    iShares MSCI AC Asia Information Tech
    Financial
    Exchange Traded Fund
    6
    AAME
    Atlantic American Corp.
    Financial
    Life Insurance
    7
    AAN
    Aaron's, Inc.
    Services
    Rental & Leasing Services
    8
    AAON
    AAON Inc.
    Industrial Goods
    General Building Materials
    9
    AAP
    Advance Auto Parts Inc.
    Services
    Auto Parts Stores
    10
    AAPL
    Apple Inc.
    Technology
    Personal Computers
    11
    AAT
    American Assets Trust, Inc.
    Financial
    REIT - Office
    12
    AAU
    Almaden Minerals Ltd.
    Basic Materials
    Industrial Metals & Minerals
    I am trying to check the last date (i.e. max date) and also check the penultimate date (i.e. the second to the last date).  And then find the difference between the two (i.e. last date minus penultimate
    date).
    I would like to do that for each of the companies listed in Table 2: Tickers.  I am able to do it for just one company (MSFT) using the queries below:
    SELECT
    [First] = MIN(ExDate),
    [Last] = MAX(ExDate),
    [Diff] = DATEDIFF(DAY, MIN(ExDate), MAX(ExDate))
    FROM (
    SELECT TOP 2 Dividends.ExDate
    FROM Dividends, Tickers
    WHERE Dividends.symId=Tickers.symId
    AND Tickers.Symbol='MSFT'
    ORDER BY ExDate DESC
    ) AS X
    Outputs the following result:
    First
    Last
    Diff
    2012-11-13
    2013-02-19
    98
    But what I would like instead is to be able to output something like this:
    Symbol
    First
    Last
    Diff
    MSFT
    2012-11-13
    2013-02-19
    98
    AAN
    2012-11-13
    2012-12-14
    1
    X
    2012-11-13
    2012-12-14
    1
    Can anyone please let me know what do I need to add on my query in order to achieve the desired output?
    Any help would be greatly appreciated.
    Thanks in advance. 

    Could you try this?
    create table Ticker (SymbolId int identity primary key, Symbol varchar(4))
    insert into Ticker (Symbol) values ('MSFT'), ('ORCL'), ('GOOG')
    create table Dividend (DividendId int identity, SymbolId int constraint FK_Dividend foreign key references Ticker(SymbolId), ExDate datetime, Amount decimal(18,4))
    insert into Dividend (SymbolId, ExDate, Amount) values
    (1, '2012-10-1', 10),
    (1, '2012-10-3', 1),
    (1, '2012-10-7', 7),
    (1, '2012-10-12', 2),
    (1, '2012-10-23', 8),
    (1, '2012-10-30', 5),
    (2, '2012-10-1', 10),
    (2, '2012-10-6', 1),
    (2, '2012-10-29', 7),
    (3, '2012-10-1', 22),
    (3, '2012-10-3', 21),
    (3, '2012-10-7', 3),
    (3, '2012-10-12', 9)
    WITH cte
    AS (SELECT t.Symbol,
    d.ExDate,
    d.Amount,
    ROW_NUMBER()
    OVER (
    partition BY Symbol
    ORDER BY ExDate DESC) AS rownum
    FROM Ticker AS t
    INNER JOIN Dividend AS d
    ON t.SymbolId = d.SymbolId),
    ctedate
    AS (SELECT Symbol,
    [1] AS maxdate,
    [2] AS penultimatedate
    FROM cte
    PIVOT( MIN(ExDate)
    FOR RowNum IN ([1],
    [2]) ) AS pvtquery),
    cteamount
    AS (SELECT Symbol,
    [1] AS maxdateamount,
    [2] AS penultimatedateamount
    FROM cte
    PIVOT( MIN(Amount)
    FOR RowNum IN ([1],
    [2]) ) AS pvtquery)
    SELECT d.Symbol,
    MIN(MaxDate) AS maxdate,
    MIN(penultimatedate) AS penultimatedate,
    DATEDIFF(d, MIN(penultimatedate), MIN(MaxDate)) AS numberofdays,
    MIN(MaxDateAmount) AS maxdateamount,
    MIN(penultimatedateAmount) AS penultimatedateamount,
    MIN(MaxDateAmount) - MIN(penultimatedateAmount) AS delta
    FROM ctedate AS d
    INNER JOIN cteamount AS a
    ON d.Symbol = a.symbol
    GROUP BY d.Symbol
    ORDER BY d.Symbol
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers.
    Thanks!
    Aalam | Blog (http://aalamrangi.wordpress.com)

  • Find the difference between two columns in an ssrs matrix ? MSCRM

    Hi All,
    I am working in reporting part of our project (On-line MSCRM 2013) & in reporting services.
    I am trying to create report using fetch xml based. Below is the snap what we required the result.
    Kindly help me, how to get the difference in both column. (Its a matrix table where year is grouped).
    We need difference between both year Like (Plan Revenue of 2013 & Plan Revenue of 2014 difference in Plan Revenue Diff section) and same for Actual
    Revenue.
    https://social.microsoft.com/Forums/en-US/054d5ca4-0d38-4dc6-84a8-88866cc228fe/find-the-difference-between-two-columns-in-an-ssrs-matrix-mscrm?forum=crmdevelopment
    Thanks,
    Mohammad Sharique

    Hi Bro,
    I used parametrized option for year and done the report,Currently we are getting values in Difference column now i want to show
    that value in percentage. How can we show the percentage based on that value. Means i want to show the Difference in Percentage. 
    Kindly help me i tried but getting some issue. Below i am mentioning the code and snap with result.
    Below expression using to showing Plan Revenue in Percentage for year.
    =
    Sum(IIF(Fields!new_year.Value =Parameters!StartYear.Value,cdec(Fields!new_planrevenueValue.Value/1000), cdec(0)))
    - Sum(IIF(Fields!new_year.Value =Parameters!EndYear.Value,cdec(Fields!new_planrevenueValue.Value/1000), cdec(0)))
    /IIF(Sum(IIF(Fields!new_year.Value = Parameters!StartYear.Value,cdec(Fields!new_planrevenueValue.Value/1000), cdec(0)))>0,
    (Sum(IIF(Fields!new_year.Value = Parameters!StartYear.Value,cdec(Fields!new_planrevenueValue.Value/1000), cdec(0))))
    ,1)
    )*100))
    Result issue is as below in snap with highlighted in red colour.
    Kindly help me on this issue also :)

  • Find the difference between loading and registering the drivers..

    Dear Sir..
    Could you please help me to find the difference between two activities..
    1.Loading the drivers
    2.Registering the drivers
    What's the difference between loading and registeing the drivers and what activities take place by the JVM to do it all.

    Dear Sir..
    Could you please help me to find the difference
    between two activities..
    1.Loading the drivers
    2.Registering the drivers
    What's the difference between loading and registeing
    the drivers and what activities take place by the JVM
    to do it all.You load a class - it isn't specific to a driver.
    That is part of java - not JDBC.
    Normally JDBC drivers register themselves when the class is loaded. This is specific to the driver and has nothing to do with a user of the driver. It is only a concern to someone who must implement a driver.

  • How to find the difference between Project costs & Cost center costs?

    Hi all,
    Can you please explain me ? What is project Cost & Cost center cost and which are the tables having those fields of project cost & cost center Costs? And how to find the difference between their costs ? And please give me the functional Idea about it?
    Thanking you all in Advance...
    Regards,
    Chandru

    Hi,
    goto table COSP:
    1) object-no. beginning with 'KS' refer to cost-centre
       example: 'KSKOKA4711'
       with KS, KOKA = controlling area and 4711 = cost centre
    2) OBJNR beginning with 'PR' refer to projects / WBS-element
       example PR00001234
    Message was edited by: Andreas Mann

  • Extract Time from date and Time and Need XLMOD Funtion to find the Difference between Two Time.

    X6 = "1/5/15 5:16 AM" & NOW ....................difference by Only Time
    not date
    X6 date and Time will be changing, Its not Constant
                Dim myDateTime As DateTime = X6
                Dim myDate As String = myDateTime.ToString("dd/MM/yy")
                Dim myTime As String = myDateTime.ToString("hh:mm tt")
                Dim myDateTime1 As DateTime = Now
                Dim myDate1 As String = myDateTime1.ToString("dd/MM/yy")
                Dim myTime1 As String = myDateTime1.ToString("hh:mm tt")
    Need to use this function to find the Difference between Two Time. due to 12:00 AM isuue
    Function XLMod(a, b)
        ' This replicates the Excel MOD function
        XLMod = a - b * Int(a / b)
    End Function
    Output Required
     dim dd  = XLMod(myTime - myTime1)
    Problem is myTime & myTime1 is String Need to convert them into Time, Later use XLMOD Funtion.

    Induhar,
    As an addendum to this, I thought I'd add this in also: If you have two valid DateTime objects you might consider using a class which I put together a few years ago
    shown on a page of my website here.
    To use it, just instantiate with two DateTime objects (order doesn't matter, it'll figure it out) and you'll then have access to the public properties. For this example, I'm just showing the .ToString method:
    Option Strict On
    Option Explicit On
    Option Infer Off
    Public Class Form1
    Private Sub Form1_Load(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) _
    Handles MyBase.Load
    Dim date1 As DateTime = Now
    Dim date2 As DateTime = #1/1/1970 2:35:00 PM#
    Dim howOld As New Age(date1, date2)
    MessageBox.Show(howOld.ToString, "Age")
    Stop
    End Sub
    End Class
    I hope that helps, if not now then maybe at some point in the future. :)
    Still lost in code, just at a little higher level.
      Thanx frank, can use this in Future....

  • Function Module to find the Difference between two times.

    Hi All,
    Wud you plz let me know the Function Module to find the Difference between two times.
    Input Time1( Hours:Minutes) Time2 ( Hours:Minutes)
    Need Output in Hours:Minutes only . ( No seconds Needed )
    Ex :
    Input :
           06:00 to 18:00 Output : 12:00
    and  20:00 to 06:00 Output: 10:00 with +ve sign only. No -ve sign.
    Thanks,
    N.L.Narayana

    check this .
    data : p_timel like sy-uzeit,
           p_timeh like sy-uzeit,
           diff like sy-uzeit,
           di(8) type c .
           p_timel = '200000'.
           p_timeh = '060000'.
           diff = p_timeh - p_timel.
           concatenate diff+0(2) ':' diff+2(2) into di.
           write:/ di.
    also check for this.
           p_timel = '060000'.
           p_timeh = '180000'.
    see if this can be implemented in ur code .
    or else  u can try with  Fm L_TO_TIME_DIFF passing startdate enddate starttime endtime with UOM as MIN
    hope this helps regards,
    vijay

  • How to find the average of table row values it should display in next row in libwindow/​CVI

    Hi,
    How to find the average of table row values it should display in next row in libwindow/CVI
    Please let me know the solution.

    There isn't a built-in function to perform calculations on thable cells. What you can do is to retrieve thable cells values and calculate the average by yourself.
    To retrieve a bunch of cells in a single instruction you can use GetTableCellRangeVals: prerequisite for this function to work correctly is that cells are all included in a Rect structure (shortly, a rectangle) and are all of the same data type. See the help for the function for some explanations and the link to an example of its usage. In Cell range parameter you can pass VAL_TABLE_ROW_RANGE (row) macro to retrieve an entire row. See here for details.
    Once you have retrieved cell values in an array, you can pass it to Mean function to calculate the average.
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • BCT - how to find the difference between installed BCT and the newest BCT?

    Hi,
    How do I find the difference between installed BCT and the newest BCT?
    or find a description of the newest BCT?
    Thank you.
    - Gunnar

    Hi,
    Thank you for your answer.
    I am aware of the possibilities you mention.
    I am looking for a way to find the parts of the business content that has been modified since I installed our current version WITHOUT installing anything.
    That is for example:
    If F&R business content has been moved from 3.x technology to 7.0
    If there is changes to the F&R content at all
    -> if our current version of business content already contains the newest version of Business Content for F&R, then it is not a prerequirement to an F&R project that we update business content.
    The possibility to see that the only changes might be in the area of SAP HCM ...
    Thank you.
    - Gunnar

  • Find the same day in a range then find the difference between the days

    Need assistnace with the following .
    I have a table of ids for courses and each course class is on a day. I have to take the first day the course class is on and find the next same day then work out the difference in days.
    eg. a course class is on a saturday then have to go thru the course class associated to a course and find the next saturday then work out the difference.
    Anyone able to help - it would be much appreciated

    course class id date day
    abcdefa 18/12/2002 wednesday
    abcdefb 19/12/2002 thursday
    abcdefc 20/12/2002 friday
    zxvyza 17/12/2002 monday
    zxvyzb 20/12/2002 thursday
    zxvyzc 21/12/2002 friday
    zxvyzd 24/12/2002 monday
    zxvyze 26/12/2002 wednesday
    lmnopa 11/11/2002 tuesday
    lmnopb 12/11/2002 wednesday
    lmnopc 14/11/2002 friday
    lmnopd 19/11/2002 wednesday
    lmnope 21/11/2002 friday
    where abcdefa, abcdefbc, abcdefc are for course id abcdef
    and the other set of course class ids are for course id zxvyz.
    and 3rd set relates to course id lmnop.
    expectation:
    the difference between days for the first set of data to be 0
    the difference between days for 2nd set to be 7 days (ie. take the first day for the course class and see if can find another that is the same and then work out the difference i.e monday) then return the difference then go to next course class id.
    the diff between 3rd set is calc the diff between Wednesdays, ignore the last friday and find the next course class id. the answer here will be 7 days.
    I have worked out the days from the dates (although the above is only an example)but wasnt sure how to pick the same days then work out the difference and then move to the next course class id. Some course classes wont have another same day.

  • Find the difference between two internal table

    how can i see the difference between two interal tables?
    The requirement is as follows
    1. We have a transparent table, which stores the employee data with EMP ID as key.
    2. We load the transp table data into a interal table (B).
    3. We get data from legecy system as file and it gets loaded into another internal table (A) (this also has the same EMP ID key and this will have latest addition/update to those emplyees).
    Now we need to seperate out these data into three interal table Inserted (I), Deleted (D) and Updated (U).
    We want to do followign things
    I = A - B
    D = B - A
    Both A and B will have around 40k records. Hence we are trying to avoid the looping.
    Please suggest the best option for us.
    Thank you in advance.
    Raghavendra

    >
    RAGHAV URAL wrote:
    > how can i see the difference between two interal tables?
    > The requirement is as follows
    >
    > 1. We have a transparent table, which stores the employee data with EMP ID as key.
    > 2. We load the transp table data into a interal table (B).
    > 3. We get data from legecy system as file and it gets loaded into another internal table (A) (this also has the same EMP ID key and this will have latest addition/update to those emplyees).
    >
    > Now we need to seperate out these data into three interal table Inserted (I), Deleted (D) and Updated (U).
    >
    > We want to do followign things
    > I = A - B
    > D = B - A
    >
    > Both A and B will have around 40k records. Hence we are trying to avoid the looping.
    >
    > Please suggest the best option for us.
    >
    > Thank you in advance.
    > Raghavendra
    Hi Raghavendra,
      Currently as of my knowledge, these operations are only possible through LOOPs. But LOOPign can be really fast here if you properly utilize the SORTING, READ with BINARY SEARCH and FIELD-SYMBOLS usage. I would say:-
    Steps for Insert:-
    SORT: A, B.
    LOOP AT A ASSIGNING <WA_A>.
      READ TABLE B WITH TABLE KEY key = <WA_A>-key BINARY SEARCH.
      IF SY-SUBRC NE 0.
        APPEND <WA_A> TO I.
      ENDIF.
    ENDLOOP.
    Steps for Delete:-
    SORT: A, B.
    LOOP AT B ASSIGNING <WA_B>.
      READ TABLE A WITH TABLE KEY key = <WA_B>-key BINARY SEARCH.
      IF SY-SUBRC NE 0.
        APPEND <WA_B> TO D.
      ENDIF.
    ENDLOOP.
    Regards,
    Ravi.

  • How to find the differences between 4.6C and 4.7EE

    Hi,
      The client I am working for planning to upgrade from 4.6C to 4.7. As a ABAP consultant I want to know what are the changes that are made in 4.7 in ABAP. Where can I get the information i.e changes in ABAP from 4.6C to 4.7. Please advise.Please help as this is urgent for me.
    Thanks & Regards,
    Sam.

    Hi,
    to know the differences in each release
    Here is the link for the same
    http://help.sap.com/saphelp_nw2004s/helpdata/en/5b/8c3842bb58f83ae10000000a1550b0/frameset.htm
    http://service.sap.com/releasenotes
    Check this link ... this link will definitely explin u clearly the difference between the two versions...
    http://www.stonewayinc.com/clients/sap/bestoftour/presentations/SAP_BOT_2_Furlan_IBM.ppt
    See this weblog:
    /people/thomas.jung3/blog/2005/05/15/abap-46c-to-640-delta-training
    Re: R/3 Enterprise v mySAP ERP 2003 v ECC 5.0 v mySAP ERP 2004
    http://service.sap.com/~form/sapnet?_SHORTKEY=01100035870000497320&_SCENARIO=01100035870000000112&_OBJECT=011000358700000810532004E
    Regards,
    Anver

Maybe you are looking for

  • 3rd Party AIFF loops tempo changes from loop library and Logic session

    Hi there, Hope somebody out there can help me out! I've recently purchased some 3rd party loops, some in AIFF and some in WAV (Which I have converted to AIFF using the Apple Loops Utility), and i have been able to get these into the logic Loop librar

  • Problem launching a jsp page with eclipse and tomcat

    Hi, I have just started using eclipse and tomcat for creating dynamic web pages. I tried to launch a jsp page after starting the tomcat server with the URL: http://locahost:8080/HelloWorld/, an error page was displayed as below: HTTP Status 404 -/ ty

  • Dispaly or Hide a column based on Prompt Value

    Hi All, How can I Display or Hide a Column based on Prompt Value selected? On my dashboard I have a Report/Request and a Dashboard Prompt. Dashboard Prompt has three values, say: *'A', 'B' and 'C'*. And my report/request has three columns named *'Fie

  • The following Nuget packages could not be installed in project~

    When i create a new azure cloud service project in VS, the VS process fails with dialog message. See this error, Windows Azure Tools for Microsoft Visual Studio The following NuGet packages could not be installed in project WebRole: Microsoft.Windows

  • Is Saudi Government Ban on FaceTime a lie?!

    I have browsed apple communities for the reason of banning facetime from iPhones sold in Saudi and the answer from Apple always blame the government of Saudi for imposing this ban and request customers to complain to their government. When users do t