Compare previous value in the table

Hi:
I want to compare the previous value in the Acute Amt# with the current record and pass previous value to the Return Value column based on they are eqaul or not. Can you please help me how to get this ?
Here is the sample data.
REN#     End#     Acute Amt#     Return Value
1     0     1583     1583
2     0     1587     1587
2     1     1572     1572
3     0     1572     Null
3     1     1572     Null
4     0     1572     Null
4     1     1572     Null

http://download.oracle.com/docs/cd/B13789_01/appdev.101/b10795/adfns_fl.htm
Would this feature help with your problem? Depending on the version of your database.
"This example uses a Flashback Query to examine the state of a table at a previous time............."

Similar Messages

  • How  to compare previouse value in pl/sql array

    DECLARE
    CURSOR stg_raw_cur IS
    SELECT RAW_STG_ID,
    DEVICE_CD,
    MODEL_VERSION,
    PLATFORM_CD,
    PROFILE_COOKIE,
    LOCATION_CD,
    SAMPLE_RATE,
    EVENT_TYPE_CD,
    to_char(to_date(to_date(substr(EVENT_DATE_TIME,1,8),'yyyymmdd')-1 ||
    'T' ||
    substr(EVENT_DATE_TIME,10,8)
    || 'Z','DD-MON-RR"T"HH24:MI:SS"Z"'), 'YYYYMMDDYY"T"HH24:MI:SS"Z"' ) EVENT_DATE_TIME,
    EVENT_SPECIFIC,
    BATCH_ID,
    DWH_ARVL_DT,
    DWH_ARVL_DT_ID,
    DWH_CREATE_DT from dwh_stg.stg_raw where batch_id >= 200
    order by batch_id asc;
    TYPE stgrawarr IS TABLE OF stg_raw_cur%ROWTYPE;
    stg_raw_rec stgrawarr;
    l_batch_id NUMBER :=0 ;
    v_ctr NUMBER :=0;
    l_temp_batch_id number :=0;
    BEGIN
    OPEN stg_raw_cur;
    LOOP
    FETCH stg_raw_cur BULK COLLECT INTO stg_raw_rec LIMIT 100;
    EXIT
    WHEN stg_raw_cur%NOTFOUND;
    END LOOP;
    CLOSE stg_raw_cur;
    for i in stg_raw_rec.first..stg_raw_rec.last
    loop
    dbms_output.put_line('batch id is '|| stg_raw_rec(i).batch_id );
    IF l_batch_id != stg_raw_rec(i).batch_id
    then
    dbms_output.put_line('Different');
    end if;
    l_temp_batch_id := stg_raw_rec(i).batch_id;
    commit;
    end loop;
    END;
    I want to compare previous value of stg_raw_rec(i).batch_id if differnet then increament the value
    else leave the same.
    thanks.

    Try this,
    FOR i IN stg_raw_rec.FIRST .. stg_raw_rec.LAST
       LOOP
          IF l_temp_batch_id != stg_raw_rec (i).batch_id
          THEN
             --increment
             l_temp_batch_id := l_temp_batch_id + 1;
          END IF;
           DBMS_OUTPUT.PUT_LINE ('batch id is ' || stg_raw_rec (i).batch_id||' unique batch id is '||l_temp_batch_id);
        --  DBMS_OUTPUT.PUT_LINE ('batch id is ' || stg_raw_rec (i).batch_id);
        --  IF l_batch_id != stg_raw_rec (i).batch_id
        --  THEN
        --    DBMS_OUTPUT.PUT_LINE ('Different');
        --  END IF;
          l_temp_batch_id := stg_raw_rec (i).batch_id;
          COMMIT;
       END LOOP;

  • Compare previous value and new value on Campaign Save

    Hi All,
    I create a campaign. I need some exit ( badi etc.) which is called before saving the campaign and after saving the campaign. My main intention is to compare the previous value and the new value.
    Thanks in advance,
    Raviraj

    Yes, you would have to write code that specifically compared each column. And update that code when the column list changed. Of course, you could always write code that generated your triggers for you based on the column definitions.
    On the other hand, I would tend to suggest that if you need an audit history, you want to store the whole row. Otherwise, the queries necessary to parse your audit table get to be hideously complicated and people spend a lot of time trying to reconstruct the state of a row at a particular point in time, often introducing errors.
    If you need an audit history, I would also tend to look into Oracle's auditing features or something like Workspace Manager that automatically tracks a version history for rows. Both of those are built into the database, which tends to make them a lot easier to deal with than a custom trigger solution.
    Justin

  • How to display the values from the table in the screen

    Hi,
    I have created a screen where i will enter the values for the field treshold amount and desc and if i press update button  .it will update the new values by overriting the existing values .
    Now i have got requirement i need to create a button show which will display the existing value from the table. always there will be only one entry...in this table
    Please can one give me idea...to do this
    or sample code...thanks in advance
    regards
    paveeeeee

    Define a function code 'SHOW' for your button. In your PAI module, when you check for various sy-ucomms, check for 'SHOW' also.
    Your code will be like this:
    Case sy-ucomm.
      when 'SHOW'.
         perform show_details.
    endcase.
    In the perform, you can fetch the data from the table and put it in global variables. In the PBO, move the data from the global variables to the screen fields so that they get displayed on the screen.
    Hope this helps. Reward points for useful answers.
    Regards
    Nithya

  • How to display(binding) values in the table from more than one node?

    Hi,
    I have two nodes (TRIPS & AMOUNTS)in the context. How to bind these values into the table control?
    When i bind second one, first one is getting replaced.

    Hi Mog,
    Of course it is possible to create a table from attributes of more than one node, and in some cases this is still necessary, but you have to do this the hard (manual) way.
    If you have a table control, have a look at the properties and the elements belonging to it.
    First of all, there is the property "dataSource", which binds to a multiple node (let's name it TableRootNode). This means that for each element of THIS node, one row is created. In each row the data of exactly one element of this TableRootNode is displayed.
    Then you have columns in this table. Inside of the columns there is a header and an editor. The editor is the interesting part.
    Normally the primary property of this editor is bound to an attribute of the TableRootNode. Then everything works as expected. If it binds to an attribute of a subnode (SUB) of TableRootNode, then in row i the data of the subnode of the i-th element of TableRootNode is displayed. There is no need for SUB to be a multiple node, but it must not be a singleton.
    If you bind a property of the editor to an attribute, which does not lie in the subtree of TableRootNode, then you will see the same value in each row.
    Now it depends on the structure of your context. Take the node, which is relevant for the change in each row (I assume it is TRIPS) and bind the table to the node as you are used to. Then for each additional column, you have to create a new column in the tree, create a new header element with a title and a new editor (e.g. textview or inputfield) and then bind the right property of the editor to the corresponding attribute in node AMOUNTS).
    If these 2 nodes do not have parent-child-relationship, the tip to create a new node, which consists of the attributes of both nodes is the only solution.
    Ciao, Regina

  • Old value in the table  SETLEAF

    Dear All,
    Normally we take back up on every weekend. Due to some wrong transport request in production in last weekend, all the value in the table - SETLEAF has been overwriten. Is there any way in which we can read the value entry in the table -SETLEAF from the back up system befor the last week end ?
    Please help immideate basis.
    Regards,
    sp sahu

    Hello,
    I think you will have to build another database to read the value from specific table.
    Restore system to another server and check the table valaues.
    Good Luck,
    Atil

  • Exit in DP90 and how to get value in the table

    Hi all,
    My requirement is when execute DP90(create billing request), the amount in the table must be validated when I click the "Billing Request" button.
    Please tell me the user_exit, BADI or any other enhancement which can I use to validate the amount in that transaction.
    And how to get the amount(amount to be Billed, Amount rejected) value in the table after that??
    Thanx

    Hi Teja,
    Check the BADI (SE18) - BADI_SD_DPBP - Extensions in SD for DP90 with Billing Plan

  • How to find the value in the table in database ?

    Hi, Could you please advise me, How to findout the data-value in the table in database ?

    what do you mean by value ?
    --Girish                                                                                                                                                                                                                           

  • Find second Biggest and second smallest values in the table

    Hi guys
    I am new to oracle - sql and pl/sql
    I need u r help
    My question is i have a table with columns s.no, emp name, salary etc.,
    how can i get the second largest and smallest value in the table (based on salary)
    Any one pls give the queries (pls the query is used in oracle 8i)
    Regards
    Marimuthu.N

    You only need to use max and min. Once you have it, select the max lower than max and the min biggest than min.

  • How to pass line item values in the table paramer of FM

    Hi all,
    When i will give the import of  the FM as VBELN"sales order number.
    I want to display all the line items for "PO Quantity in the out put of the FM.
    For this i thnk i have to pass the line item values in the table parameter of the FM.
    Can any body please tell me how to pass the values for the line items in the table parameter fo teh FM.
    Please give a example.
    Thanks

    Sub pLoopThroughPivotFields()
    Dim oItem As Excel.PivotItem
    Dim oField As Excel.PivotField
    Set oField = ThisWorkbook.Worksheets("Sheet1").PivotTables("Pivot Table name").PivotFields("field name")
    For Each oItem In oField.PivotItems
    oField.CurrentPage = oItem.Name
    'Put your copy code here
    DoEvents
    Next oItem
    End Sub
    Felipe Costa Gualberto - http://www.ambienteoffice.com.br

  • How to Maintain Values in the Table control?

    Hi,
    I'm Saikumar.
    I've done a table control program.
    When I click SAVE or ENTER Button, the values are getting saved into the database(This is working alright)......but when I click those buttons, The values entered in the table control are getting cleared.
    What should I do in order to have those values in the table control itself when I click SAVE/ENTER? (I need to create multiple records at a time)
    What I've done is:
    IF sy-ucomm = 'SAVE' OR sy-ucomm = 'ENTR'.
    INSERT into <database table> values wa_matgl.
    MODIFY it_matgl from wa_matgl INDEX tc1-current_line. "tc1 is the table control name.
    Refresh it_matgl.
    endif.
    I tried many ways but the vales are getting cleared in the table control? (I need to create multiple records at a time).
    Please suggest a way to overcome it.
    Thanks in advance,
    saikumar

    Hi ...
    Just to add...
    were there any values in the internal table it_matgl  initially in the PBO screen to be shown to the users ?
    <u>if the answer is no...then......</u>
    i came across the same coding in DEMO_DYNPRO_TABCONT_LOOP_AT.....
    here also in PAI..when we press enter..the values are not retained...
    MODIFY it_matgl from wa_matgl INDEX tc1-current_line. "tc1 is the table control name.
    <b>because i believe the modify statement is not working.coz the it_matgl is empty..pls check if sy-subrc = 0....after the modify statement....if it is not...then we need to insert the data into the it_matgl using an append statement</b>
    for this it_matgl needs to be with header line...
    Pls explore the following....
    data : it_matgl type table of XXXX with header line.
    in the section
    IF sy-ucomm = 'SAVE' OR sy-ucomm = 'ENTR'.
    INSERT into <database table> values wa_matgl.
    MODIFY it_matgl from wa_matgl INDEX tc1-current_line. "tc1 is the table control name.
    <i>if sy-subrc <> 0.
    move corresponding wa_matgl to it_matgl.
    append it_matgl.
    clear it_matgl.
    endif.
    endif.</i>
    Pls check and revert
    Regards
    Byju

  • How to update values in the table control at  Cat2 transaction,

    Hi,
    i am working on cat2 transaction, here
    i am using the exit_saplcats_006 and updating values at catsdb table, but i want to display this values at the table control in the cat2 transaction.
       can any one provide me solution for this same.
    Regards

    Hi Suresh
      this is actual requirement
    in the CAT2.
    1. Add a new column for WBS description and derive the value as per the FS
    2. Retrieve project number and description and update in the column specified
    3. When a service order is selected it should do the same for 2.
    4. Finally repeat for the worklist view (which is the section above)
       here i am able to display values at data entry area
    for service order and network but not worklist area ?
        updation is not coming, can u plz go throw it..
    Thanks
    Chinna

  • Hardcode the values in the table

    Hiii
    Iam developing a web dynpro application.With out writing the code i can able to deploy and run the application.In that i want to hardcode values in the table for demo purpose.how i can get those values.
    Is there any property in web dynpro to do that,,,,,,,, or else,,,,,,,,, we have to write the code in the application.
    If thats the case,,,,Please provide the code to get the values in the table.
    Regards
    Sushma

    Hi
    For different data,,,,,in what way i have to do.
    Like this your saying
    IPrivateEtrecEmpView.IEmployeeElement element4 = wdContext.nodeEmployee().createEmployeeElement();
                   element4.setDesignation("Software Engineer");
                   element4.setDepartment("Basis");
                   element4.setEmailID("");
                                  element4.setEmpCode("0011579");
                                  element4.setEmpName("");
                                  element4.setMobileNo("");
                                  element4.setSlno("4");
                                  element4.setLocation("Bangalore");
                        wdContext.nodeEmployee().addElement(element4);
         IPrivateEtrecEmpView.IEmployeeElement element3 = wdContext.nodeEmployee().createEmployeeElement();
                             element3.setDesignation("Software Engineer");
                             lement3.setDepartment("Web dynpro");
                             element3.setEmailID("");
                             element3.setEmpCode("0011579");
                             element3.setEmpName("");
                             element3.setMobileNo("");
                                  element3.setSlno("4");
                                  element3.setLocation("Bangalore");
                   wdContext.nodeEmployee().addElement(element3);

  • Update the values in the table on select of a particular row

    hi
    I want to update the values in the table on selecting the particular row.
    im able to select the particular row using Leadselect.
    can any one help me in updating the values in the table?
    regards
    raji

    hi,
    values are coming from my database ( SQLServer.)
    on click of the button i am able to display the values from the database.
    My problem is on selection of any row , i should be able to edit/update the values in the table .
    regards
    raji

  • Executed  Step outcome  value  from the table

    Hi,
       How to get the Step outcome  value  from the table for the executed workitem.
    Regards,
    Rani.

    Hi Rani,
    For database tables you can refer to tables:
    SWWLOGHIST -      History of a work item
    SWWORGTASK -      Assignment of WIs to Org.Units and Tasks
    SWWUSERWI -      Current Work Items Assigned to a User
    SWWWIHEAD -      Header Table for all Work Item Types
    SWWWIAGENT -      Gets agents assigned to a workitem
    You can you FMs like SAP_WAPI_GET_WORKITEM_DETAIL, SAP_WAPI_CREATE_WORKLIST as per your requirement.
    Hope this helps!
    Regards,
    Saumya

Maybe you are looking for

  • IMac can't see printer connected to Windows 7 PC via USB

    Hi all, I have a mixed PC/Mac (Snow Leopard & Leopard) network and a Canon PIXMA MP780 printer connected to a PC running Windows 7. Last week, when this printer had XP on it, I could print. Since "upgrading" to Windows 7, the Macs can no longer see t

  • IPhone 5 reboot loop. Need some help

    My iPhone5 suddenly reboots and it repeats that every 5-10 mins. The problem gets worse when connected to the computer. Sometimes, when battery is low, it goes off and doesnt turn on, but when connected to the computer, it shows the white apple scree

  • FLASHBACK_TRANSACTION_QUERY not working

    I try the following and it always fails. Can somebody tell me why ? SQL> select * from v$version; BANNER Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production PL/SQL Release 11.2.0.3.0 - Production CORE    11.2.0.3.0      Produ

  • How to remove the statusbar message in panelCollecion ?

    Hi All, JDev ver 11.1.1.3.0 How to remove the statusbar message in panelCollecion ? I am getting 'Columns hidden' in the status bar.. i want to remove that ? give suggestion.. Regards Gops

  • Editing using Photoshop CS4 on PC

    Hi I want to edit photos in my MacBook Aperture library using Photoshop on my PC. Is this possible ? Thanks