How to restate the ytd after an update??

I have a situation that I need to tackle to update b_id column and restate the YTD charge in a table.
Can some one help me on how to use analytical function to update and restate the ytd in a table.
Step 1: Update in Column b_id to replace C4000 with NV500 for eff_dt 1/31/2007
Step 2: Restate the Ytd_chrg column as shown in the following record set:
Following are the record set before update
a_id b_id c_id eff_dt curr_chrg ytd_chrg
07200 C4000 ABC_01 1/31/2007 400 400
07200 C4000 ABC_01 2/28/2007 0 400
07200 C4000 ABC_01 3/31/2007 0 400
07200 C4000 ABC_01 4/30/2007 0 400
07200 C4000 ABC_01 5/31/2007 0 400
07200 C4000 ABC_01 6/30/2007 0 400
07200 NV500 ABC_01 2/28/2007 500 500
07200 NV500 ABC_01 3/31/2007 600 1100
07200 NV500 ABC_01 4/30/2007 250 1350
07200 NV500 ABC_01 5/31/2007 100 1450
07200 NV500 ABC_01 6/30/2007 200 1650
Following are record set after update and restate the ytd_chrg
a_id b_id c_id eff_dt curr_chrg ytd_chrg
07200 NV500 ABC_01 1/31/2007 400 400
07200 C4000 ABC_01 2/28/2007 0 400
07200 C4000 ABC_01 3/31/2007 0 400
07200 C4000 ABC_01 4/30/2007 0 400
07200 C4000 ABC_01 5/31/2007 0 400
07200 C4000 ABC_01 6/30/2007 0 400
07200 NV500 ABC_01 2/28/2007 500 900
07200 NV500 ABC_01 3/31/2007 600 1500
07200 NV500 ABC_01 4/30/2007 250 1750
07200 NV500 ABC_01 5/31/2007 100 1850
07200 NV500 ABC_01 6/30/2007 200 2050
Your help is appreciated.
Thanks.

The rule/logic on which we need to update that column are:
Step 1: Update the b_id column. change C4000 TO NV500 for eff_dt '1/31/2007'
update T_INVC_RPT
set b_id = 'NV500'
WHERE A_ID = '07200'
AND B_ID = 'C4000'
AND C_ID = 'ABC_01'
AND eff_dt = to_date('1/31/2007','mm/dd/yyyy');
Step 2: Update the 'running total' from column curr_chrg to the column ytd_chrg.
Pl. see the above after update example for ytd_chrg calculation from Jan-June period.
I can run the select analysical sql without error. (computes the running total for curr_chrg from jan-june
The update sql script is not working!!!
update T_INVC_RPT
set YTD_CHRG = (SELECT sum(CURR_CHRG)
OVER (ORDER BY a_id, b_id, c_id, eff_dt)
FROM T_INVC_RPT
WHERE A_ID = '07200'
AND B_ID = 'NV500'
AND C_ID = 'ABC_01'
ORDER BY C_ID)
WHERE A_ID = '07200'
AND B_ID = 'NV5000'
AND C_ID = 'ABC_01'
ORDER BY C_ID;
Thanks,
Message was edited by:
[email protected]
Message was edited by:
[email protected]

Similar Messages

  • HT4528 How do you close programs running in the background after you update to the ios7?

    How do you close programs running in the background after you update to the ios7?  It no longer works to tap the button twice

    double tap the home button, and swiipe upp on the app screenshot

  • How to suspend the installation after downloading packages via ota for lollipop 5.0.1. on my Note 4. always asks me to install it on notification bar. thank you :)

    How to suspend the installation after downloading packages via ota for lollipop 5.0.1. on my Note 4. always asks me to install it on notification bar. thank you

    If you factory reset, it wont make the update go away, but you should back up and reset before you install the update.

  • Firefox has been crashing all the time after I updated to the newest version. I tried to uninstalled firefox and all addons. Restarted the computer to reinstall Firefox and it's still crashing all the time. Please help.

    Firefox has been crashing all the time after I updated to the newest version. I tried to uninstalled firefox and all addons. Restarted the computer to reinstall Firefox and it's still crashing all the time. Please help.

    https://support.mozilla.com/en-US/kb/Firefox%20crashes#w_get-help-fixing-this-crash
    Type '''about:crashes''' in the URL bar and hit Enter. <br />
    Click the hyperlinks to bring up the Crash Report pages and copy'n'paste the URL of each of those reports into the message box here. We'll see if we can help you figure out what is causing those crashes to happen.

  • Cannot delete the Folder on the desktop after Mavericks update. when I try to delete it, it is asking for logon password, When I give the logon password, it plays a sound of moving to Trash, but the folder still remains on the desktop

    Cannot delete the Folder on the desktop after Mavericks update. when I try to delete it, it is asking for logon password, When I give the logon password, it plays a sound of moving to Trash, but the folder still remains on the desktop
    Please help

    It is a folder which I have created. Name is "SAP".
    I copied some of my office stuff and then deleted the contents inside the folder. But I couldnt delete the folder SAP.
    This is happening after the Mavericks update.

  • How I get the new software to update my phone fast???

    How I get the newest software to update my Iphone fast?

    What do you mean by "fast"?  The only way for you is to connect your phone to iTunes and click "Udate. If this seems to dowload too slow, disable ALL security apps (firewall, antivirus, etc.) when updating.
    Your profile states you're running iOS 3.1.3 on an iPhone 4 which isn't even possible - the iPhone 4 can't run anything earlier than iOS 4.0

  • When i update apps on my iphone they need the ID that i used when i downloaded these app and i forgot this ID and a make a new ID how i used the new one to update these apps thanks

    Hello all,
    when i update apps on my iphone they need the ID that i used when i downloaded these apps and i forgot this ID and a make a new ID
    How i used the new one to update these apps?
    thanks

    Your device can hold apps from multiple IDs, but to update them you have to swicth identities which is time consuming. If possible use only the one ID. If you need to reset the password for your old ID visit My Apple ID.
    tt2

  • How to enable the screen after triggering the error message

    Hi All,
    we have a tcode IW31, in that one field(WBS element -PROID) is not mandatory. so we have written the following code to make it mandatory in a user exit EXIT_SAPLCOIH_010.It's triggering the error message, but it is going into disable mode. Please sugget me how to enable the screen after getting the error message triggering.
    if not caufvd_imp-proid is initial.
      select single * from t350 into wa_t350
              where  auart    = caufvd_imp-auart
                and  imord    = 'X'.
      if sy-subrc is initial.
        pspel = caufvd_imp-proid.
      else.
        call function 'CONVERSION_EXIT_ABPSP_OUTPUT'
             exporting
                  input  = caufvd_imp-proid
             importing
                  output = l_posid.
        concatenate text-t10 l_posid text-t11
                    into l_textline1 separated by space.
        message i208(00) with l_textline1.
      endif.
    else.
      message e208(00) with 'Please maintain WBS element in Location Tab'.
    endif.
    Thanks

    Hi,
    Instead of error message use status message like
    message s208(00) with 'Please maintain WBS element in Location Tab'.
    Leave to screen sy-synnr.
    This will allow to move to the screen and have in enable mode.
    WIth Regards,
    Dwaraka.S
    Edited by: Dwarakanath Sankarayogi on Feb 13, 2009 7:46 AM

  • Anyone knows how to get the photos after IMG_9999 from iphone? :-(ps:... i got them all in my camera roll but when i connected to the computer there's nothing after IMG_9999..

    anyone knows how to get the photos after IMG_9999 from iphone? :-(ps:... i got them all in my camera roll but when i connected to the computer there's nothing after IMG_9999.. many thanks :-)

    They show in the camera roll, just not your computer?
    Have you checked every folder that is in the DCIM folder?

  • How to run the BAPI after creation or Modification ?

    HI Abapers,
    How to run the BAPI after creation or Modification ? What is the step by step procedure to run the the BAPI?
    Immediate reply is highely appriciable.
    Regards,
    Chow.

    Hi
    If you have done with BAPI creation correctly Run it similar to the fun mdule which we run in SE37 calling this BAPi in the program with CALL FUNCTION and passing the necessary parameters
    see the sample bapi code how it is called in Program
    data : w_resb_header like bapirkpfc.
    data: begin of itab_resb occurs 0.
    include structure bapiresbc.
    data: end of itab_resb.
    data: begin of itab_bapi_return occurs 0.
    include structure bapireturn.
    data: end of itab_bapi_return.
    data : w_resb_no like bapirkpfc-res_no.
    w_resb_header-plant = p_werks.
    w_resb_header-res_date = sy-datum.
    w_resb_header-created_by = sy-uname.
    w_resb_header-cost_ctr = '0000010001'.
    w_resb_header-move_type = '201'.
    w_resb_header-gr_rcpt = w_room_time.
    w_resb_header-part_acct = 'OR'.
    *ITEM DATA
    loop at i_details.
    itab_resb-material = i_details-matnr.
    itab_resb-plant = i_details-werks.
    itab_resb-store_loc = i_details-lgort.
    itab_resb-quantity = i_details-qty.
    itab_resb-unit = i_details-meins.
    append itab_resb.
    clear itab_resb.
    clear i_details.
    endloop.
    call function 'BAPI_RESERVATION_CREATE'
    exporting
    reservation_header = w_resb_header
    NO_COMMIT =
    MOVEMENT_AUTO =
    importing
    reservation = w_resb_no
    tables
    reservation_items = itab_resb
    return = itab_bapi_return
    call function 'BAPI_TRANSACTION_COMMIT'
    exporting
    wait = 'X'
    IMPORTING
    RETURN =    .
    wait up to 5 seconds.
    w_resb_no contains your reservations numnber
    Regards
    Anji

  • How to cut the zeros after the decimal point ?

    Hello everybody,
    does anyone know a solution how to cut the zeros after the decimal point at at CHAR data field?
    For example the field
    &RM06P-PRMG1&
    This is a char field in the database, so that the command
    &RM06P-PRMG1(.0C)&
    doesn't work.
    At the moment the output on the form is like that
    124,000
    It shoud be like that
    124
    It would be great if anyone could help me!
    TIA!
    Strobbel

    Hi Strobbel,
    If you are working on standard sapscript, first make a zcopy of it, do the modifications in that and assign the new form to the output types in tcode NACE.
    First you need to create a program to write the logic, so go to tcode SE38 , create a new program (say zremove_zero) with Program type Executable.
    Now you will see ABAP Editor with statement;
    Report zremove_zero.
    Add the following lines below the report statement.
    *&      Form  remove_zero
    *       text
    *      <--lv_AMT  text
    FORM remove_zero  CHANGING lv_amt.
      DATA p_amt TYPE p.
      MOVE lv_amt TO p_amt.
      MOVE p_amt TO lv_amt.
    Condense lv_amt.
    ENDFORM.
    Now save and activate the program.
    Now open the zcopy of your script and Just above the statement  &RM06P-PRMG1& write the following lines;
    /: perform remove_zero in program zremove_zero
    /: changing &RM06P-PRMG1&
    /: endperform.
    Now you can see your amount printing without decimals.
    Try and let me know, hope i have guided you clearly.
    Regards
    Karthik D
    P.S.: I advice you to take help from an ABAPER.

  • How to quit the games after open it?

    How to quit the games after open it?

    iOS 7 How to Close Apps
    Double Tap the Home Button... Then swipe the App (not the icon) Upwards... Tap the Home Button when finished.
    From Here  >  http://support.apple.com/kb/HT4211

  • HT1222 how I get the latest airport software update?

    How i get the latest airport software update?

    Marlon brown wrote:
    I been trying to get this update off my phone but can not
    I been trying to figure out what you're talking about but can not

  • TA22800 How long does the 10.8.3 update take?

    How long does the 10.8.3 update take?

    It depends on your Internet speed. I have about 5MBPS and it took me 8hrs. If you have hi-speed internet I would say it would take about a hour.
    Hope This Helps!
    Mini Apple Genuis

  • How do I verify iCloud after I updated already?

    How do I verify iCloud after I updated to software 5.0? A message about account settings keeps coming up, although setting are fine

    You should have received an email which you can follow for verification. if you haven't received one, Start here, change your country if necessary and go to manage your account. Ask for a new email to be sent to you.

Maybe you are looking for

  • Special character displaying as ? in PDF output

    Hi, I am generating BI publisher report through Oracle application. My Pdf output is ok for Finnish and German language. But for polish font I am getting ? in PDF output. When I open XML file it says " The XML page cannot be displayed Cannot view XML

  • My desktop image will not resize no matter what I do.

    For some reason, I cannot get the images that I use as my desktop wallpaper to do anything but "full screen". I've done restarts and tried every type of image display and nothing works. I have some great wallpaper images, but unless I can do "fit to

  • OALL8 is in an inconsitent state

    I am having a problem with a sql query, that i execute through JDBC. I get a SQLJ exception with the message "OALL8 is in an inconsitent state" It only happens when I execute this particular query. All the other queries i execute, return normally. Ca

  • Java.lang.ClassCastException Ljava.lang.Object

    Hi everyone, I am a Software Engineer working in an enterprise application with the technologies Struts 2.0.11,EJB3.0 and Jasper reports3.0. In my enterprise application I got the Exception java.lang.ClassCastException Ljava.lang.Object while casting

  • Memory full in nokia c7

    after download,the phone cant do anything again.it shows memory full and it will automaticallý reboot itself and the shortcuts in the wiget will display '?'. If u touch it, it dispjays 'insert memory card or reinstall app' The point is that the memor