Dynamic update  of cursor records when table gets updated

Hi,
I am having a table with 4 columns as mentioned below
For a particular prod the value greater less than 5 should be rounded to 5 and value greater than 5 should be rounded to 10. And the rounded quantity should be adjusted with in a product starting with orderby of rank with in a prod else leave it
Table1
Col1     prod     value1     rank
1     A     2     1          
2     A     6     2
3     A     5     3
4     B     6     1
5     B     3     2
6     B     7     3
7     C     4     1
8     C     2     2
9     C     1     3
10     C     7     4
Output
Col1     prod     value1     rank
1     A     5     1          
2     A     5     2
3     A     3     3
4     B     10     1
5     B     0     2
6     B     6     3
7     C     5     1
8     C     5     2
9     C     0     3
10     C     4     4
I have taken all the records in to a cursor. Once after rounding the request of 1st rank and adjusting the values of next rank is done. Trying to round the value for 2nd rank as done for 1st rank. Its not taking the recently updated value(i,e adjusted value in rounding of 1st rank).
This is becoz of using a cursor having a value which is of old value.
Is there any way to handle such scenario's where cursor records gets dynamically updated when a table record is updated.
Any help really appreciated.
Thanks in Advance

Hi,
Below is the scenario. Which I am looking for.
ITEM_ID(A)
ITEM_ID Value Date
A          3     D1     
A          5     D2
A          3     D3     
A          5     D4
A          3     D5     
A          5     D6
Rounding for Item A has to be done for the rows less then D2 and rounding value is
x and value adjustment to be done from very next row.
--For record D1 rounding to be done and value adjustment is to be done from D2 to till the end untill the adjustment value is 0.
--For record D2 (updated value has to be taken from rounding which updated in D1 row rounding) and the adjustment has to be done from very next row D3 to till the end or adjustment value is o.
--For D3 row onwards no rounding has to be done.
ITEM_ID(B)
B          7     D1     
B          8     D2
B          9     D3     
B          5     D4
B          4     D5     
B          3     D6
Rounding for Item has to be done for the rows less then D3 and rounding value is
y and value adjustment to be done from very next row.
--For record D1 rounding to be done and value adjustment is to be done from D2 to till the end untill the adjustment value is 0.
--For record D2 (updated value has to be taken from rounding which updated in D1 row rounding) and the adjustment has to be done from very next row D3 to till the end or adjustment value is o.
--For record D3 (updated value has to be taken from rounding which updated in D2 row rounding) and the adjustment has to be done from very next row D4 to till the end or adjustment value is o.
--For D4 row onwards no rounding has to be done.
Thanks in Advance
Edited by: unique on Apr 16, 2010 11:20 PM

Similar Messages

  • Updating MDM table when another table gets updated

    Hi Guys,
    We use MDM catalog for SRM we have a table Catogories and Hierarchy, Our requirement is when ever Catogories table gets updated we have to update the Hierarchy table using some logic, So please let me know whether it is possible to do this and How to do it.
    Regards,
    Prabhu

    Hi Adrivit
    Thanks for ur idea, Could you please help me for the below questions,
    1. Currently we use Import manager to create a Catogories table, Now we want to do via PI, So we create a OUT file and drop it in the MDM OUT FTP directory but I want to know how the system picks it and process.
    2. When the MDM picks the file to upload it in Catogories table whether i will do duplicate check??? Or Is there any way I can code to check whether the give data record exist in the MDM data base then exclude or Ignore those entries.
    Regards,
    Prabhu

  • When MSKA (Sales Order Stock) table get updated?

    Hi,
    May I know when MSKA(Sales Order Stock)  table get updated?
    Regards,
    thiyagu

    suppose a sales order has been created of 10 MTS and Production Person give me 5 MTS against the sales order by creating Planned Order& Production Order wrt Sales Order,then 5 MTS will be updated into Unrestricted - Use.
    If suppose Material is Return Delivery ,then after MIGO , it goes to Quality Inspection,then this Quantity will Updated in to Stock in Quality Inspection .
    Hope ,it will help you.
    Best Regards,
    Ankur

  • When this table get update AFRP1 & AFRP2  - Confirmation table

    Hi ALL,
    I just wanted to know when this table get update .
    I know this table   AFRP1 Table of planned changes to conf.: Automatic
                              AFRP2 Table of planned changes for confirmation: B
    But i wanted to know when i will get update entry in this two table  table . I  have created one production order , released & confirmed it throgh  Co15 & done the goods movement also . But i dont get entry in this table .
    Am i skipping anything ? please guide me on this .
    Please give me all steps to get entry in this table .
    regards
    Piyush

    Hi Piyush,
    I have never used this feature, so I cannot speak from experience.  However, here is what I found in the SAP docs.
    These tables are updated when you have implemented 'decoupling' of either auto goods receipt, or backflushing.
    http://help.sap.com/erp2005_ehp_04/helpdata/EN/b1/c04d42439a11d189410000e829fbbd/frameset.htm
    There are several OSS notes that indirectly allude to these tables.  Just log onto OSS as search on "AFRP1"
    Do you have a problem with these tables?
    Best Regards,
    DB49

  • Mass upload for info records when price gets changes

    Dear All,
    How to do Mass upload for info records when price gets change.
    Regards,
    Bhargav

    Hi Bhargav,
    Please upload the present price (Map) by  LSMW . When you are doing the transactions  then automatically by selecting option info update price will be updated the  info record in Order Price history
    Regards
    M B Raju

  • How does the MDKP table gets updates

    Dear PP Guru's,
    I am new to SAP PP,
    We have a query that how does the MDKP table gets updates,
    Some time If we create new material by coping the material which is showing in table MDKP,
    But new material is not showing in table MDKP,
    Based on table MDKP we are fetching some data, due to above problem we are not able to fetch the data for some materials,
    Please suggest what could be the reason,
    Any help will be highly appreciated,
    Thanks in advance,
    Sachin.

    Thanks Thaila,
    I have checked the same by doing MRP through MD02 & the entry is getting update in MDKP,
    But for some of our materials MRP (MD02) is done earlier, but these materials are not showing in MDKP,
    Please suggest, when the entries in MDKP are removed, are there any conditions for removing the entries from MDKP.
    please pour some light on the issue,
    Thanks once again,
    Sachin.

  • Unable to update and delete record in table

    Hello All,
    Kindly help me regarding the below mentioned issue plz
    When I want to update or delete record in table from form developed in 6i give no error message but no action and when I run same form on other system updation and deletion are successfully done.
    Any suggestion

    Hello
    More explanation is as under:
    1. I am working on only one table say A
    2. Wants to update only one row of Table A at one time in single user envoirment.
    3. My form is successfully update some rows as well but not on all rows on one PC while same form able to update all rows on other PC.
    4. I drop the table and re-create the table again but problem persist.
    Any advice plz.

  • On generation of an idoc which tables gets updated?

    friends on generation of an idoc which tables gets updated?(other than edidc,ediddd,edids
    ,rfcdes).

    HI Raja,
        YOu can just go to SE11 transaction.
    Type EDI* and press F4. You would get a list of all the EDI tables(Usually all IDOC related tables start with EDI ).
    In case you do not have system access: here are some more:
    EDICONFIG                      Parameter Table for User-specific Configur
    EDID2                          IDoc Data Record from 3.0C onwards       
    EDID3                          IDoc Data Record from 3.0 onwards        
    EDID4                          IDoc Data Records from 4.0 onwards       
    EDIDC                          Control record (IDoc)                    
    EDIDD_OLD                      IDoc Data Record                         
    EDIDO                          Value table for IDoc types               
    EDIDOCINDX                     Control record (IDoc)                    
    EDIDOT                         Short description of IDoc types          
    EDIDS                          Status Record (IDoc)                     
    EDIE5                          Assign logical address to physical destina
    EDIFCT                         IDoc: Assignment of FM to log. message and
    EDIFM                          IDoc: Function modules for creating file n
    EDIFMT                         IDoc: Text table for EDIFM (funct. module
    EDILOGADR                      Assign logical address to physical destina
    EDIMAP                         EDI: Assignment Table Between IDoc and App
    EDIMSG                         Output Types and Assignment to IDoc Types
    EDIMSGT                        Short description of SAP message types   
    EDIPHONE                       Telephony Data for Partner Profiles      
    EDIPO                          Table for description of ports for EDI   
    EDIPO2                         Table for R/2 Port Definitions           
    EDIPOA                         Table for ALE Port Definitions           
    EDIPOD                         Table for File Port Definitions          
    EDIPOF                         Ports for ABAP programming interface     
    EDIPOI                         Table for describing Internet ports      
    EDIPORT                        Summary Table for all Port Types for IDoc
    EDIPOX                         Table for Description of XML Port        
    EDIPOXH                        Table for XML HTTP Port Description      
    EDIPOXU                        Conversion of special characters for XML 
    EDISDEF                        IDoc Development : IDoc Segment Definition
    EDISEG                         EDI: IDoc Segments with Assignment to Segm
    EDISEGMENT                     IDoc Development : IDoc Segment          
    EDISEGT                        EDI: Short Description of IDoc Segments  
    EDISYN                         Syntax Description for Extended Basic Type
    EDI_CNVBAS                     Conversion Table for Basic Types         
    EDI_CNVDOC                     Conversion Table for Field DOCTYP        
    EDI_CNVEXT                     Conversion Table for Extensions          
    EDI_CNVMES                     Conversion Table for Logical Message Types
    Regards,
    Ravi

  • I down loaded the update for 4 and when I get to the end where is you click finish, it tells me to close firefox, but I do not have it open. Now I can not get in to Firefox at all. PLEASE Help.

    I down loaded the update for 4 and when I get to the end where is you click finish, it tells me to close firefox, but I do not have it open. Now I can not get in to Firefox at all. PLEASE Help.

    You can get Firefox 3.6 from http://www.mozilla.com/en-US/firefox/all-older.html
    You should still have your profile folder, so when you install 3. you will get your bookmarks and other user data back.
    There is a third party version of Firefox that runs on OS X 10.4/10.5 and PPC Macs, for details see http://www.floodgap.com/software/tenfourfox

  • I was in the process of jailbreaking and updating my ipod and when i was updating it,it went into recovery mode and now i cant get it out of recovery mode so what can i do??

    i was in the process of jailbreaking and updating my ipod and when i was updating it,it went into recovery mode and now i cant get it out of recovery mode so what can i do??

    Go elsewhere:
    Jailbreaking voids the Apple warranty and also means that you will not get any support from Apple, including from this Apple forum. Jailbreaking can't be discussed in this Apple forum.
    Unauthorized modification of iOS has been a major source of instability, disruption of services, and other issues

  • Hi I am getting an update failed message (49) when trying to update photoshop after installing and whenever I start photoshop and try to access the file menu it crashes

    Hi I am getting an update failed message (49) when trying to update photoshop after installing and whenever I start photoshop and try to access the file menu it crashes

    Duplicate thread.

  • What are the tables getting updated

    Dear,
    can anybady tell me the what are the table getting updating while doing J1IEX (CAPTURE AND POST). like RG23A, RG23C,RG1,PLA.......
    THANKS
    MRS

    Thanks Ravi,
    Can u help me some more input like how to see the RG23A value and RG23C,PLA.
    what Is the any t code to the know the status?
    Thanks
    mrs

  • HT5312 I have a used iMac 21.5 in that i would like to reset the apple id so when I get updates in goes to my id instead of the previous owners id. Which in the case is a relative

    I have a used iMac 21.5 in that i would like to reset the apple id so when I get updates in goes to my id instead of the previous owners id. Which in the case is a relative. How can I do this ?

    The Mac, it's OS and the iLife apps are still associated with the original owners Apple ID.Normally the original owner needs to follow the process to prepare a Mac for selling or giving it to someone else. They need to call Apple Care and request that their Apple ID be disassociated from the Mac, erase the Mac and install the most recent version of OS X that shipped on the Mac, reinstall the iLife apps and deauthorize the Mac from their iTunes account.
    If you have a bill of sale of some sort and can prove the Mac beongs to you, Apple may be able to assist you. Call Apple Care and explain the issue.

  • How do I enable my iTouch? I am trying to update the apps but when I click "Update All", a pop up "Your Apple ID has been disabled." How do I change it so I can enable my iTouch? Thanks.

    How do I enable my iPod? I am trying to update the apps but when I click "Update All", a pop up "Your Apple ID has been disabled." How do I change it so I can enable my iPod? My iPod is not locked (I know my password), but I just can't figure out how to enable it. Thanks.

    This may help:
    http://support.apple.com/kb/ts2446

  • Macbook pro - iPhoto keep prompting to update after Yosemite update. Error message when trying to update -This update is not available for this Apple ID either because it was bought by a different user or the item was cancelled

    macbook pro - iPhoto keep prompting to update after Yosemite update. Error message when trying to update -This update is not available for this Apple ID either because it was bought by a different user or the item was refunded or cancelled. 

    I only have 1 apple ID and the same was used to set up this early 2011 macbook pro and iPhoto app. I don't want to loose out on any photos. I tried logging out of app store and back in but no luck. PLEEAASEE HELPP!!!
    This problem has been reported by quite a few forum members, who skipped the update to iPhoto 9.5.1 while running Mavericks. In that case try to purchase iPhoto again instead of updating.
    After making your backup try the following:
    Uninstall iPhoto by deleting it from the applications folder, but do not empty the Trash.
    Launch the App Store, click the "Store" menu, and sign in with your AppleID.
    Open the main page of the App Store and search for iPhoto.
    If iPhoto is listed as "Free", click the "Free" button to buy it with your current AppleID.
    If it is not showing as free, there is no help but contacting the App Store Support, as Niel pointed out: http://www.apple.com/support/mac/app-store/contact/

Maybe you are looking for

  • How do I install QT7 from my download list to hard drive on 10.7 Lion?

    I'm a newbie to Macs.  I just downloaded QuickTime 7 Player.  I want to install it on my new Mac OS X, V. 10.7.2.  Can anyone walk me through the process? (Hmm, downloads are now listed on the Safari window.)  Thanks.

  • Text does not move to a new line, I have to scroll to the right???

    In Safari and Firefox browsers when looking at some webpages the text is one long line and I have to scroll to the right to read everything. How do I restore the text so it goes down instead of across? I searched for wrap text but could not find anyt

  • Safari is missing completely

    Hi, Safari is gone.  It is not in applications, it is nowhere to be found in finder or searchlight.  I tried reinstalling my software bundle from the dvd....nothing.  The problem began when I created another user login...she could not access safari (

  • How to mask and unmask screen fields?

    Hi,     I have a PNP LDB selection screen. Also I have an extra Key Date field at bottom ( apart from the std period selection ) , which is defined by me.If i enter some value in a particular field say, Action Type, I need to make my Key Date field a

  • Account integration problem with ECC 6.0

    Hi We have using PPM 5.0 system with ECC 6.0 system (No EHP). Problem we are facing is we are not able to created the PS project automatically. I have done already all the necessary settings and in manual case it working fine it seems. I eager to kno