Oracle Update Flag SOLVED

I have a PRE-UPDATE trigger used for cascade updates which warns users how many tables they will be effecting when they make their changes.
DECLARE
  v_seq_num         NUMBER;
  v_tab_num         NUMBER;
  v_old_mfcode  VARCHAR2(8);
  v_new_mfcode  VARCHAR2(8);
BEGIN
v_old_mfcode := get_item_property('DD_MATFUEL.MFCODE',database_value);
v_new_mfcode := :DD_MATFUEL.MFCODE;
if v_old_mfcode <> v_new_mfcode then
SELECT COUNT(*)
INTO v_seq_num
FROM DD_MATFUELSEQ
WHERE MFCODE = v_old_mfcode;
SELECT COUNT(*)
INTO v_tab_num
FROM DD_TAB_MFCOLLAPSE
WHERE MFCODE = v_old_mfcode;     
msg_confirm ('Warning...', v_old_mfcode || ' will be updated to ' || v_new_mfcode || ' on the following tables...'||chr(10) ||
                      'DD_MATFUELSEQ ' || v_seq_num || ' instances' || chr(10) ||
                      'DD_TAB_MFCOLLAPSE ' || v_tab_num || ' instances');
end if;
END;---------------------------------------------------------------------------
On the msg_confirm() they have an option for yes or cancel. I was wondering if there was a hidden oracle forms update flag that gets assigned to rows when something has been changed. Since cancel does a rollback it is stopping all the ones they already clicked 'yes' for to rollback as well. I was hoping I could maybe put this in a loop with a commit after each check instead of using a PRE-UPDATE trigger. Any help would be appreicated.
Thanks
Message was edited by:
Yachera

You can create your own hidden non-base-table flag in the record, and set it depending on which button of your alert the user presses.
Then, in the on-update trigger, if they want to proceed, you can issue an Update_Record; statement, or bypass the Update_Record;
Either way, be sure to clear the flag in the on-update trigger.
But I would do all this checking in the when-validate-record trigger, or even sooner, in the On-Lock trigger, so it is processed sooner.
If you use when-validate-record, they will get the message as soon as they leave the record and navigate to the next. If they wish to cancel updating that row, you should set all the values back to their original (use Get_Item_Property(...,Database_Value), and set the record status back to Query_Status.
But even better would be in the On-Lock trigger. Check the counts and issue the alert BEFORE you issue the standard Lock_Record; command. If they want to cancel changes, all you need to do is issue a Raise Form_trigger_failure; and Forms will change the data back to original values. If they want to proceed with changes, then issue the Lock_Record; command.
Doing either of the above will prevent Forms from even trying to update the row when the user wants to save, and visually, the user can see their changes were backed out.

Similar Messages

  • Inconsistent update flags (Notification E C( 004)

    Hi Friends,
         When I processed the order in CRM Online it got replicated to R/3
         and from R/3 Delivery and invoice got created and document is completed.
         The Issue is that the Bdoc which has to replciate the Delivery and Invoice back to CRM
         did not replicate and in SMW01 i could find the error against the Queue CSA_ORDER_4000*
         "Inconsistent update flags Message no. C(004" and
          in CRMD_ORDER I could see the error as,
          An error has occured in the system C23CLNT100 while copying the document
          Message no. CRM_ORDER_MISC 020
          Diagnosis
          Errors have occured while transferring the document into another system. Remove the error  
          messages from the enclosed log.
          Transmission log
           Inconsistent update flags (Notification E C( 004)
         Please let me know if any one has faced this issue (I have already applied the OSS Note)
         and please tell me how to resolve this issue.
         Regards,
         Satish Kumar

    Hi Satish,
        I have same issue in CRM production system. Where you able to solve it? If yes, please share how you solved it.
    Thanks,
    Regards
    Deepika

  • Inconsistant update flags

    Hi Experts,
    Creating a sales document in CRM sporadically apears message "C( 004 inconsistent update flags". My case is similar to note 747077, with two differences:
    1) The error occurs sporadically
    2) In note 747077 they use as distribution lock, which seem to be sistem status I1026.
        We use user status NoDs that prevents distribution and has operations "to distribute" forbidden.  (In user Status NoDs,  I1026 is inactiv. )
    Bdoc with status NoDs usually show messages:
      <i><b>CRM_ORDER_MISC022 - No upload into R/3
      CRM_ORDER_MISC024 - R/3 adapter is called</b></i>
    In error cases the bdocs with status NoDs have only one message:
      <i><i><b>CRM_ORDER_MISC024 - R/3 adapter is called</b></i></i>
    <b>Has anybody an idea what can solve the problem?</b>
    <b>Is there a way to activate and desactivate sistem status I1026 in status profile?</b>

    Hi,
    I would recommend to check all the Partners and Products, used in Order, already exist in R/3.
    Secondly, controlling the System status Ixxxx can be done through User status.
    Just set the System status u want against the user status in Customising:
    SPRO > SAP Implementation Guide > Customer Relationship Management > Transactions > Basic Settings > Status Management > Change Status Profile for User Status
    Hope this helps...
    Kindly reward with points in case helpful
    Sharif

  • After getting an update from 10.6.8 many of my programs were no longer able to open. How can I undo the update or solve this problem another way?

    After getting an update from 10.6.8 many of my programs were no longer able to open. How can I undo the update or solve this problem another way?

    Do you have a bootable clone from prior to the update? If so, roll back with that.
    Are your apps that won't open PPC and do they need Rosetta? Do you need to activate Rosetta?
    Have you considered reinstalling 10.6 from your install disc and then coming forward with the 10.6.8 Combo Updater, then doing software update and not including whatever it was you installed that caused this propblem?
    By the way - what update was it that caused this problem?

  • How to update flag in multiple tables using custom sql DB adapter

    hi all,
    I have a scenario: I want to update flags in multiple tables in DB2. I have used toplink update only to update all tabless after creating relationships between them. But that approach is not working as it couldnot detect emmisions with DB2 and update the complete record with blank values in other columns.
    So, i want to use custom sql now. Can anybody help in resolving the issue or in writing the custom sql.
    Regards
    Richa

    Dear SeánMacGC thanks for reply,
    But "a.changed" is not a field in GNMT_CUSTOMER_MASTER_CHG. what i am doing in this procedure is i am collecting bulck data and validating field by field from GNMT_CUSTOMER_MASTER_CHG with GNMT_CUSTOMER_MASTER table as their structure is same.. if v_name is not same as v_name_chg then i am setting changed flag to "Y" changed is "changed dbms_sql.varchar2_table" and updating GNMT_CUSTOMER_MASTER in bluck where changed flag ='Y'...
    type custRec is record
    n_cust_ref_no dbms_sql.number_table,
    v_name dbms_sql.varchar2_table,
    v_name_chg dbms_sql.varchar2_table,
    rowid rowidArray,
    *changed dbms_sql.varchar2_table*
    i cannot use simple SQL as i need to validate field for each records with GNMT_CUSTOMER_MASTER_CHG and insert into log file as well.....
    to run this procedure:
    execute DO_DC_NAME_UPDATE_OTHER_TAB.DO_NAME_UPDATE_OTHER_TAB;
    Thanks...

  • Please Help needed  - Inconsistent update flags error

    Hello Experts,
    I am experiencing an error in the Middleware and I am not able to find a solution.
    When I create sales order in CRM, they get replicated correctly to R3. Nevertheless, I never receive the notification from R3 to CRM and the Bdoc remains in Intermediate status with the message 'ERP adapter is called'.
    When I modify the sales order in R3, I receive a notification from R3 to CRM with the error 'Inconcistent update flags'.
    Can anyone help me to fix this issue? Why I am not receiving the notification from R3 to CRM once the sales order is replicated?
    Thanks a lot.
    Regards,
    Oliver

    Hello Oliver,
    This means that the BDoc is still awaiting a response from ECC.It is likely that an outbound queue in ECC is in stop mode or waiting mode. Can you please check the outbound queue in ECC?
    The message "R/3 adapter is called" is not an actual error or problem, it is just a flow message saying that the flow has left CRM. In your case, the flow made it to R/3 where it has got stuck most likely due to some conversion error /an application error.
    With report CRM_ODE_CHECK_CFG on CRM system check all necessary settings for data exchange of sales orders between CRM and R/3. Please check if application BC-MID is active in table TBE11 on R/3 side.
    Thanks,
    Rohit

  • Include-updates flag

    Does anybody know that:
              Corresponds the include-updates flag in the weblogic-cmp-rdbms-jar.xml file only to UPDATE SQL commands or also to INSERTs? In other words: When I create a new ACCOUNT and call a finder in the same transaction that should return this new ACCOUNT, will this work?
              Stephan

    yes, it will include the inserts too.
              vasanthi Ramesh

  • Updating flag using itab

    Hi Guys
    I need to update flag to X for all flag = I from my ztable. Ztable is a database table with many entries (10000's). I currently have code that implements this functionality but performance is very imp here so I need to fine tune the code, perhaps putting it in itab and modifying the entire table from it should work
    This is what I have so far
      update ztable
      set flag = 'X'
      where flag = 'I'.

    Hi,
    Please try this.
    loop at itab.
    move 'X' to itab-flag.
    modify itab.
    endloop.
    modify ztable from table itab.
    OR
    loop at itab.
      update ztable
      set flag = 'X'
      where kunnr = itab-kunnr
        and vbeln = itab-vbeln.
    endloop.
    Regards,
    Ferry Lianto

  • SIS update flag in Customer master

    Hi,
    Where can i find SIS update flag in Customer master level.
    Regards
    JACK

    Hi,
    Assign values in customer statistics group field in the sales area data -> Sales tab.
    Regards
    Edited by: Shiva Ram on Jan 16, 2008 1:34 PM

  • Material Type: Value Updating Flag

    Hi
    For a material type, is there a possibility that only the 'Value Updating' flag is checked and the 'Quantity Updating' flag is unchecked? Is this a realistic scenario? Any reall-time example for such a scenario?
    In this case, is the material type considered as Inventory managed ?
    What is the implication of checking the 'Value Updating' flag?
    Does this mean that a Stock Account is associated with the material type?
    Thanks for your inputs here in advance
    Kind Regards
    ~P

    Hi,
    It is very well possible to have materials with value updation only.
    It is useful when no inventory i.e no stock is to be maintained. Only value is the required.
    For eg: Pipeline material is directly consumed. No inventory is required to be maintained against it.
    Such materials are also called as non-stockable materials.
    These materials will always be procured against an account assigment category in PO. The value is directly posted to Consumption Account picked via Acc *** Category during GR.
    No stock/inventory account will be posted during GR.
    Regards,
    Komal

  • Oracle Updating Batches

    Hi All,
    I wanted to have Batch execute in my java method.
    There are few requirements of that
    1. The data has to be inserted in 2 tables
    2. The data has to be deleted from 2 tables
    3. I have to use Statement for delete as the query uses in clause.
    I have gone through http://web.umr.edu/~ora9i/java.901/a90211/oraperf.htm for Oracle Updating batches.As per the details given in above link, I have few doubts
    1.Can I use 2 or more different Prepared Statements in same Batch?
    For Example:
    //Creating a prepared statement for first table
    ps = conn.prepareStatement(INSERT_INTO_TABLE1);
    ((OraclePreparedStatement)ps).setExecuteBatch (30);
    ps.setInt(1, 23);
    ps.setString(2, "Sales");
    ps.setString(3, "USA");
    ps.executeUpdate(); //JDBC queues this for later execution
    ps.setInt(1, 24);
    ps.setString(2, "Blue Sky");
    ps.setString(3, "Montana");
    ps.executeUpdate(); //JDBC queues this for later execution
    ps.setInt(1, 25);
    ps.setString(2, "Applications");
    ps.setString(3, "India");
    ps.executeUpdate(); //The queue size equals the batch value of 3
    //JDBC sends the requests to the database
    ps.setInt(1, 26);
    ps.setString(2, "HR");
    ps.setString(3, "Mongolia");
    ps.executeUpdate(); //JDBC queues this for later execution
    //Creating a prepared statement for second table
    ps = conn.prepareStatement(INSERT_INTO_TABLE2);
    ((OraclePreparedStatement)ps).setExecuteBatch (30);
    ps.setInt(1, 23);
    ps.setString(2, "Sales");
    ps.setString(3, "USA");
    ps.setInt(4,1);
    ps.executeUpdate(); //JDBC queues this for later execution
    ps.setInt(1, 24);
    ps.setString(2, "Blue Sky");
    ps.setString(3, "Montana");
    ps.setInt(4,1);
    ps.executeUpdate(); //JDBC queues this for later execution
    ps.setInt(1, 25);
    ps.setString(2, "Applications");
    ps.setString(3, "India");
    ps.setInt(4,1);
    ps.executeUpdate(); //The queue size equals the batch value of 3
    //JDBC sends the requests to the database
    ps.setInt(1, 26);
    ps.setString(2, "HR");
    ps.setString(3, "Mongolia");
    ps.executeUpdate(); //JDBC queues this for later execution
    //Atlast calling send batch
    ((OraclePreparedStatement)ps).sendBatch();
    2.Can I use the Oracle Updating Batches for Normal Statements? Can any one elaborate following points
    •     Do not mix standard update batching syntax with Oracle update batching syntax in the same application. The JDBC driver will throw an exception when you mix these syntaxes
    As per above statement, we can’t have both type of updating in a method or in the whole application. Can any one elaborate this point, how it’s possible as every time we have to open a new connection object?
    If we cant make use of both type of batching, then how to implement the Oracle Updating Batches for simple Statements.
    •     The Oracle implementation of standard update batching does not implement true batching for generic statements and callable statements. Although Oracle JDBC supports the use of standard batching syntax for Statement and CallableStatement objects, you will see performance improvement for only PreparedStatement objects.
    3. If first case is possible & if we can use the Oracle Updating Batches for simple Statements, then can we have all the statements in one Batch?
    the query if run from PL/SQL will be like this and in same sequence
    delete from table1 where country in ('USA','GERMANY')// multiple statement of this type
    delete from table2 where country in ('USA','INDIA'))// multiple statement of this type
    insert into table1 values(1,'SALES','USA'))// multiple statement of this type
    insert into table2 values(1,'SALES,'Australia','1')// multiple statement of this type

    Dear Robert Richardson,
    Unfortunately you can only access the Batch/Serial object by an document object.
    If you want to update a Batch fields, then you need to get the document object first, then get its batch object as
    Documents > Document_Lines > BatchNumbers.
    Another thought is to update the field value by UI API when open the OIBT form if possible.
    Best Regards
    Jane Jing
    SAP Business One Forums team

  • Can you force a Oracle Update Statement to use a specific database thread?

    We are attempting to write a Oracle Update Statement to update a value on all records in a single column. We are updating a column with a value found in a history table. Simple enough. We do it all the time. It works but we are having contention issue with users on the system using the main database threads and updating the same table at the same time. So what is happening is the update uses up all the available database threads and then the users just get timeouts and can't update. What we are trying to determine is can I write it to force the update statement to use a specific thread on the database when it is running?
    Here is the current update statement
    UPDATE
    TASK_DATA TSK
    SET
    dttSTATUS_WORK_IN_PROGRESS_TIM =
    SELECT
    HIS.T5
    FROM
    H2839 HIS
    WHERE
    TSK.REQUEST_ID = HIS.ENTRYID
    AND
    HIS.T5 IS NOT NULL
    AND
    TSK.dttSTATUS_WORK_IN_PROGRESS_TIM IS NULL
    Edited by: user11307503 on Oct 21, 2009 3:47 PM

    the update uses up all the available database threads and then the users just get timeouts and can't updateI'm not convinced that you're got a clear picture of how Oracle works and what is going on here.
    You're updating TASK_DATA, the whole table.
    Writers don't block readers - that's a key principle of Oracle.
    But if all the other users are trying to update a row or rows in TASK_DATA at the same time as your other process is updating all rows in the table, then there's going to be contention.
    This is not about "using up all available database threads" - that's nonsense.
    This is (probably) about sessions trying to update rows that your other process has locked.
    1. Get a clear picture of what the sessions are waiting on - it's probably TX locks.
    2. How many rows are you updating with this update on TASK_DATA?
    3. How long does it take? How often do you do it? Is there no quieter time when you can do it?

  • Trigger and Update Flag Table

    I've recently started trying to automate around a dozen procedures. These procedures are set to run immediately after the necessary previous procedure(s) is(are) done.
    What I am attempting to accomplish is a single generic trigger that will fire off each procedure when its parent procedures have finished firing. This will be accompanied by an update_flag table with three columns
    PARENT_PRC----------------------CHILD_PRC----------------------FLAG
    parent_prc_name1--------------child_prc_name1-----------------N
    parent_prc_name1--------------child_prc_name2-----------------N
    parent_prc_name3--------------child_prc_name3-----------------Y
    Logic:
    *1.*     When a procedure fires it updates this table to set any rows in which it is the “PARENT_PRC” by updating the FLAG column to = Y.
    *2.*     The trigger will execute a child procedure if its flag (or in the case of multiple parent procedures; all of its flags) are set to 'Y'. This trigger is set to fire AFTER a table update on the UPDATE_FLAG table.
    ----a.     I have to execute the procedure UFLAG in a job because I want the trigger to execute the procedure and then continue running immediately, rather than wait for the procedure to finish then commit. This way the trigger could start several procedures all running at the same time.
    ----b.     I have made it an autonomous transaction because I needed the job to fire immediately rather than be queued, which required a commit within the trigger.
    *3.*     The last step is to set the flag in UPDATE_FLAGS back to 'N' for CHILD_PRC = '||uflag||' once the child procedure is complete.
    ----a.     I have tried placing the update child_prc = 'N' in the trigger but it won’t allow a trigger that fires on update to update the same table.
    ----b.     I want to avoid putting the update statement in all of my procedures because I would like the option of running these procedures manually for testing purposes WITHOUT effecting the update_flags table.
    Number 3. is the key problem I have been having. Placing code within the trigger to update the update_flags table setting 'Y's back to 'N's once the procedures have fired causes a deadlock error.
    I believe this is simply because the trigger is attempting to update a table which (upon updating) causes the same trigger to fire before it has finish executing.
    How can I update the Flag table to reset the update flags back to 'N'?
    Is there a different way of doing this all together?
    Here is some code with dummy procedures that demonstrates what I have so far.
    With this code, executing parent procedures should set the update_flag table to 'Y' for FLAG where procedure = 'parent_prc'.
    I need to find a way to execute the child procedures AND set the FLAG column back to 'N' from the trigger.
    ex. executing parent_1 should set update_flags.flag = 'Y' where parent_prc = 'parent_1' and thus execute procedure CHILD_A and CHILD_B.
    create table update_flags (parent_prc varchar2(10), child_prc varchar2(10), flag varchar2(1));
    insert into update_flags values('parent_1', 'child_a', 'N');
    insert into update_flags values('parent_1', 'child_b', 'N');
    insert into update_flags values('parent_2', 'child_c', 'N');
    insert into update_flags values('parent_3', 'child_c', 'N');
    insert into update_flags values('parent_4', 'child_d', 'N');
    CREATE OR REPLACE procedure parent_1 as
    BEGIN
    update update_flags set flag = 'Y' where parent_prc = 'parent_1';
    END parent_1;
    CREATE OR REPLACE procedure parent_2 as
    BEGIN
    update update_flags set flag = 'Y' where parent_prc = 'parent_2';
    END parent_2;
    CREATE OR REPLACE procedure parent_3 as
    BEGIN
    update update_flags set flag = 'Y' where parent_prc = 'parent_3';
    END parent_3;
    CREATE OR REPLACE procedure parent_4 as
    BEGIN
    update update_flags set flag = 'Y' where parent_prc = 'parent_4';
    END parent_4;
    CREATE OR REPLACE procedure child_a as
    BEGIN
    dbms_output.PUT_LINE('CHILD_A Worked');
    commit;
    END child_a;
    CREATE OR REPLACE procedure child_b as
    BEGIN
    dbms_output.PUT_LINE('CHILD_B Worked');
    commit;
    END child_b;
    CREATE OR REPLACE procedure child_c as
    BEGIN
    dbms_output.PUT_LINE('CHILD_C Worked');
    commit;
    END child_c;
    CREATE OR REPLACE procedure child_d as
    BEGIN
    dbms_output.PUT_LINE('CHILD_D Worked');
    commit;
    END child_d;
    CREATE OR REPLACE TRIGGER MASTER_TRG
    AFTER UPDATE
    ON UPDATE_FLAGS
    DECLARE
    Pragma  AUTONOMOUS_TRANSACTION;
    BEGIN
      DECLARE
      job_num number;
      uflag varchar2(1000);
      BEGIN
            select  MAX(case when COUNT(case when flag='Y' then 1 end)=COUNT(*) then CHILD_PRC else '  ' end)
            into uflag
            from        update_flags
            group by    child_prc;
            IF   uflag <> '  ' THEN
                                      --update update_flags set  flag = 'N' where child_prc = uflag     --(line of code that causes deadlock error)
                            dbms_job.submit (job => job_num,
                            what => ' '||uflag||';'
            END IF; 
       END;            
    COMMIT;
    END MASTER_TRG;
    execute parent_2;
    execute parent_3;

    >
    I think I am getting my head around the transactional/trigger issue.
    >
    It doesn't sound like it since you are still talking 'triggers'. At any rate it is OP that needs to get their head around it.
    OP doesn't even know what the entire process needs to be but has already decided that
    1. a single generic trigger that will fire off each procedure when its parent procedures have finished firing
    2. an update_flag table with three columns: PARENT_PRC, CHILD_PRC, FLAG
    3. a procedure fires it updates this table to set any rows in which it is the “PARENT_PRC” by updating the FLAG column to = Y.
    4. a job - I have to execute the procedure UFLAG in a job
    5. I have made it an autonomous transaction because I needed the job to fire immediately rather than be queued, which required a commit within the trigger.
    6. there should be an option of running these procedures manually for testing purposes WITHOUT effecting the update_flags table.
    Fortunately OP had the wisdom to ask
    >
    Is there a different way of doing this all together?
    >
    Doesn't anyone design things anymore? Seems like everyone just wants to decide what the solution ought to be be and then try to force the problem to fit into it.
    The first stage is the DESIGN - not the implementation details or technology to use.
    The first design step is to outline, or flowchart, the PROCESS that needs to take place. Since OPs post lacks sufficient detail I will substitute my own 'guesstimations' to illustrate.
    1. there are one or more 'parent' processes
    2a. these parent processes are allowed to run in parallel as they do not interfere in any way with the processing done by other parent or child processes. (is this true?)
    2b. these parent processes ARE NOT allowed to run in parallel as they may interfere with each other.
    3. Each parent process can have one or more 'child' processes. (it appears that these aren't really children but rather processes that are 'dependent' on the parent or that must always be executed after, and each time that the parent executes.
    So here are just SOME of the things that are missing that must be known before possible alternatives can be explored
    1. Re item #2 - can the parent processes be executed in parallel? Or must they be executed serially? Will any of the parent processes be dependent on any other parent or child process?
    2. What is the relationship between a parent process and its child processes? Is the parent always executed first? What triggers the parent execution? How often is it executed?
    What if it is already executing? What if other parent processes are currently executing? What if one or more of its child processes are executing? What if the parent process fails for any reason - what action should be taken?
    Based on what was posted a set of parent and child processes might need nothing more than: execute parent, execute child1, execute child2, . . ., execute childn.
    3. What is the relationship between the child processes that belong to the same parent? Can they be executed in parallel (i.e. are they completely independent)? Or must they be executed in some particular order? What if one or more of the child processes fails for any reason - what action should be taken?
    4. Will any other user or process be executing these parent or child processes? That could interfered with the automated stream.
    5. What type of exception handling and recovery needs to be implemented in one or more steps of the processing fail for some reason?
    Typically there is often one or more control tables (OPs flag table) to control and limit the processing. But the table would have status information for every process not just the children:
    A. STATUS - DISABLED, ACTIVE, RUNNING, IDLE, ERROR
    B. START_TIME
    C. END_TIME
    D. RESULT_CODE
    The control table can be used by a parent or child process to determine if it is permitted to run. For example the first thing a procedure might do is check it's own STATUS. If it is already running it would exit or log an error or message. If that test is passed it might check the status of any dependent processes. For example it might check that its child processes are ACTIVE and ready to run; if a child was still running the parent would exit or log an error or message.
    The control process would lock the appropriate control table records (FOR UPDATE) and would set the status and other fields appropriately to prevent interference by other processes or procedures.
    Design first. Then look at the implementation options.

  • Everyones Oracle Linux Problem solved!!!

    Everyones Oracle Linux Problem solved!!!
    Here's something Linux people should relate to: Use what works!
    what works?
    NT works! NT works great with 8i AND OAS.
    No hassles at all!
    Up and running within one day!!!!
    Guaranteed!
    U don't see a NT forum here with people having ridiculous install problems like Linux people?
    Perhaps Oracle should moderate this newsgroup and even give an authorative answer or two?
    null

    I have switched our development and soon production databases to Linux because it runs like a charm. Fast and efficient, no problems. The installer has been a problem no doubt because Oracle put less of an emphasis on debugging their Linux installer than their idiot-proof NT installer.
    By the way, I was able to circumvent installer problems by just linking svrmgrl to svrmgrlO; this avoided the dreaded segmentation fault and kicked everything open just fine.
    BTW, about NT; what makes an OS is not how well everything works when everything is going well, but how bad it gets when something goes bad. For instance, the segmentation faults on Linux weren't a problem because I just picked up and continued; on NT you'd have to restart the whole system...not a pleasant feature.
    null

  • Open SQL statment for Update flag based on Date

    Dear all,
    I am trying to write an Open SQL statement to update a flag in a table. Table Ztable1 with fields Sr.No, Flag, Datefrom, DateTo. i would like to update Flag entry in the table only if today falls in between Datefrom & Dateto. I can satisfy the above requirement using the following ABAP code.
    DATA: lv_timestamp TYPE timestamp,
          lv_today LIKE adr2-valid_from,
          tz TYPE timezone.
    CONVERT DATE sy-datlo TIME sy-timlo INTO TIME STAMP lv_timestamp
      TIME ZONE tz.
    lv_today = lv_timestamp.
    update ztable1 set flag = 'X' where lv_today BETWEEN datefrom and dateto.
    But the issue is that, DateFrom & DateTo contains space aswell Dates. Datefrom can be space if it is start of Time (01010001) and also DateTo can be space if it is End of time (31129999). Which means that if DateFrom is space, then it should treated as 01010001, simlarly DateTo is space, then it should be 31129999. How can i write the if else cases within where clauses.
    I know Decode statement in Native sql programming, but that won't fit for Opensql in ABAP. Also, because of huge entries in database, i cannot read entries, manupulate & then update.
    How can i enhance the same above Update statement to cater this need.
    Please advise.
    Thanks a lot in advance.
    Greetings, Satish

    Hi,
    first fetch records in to internal table.
    ranges: r_range for sy-datum.
    loop at itab into wa.
    if wa-validfrom is initial.
    wa-validfrom =  (here u pass valid from date).
    elseif wa-validto is initial
    wa-validto = 99991231.
    endif.
    r_range-low = wa-validfrom
    r_range-high = wa-validto
    *check here current date is falling in interval. if its fall between ranges update flas in work area and *modify you internal table
    if sy-datum in r_range.
    wa-flag = 'x'.
    modify itab from wa.
    endif.
    refresh r_range.
    clear wa-flag.
    endloop.
    *--Finally update your ztable
    modify ztable from table itab.
    Regards,
    Peranandam

Maybe you are looking for