Issue with Update Routine

Hi Experts,
I tried the below code to calculate the no of days between Document Created date and System date. Also it is a condition that if a record is created yesterday and if its created time is greater than 17hrs, then the no of days shld be zero. But this code isn't working that way.
For any records created yesterday after 17hrs, the code still produces days as 1.
FYI - The Fuctional Module always adds one more to the differnce day and hence the line
  RESULT = OUT - 1.
Any Suggestions is highly appreciated.
Thanks,
DV
The code is
PROGRAM UPDATE_ROUTINE.
$$ begin of global - insert your declaration only below this line  -
TABLES: ...
DATA:   ...
TABLES: /BIC/PZCRM_ITM.
*DATA: IT_ZCRMITM LIKE /BIC/PZCRM_ITM OCCURS 0 WITH HEADER LINE.
DATA: BEGIN OF IT_ZCRMITM OCCURS 0,
          /BIC/ZCRM_ITM LIKE /BIC/PZCRM_ITM-/BIC/ZCRM_ITM,
          CREA_TIME LIKE /BIC/PZCRM_ITM-CREA_TIME,
      END    OF IT_ZCRMITM.
SELECT /BIC/ZCRM_ITM CREA_TIME FROM
/BIC/PZCRM_ITM INTO TABLE IT_ZCRMITM.
DATA: CUR_DATE LIKE SY-DATUM,
      PRE_DATE LIKE SY-DATUM,
      DOC_DATE LIKE SY-DATUM,
      TIME_CREA LIKE SY-UZEIT,
      OUT LIKE SY-TABIX.
$$ end of global - insert your declaration only before this line   -
FORM compute_key_field
  TABLES   MONITOR STRUCTURE RSMONITOR "user defined monitoring
  USING    COMM_STRUCTURE LIKE /BIC/CS80CRM_PRI
           RECORD_NO LIKE SY-TABIX
           RECORD_ALL LIKE SY-TABIX
           SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS
  CHANGING RESULT LIKE /BIC/VZCRM_PRI1T-/BIC/ZOPENDAYS
           RETURNCODE LIKE SY-SUBRC
           ABORT LIKE SY-SUBRC. "set ABORT <> 0 to cancel update
$$ begin of routine - insert your code only below this line        -
fill the internal table "MONITOR", to make monitor entries
  CLEAR: CUR_DATE.
  CLEAR: OUT.
  CLEAR: DOC_DATE.
  CLEAR: TIME_CREA.
result value of the routine
***Get Time Created***
READ TABLE IT_ZCRMITM WITH KEY
/BIC/ZCRM_ITM = COMM_STRUCTURE-/BIC/ZCRM_ITM.
IF SY-SUBRC = 0.
TIME_CREA  = IT_ZCRMITM-CREA_TIME.
ENDIF.
***Get Time Created***
***Get No of Days***
  CUR_DATE = SY-DATUM.
  DOC_DATE = COMM_STRUCTURE-calday.
  CALL FUNCTION 'Z_SELECT_FACTDAYS_FOR_PERIOD'
    EXPORTING
      I_DATAB  = DOC_DATE
      I_DATBI  = CUR_DATE
      I_FACTID = 'AU'
    IMPORTING
      OUT_DAYS = OUT.
***Get No of Days***
***Calculate appropriate No of Days for Yesterday's Records***
if time created is after 17.00 hrs then no of days for the records cre
otherwise the result will be OUT minus 1
  PRE_DATE = SY-DATUM - 1.
  IF DOC_DATE = PRE_DATE AND
    IT_ZCRMITM-CREA_TIME GT '170000'.
    RESULT = OUT - 2.
  ELSE.
    RESULT = OUT - 1.
  ENDIF.
***Calculate appropriate No of Days for Yesterday's Records***
if the returncode is not equal zero, the result will not be updated
  RETURNCODE = 0.
if abort is not equal zero, the update process will be canceled
  ABORT = 0.
$$ end of routine - insert your code only before this line         -

Hi Olivier,
Thanks for your response.
1. I will add the clause as u have suggested. But may I know teh scenario where we may find inactive master data- We load and activaet the master data daily.
2. The function module code is as below. This FM is similar to one in R3 I think u can find by searching with SELECT_FACTDAYS
FUNCTION Z_SELECT_FACTDAYS_FOR_PERIOD.
""Local Interface:
*"  IMPORTING
*"     REFERENCE(I_DATAB) LIKE  SY-DATUM
*"     REFERENCE(I_DATBI) LIKE  SY-DATUM
*"     REFERENCE(I_FACTID) LIKE  TFACT-IDENT
*"  EXPORTING
*"     REFERENCE(OUT_DAYS) LIKE  SY-TABIX
  DATA: L_V_AKTDAT LIKE SCAL-DATE.
  DATA: L_V_INDICATOR LIKE SCAL-INDICATOR.
CLEAR  : ETH_DATS.
REFRESH: ETH_DATS.
  L_V_AKTDAT = I_DATAB.
do it for all days in space of time
  WHILE L_V_AKTDAT <= I_DATBI.
    CALL FUNCTION 'DATE_CONVERT_TO_FACTORYDATE'
         EXPORTING
              DATE                         = L_V_AKTDAT
              FACTORY_CALENDAR_ID          = I_FACTID
         IMPORTING
              WORKINGDAY_INDICATOR         = L_V_INDICATOR
         EXCEPTIONS
              CALENDAR_BUFFER_NOT_LOADABLE = 1
              CORRECT_OPTION_INVALID       = 2
              DATE_AFTER_RANGE             = 3
              DATE_BEFORE_RANGE            = 4
              DATE_INVALID                 = 5
              FACTORY_CALENDAR_NOT_FOUND   = 6
              OTHERS                       = 7.
   IF SY-SUBRC NE 0.
     MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
            RAISING DATE_CONVERSION_ERROR.
   ENDIF.
indicator is space if actual day is a working day
if indicator is not space the actual day isn't a working day
    IF L_V_INDICATOR EQ SPACE.
     CLEAR ETH_DATS.
     ETH_DATS-PERIODAT = L_V_AKTDAT.
     APPEND ETH_DATS.
      out_days = out_days + 1.
    ENDIF.
    L_V_AKTDAT = L_V_AKTDAT + 1.
  ENDWHILE.
ENDFUNCTION.
3. There will be always a masterr data record, coz we load them daily. and the load is a full update so no records gets deleted.
4. The load will be a Daily load. Business wants to capture the Snapshot for that day.  So apart from deciding the no of days based on created time, the other logic works fine.
So my suspecian is that the part which decides based on Time created is not actually working in the way we expeceted.
DV
Message was edited by:
        DVMC

Similar Messages

  • Issue with Update of Table VARINUM

    Hi,
    I am getting waiting Issues with Update of table VARINUM. Has anybody faced such an issue.
    I have a lot of Jobs which are running in background. I am submitting it through a report. what can be the issue.
    Regards,
    Abhishek jolly

    Thisi is quite old, but not answered properly yet, so there you go:
    SAP generates a new job and temporary variant on report RSDBSPJS, for each HTTP call,which creates database locks on table VARINUM .
    This causes any heavyweight BSP application  to hang and give timeout errors.
    The problem is fixed applying OSS note 1791958, which is not included in any service pack.

  • Any other realtors having issues with updating their Suprakey on their Android?

    Any other realtors having issues with updating their Suprakey on their Android?

    The follow is from clicking on that error number in the article cited at the end of my post:
    Error 3194: Resolve error 3194 by updating to the latest version of iTunes. "This device is not eligible for the requested build" in the updater logs confirms this is the root of the issue. For more Error 3194 steps see: This device is not eligible for the requested build above.
    iOS: Resolving update and restore alert messages

  • Having issue with update Adobe 11.0.06.  Error 1603.

    Having issue with update Adobe 11.0.06.  Error 1603.

    You should have gotten this information with the error: "Shut down Microsoft Office and all web browsers. Then, in Acrobat or Reader, choose Help > Check for Updates. See also Error 1603 | Install | CS3, CS4 products." Also, be sure you log in as the administrator and disable anti-virus.

  • Having issues with update to iOS 8

    Having issues with update to iOS 8, wheel keeps spinning with 9 hrs remaining to complete update. What are my options?
    <Re-Titled By Host>

    I am a windows/mac user... And I was  Linux user for several years...  And so far I have been really happy with apple but this problem is frustrating.
    I don't understand:
    1)Why can't I go back to iOS7 since this was apparently the most stable version for my iPad ?
    2) Why is apple not doing anything about it,  ?
    3) If the problem is that my iPad's can't fully support the features of iOS8, why on earth have they made it available to iPad 2?
    Any way, I will just wait a bit longer and probably start looking in to a Samsung tablet or something....
    Cheers,

  • Issue with Start Routine

    Hi Experts,
    I searched in the forum, but no Start Routine found which includes lot of code,as i know it's not gud to post code here, but i am not finding solution, pls help me.
    I have small issue with the following code, pls specify changes.Original routine is from BW3.5 version, i have made some changes, please specify if any. If you could help me, i will be very thankfull to u people,
    Start Routine:
    TYPES:
    BEGIN OF sl_keyfigures,
    ---(Here all the fields are defined)
    END OF sl_keyfigures.
    DATA: gt_sl_keyfigures TYPE TABLE OF sl_keyfigures,
          lv_corqty LIKE /bi0/acds_ds0600-apo_corqty,
          lv_logsys LIKE /bi0/acds_ds0600-apo_logsys,
          ls_monitor TYPE rsmonitor,
          gs_current_doc TYPE /bic/cs80cds_ds07.
    FIELD-SYMBOLS: <ls_data_package> TYPE data_package_structure,
                     <ls_time_series> TYPE /bi0/acds_ds0700.
      DATA: ls_keyfigures TYPE sl_keyfigures,
            lv_corr_cumdel LIKE /bi0/acds_ds0700-apo_delqty,
            lv_cumdel LIKE /bi0/acds_ds0700-apo_delqty,
            lv_cumreq LIKE /bi0/acds_ds0700-apo_delreq,
            lv_cumcon LIKE /bi0/acds_ds0700-apo_delcon.
      SORT SOURCE_PACKAGE BY doc_number s_ord_item apo_logsys calday.
      CLEAR: lv_corr_cumdel, lv_cumdel, lv_cumreq, lv_cumcon.
      LOOP AT SOURCE_PACKAGE ASSIGNING <ls_data_package>.
        IF gs_current_doc-doc_number <> <ls_data_package>-doc_number OR
           gs_current_doc-s_ord_item <> <ls_data_package>-s_ord_item OR
           gs_current_doc-apo_logsys <> <ls_data_package>-apo_logsys.
    doc changed
          CLEAR: lv_corr_cumdel, lv_cumdel, lv_cumreq, lv_cumcon.
          gs_current_doc-doc_number = <ls_data_package>-doc_number.
          gs_current_doc-s_ord_item = <ls_data_package>-s_ord_item.
          gs_current_doc-apo_logsys = <ls_data_package>-apo_logsys.
          SELECT apo_corqty FROM /bi0/acds_ds0600 INTO lv_corqty
            WHERE doc_number = <ls_data_package>-doc_number
            AND s_ord_item = <ls_data_package>-s_ord_item
            AND apo_logsys = <ls_data_package>-apo_logsys.
          ENDSELECT.
    IF sy-subrc <> 0.
    no correction quantity found
            IF <ls_data_package>-apo_logsys IS INITIAL.
              lv_logsys = 'no logical system' ( 001 ).
            ELSE.
              lv_logsys = <ls_data_package>-apo_logsys.
            ENDIF.
            ls_monitor-msgid = 'RS_BCT_APO_CDS'.
            ls_monitor-msgty = 'S'.
            ls_monitor-msgno = '010'.
            ls_monitor-msgv1 = <ls_data_package>-doc_number.
            ls_monitor-msgv2 = <ls_data_package>-s_ord_item.
            ls_monitor-msgv3 = lv_logsys.
            ls_monitor-detlevel = '2'.
            APPEND ls_monitor TO MONITOR.
          ENDIF.
        ENDIF.
        ls_keyfigures-vbeln = <ls_data_package>-doc_number.
        ls_keyfigures-vbelp = <ls_data_package>-s_ord_item.
        ls_keyfigures-logsys = <ls_data_package>-apo_logsys.
        ls_keyfigures-date = <ls_data_package>-calday.
        lv_cumdel = lv_cumdel + <ls_data_package>-apo_delqty.
        lv_cumreq = lv_cumreq + <ls_data_package>-apo_delreq.
        lv_cumcon = lv_cumcon + <ls_data_package>-apo_delcon.
        lv_corr_cumdel = lv_cumdel - lv_corqty.
    call for requested time series
        CALL FUNCTION 'CMDS_CALC_SERVICE_LEVEL'
          EXPORTING
            iv_demand_qty       = <ls_data_package>-apo_delreq
            iv_delivery_qty     = <ls_data_package>-apo_delqty
            iv_***_delivery_qty = lv_corr_cumdel
            iv_***_demand_qty   = lv_cumreq
          IMPORTING
            ev_early_qty        = ls_keyfigures-early_req_qty
            ev_early_scl        = ls_keyfigures-early_req_scl
            ev_late_qty         = ls_keyfigures-late_req_qty
            ev_late_scl         = ls_keyfigures-late_req_scl
            ev_punct_qty        = ls_keyfigures-punct_req_qty
            ev_punct_scl        = ls_keyfigures-punct_req_scl.
    Since open requested quantities for customer orders are not updated
    in BW from InfoSource 2LIS_11_V_SCL key figures that are based on
    open requested quantities cannot be calculated
        IF <ls_data_package>-apoplanned <> '1'.
          CLEAR: ls_keyfigures-early_req_qty,
                 ls_keyfigures-early_req_scl,
                 ls_keyfigures-late_req_qty,
                 ls_keyfigures-late_req_scl,
                 ls_keyfigures-punct_req_qty,
                 ls_keyfigures-punct_req_scl.
        ENDIF.
    call for confirmed time series
        CALL FUNCTION 'CMDS_CALC_SERVICE_LEVEL'
          EXPORTING
            iv_demand_qty       = <ls_data_package>-apo_delcon
            iv_delivery_qty     = <ls_data_package>-apo_delqty
            iv_***_delivery_qty = lv_corr_cumdel
            iv_***_demand_qty   = lv_cumcon
          IMPORTING
            ev_early_qty        = ls_keyfigures-early_conf_qty
            ev_early_scl        = ls_keyfigures-early_conf_scl
            ev_late_qty         = ls_keyfigures-late_conf_qty
            ev_late_scl         = ls_keyfigures-late_conf_scl
            ev_punct_qty        = ls_keyfigures-punct_conf_qty
            ev_punct_scl        = ls_keyfigures-punct_conf_scl.
        APPEND ls_keyfigures TO gt_sl_keyfigures.
        CLEAR ls_keyfigures.
      ENDLOOP.
    Error:
    E:Within classes and interfaces, you can only use "TYPE" to refer to ABAP
    Dictionary types (not "LIKE" or "STRUCTURE").
    Thanks,
    Venkatesh

    eg of start routine:
    SELECT customer /bic/cg_gblrp1 /bic/cg_regrp2 /bic/cg_locrp3
        /bic/cg_locrp4 /bic/cg_locrp5 /bic/cg_chanel
        /bic/cg_subchn
        INTO TABLE tab_customer FROM /bi0/pcustomer
        FOR ALL ENTRIES IN tab_cust WHERE
        customer = tab_cust-customer AND
        objvers = 'A'.
        SORT tab_customer BY customer.
    Hope this helps and assign pts for the same.

  • Issue with updating Security Info on my Microsoft ID

    I am stuck in a vicious circle trying to sort an issue with my Microsoft account.
    I need to remove an old, defunct, email address and add a load of new security info however, depending on whether the date format on the page I keep being directed to is UK or US, either the updates haven’t happened or they won’t
    be happening until next month – which seems ridiculous!
    I’m trying to sign up for a Windows Store developer account to publish a Windows 8 app. I’m using my MSDN subscription to register for this (for free) but there is a step I can’t get past because it insists on sending a code to
    my old email address – to which I have no access. It is picking up this address from my Microsoft Account Security info – however, I updated this info weeks ago. This is the screen I see (I’ve blurred out some of it as it seemed foolish to publish all my security
    info J
    It says my old address will be removed on 03/04/2013 and my new info added on that same date. Does anyone know if this is UK date format 3<sup>rd</sup> April – in which case it’s a long wait or a US date 4<sup>th</sup>
    March in which case it didn’t happen? I’ve tried phoning 5000 and the Microsoft Customer support lines but neither of them have a clue where to start. They just keep asking me if I’ve forgotten my password – which I haven’t.
    Does anyone know how I can resolve this? My only option at the moment is to wait until 3<sup>rd</sup> of April and see if anything changes – which is not ideal.
    Cheers,
    Rob

    Hello,
    The Microsoft account forum has been retired and all account related questions must now be asked online
    here.
    Select the issue you need help with and fill out the requested details on the next page.
    You need to be signed in with a Microsoft account to access the form. If you are unable to access your primary account, you can use an alternate account (if you have one) or create a new one at
    https://signup.live.com
    You can read further information about blocked accounts
    here.
    Karl
    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
    My Blog: Unlock PowerShell
    My Book:
    Windows PowerShell 2.0 Bible
    My E-mail: -join ('6F6C646B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})

  • Issue with update of BOM by Variant Config - Cost relevant indicator

    Hi All VC Expert,
    We are facing an issue with the update by reference characteristic of the field STPO-SANKA Cost relevancy indicator on the BOM.
    We are on SAP ECC 6.0 release 700 on Oracle
    Hot Package
    - SAPKA70015 on ERP Cross Application componenent
    - SAPKH60013 on SAP-APPL Logistics and accouting
    We are using material variant
    We are on the first level of configuration
    Classically, we built a procedure to set X to this data base field as below :
    $self.STPO_SANKA = 'X'
    We assigned this procedure to the relevant items
    Here is the result we have:
    At the creation of the Plan Order, this is not working
    At the creation of the Prod Order, this is not working
    When we do a Reload PP master data, this is working very well
    On CU50/VA02 when we check the trace, the procedure is executed.
    Do somebody have an idea or already facing this and solve it ?
    Thanks in advance for your appreciated help.

    Hi Fabien. Did you solve your problem?

  • Issue with update to 10.6.5 and WIFI connection

    I have been having an ongoing issue with my MBP over the last 6 months and even more consistently within the last several weeks.
    I have searched the other posts and I think that I might be making a connection here. So, please chime in if you have anything to add to solving or addressing my problem as I think that there are others out there suffering.
    Issue in short: Waking my MBP from sleep mode or turning it on loses my connection to my WIFI that is password protected.
    Mainly when I wake my MBP from sleep mode this occurs a lot.
    I have contacted AppleCare many times and have taken my computer to the Genius guys and I have done the following:::
    Genius guys tested the computer and could not replicate. No hardware issues found, must be a software issue.
    AppleCare, done many things to reset the computer, re-installed Snow Leopard, deleted Caches and other things.
    Now, I am wondering if there is something actually due to the OS updates after 10.6.2 or 10.6.3 that is causing my issue that much more.
    I can see my wireless router as available to join, I select it, type in my password, and it states invalid password. Try to restart, reboot, and nothing. It almost appears that it loses the sync between my keychain and such.
    As of late, as I stated, the problem is more persistent now.
    What do you think? An issue with the latest updates of 10.6.5?

    I too often have a devil of a time connecting to a Linksys WiFi router with a brand-new unibody MacBook Pro 15", 2.66GHz. I noticed that if I boot the machine off an external Firewire drive this seems to be more of an issue than if I boot off the internal drive.
    I beginning to thing there's some kind of interference between the Firewire system and the WiFi system.
    The router is a Linksys with the latest firmware update. My MacBook and iPhone 3G, iPhone 4 connect to the router fine.

  • Performence issue with Update

    hi all,
    I am facing issue with below update statemetn. taking huge time to update. in xx__TEMP table I have index on Project id column. and all underlying table hase index.
    Please look into plan and let me how I can reduce Cost for the blow update statement.
    Thanks in advance.
    UPDATE dg2.ODS_PROJ_INFO_LOOKUP_TEMP o
    SET Months_In_Stage_Cnt =
    (SELECT
    NVL(ROUND(MONTHS_BETWEEN(SYSDATE,x.project_event_actual_date),2),0) Months_In_Stage_Cnt
    FROM od.project_event x
    WHERE x.project_id = o.project_id
    AND event_category_code = 'G'
    AND project_event_seq_nbr =
    (SELECT MAX(project_event_seq_nbr)
    FROM od.project_event y
    WHERE y.project_id = x.project_id
    AND y.event_category_code = 'G'
    AND y.project_event_actual_date IS NOT NULL
    AND stage_nbr <> 0
    AND y.project_event_seq_nbr <
    (SELECT project_event_seq_nbr
    FROM od.project_event z
    WHERE stage_nbr =
    (SELECT current_stage_nbr
    FROM od.project
    WHERE project_id = x.project_Id )
    AND z.project_id = x.project_Id
    AND z.event_category_code = 'G'
    AND skip_stage_ind = 'N'
    AND project_event_actual_date IS NULL )
    Plan
    UPDATE STATEMENT CHOOSECost: *1,195,213* Bytes: 71,710,620 Cardinality: 41,213
    14 UPDATE DG2.ODS_PROJ_INFO_LOOKUP_TEMP
    1 TABLE ACCESS FULL TABLE DG2.ODS_PROJ_INFO_LOOKUP_TEMP Cost: 36 Bytes: 71,710,620 Cardinality: 41,213
    13 FILTER
    3 TABLE ACCESS BY INDEX ROWID TABLE OD.PROJECT_EVENT Cost: 9 Bytes: 104 Cardinality: 8
    2 INDEX RANGE SCAN INDEX (UNIQUE) od.XPKPROJECT_EVENT Cost: 3 Cardinality: 8
    12 SORT AGGREGATE Bytes: 16 Cardinality: 1
    11 FILTER
    5 TABLE ACCESS BY INDEX ROWID TABLE od.PROJECT_EVENT Cost: 9 Bytes: 16 Cardinality: 1
    4 INDEX RANGE SCAN INDEX (UNIQUE) od.XPKPROJECT_EVENT Cost: 3 Cardinality: 8
    10 FILTER
    7 TABLE ACCESS BY INDEX ROWID TABLE od.PROJECT_EVENT Cost: 9 Bytes: 108 Cardinality: 6
    6 INDEX RANGE SCAN INDEX (UNIQUE) od.XPKPROJECT_EVENT Cost: 3 Cardinality: 8
    9 TABLE ACCESS BY INDEX ROWID TABLE od.PROJECT Cost: 2 Bytes: 9 Cardinality: 1
    8 INDEX UNIQUE SCAN INDEX (UNIQUE) od.XPKPROJECT Cost: 1 Cardinality: 1
    Thanks
    Deb

    882134 wrote:
    Can any body give me some light why upto Select statement cost is ok, but only Update statemet is take huge 11m costing.
    thanks
    DebOkay so completely ignore the content of the 2 forum posts.
    Why is the cost an issue for you? Without your tables, data and environment, and without a readable execution plan it's difficult to help you.
    Maybe you could read the link I gave you and post some of the information it talks about up here.
    p.s. read the link.

  • Issue with updating partitioned table

    Hi,
    Anyone seen this bug with updating partitioned tables.
    Its very esoteric - its occurs when we update a partitioned table using a join to a temp table (not non-temp table) when the join has multiple joins and you're updating the partitoned column that isn't the first column in the primary key and the table contains a bit field. We've tried changing just one of these features and the bug disappears.
    We've tested this on 15.5 and 15.7 SP122 and the error occurs in both of them.
    Here's the test case - it does the same operation of a partitioned table and a non-partitioned table, but the partitioned table shows and error of "Attempt to insert duplicate key row in object 'partitioned' with unique index 'pk'".
    I'd be interested if anyone has seen this and has a version of Sybase without the issue.
    Unfortunately when it happens on a replicated table - it takes down rep server.
    CREATE TABLE #table1
        (   PK          char(8) null,
            FileDate        date,
            changed         bit
    CREATE TABLE partitioned  (
      PK         char(8) NOT NULL,
      ValidFrom     date DEFAULT current_date() NOT NULL,
      ValidTo       date DEFAULT '31-Dec-9999' NOT NULL
    LOCK DATAROWS
      PARTITION BY RANGE (ValidTo)
      ( p2014 VALUES <= ('20141231') ON [default],
      p2015 VALUES <= ('20151231') ON [default],
      pMAX VALUES <= (MAX) ON [default]
    CREATE UNIQUE CLUSTERED INDEX pk
      ON partitioned(PK, ValidFrom, ValidTo)
      LOCAL INDEX
    CREATE TABLE unpartitioned  (
      PK         char(8) NOT NULL,
      ValidFrom     date DEFAULT current_date() NOT NULL,
      ValidTo       date DEFAULT '31-Dec-9999' NOT NULL,
    LOCK DATAROWS
    CREATE UNIQUE CLUSTERED INDEX pk
      ON unpartitioned(PK, ValidFrom, ValidTo)
    insert partitioned
    select "ET00jPzh", "Jan  7 2015", "Dec 31 9999"
    insert unpartitioned
    select "ET00jPzh", "Jan  7 2015", "Dec 31 9999"
    insert #table1
    select "ET00jPzh", "Jan 15 2015", 1
    union all
    select "ET00jPzh", "Jan 15 2015", 1
    go
    update partitioned
    set    ValidTo = dateadd(dd,-1,FileDate)
    from   #table1 t
    inner  join partitioned p on (p.PK = t.PK)
    where  p.ValidTo = '99991231'
    and    t.changed = 1
    go
    update unpartitioned
    set    ValidTo = dateadd(dd,-1,FileDate)
    from   #table1 t
    inner  join unpartitioned u on (u.PK = t.PK)
    where  u.ValidTo = '99991231'
    and    t.changed = 1
    go
    drop table #table1
    go
    drop table partitioned
    drop table unpartitioned
    go

    wrt to replication - it is a bit unclear as not enough information has been stated to point out what happened.  I also am not sure that your DBA's are accurately telling you what happened - and may have made the problem worse by not knowing themselves what to do - e.g. 'losing' the log points to fact that someone doesn't know what they should.   You can *always* disable the replication secondary truncation point and resync a standby system, so claims about 'losing' the log are a bit strange to be making. 
    wrt to ASE versions, I suspect if there are any differences, it may have to do with endian-ness and not the version of ASE itself.   There may be other factors.....but I would suggest the best thing would be to open a separate message/case on it.
    Adaptive Server Enterprise/15.7/EBF 23010 SMP SP130 /P/X64/Windows Server/ase157sp13x/3819/64-bit/OPT/Fri Aug 22 22:28:21 2014:
    -- testing with tinyint
    1> use demo_db
    1>
    2> CREATE TABLE #table1
    3>     (   PK          char(8) null,
    4>         FileDate        date,
    5> --        changed         bit
    6>  changed tinyint
    7>     )
    8>
    9> CREATE TABLE partitioned  (
    10>   PK         char(8) NOT NULL,
    11>   ValidFrom     date DEFAULT current_date() NOT NULL,
    12>   ValidTo       date DEFAULT '31-Dec-9999' NOT NULL
    13>   )
    14>
    15> LOCK DATAROWS
    16>   PARTITION BY RANGE (ValidTo)
    17>   ( p2014 VALUES <= ('20141231') ON [default],
    18>   p2015 VALUES <= ('20151231') ON [default],
    19>   pMAX VALUES <= (MAX) ON [default]
    20>         )
    21>
    22> CREATE UNIQUE CLUSTERED INDEX pk
    23>   ON partitioned(PK, ValidFrom, ValidTo)
    24>   LOCAL INDEX
    25>
    26> CREATE TABLE unpartitioned  (
    27>   PK         char(8) NOT NULL,
    28>   ValidFrom     date DEFAULT current_date() NOT NULL,
    29>   ValidTo       date DEFAULT '31-Dec-9999' NOT NULL,
    30>   )
    31> LOCK DATAROWS
    32>
    33> CREATE UNIQUE CLUSTERED INDEX pk
    34>   ON unpartitioned(PK, ValidFrom, ValidTo)
    35>
    36> insert partitioned
    37> select "ET00jPzh", "Jan  7 2015", "Dec 31 9999"
    38>
    39> insert unpartitioned
    40> select "ET00jPzh", "Jan  7 2015", "Dec 31 9999"
    41>
    42> insert #table1
    43> select "ET00jPzh", "Jan 15 2015", 1
    44> union all
    45> select "ET00jPzh", "Jan 15 2015", 1
    (1 row affected)
    (1 row affected)
    (2 rows affected)
    1>
    2> update partitioned
    3> set    ValidTo = dateadd(dd,-1,FileDate)
    4> from   #table1 t
    5> inner  join partitioned p on (p.PK = t.PK)
    6> where  p.ValidTo = '99991231'
    7> and    t.changed = 1
    Msg 2601, Level 14, State 6:
    Server 'PHILLY_ASE', Line 2:
    Attempt to insert duplicate key row in object 'partitioned' with unique index 'pk'
    Command has been aborted.
    (0 rows affected)
    1>
    2> update unpartitioned
    3> set    ValidTo = dateadd(dd,-1,FileDate)
    4> from   #table1 t
    5> inner  join unpartitioned u on (u.PK = t.PK)
    6> where  u.ValidTo = '99991231'
    7> and    t.changed = 1
    (1 row affected)
    1>
    2> drop table #table1
    1>
    2> drop table partitioned
    3> drop table unpartitioned
    -- duplicating with 'int'
    1> use demo_db
    1>
    2> CREATE TABLE #table1
    3>     (   PK          char(8) null,
    4>         FileDate        date,
    5> --        changed         bit
    6>  changed int
    7>     )
    8>
    9> CREATE TABLE partitioned  (
    10>   PK         char(8) NOT NULL,
    11>   ValidFrom     date DEFAULT current_date() NOT NULL,
    12>   ValidTo       date DEFAULT '31-Dec-9999' NOT NULL
    13>   )
    14>
    15> LOCK DATAROWS
    16>   PARTITION BY RANGE (ValidTo)
    17>   ( p2014 VALUES <= ('20141231') ON [default],
    18>   p2015 VALUES <= ('20151231') ON [default],
    19>   pMAX VALUES <= (MAX) ON [default]
    20>         )
    21>
    22> CREATE UNIQUE CLUSTERED INDEX pk
    23>   ON partitioned(PK, ValidFrom, ValidTo)
    24>   LOCAL INDEX
    25>
    26> CREATE TABLE unpartitioned  (
    27>   PK         char(8) NOT NULL,
    28>   ValidFrom     date DEFAULT current_date() NOT NULL,
    29>   ValidTo       date DEFAULT '31-Dec-9999' NOT NULL,
    30>   )
    31> LOCK DATAROWS
    32>
    33> CREATE UNIQUE CLUSTERED INDEX pk
    34>   ON unpartitioned(PK, ValidFrom, ValidTo)
    35>
    36> insert partitioned
    37> select "ET00jPzh", "Jan  7 2015", "Dec 31 9999"
    38>
    39> insert unpartitioned
    40> select "ET00jPzh", "Jan  7 2015", "Dec 31 9999"
    41>
    42> insert #table1
    43> select "ET00jPzh", "Jan 15 2015", 1
    44> union all
    45> select "ET00jPzh", "Jan 15 2015", 1
    (1 row affected)
    (1 row affected)
    (2 rows affected)
    1>
    2> update partitioned
    3> set    ValidTo = dateadd(dd,-1,FileDate)
    4> from   #table1 t
    5> inner  join partitioned p on (p.PK = t.PK)
    6> where  p.ValidTo = '99991231'
    7> and    t.changed = 1
    Msg 2601, Level 14, State 6:
    Server 'PHILLY_ASE', Line 2:
    Attempt to insert duplicate key row in object 'partitioned' with unique index 'pk'
    Command has been aborted.
    (0 rows affected)
    1>
    2> update unpartitioned
    3> set    ValidTo = dateadd(dd,-1,FileDate)
    4> from   #table1 t
    5> inner  join unpartitioned u on (u.PK = t.PK)
    6> where  u.ValidTo = '99991231'
    7> and    t.changed = 1
    (1 row affected)
    1>
    2> drop table #table1
    1>
    2> drop table partitioned
    3> drop table unpartitioned

  • Are there any issues with updating to IOS 5.0.1

    I have a  brand new IPad 2 and I see there is an OS update available. I see there are issues with some IPhones, but I'm wondering if there is any reason not to update the OS on my IPad?

    I haven't had any issues, although posts in this forum show some have. To upgrade to iOS5 you need to have your iPad connected to your computer. Once iOS5 is installed, further iOS updates can be installed via WiFi connection.
    You can download a complete iPad 2 User Guide here: http://manuals.info.apple.com/en/ipad_user_guide.pdf
     Cheers, Tom

  • Any known issues with updating to the Windows 8.1 RTM?

    The Windows 8.1 RTM is finally on MSDN. I was looking to run the update and wanted to see if anyone has upgraded and see if anyone has seen any issues with CC.

    In case anybody else is using Windows 8.1 on 3200 x 1800 resolution and experiencing the same problem, I think I may have found a workaround.  At least on this laptop (Dell XPS15) I can right
    -click on the EDQ application in the Start Menu and choose to Run with graphics processor / High - performance (NVIDIA) processor.  This appears to render the EDQ canvas with sympathetically sized fonts making the processes, and the attributes within processors, readable again.
    I would be interested to hear if anybody has some Java font parameter that can be set to control the font size on Java applications, but for now the problem I had appears to be solved.

  • Torch 9800 Issues with updating software

    Hi there I'm new to this forum and to BB.
    I have been having issues with my Torch for a couple of weeks now, firstly I had issues with it when it was charging the red light and not coming on, but managed to get it to work after a bit of searching on here.
    This happened regularly over the past week, then today I have the Error 507 message.
    I have used Desktop Manager  v5.0.1 to try and update it but I didn't have the password for the phone and after 10 attempts it wiped the phone which I wasn't really bothered about.
    I am now trying to update the software but when I get to the Device Application Selection page it says that I have don't have any  space left.
    Is there any way around this so that I can update the phone's software?
    Any help would be much appreciated.
    Clwyd

    Hi! Welcome to the forums.
    Please keep us posted and goodluck.
    Click if you want to Thank someone. If Problem is resolved, so that others can make use of it.

  • Issues with updating!! Help!!

    I got the App 200 Error and am trying to update the OS, but my desktop manager keeps saying that I have connection issues with the internet and won't let me update. Is there something I can do??

    Are you doing a web-based upgrade or are you going through the BlackBerry Desktop Software?
    If you have tried both of those options, and are still having issues have a look at the link below. This link will explain how to perform a clean application load of the BlackBerry device Software.
    How to perform a clean reload of the BlackBerry Device Software using BlackBerry Desktop Manager for Windows - KB11320
    http://www.blackberry.com/btsc/KB11320
    Hope this helps.

Maybe you are looking for

  • Wont download video from i tunes list

    I have a video I just got from i tunes (yes it mp4 converted, I checked) and when i try to download it to my i pod it says (name of i pod) disk can not be read to or from. I have had other problems with videos being downloaded to my i pod as well. an

  • HT5372 i have tried sending message to lock my iPhone but it not working

    i have tried sending message to lock my iPhone but it not working. what should i do to be able to make this work well for me.

  • Kern text in Photoshop Elements?

    I am trying to find text kerning in Photoshop Elements 7.0. Am I missing it or is it not included in Elements?

  • Dimmest PB display I've ever had

    Just got a 12" PB (1.5 ghz) used. Runs great but the display is dimmer than my old Pismo. Any hacks to brighten the screen?

  • Having trouble in updating mac os x

    Hey, I'm Umair khan I just need support of you fellas out there, Coming to the point.. Im updating my mac os x 10.5.6 to 10.5.8 but unfortunately Im not having succes, Aproximately after 72% of done with that error comes with these words as follows,