Query on Lock object

Hi,
I need to lock the Custom table based on company code.
I have an Internal table with list of company codes. Now I need to lock the table for All the company codes there in ITAB.
I am doing like this.
Before Save:
LOOP AT it_lock INTO wa_t001.
          CALL FUNCTION 'ENQUEUE_EYFR1FIT_GIFTREF'
            EXPORTING
              mode_yfr1fit_gift_ref = 'E'
              mandt                 = sy-mandt
              bukrs                 = wa_t001-bukrs.
          X_BUKRS                     = ' '
          _SCOPE                      = '2'
          _WAIT                       = ' '
          _COLLECT                    = ' '
        EXCEPTIONS
          FOREIGN_LOCK                = 1
          SYSTEM_FAILURE              = 2
          OTHERS                      = 3
          IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
          CLEAR wa_t001.
        ENDLOOP.
After Save
LOOP AT it_lock INTO wa_t001.
    CALL FUNCTION 'DEQUEUE_EYFR1FIT_GIFTREF'
      EXPORTING
        mode_yfr1fit_gift_ref = 'E'
        mandt                 = sy-mandt
        bukrs                 = wa_t001-bukrs.
    X_BUKRS                     = ' '
    _SCOPE                      = '3'
    _SYNCHRON                   = ' '
    _COLLECT                    = ' '
    CLEAR wa_t001.
  ENDLOOP.
Please let me know is that the write way?
Or do we need to pass any extra parameters?
what is the COLLECT parameter for?
Thanks,
Sandeep

Hi,
Refer following code,
*--Check if monitor table is initial
  IF NOT gt_hdrlog[] IS INITIAL.
    LOOP AT gt_hdrlog INTO ls_monitor.
*--Lock the DB table ZAPT_AR_MONITOR before updation
      CALL FUNCTION 'ENQUEUE_EZAPT_AR_MONITOR'
        EXPORTING
          mode_zapt_ar_monitor = lc_x                 "Check
          mandt                = sy-mandt             "Cient
          doc_num              = ls_monitor-doc_num   "IDOC number
          x_doc_num            = lc_x                 "Check
        EXCEPTIONS
          foreign_lock         = 1
          system_failure       = 2
          OTHERS               = 3.
      IF sy-subrc NE 0.
        WAIT UP TO 1 SECONDS.
      ELSE.
*--If DB table is locked then insert data into custom table
        INSERT into zapt_ar_monitor values ls_monitor.
        IF sy-subrc NE 0.
*--Update custom table
          UPDATE zapt_ar_monitor FROM ls_monitor.
        ENDIF.
      ENDIF.
*--Unlock the table after updation
      CALL FUNCTION 'DEQUEUE_EZAPT_AR_MONITOR'
        EXPORTING
          mode_zapt_ar_monitor = lc_x                 "Check
          mandt                = sy-mandt             "Client
          doc_num              = ls_monitor-doc_num   "IDOC Number
          x_doc_num            = lc_x.                "Check
*--Clear the work areas
      CLEAR : ls_monitor.
    ENDLOOP.
  ENDIF.
Regards,
Prashant

Similar Messages

  • Query To Kill Locked Object's Session

    Hi ,
    Im trying to write script to getting sid & Serial# for frequently locked objects in my database.
    i have tried with 3 ways as following, Pl Guide me for choosing better.
    Query 1:
    SELECT SID,SERIAL# FROM V$SESSION WHERE SID IN (SELECT SID FROM V$LOCKED_OBJECT WHERE OBJECT_ID IN ('34943','34957','34966')));
    Query 2:
    select
         sess.sid,
         sess.serial#
    from
         v$locked_object lo,
         dba_objects ao,
         v$session sess
    where
    ao.object_id = lo.object_id
         and
    lo.session_id = sess.sid
         AND
    AO.OBJECT_ID IN('34943','34957','34966');
    Query 3:
    select
    sid,
    serial#
    from
    select
    sid,
    serial#
    from
    v$session
    ) y,
    select
    b.session_id
    from
    select
    object_id,
    session_id,
    locked_mode
    from
    v$locked_object
    ) b,
    select
    object_id,
    object_name,
    owner
    from
    dba_objects
    where
    object_name in ('PMA_DEFECT_DETAILS',
    'PMA_DEFECT_HEADER',
    'PMA_DEFECT_TRANS')
    ) c
    Where
    b.object_id = c.object_id
    ) x
    Where
    x.session_id = y.sid ;
    Edited by: Abk on Jan 2, 2009 6:31 PM
    Edited by: Abk on Jan 2, 2009 6:34 PM

    Hi..
    To know the lock you can use the query below, you will know the sid and find the serial# from v$session.
    >
    col sid for 9999
    col id1 for 99999999
    col id2 for 99999999
    col lmode head "Lock Held" form a14
    col request1 head "Lock Request" form a16
    col type head "Lock Type" form a40
    col ctime head "Time Held" form 99999
    select sid,
    DECODE(TYPE,
    'BL','Buffer hash table',
    'CF','Control File Transaction',
    'CI','Cross Instance Call',
    'CS','Control File Schema',
    'CU','Bind Enqueue',
    'DF','Data File',
    'DL','Direct-loader index-creation',
    'DM','Mount/startup db primary/secondary instance',
    'DR','Distributed Recovery Process',
    'DX','Distributed Transaction Entry',
    'FI','SGA Open-File Information',
    'FS','File Set',
    'IN','Instance Number',
    'IR','Instance Recovery Serialization',
    'IS','Instance State',
    'IV','Library Cache InValidation',
    'JQ','Job Queue',
    'KK','Redo Log "Kick"',
    'LS','Log Start/Log Switch',
    'MB','Master Buffer hash table',
    'MM','Mount Definition',
    'MR','Media Recovery',
    'PF','Password File',
    'PI','Parallel Slaves',
    'PR','Process Startup',
    'PS','Parallel Slaves Synchronization',
    'RE','USE_ROW_ENQUEUE Enforcement',
    'RT','Redo Thread',
    'RW','Row Wait',
    'SC','System Commit Number',
    'SH','System Commit Number HWM',
    'SM','SMON',
    'SQ','Sequence Number',
    'SR','Synchronized Replication',
    'SS','Sort Segment',
    'ST','Space Transaction',
    'SV','Sequence Number Value',
    'TA','Transaction Recovery',
    'TD','DDL enqueue',
    'TE','Extend-segment enqueue',
    'TM','DML enqueue',
    'TS','Temporary Segment',
    'TT','Temporary Table',
    'TX','Transaction',
    'UL','User-defined Lock',
    'UN','User Name',
    'US','Undo Segment Serialization',
    'WL','Being-written redo log instance',
    'WS','Write-atomic-log-switch global enqueue',
    'XA','Instance Attribute',
    'XI','Instance Registration',
    decode(substr(TYPE,1,1),
    'L','Library Cache ('||substr(TYPE,2,1)||')',
    'N','Library Cache Pin ('||substr(TYPE,2,1)||')',
    'Q','Row Cache ('||substr(TYPE,2,1)||')',
    '????')) TYPE,
    id1,id2,
    decode(lmode,
    0,'None(0)',
    1,'Null(1)',
    2,'Row Share(2)',
    3,'Row Exclu(3)',
    4,'Share(4)',
    5,'Share Row Ex(5)',
    6,'Exclusive(6)') lmode,
    decode(request,
    0,'None(0)',
    1,'Null(1)',
    2,'Row Share(2)',
    3,'Row Exclu(3)',
    4,'Share(4)',
    5,'Share Row Ex(5)',
    6,'Exclusive(6)') request1,
    ctime, decode(BLOCK,
              0, 'Not Blocking',
              1, 'Blocking',
              2, 'Global',block) status
    from
    v$lock
    where sid>5
    and type not in ('MR','RT')
    order by decode(request,0,0,2),block,5
    ==================================================
    To know the session:--
    col username for a20
    col program for a20
    col osuser for a15
    SELECT NVL(s.username, '(oracle)') AS username,
    s.osuser,
    s.sid,
    s.serial#,
    p.spid,
    s.status,
    s.module,
    s.machine,
    s.program,
    TO_CHAR(s.logon_Time,'DD-MON-YYYY HH24:MI:SS') AS logon_time
    FROM v$session s,
    v$process p
    WHERE s.paddr = p.addr
    ORDER BY s.username, s.osuser;
    >
    HTH
    Anand

  • How to find locked object query?

    There is random error ORA-00054 coming during execution of one process which is using SELECT FOR UPDATE NO WAIT statement.
    Logs of process is showing row is accessed only once but still it gets error of "resource busy".
    So there must be any other session which is locking object and it is not identifid. I want to identify which other session/user is locking object.
    I am trying with below query which shows session id, terminal name and object name which is locked.
    SELECT a.sid,a.serial#, a.username,c.os_user_name,a.terminal,
    b.object_id,substr(b.object_name,1,40) object_name,sysdate
    from v$session a, dba_objects b, v$locked_object c
    where a.sid = c.session_id
    and b.object_id = c.object_id But i want information of SQL query from v$sqltext so i can find out throughout the applicaiton where it is executed?
    Thanks

    Finding session that it locking is not a problem.
    Finding SQL responsible is not necessarily straightforward.
    You might be lucky. You might not.
    If the SQl responsible for locking the row ran for a long time or was blocked by something else, AND you're on version >= 10g AND you're licensed for Diagnostic Pack, then you should find some evidence in ASH - DBA_HIST_ACTIVE_SESS_HISTORY.
    Doug Burns has a 10-part series on the subject.
    http://oracledoug.com/serendipity/index.php?/archives/1477-Diagnosing-Locking-Problems-using-ASH-Part-1.html
    There is another current thread on the same issue:
    How to find sql statement which generates LOCK

  • Error while query execution - Query getting locked by another user execute

    Hi All,
    I am facing an issue ..
    When I execute a query I am getting an error message ie popping as blocked by some other user. And I able to see the lock when I go to SM12. If the other user logged off or if we unlock his entry, then both the workbook and query is getting executed as expected. What can be the reason for this phenomena?
    In my understanding, in the same time multiple users can execute the query /workbook. But in our case its not allowing.
    Can someone suggest a resolution at the earliest, as it is affecting the reports in live environment
    Regards
    Mathew

    The Bex Analyser (Front end) Patch is 501 and the SAP BI is 15.
    The error message that I am getting while executing the query is "The object requested is currently locked by user --". 
    When I go to SM12, I can see a lock in the user's name.

  • Lock object issue

    Dear Experts,
    We are using the fn. Module "SD_SALES_DOCUMENT_ENQUEUE", to process a sales order with multi line item and to unlock the table, we are using "DEQUEUE_ALL", but for some reason, in the sales order processing when the system comes to next line item, the lock object is throwing an error, I'm not sure if this is due to the lock not being released on the order.
    1st item success
    2nd item failure
    3rd item success
    4th item failureu2026.not always the same pattern, but usually.
    Please suggest .
    Thanks
    -Amit

    Hi Zekeriya,
    I have tried with the query you mentioned but didnt get any output.STILL THE PROBLEM PERSISTS...
    SQL> select s1.username || '@' || s1.machine
    || ' ( SID=' || s1.sid || ' ) is blocking '
    || s2.username || '@' || s2.machine || ' ( SID=' || s2.sid || ' ) ' AS blocking_status
    from v$lock l1, v$session s1, v$lock l2, v$session s2
    where s1.sid=l1.sid and s2.sid=l2.sid
    and l1.BLOCK=1 and l2.request > 0
    and l1.id1 = l2.id1
    and l2.id2 = l2.id2 ; 2 3 4 5 6 7 8
    no rows selected

  • Is it possible to get locked objects in passed time?

    Hi,
    I would like to get locked objects in passed time. The oracle version is 9i.
    For example,
    Can I get a list locked objects five days ago? Because I would like to keep locked objects statistics?
    Does these information stored?
    regards,

    Hi,
    your best shot is ASH (active session history). It contains information about active sessions, their wait events, wait times, blockers, objects accessed, SQL running etc. For recent events you may query V$ACTIVE_SESSION_HISTORY, if you are interested in older data then you can try
    looking in DBA_HIST_ACTIVE_SESS_HISTORY.
    There are many limitations when analyzing ASH data, such as:
    1) limited retention time
    2) periodic sampling (you won't be able to see anything that falls in between snapshots)
    3) bias towards longer events
    etc.
    so you need to be careful when analyzing these data.
    Best regards,
    Nikolay

  • About lock object and how to create it

    Hi ABAP gurus,
    Can any one explain about the Lock Objects and How to create Lock object step by step.
    Rgds,

    Hi Rangamma,
    Check this info.
    Lock objects are use in SAP to avoid the inconsistancy at the time of data is being insert/change into database.
    SAP Provide three type of Lock objects.
    - Read Lock(Shared Locked)
    protects read access to an object. The read lock allows other transactions read access but not write access to
    the locked area of the table
    - Write Lock(exclusive lock)
    protects write access to an object. The write lock allows other transactions neither read nor write access to
    the locked area of the table.
    - Enhanced write lock (exclusive lock without cumulating)
    works like a write lock except that the enhanced write lock also protects from further accesses from the
    same transaction.
    You can create a lock on a object of SAP thorugh transaction SE11 and enter any meaningful name start with EZ Example EZTEST_LOCK.
    Use: you can see in almost all transaction when you are open an object in Change mode SAP could not allow to any other user to open the same object in change mode.
    Example: in HR when we are enter a personal number in master data maintainance screen SAP can't allow to any other user to use same personal number for changes.
    Technicaly:
    When you create a lock object System automatically creat two function module.
    1. ENQUEUE_<Lockobject name>. to insert the object in a queue.
    2. DEQUEUE_<Lockobject name>. To remove the object is being queued through above FM.
    Lock objects are use in SAP to avoid the inconsistancy at the time of data is being insert/change into database.
    SAP Provide three type of Lock objects.
    - Read Lock(Shared Locked)
    protects read access to an object. The read lock allows other transactions read access but not write access to
    the locked area of the table
    - Write Lock(exclusive lock)
    protects write access to an object. The write lock allows other transactions neither read nor write access to
    the locked area of the table.
    - Enhanced write lock (exclusive lock without cumulating)
    works like a write lock except that the enhanced write lock also protects from further accesses from the
    same transaction.
    You can create a lock on a object of SAP thorugh transaction SE11 and enter any meaningful name start with EZ Example EZTEST_LOCK.
    Use: you can see in almost all transaction when you are open an object in Change mode SAP could not allow to any other user to open the same object in change mode.
    Example: in HR when we are enter a personal number in master data maintainance screen SAP can't allow to any other user to use same personal number for changes.
    Technically:
    When you create a lock object System automatically creat two function module.
    1. ENQUEUE_<Lockobject name>. to insert the object in a queue.
    2. DEQUEUE_<Lockobject name>. To remove the object is being queued through above FM.
    http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm
    GO TO SE11
    Select the radio button "Lock object"..
    Give the name starts with EZ or EY..
    Example: EYTEST
    Press Create button..
    Give the short description..
    Example: Lock object for table ZTABLE..
    In the tables tab..Give the table name..
    Example: ZTABLE
    Save and generate..
    Your lock object is now created..You can see the LOCK MODULES..
    In the menu ..GOTO -> LOCK MODULES..There you can see the ENQUEUE and DEQUEUE function
    Lock objects:
    http://www.sap-img.com/abap/type-and-uses-of-lock-objects-in-sap.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm
    Match Code Objects:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/41/f6b237fec48c67e10000009b38f8cf/content.htm
    http://searchsap.techtarget.com/tip/0,289483,sid21_gci553386,00.html
    See this link:
    http://www.sap-img.com/abap/type-and-uses-of-lock-objects-in-sap.htm
    Hope this resolves your query.
    <b>Reward all the helpful answers.</b>
    Regards

  • Locked Objects

    Hi,
    I want to ask is that if i can find any objects in the V$locked_Object then do i need to kill those sessions always????
    The thing is when i see some objects in the locked_objects i am looking for the query which is locking the object. But after some that that sesssion removed from V$locked_Object
    Sometimes if i track any locked object and find the query related to it that time query is normal query of SELECT.
    1. So do i need to worry about it to resolve lock? And always i need to kill that session which is in V$Locked_Object.
    2. Also please let me know how can i check which SQL statements in a day locking objects in the database Can we check this one?
    Please give any idea about.

    DBA_BLOCKERS lists the sessions that hold a lock that another session is blocked on a request for. DBA_WAITERS lists the sessions that are blocked requesting a lock that some other session holds. Are you seeing any rows in these tables? If we're talking about a bunch of sessions that are taking out row share locks, for example, there's nothing to be concerned about because those aren't (generally) going to block anyone else.
    If you are, are the blocks resolving themselves? A session that takes out a lock might block another session temporarily, but as long as the blocker finishes its processing and releases the lock within a reasonable time frame, the waiter should be able to continue after the lock is released. There may be options to redesign the application so that the blocker locks fewer objects/ fewer rows/ holds the lock for less time in order to decrease contention, but certainly nothing that would require DBA intervention.
    The case where a DBA needs to be involved is when
    - A session takes out a lock that is capable of blocking other sessions
    - For whatever reason, that session fails to release the lock
    - One (or more) other sessions are blocked waiting for the lock to be released
    The classic example of this would be an application that was poorly designed to do pessimistic locking and to hold locks across user interactions. So if an application does a SELECT FOR UPDATE to lock a particular row and holds that row while waiting for a human to do something, but the human decides to go to lunch/ work in a different application/ go on vacation, every other user that tries to lock that same row is going to block, which can be highly unpleasant.
    Justin

  • Delay when querying from CUBE_TABLE object, what is it?

    Hi Guys,
    We are using Oracle OLAP 11.2.0.2.0 with an 11g Cube, 7 Dimensions, Compressed and partitioned by Month.
    We have run into a performance issue when implementing OBIEE.
    The main issue we have is a delay while drilling on a hierarchy. Users have been waiting 7-12 seconds per drill on a hierarchy, and the query is only returning a few cells of data. We have managed to isolate this to slow performing queries on CUBE_TABLE.
    For example, the following query returns one cell of data:
    SELECT FINSTMNT_VIEW.BASE, FINSTMNT_VIEW.REPORT_TYPE, FINSTMNT_VIEW.COMPANY, FINSTMNT_VIEW.SCENARIO, FINSTMNT_VIEW.PRODUCT, FINSTMNT_VIEW.ACCOUNT, FINSTMNT_VIEW.SITE, FINSTMNT_VIEW.TIME
    FROM "SCHEMA1".FINSTMNT_VIEW FINSTMNT_VIEW
    WHERE
    FINSTMNT_VIEW.REPORT_TYPE IN ('MTD' )
    AND FINSTMNT_VIEW.COMPANY IN ('E01' )
    AND FINSTMNT_VIEW.SCENARIO IN ('ACTUAL' )
    AND FINSTMNT_VIEW.PRODUCT IN ('PT' )
    AND FINSTMNT_VIEW.ACCOUNT IN ('APBIT' )
    AND FINSTMNT_VIEW.SITE IN ('C010885' )
    AND FINSTMNT_VIEW.TIME IN ('JUN11' ) ;
    1 Row selected in 4.524 Seconds
    Note: FINSTMNT_VIEW is the automatically generated cube view.
    CREATE OR REPLACE FORCE VIEW "SCHEMA1"."FINSTMNT_VIEW" ("BASE","REPORT_TYPE", "COMPANY", "SCENARIO", "PRODUCT", "ACCOUNT", "SITE", "TIME")
    AS
    SELECT "BASE", "REPORT_TYPE", "COMPANY", "SCENARIO", "PRODUCT", "ACCOUNT", "SITE", "TIME"
    FROM TABLE(CUBE_TABLE('"SCHEMA1"."FINSTMNT"') ) ;
    If we increase the amount of data returned by adding to the query, it only increased the query time by .4 seconds
    SELECT FINSTMNT_VIEW.BASE, FINSTMNT_VIEW.REPORT_TYPE, FINSTMNT_VIEW.COMPANY, FINSTMNT_VIEW.SCENARIO, FINSTMNT_VIEW.PRODUCT, FINSTMNT_VIEW.ACCOUNT, FINSTMNT_VIEW.SITE, FINSTMNT_VIEW.TIME
    FROM "SCHEMA1".FINSTMNT_VIEW FINSTMNT_VIEW
    WHERE
    FINSTMNT_VIEW.REPORT_TYPE IN ('MTD' )
    AND FINSTMNT_VIEW.COMPANY IN ('E01' )
    AND FINSTMNT_VIEW.SCENARIO IN ('ACTUAL' )
    AND FINSTMNT_VIEW.PRODUCT IN ('PT' )
    AND FINSTMNT_VIEW.ACCOUNT IN ('APBIT' )
    AND FINSTMNT_VIEW.SITE IN ('C010885', 'C010886', 'C010891', 'C010892', 'C010887', 'C010888', 'C010897', 'C010893', 'C010890', 'C010894', 'C010896', 'C010899' )
    AND FINSTMNT_VIEW.TIME IN ('JUN11' ) ;
    12 rows selected - In 4.977 Seconds
    If we increase the data returned even more:
    SELECT FINSTMNT_VIEW.BASE, FINSTMNT_VIEW.REPORT_TYPE, FINSTMNT_VIEW.COMPANY, FINSTMNT_VIEW.SCENARIO, FINSTMNT_VIEW.PRODUCT, FINSTMNT_VIEW.ACCOUNT, FINSTMNT_VIEW.SITE, FINSTMNT_VIEW.TIME
    FROM "SCHEMA1".FINSTMNT_VIEW FINSTMNT_VIEW
    WHERE
    FINSTMNT_VIEW.REPORT_TYPE IN ('MTD' )
    AND FINSTMNT_VIEW.COMPANY IN ('ET', 'E01', 'E02', 'E03', 'E04' )
    AND FINSTMNT_VIEW.SCENARIO IN ('ACTUAL' )
    AND FINSTMNT_VIEW.PRODUCT IN ('PT', 'P00' )
    AND FINSTMNT_VIEW.ACCOUNT IN ('APBIT' )
    AND FINSTMNT_VIEW.SITE IN ('C010885', 'C010886', 'C010891', 'C010892', 'C010887', 'C010888', 'C010897', 'C010893', 'C010890', 'C010894', 'C010896', 'C010899' )
    AND FINSTMNT_VIEW.TIME IN ('JUN11', 'JUL11', 'AUG11', 'SEP11', 'OCT11', 'NOV11', 'DEC11', 'JAN12') ;
    118 rows selected - In 14.213 Seconds
    If we take the time for each query and divide by the number of rows, we can see that querying more data results in a much more efficient query:
    Time/Rows returned:
    1 Row - 4.524
    12 Rows - 0.4147
    118 Rows - 0.120449153
    It seems like there is an initial delay of approx 4 seconds when querying the CUBE_TABLE object. Using AWM to query the same data using LIMIT and RPR is almost instantaneous...
    Can anyone explain what this delay is, and if there is any way to optimise the query?
    Could it be the AW getting attached before each query?
    Big thanks to anyone that can help!

    Thanks Nasar,
    I have run a number of queries with logging enabled, the things you mentioned all look good:
    Loop Optimization: GDILoopOpt     COMPLETED
    Selection filter: FILTER_LIMITS_FAST     7
    ROWS_FAILED_FILTER     0
    ROWS_RETURNED     1
    Predicates: 7 pruned out of 7 predicates
    The longest action I have seen in the log is the PAGING operation... but I do not see this on all queries.
    Time Total Time OPERATION
    2.263     27.864          PAGING     DYN_PAGEPOOL     TRACE     GREW     9926KB to 59577KB
    1.825     25.601          PAGING     DYN_PAGEPOOL     TRACE     GREW     8274KB to 49651KB
    1.498     23.776          PAGING     DYN_PAGEPOOL     TRACE     GREW     6895KB to 41377KB
    1.232     22.278          PAGING     DYN_PAGEPOOL     TRACE     GREW     5747KB to 34482KB
    1.17     21.046          PAGING     DYN_PAGEPOOL     TRACE     GREW     4788KB to 28735KB
    1.03     19.876          PAGING     DYN_PAGEPOOL     TRACE     GREW     3990KB to 23947KB
    2.808     18.846          PAGING     DYN_PAGEPOOL     TRACE     GREW     3325KB to 19957KB
    What is strange is that the cube operation log does not account for all of the query time. For example:
    SELECT "BASE_LVL" FROM TABLE(CUBE_TABLE('"EXAMPLE"."FINSTMNT"'))
    WHERE
    "RPT_TYPE" = 'MTD' AND
    "ENTITY" = 'ET' AND
    "SCENARIO" = 'ACTUAL' AND
    "PRODUCT" = 'PT' AND
    "GL_ACCOUNT" = 'APBIT' AND
    "CENTRE" = 'TOTAL' AND
    "TIME" = 'YR09';
    This query returns in 6.006 seconds using SQL Developer, if I then take the CUBE_OPERATION_LOG for this query and subtract the start time from the end time, I only get 1.67 seconds. This leaves 4.3 seconds unaccounted for... This is the same with the my other queries, see actual time and logged time below:
    Query     Actual     Logged      Variance
    S3     6.006     1.67     4.336
    L1     18.128     13.776     4.352
    S1     4.461     0.203     4.258
    L2     4.696     0.39     4.306
    S2     5.882     1.575     4.307
    Any ideas on what this could be or how I can capture this 4.3 second overhead?
    Your help has been greatly appreciated.

  • Lock object is not working automatically

    Hi experts,
    i have a problem , A table is updated by a program which is used by multiple user . I have used lock function module 'ENQUEUE_E_TABLE ' and 'DEQUEUE_E_TABLE' for that . when updation section occurs first user which come first go through it and for rest users amessage cones 'table is locked by XYZ user' . When first completes the updation resr users is not updating automatically they stand at that position where message comes. How to solve this issue?
    Avadhesh Chandra

    Hi,
    We can lock the table before updating the entries. Two types of locks are there.
    1. To lock the entire table. Here when the table is locked by one program, another program will not be able to modify it.
    2. To lock the particular record only. Here when the record is locked by one program, the other program can modify records other than the one locked.
    For option 1
    Use the FM ENQUEUE_E_TABLEE to lock the table and FM DEQUEUE_E_TABLEE to unlock table.
    For option 2
    Go to SE11. There enter the name of your lock object and create it. Next screen you have to mention which field you want to lock.
    For more info. on LOCK OBJECTS go to
    http://help.sap.com/saphelp_nw2004s/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm
    If you want to lock the entire table, then use the FM said in option 1 in DO-ENDDO loop. 
    Run the loop till it gets successful (sy-subrc = 0)
    DO.
    *Call the FM.
    IF sy-subrc = 0.
        EXIT.
    ENDIF.
    ENDDO.
    If you want to just try some number of times rather than keep on looping then can use for eg: DO 100 TIMES.

  • Is it possible the query in view object is dynamic?

    Is it possible the query in view object is dynamic?
    Generally, make the column list dynamic.
    I think this is related to whether view object can be assembled at runtime based on a dynamic cursor in a procedure?
    I ask this because I would like to know how we can use OA framework to simulate crosstab workbook in Discoverer?
    Anybody has some clues, please advise.
    Thanks.

    Hi Shay,
    Let me tell you briefly... I am sending input as customerId,customerNumber,CustomerName to the web service, if the record is available i am getting the response and i am displaying those records on page as a table. Now when i click a row i need to populate another table with all sale orders of that customer. From webservice datacontrol i have only customer object, I dont have Sales Order Object. For this i need master detail relation. In this case how to proceed. Thats why i am thinking to create a vO and EO object for sales orders table and i want to create view link for this sales order and customers. As i don't have customer VO and EO object to create view link.

  • How to build sql query for view object at run time

    Hi,
    I have a LOV on my form that is created from a view object.
    View object is read-only and is created from a SQL query.
    SQL query consists of few input parameters and table joins.
    My scenario is such that if input parameters are passed, i have to join extra tables, otherwise, only one table can fetch the results I need.
    Can anyone please suggest, how I can solve this? I want to build the query for view object at run time based on the values passed to input parameters.
    Thanks
    Srikanth Addanki

    As I understand you want to change the query at run time.
    If this is what you want, you can use setQuery Method then use executeQuery.
    http://download.oracle.com/docs/cd/B14099_19/web.1012/b14022/oracle/jbo/server/ViewObjectImpl.html#setQuery_java_lang_String_

  • Ora-04021 timeout occurred while waiting to lock object

    Hai All
    When adding a column into a table then an error comes error
    Error Message:
    ORA-04021: timeout occurred while waiting to lock object .....
    How it happens ...what is the solution....please help
    Shiju..

    Hi
    Identify the session that is using this object, kill it and then perform the ALTER table... or wait until the session that is accessing this table release it.
    Rgds
    Adnan

  • JDAPI Error: ORA-04020: deadlock detected while trying to lock object

    I have written a JDAPI program to perform read-only impact analysis and report any problems.
    The following error is occurring:
    "A deadlock among DDL and parse locks is detected.
    This deadlock is usually due to user errors in the design of an application or from issuing a set of concurrent statements which can cause a deadlock.
    ORA-04020: deadlock detected while trying to lock object /NSPC6/CHECK_FOR_FORM_CHANGE"
    The error refers to a procedure in a PL/SQL library.
    In one case the error occurred after my final "end of processing" message, which is followed only by a call to "Jdapi.shutdown()".
    Any ideas?
    Thanks,
    Neville Sweet.

    I have written a JDAPI program to perform read-only impact analysis and report any problems.
    The following error is occurring:
    "A deadlock among DDL and parse locks is detected.
    This deadlock is usually due to user errors in the design of an application or from issuing a set of concurrent statements which can cause a deadlock.
    ORA-04020: deadlock detected while trying to lock object /NSPC6/CHECK_FOR_FORM_CHANGE"
    The error refers to a procedure in a PL/SQL library.
    In one case the error occurred after my final "end of processing" message, which is followed only by a call to "Jdapi.shutdown()".
    Any ideas?
    Thanks,
    Neville Sweet.

  • Unable to delete Transport Request which contain locked objects

    Hi all,
    I need to delete  some unusable transport requests but as they contain locked objects, it's not possible to delete them. Release operation is just allowed. After releasing these transport requests, I can not find them any more in queue. Please help to find these  transport requests which are released and also provide a solution to delete instead of releasing them.
    Thanks in advance,
    Sanaz.

    Hi,
    Thank you for the reply.
    1. What do you mean by transport request , Shipment Request, Shipment Order or Tour.
    A. I mean requests which can be transported between SAP Systems using TMS (Transport Management System).
    2. What are the objects which has been locked and due to that you are facing this problem.
    A. There are diffrent object types. For examle some customizing have booen done or SAP Note correction has been implemented, ... Therefore some objects have been locked due to these operations
    3. Let's say if it's an freight Unit, then Pls confirm that System dump / error is not the cause for this.
    A. I have no idea about "Freight Unit".
    Thanks,
    Sanaz.

Maybe you are looking for

  • RH7 HTML - Receive IE script error message when double-clicking link to auto-size pop-up

    Hi, all, Anybody ever seen this situation? When double-clicking on a link to an auto-size pop-up, I get the following Internet Explorer script error message: This error also occurs when I double-click the link in preview mode within the project. A co

  • GetURL() IE iFrame Bug

    I have a flash movie inside an iFrame (I know how bad that is, but I have no other options) and 99% of the time everything works fine in IE... However, every once in a while anything using getURL() to open a link will stop working in IE. Everything t

  • How to make a custom Divider for a JSplitPane

    Hello, i wont to create a custom divider(i.e. with two JButtons inside), or expand the default one. I know, that the divider extends Container but when i call add( new JButton("...") ) i never see the button. What i have to do or what do i wrong. Sor

  • Migrating Sybase users to Oracle

    I am migrating a lists of users from Sybase to Oracle. These users are created in Oracle with connect and resource privileges. I would only want the users to have create session privilege. Is there a way to specify the privilege before users are crea

  • BUG: Can't cut and paste custom text boxes

    So this is really annoying. - Create a text box. - Set a custom text color, font and size - Postion correctly. Now I want to copy the text box to another page to maintain my text style. I can copy, but when I paste nothing happens. Meaning I have to