GL Code combination query Need tuning

Hi,
I'm trying to tune the following query
select *
FROM fnd_flex_values val1,
fnd_flex_values_tl flex1,
fnd_flex_values val2,
fnd_flex_values_tl flex2,
fnd_flex_values val3,
fnd_flex_values_tl flex3,
fnd_flex_values val4,
fnd_flex_values_tl flex4,
fnd_flex_values val5,
fnd_flex_values_tl flex5,
gl_code_combinations gc
WHERE val1.FLEX_VALUE_SET_ID = 1111001
AND val1.FLEX_VALUE = gc.segment1
AND val1.FLEX_VALUE_ID = flex1.FLEX_VALUE_ID
AND flex1.language = 'US'
AND val2.FLEX_VALUE_SET_ID = 1111002
AND val2.FLEX_VALUE = gc.segment2
AND val2.FLEX_VALUE_ID = flex2.FLEX_VALUE_ID
AND flex2.language = 'US'
AND val3.FLEX_VALUE_SET_ID = 1111003
AND val3.FLEX_VALUE = gc.segment3
AND val3.FLEX_VALUE_ID = flex3.FLEX_VALUE_ID
AND flex3.language = 'US'
AND val4.FLEX_VALUE_SET_ID = 1111004
AND val4.FLEX_VALUE = gc.segment4
AND val4.FLEX_VALUE_ID = flex4.FLEX_VALUE_ID
AND flex4.language = 'US'
AND val5.FLEX_VALUE_SET_ID = 1111005
AND val5.FLEX_VALUE = gc.segment5
AND val5.FLEX_VALUE_ID = flex5.FLEX_VALUE_ID
AND flex5.language = 'US'
The explain plan is
Plan
SELECT STATEMENT ALL_ROWSCost: 29,834 Bytes: 98,617,600 Cardinality: 81,100                                                             
     28 HASH JOIN Cost: 29,834 Bytes: 98,617,600 Cardinality: 81,100                                                        
          1 TABLE ACCESS FULL TABLE APPLSYS.FND_FLEX_VALUES_TL Cost: 1,404 Bytes: 33,076,982 Cardinality: 312,047                                                   
          27 HASH JOIN Cost: 22,334 Bytes: 90,021,000 Cardinality: 81,100                                                   
               2 TABLE ACCESS FULL TABLE APPLSYS.FND_FLEX_VALUES_TL Cost: 1,404 Bytes: 33,076,982 Cardinality: 312,047                                              
               26 HASH JOIN Cost: 15,243 Bytes: 81,424,400 Cardinality: 81,100                                              
                    3 TABLE ACCESS FULL TABLE APPLSYS.FND_FLEX_VALUES_TL Cost: 1,404 Bytes: 33,076,982 Cardinality: 312,047                                         
                    25 HASH JOIN Cost: 8,559 Bytes: 72,827,800 Cardinality: 81,100                                         
                         4 TABLE ACCESS FULL TABLE APPLSYS.FND_FLEX_VALUES_TL Cost: 1,404 Bytes: 33,076,982 Cardinality: 312,047                                    
                         24 HASH JOIN Cost: 2,284 Bytes: 64,231,200 Cardinality: 81,100                                    
                              6 TABLE ACCESS BY INDEX ROWID TABLE APPLSYS.FND_FLEX_VALUES Cost: 15 Bytes: 44,772 Cardinality: 364                               
                                   5 INDEX RANGE SCAN INDEX APPLSYS.FND_FLEX_VALUES_N2 Cost: 4 Cardinality: 364                          
                              23 HASH JOIN Cost: 2,264 Bytes: 54,261,252 Cardinality: 81,108                               
                                   8 TABLE ACCESS BY INDEX ROWID TABLE APPLSYS.FND_FLEX_VALUES Cost: 15 Bytes: 44,772 Cardinality: 364                          
                                        7 INDEX RANGE SCAN INDEX APPLSYS.FND_FLEX_VALUES_N2 Cost: 4 Cardinality: 364                     
                                   22 HASH JOIN Cost: 2,238 Bytes: 136,517,472 Cardinality: 250,032                          
                                        10 TABLE ACCESS BY INDEX ROWID TABLE APPLSYS.FND_FLEX_VALUES Cost: 15 Bytes: 44,772 Cardinality: 364                     
                                             9 INDEX RANGE SCAN INDEX APPLSYS.FND_FLEX_VALUES_N2 Cost: 4 Cardinality: 364                
                                        21 HASH JOIN Cost: 2,211 Bytes: 105,774,111 Cardinality: 250,057                     
                                             12 TABLE ACCESS BY INDEX ROWID TABLE APPLSYS.FND_FLEX_VALUES Cost: 15 Bytes: 44,772 Cardinality: 364                
                                                  11 INDEX RANGE SCAN INDEX APPLSYS.FND_FLEX_VALUES_N2 Cost: 4 Cardinality: 364           
                                             20 NESTED LOOPS Cost: 2,185 Bytes: 75,024,300 Cardinality: 250,081                
                                                  17 NESTED LOOPS Cost: 746 Bytes: 83,356 Cardinality: 364           
                                                       14 TABLE ACCESS BY INDEX ROWID TABLE APPLSYS.FND_FLEX_VALUES Cost: 15 Bytes: 44,772 Cardinality: 364      
                                                            13 INDEX RANGE SCAN INDEX APPLSYS.FND_FLEX_VALUES_N2 Cost: 4 Cardinality: 364
                                                       16 TABLE ACCESS BY INDEX ROWID TABLE APPLSYS.FND_FLEX_VALUES_TL Cost: 2 Bytes: 106 Cardinality: 1      
                                                            15 INDEX UNIQUE SCAN INDEX (UNIQUE) APPLSYS.FND_FLEX_VALUES_TL_U1 Cost: 1 Cardinality: 1
                                                  19 TABLE ACCESS BY INDEX ROWID TABLE GL.GL_CODE_COMBINATIONS Cost: 266 Bytes: 48,777 Cardinality: 687           
                                                       18 INDEX RANGE SCAN INDEX GL.GL_CODE_COMBINATIONS_N3 Cost: 3 Cardinality: 687      
Thanks,
Kiran

Please post the details of the application release, database version and OS.
Please see these links.
https://forums.oracle.com/forums/search.jspa?threadID=&q=Query+AND+Tuning&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
https://forums.oracle.com/forums/search.jspa?threadID=&q=Query+AND+Tuning&objID=c84&dateRange=all&userID=&numResults=15&rankBy=10001
Thanks,
Hussein

Similar Messages

  • Query needs tuning; Explain plan attached

    DB version:10gR2
    Currently, the below query is taking more than 28 secs to complete. The table stats are up-to-date.
    Is there a way to rewrite/tune this query?
    SELECT DISTINCT TASK_HDR.TASK_ID,
                     TASK_HDR.WHSE,
                     TASK_HDR.TASK_DESC,
                     TASK_HDR.INVN_TYPE,
                     TASK_HDR.INVN_NEED_TYPE,
                     TASK_HDR.DFLT_TASK_PRTY,
                     TASK_HDR.CURR_TASK_PRTY,
                     TASK_HDR.XPECTD_DURTN,
                     TASK_HDR.ACTL_DURTN,
                     TASK_HDR.ERLST_START_DATE_TIME,
                     TASK_HDR.LTST_START_DATE_TIME,
                     TASK_HDR.LTST_CMPL_DATE_TIME,
                     TASK_HDR.BEGIN_AREA,
                     TASK_HDR.BEGIN_ZONE,
                     TASK_HDR.BEGIN_AISLE,
                     TASK_HDR.END_AREA,
                     TASK_HDR.END_ZONE,
                     TASK_HDR.END_AISLE,
                     TASK_HDR.START_CURR_WORK_GRP,
                     TASK_HDR.START_CURR_WORK_AREA,
                     TASK_HDR.END_CURR_WORK_GRP,
                     TASK_HDR.END_CURR_WORK_AREA,
                     TASK_HDR.START_DEST_WORK_GRP,
                     TASK_HDR.START_DEST_WORK_AREA,
                     TASK_HDR.END_DEST_WORK_GRP,
                     TASK_HDR.END_DEST_WORK_AREA,
                     TASK_HDR.TASK_TYPE,
                     TASK_HDR.TASK_GENRTN_REF_CODE,
                     TASK_HDR.TASK_GENRTN_REF_NBR,
                     TASK_HDR.NEED_ID,
                     TASK_HDR.TASK_BATCH,
                     TASK_HDR.STAT_CODE,
                     TASK_HDR.CREATE_DATE_TIME,
                     TASK_HDR.MOD_DATE_TIME,
                     TASK_HDR.USER_ID,
                     TASK_HDR.RLS_DATE_TIME,
                     TASK_HDR.SKU_ID,
                     TASK_HDR.TASK_CMPL_REF_CODE,
                     TASK_HDR.TASK_CMPL_REF_NBR,
                     TASK_HDR.OWNER_USER_ID,
                     TASK_HDR.ONE_USER_PER_GRP,
                     TASK_HDR.NEXT_TASK_ID,
                     TASK_HDR.EXCEPTION_CODE,
                     TASK_HDR.CURR_LOCN_ID,
                     TASK_HDR.TASK_PARM_ID,
                     TASK_HDR.RULE_ID,
                     TASK_HDR.VOCOLLECT_ASSIGN_ID,
                     TASK_HDR.CURR_USER_ID,
                     TASK_HDR.MHE_FLAG,
                     TASK_HDR.PICK_TO_TOTE_FLAG,
                     TASK_HDR.MHE_ORD_STATE,
                     TASK_HDR.PRT_TASK_LIST_FLAG,
                     TASK_HDR.RPT_PRTR_REQSTR,
                     TASK_HDR.ORIG_TASK_ID
       FROM INVN_NEED_TYPE, TASK_DTL, TASK_HDR
        WHERE (TASK_HDR.TASK_ID = TASK_DTL.TASK_ID(+))
          AND TASK_HDR.WHSE = '01' AND TASK_HDR.STAT_CODE >= 99 AND
              TASK_HDR.INVN_NEED_TYPE = INVN_NEED_TYPE.INVN_NEED_TYPE AND
              INVN_NEED_TYPE.WHSE = TASK_HDR.WHSE AND
              (INVN_NEED_TYPE.CO = '88') AND (INVN_NEED_TYPE.DIV = '51') AND
              (TASK_DTL.PKT_CTRL_NBR IS NULL OR TASK_DTL.INVN_NEED_TYPE = 1) AND
              TASK_HDR.MOD_DATE_TIME <= sysdate-85
      ORDER BY TASK_HDR.CREATE_DATE_TIME DESC
      The explain plan:
    PLAN_TABLE_OUTPUT
    | Id  | Operation                        | Name              | Rows  | Bytes |TempSpc| Cost (%CPU)|
    |   0 | SELECT STATEMENT                 |                   | 10032 |  1969K|       |  3143   (2)|
    |   1 |  SORT ORDER BY                   |                   | 10032 |  1969K|  4232K|  3143   (2)|
    |   2 |   HASH UNIQUE                    |                   | 10032 |  1969K|  4232K|  2689   (2)|
    |   3 |    FILTER                        |                   |       |       |       |            |
    |   4 |     NESTED LOOPS OUTER           |                   | 10032 |  1969K|       |  2235   (1)|
    |   5 |      NESTED LOOPS                |                   |  3226 |   570K|       |   284   (3)|
    |   6 |       TABLE ACCESS BY INDEX ROWID| TASK_HDR          |  3412 |   559K|       |   282   (2)|
    |   7 |        INDEX RANGE SCAN          | TASK_HDR_IND_3    |  9042 |       |       |     8  (13)|
    |   8 |       INDEX UNIQUE SCAN          | PK_INVN_NEED_TYPE |     1 |    13 |       |     1   (0)|
    |   9 |      TABLE ACCESS BY INDEX ROWID | TASK_DTL          |     3 |    60 |       |     1   (0)|
    |  10 |       INDEX RANGE SCAN           | PK_TASK_DTL       |     3 |       |       |     1   (0)|
    ---------------------------------------------------------------------------------------------------

    My apologies, yes, it is:
    SELECT TASK_HDR.TASK_ID,
                     TASK_HDR.WHSE,
                     TASK_HDR.TASK_DESC,
                     TASK_HDR.INVN_TYPE,
                     TASK_HDR.INVN_NEED_TYPE,
                     TASK_HDR.DFLT_TASK_PRTY,
                     TASK_HDR.CURR_TASK_PRTY,
                     TASK_HDR.XPECTD_DURTN,
                     TASK_HDR.ACTL_DURTN,
                     TASK_HDR.ERLST_START_DATE_TIME,
                     TASK_HDR.LTST_START_DATE_TIME,
                     TASK_HDR.LTST_CMPL_DATE_TIME,
                     TASK_HDR.BEGIN_AREA,
                     TASK_HDR.BEGIN_ZONE,
                     TASK_HDR.BEGIN_AISLE,
                     TASK_HDR.END_AREA,
                     TASK_HDR.END_ZONE,
                     TASK_HDR.END_AISLE,
                     TASK_HDR.START_CURR_WORK_GRP,
                     TASK_HDR.START_CURR_WORK_AREA,
                     TASK_HDR.END_CURR_WORK_GRP,
                     TASK_HDR.END_CURR_WORK_AREA,
                     TASK_HDR.START_DEST_WORK_GRP,
                     TASK_HDR.START_DEST_WORK_AREA,
                     TASK_HDR.END_DEST_WORK_GRP,
                     TASK_HDR.END_DEST_WORK_AREA,
                     TASK_HDR.TASK_TYPE,
                     TASK_HDR.TASK_GENRTN_REF_CODE,
                     TASK_HDR.TASK_GENRTN_REF_NBR,
                     TASK_HDR.NEED_ID,
                     TASK_HDR.TASK_BATCH,
                     TASK_HDR.STAT_CODE,
                     TASK_HDR.CREATE_DATE_TIME,
                     TASK_HDR.MOD_DATE_TIME,
                     TASK_HDR.USER_ID,
                     TASK_HDR.RLS_DATE_TIME,
                     TASK_HDR.SKU_ID,
                     TASK_HDR.TASK_CMPL_REF_CODE,
                     TASK_HDR.TASK_CMPL_REF_NBR,
                     TASK_HDR.OWNER_USER_ID,
                     TASK_HDR.ONE_USER_PER_GRP,
                     TASK_HDR.NEXT_TASK_ID,
                     TASK_HDR.EXCEPTION_CODE,
                     TASK_HDR.CURR_LOCN_ID,
                     TASK_HDR.TASK_PARM_ID,
                     TASK_HDR.RULE_ID,
                     TASK_HDR.VOCOLLECT_ASSIGN_ID,
                     TASK_HDR.CURR_USER_ID,
                     TASK_HDR.MHE_FLAG,
                     TASK_HDR.PICK_TO_TOTE_FLAG,
                     TASK_HDR.MHE_ORD_STATE,
                     TASK_HDR.PRT_TASK_LIST_FLAG,
                     TASK_HDR.RPT_PRTR_REQSTR,
                     TASK_HDR.ORIG_TASK_ID
       FROM INVN_NEED_TYPE,TASK_HDR
        WHERE TASK_HDR.WHSE = '01' AND TASK_HDR.STAT_CODE >= 99 AND
              TASK_HDR.INVN_NEED_TYPE = INVN_NEED_TYPE.INVN_NEED_TYPE AND
              INVN_NEED_TYPE.WHSE = TASK_HDR.WHSE AND
              (INVN_NEED_TYPE.CO = '88') AND (INVN_NEED_TYPE.DIV = '51') AND
              TASK_HDR.MOD_DATE_TIME <= sysdate-85
         AND EXISTS (SELECT 1
                               FROM TASK_DTL
                             WHERE TASK_HDR.TASK_ID = TASK_DTL.TASK_ID
                                AND (TASK_DTL.PKT_CTRL_NBR IS NULL OR TASK_DTL.INVN_NEED_TYPE = 1))
      ORDER BY TASK_HDR.CREATE_DATE_TIME DESCAlthough you have an OUTER JOIN on TASK_DTL.TASK_ID, this is converted to an INNER JOIN with (TASK_DTL.PKT_CTRL_NBR IS NULL OR TASK_DTL.INVN_NEED_TYPE = 1), which is the equivalent of the 'EXISTS' version above.
    I haven't been able to test this.

  • How to find which query need to tuned

    Hi ,
    How can i find , which query need to tuned . Is there any mechanism behind it?

    The mechanisms behind it are depending on your database version.
    For example:
    Oracle 9i has STATSPACK that helps you to identify possible problem queries.
    Oracle 10g has AWR - Automatic Workload Repository
    Oracle 11g has SPA - Database Replay SQL Performance Analyzer
    but there are many more tools/mechanisms...trace/tkprof for example.
    Go to http://tahiti.oracle.com and do a search on 'performance tuning guide', and pick the one that matches your (sofar unknown) database version, read a bit every now and then and see what tools are at your disposal and fit your requirement and situation.
    Besides the links that Blu already posted, searches on http://asktom.oracle.com also give lots of pointers and explanations regarding the (neverending) tuning process (at least: helped me tremendously in understanding the tuning process, the do's and dont's).
    Make sure you don't get CTD (Compulsive Tuning Disorder) from all this... ;)

  • Need an API to Validate the Segment Values of an GL Code Combination

    Hi,
    I have a requuirement wherein i need to validate the semgent values of an GL Code Combination. I want to know is there any API to Validate the Segment Values. The API should be able to validate the segment values for existence in value set, enabled/disabled, Posting flag enabled or disabled (i.e Compiled Attributes Validation).Please provide me some pointers.
    Thanks & Regards,
    Siva

    look at FND_FLEX_EXT or FND_FLEX_KEYVAL
    FND_FLEX_KEYVAL.validate_segs

  • Error:APP-FND-00906: You can only query existing flexfield code combination

    Hi,
    when i am querying the particluar account combination under Budget Journals (Navigation: GL responsibility> Budgets > Enter > Journals) window the following message is displaying by the system
    APP-FND-00906: You can only query existing flexfield code combinations. You entered query criteria in your flexfield that does not identify an existing code combination. Therefore, your query will not return any rows.
    Enter a valid code combination, or enter only the flexfield segment values you know, or do not enter any values in the flexfield.
    Note: We are using the 11.5.10.2 version.
    Can any one why this error message is displaying by the system.
    Regards,
    Kevin.

    Kevin,
    Review the following documents, and see if it helps.
    Note: 365406.1 - GLXIQACC Account Inquiry Is Failing With APP-FND-00906 Can Only Query Existing Flexfield Code Combination
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=365406.1
    Note: 272773.1 - APP-FND-00906 - You Can Query Only Existing Flexfield Combinations on the Enter Budgets form
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=272773.1
    Note: 199674.1 - 11i - GLXIQBUD - Unable To Inquire Budget Account In The Budget Inquiry Form
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=199674.1
    Regards,
    Hussein

  • Reg: Process Chain, query performance tuning steps

    Hi All,
    I come across a question like,  There is a process chain of 20 processes.out of which 5 processes are completed at the 6th step error occured and it cannot be rectified. I should start the chain again from the 7th step.If i go to a prticular step i can do that particular step, How can i start the entair chain again from step 7.i know that i need to use a function module but i dont know the name of FM. Please somebody help me out.
    Please let me know the steps involved in query performance tuning and aggregate tuning.
    Thanks & Regards
    Omkar.K

    Hi,
    Process Chain
    Method 1 (when it fails in a step/request)
    /people/siegfried.szameitat/blog/2006/02/26/restarting-processchains
    How is it possible to restart a process chain at a failed step/request?
    Sometimes, it doesn't help to just set a request to green status in order to run the process chain from that step on to the end.
    You need to set the failed request/step to green in the database as well as you need to raise the event that will force the process chain to run to the end from the next request/step on.
    Therefore you need to open the messages of a failed step by right clicking on it and selecting 'display messages'.
    In the opened popup click on the tab 'Chain'.
    In a parallel session goto transaction se16 for table rspcprocesslog and display the entries with the following selections:
    1. copy the variant from the popup to the variante of table rspcprocesslog
    2. copy the instance from the popup to the instance of table rspcprocesslog
    3. copy the start date from the popup to the batchdate of table rspcprocesslog
    Press F8 to display the entries of table rspcprocesslog.
    Now open another session and goto transaction se37. Enter RSPC_PROCESS_FINISH as the name of the function module and run the fm in test mode.
    Now copy the entries of table rspcprocesslog to the input parameters of the function module like described as follows:
    1. rspcprocesslog-log_id -> i_logid
    2. rspcprocesslog-type -> i_type
    3. rspcprocesslog-variante -> i_variant
    4. rspcprocesslog-instance -> i_instance
    5. enter 'G' for parameter i_state (sets the status to green).
    Now press F8 to run the fm.
    Now the actual process will be set to green and the following process in the chain will be started and the chain can run to the end.
    Of course you can also set the state of a specific step in the chain to any other possible value like 'R' = ended with errors, 'F' = finished, 'X' = cancelled ....
    Check out the value help on field rspcprocesslog-state in transaction se16 for the possible values.
    Query performance tuning
    General tips
    Using aggregates and compression.
    Using  less and complex cell definitions if possible.
    1. Avoid using too many nav. attr
    2. Avoid RKF and CKF
    3. Many chars in row.
    By using T-codes ST03 or ST03N
    Go to transaction ST03 > switch to expert mode > from left side menu > and there in system load history and distribution for a particual day > check query execution time.
    /people/andreas.vogel/blog/2007/04/08/statistical-records-part-4-how-to-read-st03n-datasets-from-db-in-nw2004
    /people/andreas.vogel/blog/2007/03/16/how-to-read-st03n-datasets-from-db
    Try table rsddstats to get the statistics
    Using cache memoery will decrease the loading time of the report.
    Run reporting agent at night and sending results to email.This will ensure use of OLAP cache. So later report execution will retrieve the result faster from the OLAP cache.
    Also try
    1.  Use different parameters in ST03 to see the two important parameters aggregation ratio and records transferred to F/E to DB selected.
    2. Use the program SAP_INFOCUBE_DESIGNS (Performance of BW infocubes) to see the aggregation ratio for the cube. If the cube does not appear in the list of this report, try to run RSRV checks on the cube and aggregates.
    Go to SE38 > Run the program SAP_INFOCUBE_DESIGNS
    It will shown dimension Vs Fact tables Size in percent.If you mean speed of queries on a cube as performance metric of cube,measure query runtime.
    3. --- sign is the valuation of the aggregate. You can say -3 is the valuation of the aggregate design and usage. ++ means that its compression is good and access is also more (in effect, performance is good). If you check its compression ratio, it must be good. -- means the compression ratio is not so good and access is also not so good (performance is not so good).The more is the positives...more is useful the aggregate and more it satisfies the number of queries. The greater the number of minus signs, the worse the evaluation of the aggregate. The larger the number of plus signs, the better the evaluation of the aggregate.
    if "-----" then it means it just an overhead. Aggregate can potentially be deleted and "+++++" means Aggregate is potentially very useful.
    Refer.
    http://help.sap.com/saphelp_nw70/helpdata/en/b8/23813b310c4a0ee10000000a114084/content.htm
    http://help.sap.com/saphelp_nw70/helpdata/en/60/f0fb411e255f24e10000000a1550b0/frameset.htm
    4. Run your query in RSRT and run the query in the debug mode. Select "Display Aggregates Found" and "Do not use cache" in the debug mode. This will tell you if it hit any aggregates while running. If it does not show any aggregates, you might want to redesign your aggregates for the query.
    Also your query performance can depend upon criteria and since you have given selection only on one infoprovider...just check if you are selecting huge amount of data in the report
    Check for the query read mode in RSRT.(whether its A,X or H)..advisable read mode is X.
    5. In BI 7 statistics need to be activated for ST03 and BI admin cockpit to work.
    By implementing BW Statistics Business Content - you need to install, feed data and through ready made reports which for analysis.
    http://help.sap.com/saphelp_nw70/helpdata/en/26/4bc0417951d117e10000000a155106/frameset.htm
    /people/vikash.agrawal/blog/2006/04/17/query-performance-150-is-aggregates-the-way-out-for-me
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/1955ba90-0201-0010-d3aa-8b2a4ef6bbb2
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/ce7fb368-0601-0010-64ba-fadc985a1f94
    http://help.sap.com/saphelp_nw04/helpdata/en/c1/0dbf65e04311d286d6006008b32e84/frameset.htm
    You can go to T-Code DB20 which gives you all the performance related information like
    Partitions
    Databases
    Schemas
    Buffer Pools
    Tablespaces etc
    use tool RSDDK_CHECK_AGGREGATE in se38 to check for the corrupt aggregates
    If aggregates contain incorrect data, you must regenerate them.
    Note 646402 - Programs for checking aggregates (as of BW 3.0B SP15)
    Thanks,
    JituK

  • Code Combination Validation

    Hello,
    Has anyone setup Code Combination validations in Hyperion Planning? I have done it to a certain extent using forms or security. Is there a way to setup full blown code combination validation like it would be done in GL?
    Thank you,
    Nitin

    Hi,
    There is a method that works both at the web and smartview. It's quite straight forward and maintainable.
    Prepare a query that would extract the combination data along with a dummy data column (i.e. 0 for all records). Load this data to Essbase, but when loading you should select a constant member from any dimension that does not exist in code combination. For example, you do not probably have segments in GL called version or scenario, likewise code combination usually does not contain period or year. So, load the data to a constant member from each of these dimensions (i.e. Begbalance, noyear, noversion, noscenario etc.)
    In the next step you need to create dynamic calc members in any of these dimensions which you use at the column section of the forms. Usually it's only period but it might be necessary for other dimensions also. No matter in which dimension, The member formula for these members will be as below:
    Begbalance->noyear->noversion->noscenario; this is in short the combination of constant members you use while loading the code combination.
    Now edit a form and add a column as the first or last position, place this dynamic member and hide the column. If you have more than one dimension in the column that you used constant members in data load then placing the dynamic member from one of them is sufficient. For example, you might have both period and scenario on the column section. Then place only period dynamic member and select any scenario. On the rows section, enable suppression on missing data (not block). Ultimately, you must do this customization in all the forms you want code combination to kick off.
    This way only the valid combinations will appear on the form and the others will be disabled. We are happily using this for a long time.
    Cheers,
    Alp

  • How to get Code Combination Range (Account Range From - Account Range To)

    Hi,
    I have a requirement that I need to get the range of code of combinations based on the parameter (Account Range From & Account Range To) in the query. Please could anyone help how to fetch this value based on the parameter.
    Account Range From (7 Segments)
    XXX
    AAAA
    BBBB
    CCC
    000
    YYY
    ZZZZ
    Account Range To (7 Segments)
    XXX
    AAAA
    BBBB
    CCC
    000
    YYY
    ZZZZ
    These is the example of value which I will be getting on the Accounting Range From and Accounting Range. Based on this account range, I need to pull records from the GL_CODE_COMBINATIONS table. Any help on this plz?
    Thanks,
    Geno

    I would not use the code_combination_id. That code_combinaition_id is incremented by one for each new account, so unless you happened to create all your accounts in the right sequential order (not likely), then you cannot do a range of FROM code id a TO code id b. Do an SQL against the code combinations table and sort on the segments columns and take a look at the code combination id on each row, and I think you will see that they jump around quite a bit. I think you can only rely on using the segment columns values for doing an account range.
    John Dickey

  • To get code combination in transaction screen -AR

    hi all
    i am using r12
    in AR super user -transactions-in the transactions screen -when it is queried say 10000086 in the field Number
    when distributions tab is clicked we get to see a field named GL account eg 701-100001-1000-0101-1220001-000000-0000-0000
    when i see record history for Transactions screen it says RA_CUSTOMER_TRX_PARTIAL_V
    when i see record  history for gl account   RA_CUST_TRX_LINE_GL_DIST_V  but i don't see the code combinations
    how to join RA_CUSTOMER_TRX_PARTIAL_V and RA_CUST_TRX_LINE_GL_DIST_V
    i did join with customer_trx_id but it gives more number of rows
    kindly guide
    thanking in advance

    Do you want sql script to find GL Code Combinations for a AR transaction?
    If yes, following is the query.
    select rcta.trx_number, gcck.concatenated_segments
    from ra_customer_trx_all rcta, ra_customer_trx_lines_all rctla, RA_CUST_TRX_LINE_GL_DIST rctlgd, gl_code_combinations_kfv gcck
    where rcta.trx_number = '<Give your AR Invoice>'
    and rcta.customer_trx_id = rctla.customer_trx_id
    and rctla.customer_trx_line_id = rctlgd.customer_trx_line_id
    and rctlgd.code_combination_id = gcck.code_combination_id;
    If you are looking for something else, please be clear
    Regards,
    Srini

  • Bapi_Acc_Document_Post - E 018 : Invalid tax code and company code combination

    Hi All,
    I need the help of this forum once again.
    I am using bapi Bapi_Acc_Document_Post to create KR documents in SAP. The bapi works absolutely fine except for one scenario:
    For a particular type of invoice coded to Company "XXXX" with lines having tax code "I0", the bapi returns error message "E 018 : Invalid tax code and company code combination". The tax code "I0" and the company code "XXXX" has been mapped in SAP and if I try to create the invoice manually in SAP using the GUI, the invoice gets created without any issue.
    I have tried searching the forum but could not find any post on this topic.
    Therefore, requesting the masters to please help me out on this.
    Best Regards
    Sutirtha Roy

    Hi Gowthami,
    how have you solved your problem, because I am facing the similiar issue and trying desperately to post the following combination with BAPI_ACC_POST_DOCUMENT:
    001 40       490100     Aufw. aus Marge PP              R2                 15,92
    002 31       10000003   Kreditor                                R2                 15,92-
    003 50       175060     Abzugsverfahren USt            R2                  3,18-
    004 40       154060     Abzugsverfahren Vst             R2                  3,18
    THANX!
    Regards
    Marko

  • Defining more parameters than a query needs

    Hi.
    When I run the following code, I get the error "ORA-01036: illegal variable name/number" .
    The problem is that I currently define more parameters than the query needs. Thats because I don't know how many bind variables the query uses, and I would not like to parse the query ...
    I don't understand why I have to define exactly the same number of parameters, and in the exact order ... It doesn't make sense. As bind variables have names, there should be no problem passing more parameters or parameters in a different order: the binding should be done by name...
    I'm currently using Oracle10g, ODP.NET and .NET Framework 2.0.
    I would appreciate any help ...
    Thank you.
    Ricardo Coimbras
    ===== BEGIN VB.NET CODE =====
    Sub Execute_Query(ByVal SqlString as String)
    Dim ObjCmd As OracleCommand
    Dim DataAdap As OracleDataAdapter
    Dim outDsCorpo As DataSet
    Dim Constroi_Conn_String_Oracle As String
    Dim mObjConnOracle As OracleConnection
    Constroi_Conn_String_Oracle = "User ID=uuu" & _
    ";Password=ppp" & _
    ";Data Source=bd" & _
    ";Pooling=false"
    mObjConnOracle = New OracleConnection(Constroi_Conn_String_Oracle)
    mObjConnOracle.Open()
    ObjCmd = mObjConnOracle.CreateCommand()
    ObjCmd.CommandType = CommandType.Text
    ObjCmd.CommandText = SqlString
    ObjCmd.Parameters.Add("p1", OracleDbType.Char, 3, "001", ParameterDirection.Input)
    ObjCmd.Parameters.Add("p2", OracleDbType.Char, 3, "001", ParameterDirection.Input)
    DataAdap = New OracleDataAdapter(ObjCmd)
    outDsCorpo = New DataSet()
    DataAdap.Fill(outDsCorpo)
    GridView1.DataSource = outDsCorpo
    GridView1.DataBind()
    DataAdap = Nothing
    ObjCmd = Nothing
    mObjConnOracle.Close()
    mObjConnOracle.Dispose()
    mObjConnOracle = Nothing
    End Sub
    Execute_Query "select * from map.t_mapa_def where mapa_def_cod = :p1 order by mapa_def_cod"
    ===== END VB.NET CODE =====

    Hi,
    BindByPosition is the default behavior as per the docs, and you can change that by setting cmd.BindByName=true which adds a little bit of extra overhead.
    That wont fix the error seen when binding a random number of parameters to the statement though. You need to bind the correct number and types of parameters.
    Greg

  • How to Code this Query

    Hello, I'm using Access and need to code this query on SQL and I have this problem:
    I have 3 tables: Movie, Actor, Acts_In
    Movie table has fields: Movie_ID, movie_name, actor_1, actor_2, director
    Actor table has fields: Actor_ID, first_name, last_name
    Acts_IN table has fields: Movie_ID, Actor_ID
    * actor_id and movie_id are primary keys
    I have to create a query that allows me to search for a director, giving me a list of actors that have worked with that director, and all the movies they have acted in.
    so far I have come up with this code, however:
    select actor.first_name, actor.last_name, movie_name
    from (actor inner join acts_in ON acts_in.actor_ID=actor.actor_id) inner JOIN movie
    ON acts_in.movie_ID=movie.movie_id
    group by actor.first_name, actor.last_name, movie_name;
    This code gives me a list of all actors and all movies they acted in, but it does not give me specific actors in respect to a specific director, adding
    where director="XYZ"
    does not work as it gives me all actors that have worked with director XYZ but not all movies they have acted in. 
    Thanks!

    Grump. You should have provided us example data and DML, like this:
    DECLARE @movies TABLE (movie_ID INT, movie_Name VARCHAR(50), director VARCHAR(75))
    DECLARE @actors TABLE (actor_ID INT, first_name VARCHAR(50), last_name VARCHAR(50))
    DECLARE @acts_in TABLE (movie_ID INT, actor_ID INT)
    INSERT INTO @movies (movie_ID, movie_Name, director) VALUES
    (1, 'Batman Returns', 'Tim Burton'),
    (2, 'Charlie and the Chocolate Factory', 'Tim Burton'),
    (3, 'Sweeney Todd', 'Tim Burton'),
    (4, 'Alice in Wonderland', 'Tim Burton'),
    (5, 'Edward Scissor Hands', 'Tim Burton'),
    (6, 'From Hell', 'Albert Huges')
    INSERT INTO @actors (actor_ID, first_name, last_name) VALUES
    (1, 'Danny', 'DeVito'),
    (2, 'Freddie', 'Highmore'),
    (3, 'Helena', 'Bonham-Carter'),
    (4, 'Johnny', 'Depp'),
    (5, 'Mia', 'Wasikowska'),
    (6, 'Micheal', 'Keaton'),
    (7, 'Winona', 'Ryder')
    INSERT INTO @acts_in (movie_id, actor_ID) VALUES
    (1, 1),(1, 6),
    (2, 2),(2, 4),
    (3, 3),(3, 4),
    (4, 4),(4, 5),
    (5, 4),(5, 7),
    (6, 4)
    Which would have allowed us to come up with this:
    SELECT m2.director, a.first_name, a.last_name, m2.movie_Name
    FROM ((((@movies m
    INNER JOIN @acts_in ai
    ON m.movie_ID = ai.movie_ID)
    INNER JOIN @actors a
    ON ai.actor_ID = a.actor_ID)
    INNER JOIN @acts_in ai2
    ON a.actor_ID = ai2.actor_ID)
    INNER JOIN @movies m2
    ON ai2.movie_ID = m2.movie_ID)
    WHERE m.director = 'Tim Burton'
    GROUP BY m2.director, a.first_name, a.last_name, m2.movie_Name
    IIRC the primary difference between TSQL and the "Access SQL" is the freakin parens. So that *should* run in access, which you appear to be using.
    Don't forget to mark helpful posts, and answers. It helps others to find relevant posts to the same question.

  • Create New GL Code Combination - With some flags

    Hi All
    I created a new gl code combination useing the below script
    DECLARE
    l_keyval_status BOOLEAN;
    L_COA_ID NUMBER;
    P_CONCAT_SEGS VARCHAR2(500);
    l_err_msg varchar2(2000);
    l_error varchar2(255);
    BEGIN
    L_COA_ID := 50372;
    P_CONCAT_SEGS := '014.01.0000.1101020200.002.23001.01.00.000000.000.000.000';
    l_keyval_status := fnd_flex_keyval.validate_segs(
    'CREATE_COMBINATION',
    'SQLGL',
    'GL#',
    l_coa_id,
    p_concat_segs,
    'V',
    sysdate,
    'ALL', NULL, NULL, NULL, NULL,
    FALSE,FALSE, NULL, NULL, NULL);
    commit;
    if l_keyval_status then
    dbms_output.put_line('S');
    else
    l_err_msg:=substr(fnd_flex_keyval.error_message, 1, 240); --fnd_message.g
    l_error := substr(fnd_flex_keyval.error_message, 1, 240);
    dbms_output.put_line(l_error);
    dbms_output.put_line('ERROR SEGMENT :');
    l_error := to_char(fnd_flex_keyval.error_segment);
    dbms_output.put_line(l_error);
    dbms_output.put_line('ERROR ENCODED :');
    l_error := substr(fnd_flex_keyval.encoded_error_message, 1, 240);
    dbms_output.put_line(l_error);
    dbms_output.put_line('FALSE');
    dbms_output.put_line(l_err_msg||substr(sqlerrm,150,3));
    end if;
    end;
    The code combination created successfully, but in the application form of the code combination
    the Allow posting flag = 'N' and summry_flag = 'Y'
    while i need it to be created wit detail_posting_allowed = 'Y' and summry_flag = 'N'
    is there any way to set the flags while useing the API
    best regards

    Hi Miro,
    Does any account segment value used by you to create the code combination have 'Allow Posting' set to No ? I am wondering if those defaults are setting the flags at the code combination level.

  • Code combination based hierarchy

    Hi,
    I am wanting to overlay a code combination based alternative reporting hierarchy in Finance against budgets, balances and journals.
    The nature of the overlay is that the first contact is from code combination id (all of the used segments in the chart of accounts) to a parent code / description. Each parent code then has a level number and may have a parent of its own, only linked to the original gl codes through the total chain of parents.
    From initial analysis I do not think this is possible using standard functionality - but if anyone thinks overwise - let me know!
    My question is, is there a document that I can utilise to perform the analysis on how this could be linked into the existing physical table structure? (i.e. I need to understand the current PK -> FK links in the physical layer to scope the extent of the work)
    thanks,
    Robert.

    Hi,
    my requirement is that the hierarchy is multi-leveland joined on all of the six live accounting segments.
    So; -
    Level 1 - 101.10222.8554.0444.000.00000 (accounting segments) joins to; AAAAA - My analysis code level 1
    Level 2 - AAAAA (parent) joins to BBBBB - My analysis code level 2
    Note it is the total combination of all the segments which is the requirement, so just because the first segment is 101, this does not mean that all entries with first segment 101 will be this parent, only when in combination with the rest of the segments exactly as above (so one code combination id effectively)
    regards,
    Robert.

  • Combined Query Output as Filter Criteria

    Post Author: imzdo1
    CA Forum: WebIntelligence Reporting
    I have the need to run a combined query to produce a list of document numbers (I have that query working) and then use the output from that query as the filter criteria in an expanded query in the same Universe.  The output from the first query is 6500 document numbers so it would be very time consuming to cut and paste these into a filter 15 or 20 at a time and then pasting the result of the 300 queries needed to get one report.
    I have both reports built, but can not figure out how to link the first report output to the filtering criteria on the second report.  I am using Webi, not full client version.
    Is is possible and if so how?

    Post Author: RobotSlave
    CA Forum: WebIntelligence Reporting
    Hello imzdo1, what type of datasource? the following applies to SQL:
    sounds like you need to create a temporary table in your SQL stored procedure, like so:
    CREATE TABLE #TempDocumentNumbers
    documentNumber int,
    documentName Varchar(20)
    or however many columns you need, then insert into the temporary table using your existing query like so:
    INSERT INTO #TempDocumentNumbers
    SELECT (whatever your select statement is)
    just remember that you will need to have coresponding columns in your temporary table for each column your select statement returns, once you have the values stored in your temporary table you can join on it just like you would on any other table in the database,
    I like to explicitly drop temp tables at the end of my query like so:
    DROP TABLE #TempDocumentNumbers

Maybe you are looking for