Performance tuning for ABAP Query (created from t-cd SQ01)

Hello all,
We created ABAP Query report from transaction SQ01.
But the generated report has an appropriate SQL statement which causes performance problem.
To solve this issue, I guess the easiest way is;
0. Give up to use it.
1. Copy it to another object in the customer namespace.
2. Ajust SQL statement.
But I'm wondering if there're appropriate ways to adjust SQL statement of Query.
Could anybody give me any better idea?
Thank you

You can try this: Create 2 ranges, for objnr and cdtcode and fill like:
ra_objnr-sign = 'I'.
ra_objnr-option = 'CP'.
ra_objnr-low = 'OR*'.
append ra_objnr.
ra_code-sign = 'I'.
ra_code-option = 'CP'.
ra_code-low = 'CO*'.
append ra_code.
SELECT objnr udate utime
FROM jcds
INTO TABLE it_jcds
WHERE objnr IN ra_objnr
AND stat = l_tj02t
AND cdtcode IN ra_code
AND inact = space

Similar Messages

  • Performance tuning for JCDS query

    Hi All,
    I have a performance issue in following query.Any Idea how can it be improved?
        SELECT objnr udate utime
               FROM jcds
               INTO TABLE it_jcds
               WHERE objnr LIKE c_or
                AND   stat = l_tj02t
                AND   cdtcode LIKE c_co
                AND  inact = space.
    Fields          Distinct values
    CDTCODE                  111
    INACT             192
    Only one index i.e Primary Index
    UNIQUE     Index   JCDS~0 (Compute)
    Column Name                     #Distinct
    MANDT                                          3
    OBJNR                                  2.165.245
    STAT                                         100
    CHGNR                                        319
    Is 'like' statement causing the performance issue and how can it be corrected?
    Or Index can be created for this?

    You can try this: Create 2 ranges, for objnr and cdtcode and fill like:
    ra_objnr-sign = 'I'.
    ra_objnr-option = 'CP'.
    ra_objnr-low = 'OR*'.
    append ra_objnr.
    ra_code-sign = 'I'.
    ra_code-option = 'CP'.
    ra_code-low = 'CO*'.
    append ra_code.
    SELECT objnr udate utime
    FROM jcds
    INTO TABLE it_jcds
    WHERE objnr IN ra_objnr
    AND stat = l_tj02t
    AND cdtcode IN ra_code
    AND inact = space

  • Performance tuning for extraction of data from MSEG table

    Hello experts,
    I m trying to extract data via select query from MSEG table based on non-primary keys, which affects my performance.
    Below is my select query  :
    FROM mseg
    INTO w_rejqty
    WHERE ebeln = it_mseg-ebeln AND
          ebelp = it_mseg-ebelp AND
          bwart = '122'.   
    Kindly suggest some alternative way for it apart from creating secondary index on table MSEG which would be my last option because already four secondary index are created in my present situation and also is it advisable to create fifth secondary index for my problem?? Would it affect my database performance?
    Thanks in advance

    Hi Raj,
    is that possible to use this query below ? You might ask to Functional whether is possible or not.
    SELECT SINGLE belnr gjahr buzei INTO w_ekbe FROM ekbe
        WHERE ebeln = it_mseg-ebeln
        AND     ebelp = it_mseg-ebelp
    SELECT SINGLE menge FROM mseg INTO w_rejqty
       WHERE mblnr EQ w_ekbe-belnr
       AND   mjahr EQ w_ekbe-gjahr
       AND   zeile EQ w_ekbe-buzei
    Best Regards

  • Performance tuning for the query

    CURSOR c_exercise_list IS
                  DECODE(v_mfd_mask_id ,'Y',' ',o.opt_id) opt_id,
                  DECODE(v_mfd_mask_id ,'Y',' ',o.soc_sec) soc_sec,
                  P.plan_id plan_id, E.exer_id exer_id, E.exer_num,
                  DECODE(G.sar_flag, 0, DECODE(G.plan_type, 0, '1', 1, '2', 2, '3', 3, ' ', 4,'5', 5, '6', 6, '7', 7, '8', 8, '9', '0'), ' ') option_type,
                  TO_CHAR(G.grant_dt, 'YYYYMMDD') grant_dt, TO_CHAR(E.exer_dt, 'YYYYMMDD') exer_dt,
                  E.opts_exer opts_exer,
                  E.mkt_prc   mkt_prc,
                  E.swap_prc  swap_prc,
                  E.shrs_swap shrs_swap, decode(e.exer_type,2,decode(xe.cash_partial,'Y','A','2'),TO_CHAR(E.exer_type)) exer_type,
                  E.sar_shrs  sar_shrs,
                  NVL(ROUND(((xe.sar_shrs_withld_optcost - (e.opts_exer * g.opt_prc) / e.mkt_prc) * e.mkt_prc),2),0)+e.sar_cash sar_cash,
                  NVL(f.fixed_fee1,0) fixed_fee1,
                  NVL(f.fixed_fee2,0) fixed_fee2,
                  NVL(f.fixed_fee3,0) fixed_fee3,
                  NVL(f.commission,0) commission,
                  NVL(f.sec_fee,0)    sec_fee,
                  NVL(f.fees_paid,0)  fees_paid,
                  NVL(ct.amount,0)     cash_tend,
                  E.shrs_tend  shrs_tend, G.grant_id grant_id, NVL(G.grant_cd, ' ') grant_cd,
                  NVL(xg.child_symbol,' ') child_symbol,
                  NVL(xg.opt_gain_deferred_flag,'N') defer_flag,
                  o.opt_num opt_num,
                  DECODE(v_mfd_mask_id ,'Y',' ',xo.new_ssn) new_ssn,
                  ,xo.tax_verification_eligible tax_verification_eligible
                  ,(SELECT TO_CHAR(MIN(settle_dt),'YYYYMMDD') FROM tb_ml_exer_upload WHERE exer_num = E.exer_num AND user_id=E.user_id AND NVL(settle_dt,TO_DATE('19000101','YYYYMMDD'))>=E.exer_dt) AS settle_dt
                  ,xe.rsu_type  AS rsu_type
                  ,xe.trfbl_det_name AS trfbl_det_name
                  ,NVL(xg.pu_var_price ,0) v_pu_var_price
                  ,NVL(xe.ficamed_override,'N') v_ficmd_ovrride
                  ,NVL(xe.vest_shrs,0) v_vest_shrs
                  ,NVL(xe.client_exer_id,' ') v_client_exer_id
                  ,(CASE WHEN xg.re_tax_flag = 'Y' THEN pk_xop_reg_outbound.Fn_GetRETaxesWithheld(g.grant_num, E.exer_num, g.plan_type)
                         ELSE 'N'
                     END) re_tax_indicator -- 1.5V
                  ,xe.sar_shrs_withld_taxes   --Added for SAR july 2010 release
                  ,xe.sar_shrs_withld_optcost --Added for SAR july 2010 release
            (SELECT exer.* FROM exercise exer WHERE NOT EXISTS (SELECT s.exer_num FROM suspense s
                WHERE s.exer_num = exer.exer_num AND s.user_id = exer.user_id AND exer.mkt_prc = 0))E,
                grantz G,  xop_grantz xg, optionee o, xop_optionee xo, feeschgd f, cashtendered ct, planz P,xop_exercise xe
                  E.grant_num  = G.grant_num
            AND   E.user_id    = G.user_id
            AND   E.opt_num    = o.opt_num
            AND   E.user_id    = o.user_id
            AND   (G.grant_num = xg.grant_num(+) AND G.user_id=xg.user_id(+))
            AND   (o.opt_num   = xo.opt_num(+)   AND o.user_id=xo.user_id(+))
            AND   E.plan_num = P.plan_num
            AND   E.user_id = P.user_id
            AND   E.exer_num = f.exer_num(+)
            AND   E.user_id = ct.user_id(+)
            AND   E.exer_num = ct.exer_num(+)
            AND   E.user_id = ct.user_id(+)
            AND   E.exer_num=xe.exer_num(+)
            AND   E.user_id=xe.user_id(+)
            AND   G.user_id = USER
            AND NOT EXISTS (
                        SELECT tv.exer_num
                          FROM tb_xop_tax_verification tv--,exercise ex
                         WHERE tv.exer_num = e.exer_num
                           AND tv.user_id = e.user_id
                           AND tv.user_id = v_cms_user
                           AND tv.status_flag IN (0,1,3,4, 5)) -- Not Processed
            ;how to tune the query to impropve the performance, any1 help me ..thanks in advance
    Edited by: BluShadow on 21-Feb-2013 08:14
    corrected {noformat}{noformat} tags. Please read {message:id=9360002} and learn how to post code correctly.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    i got CPU cost: 458.50 Elapsed time: 1542.90 so anything can tune to improve the performance, but there is no full table scan applied for none of the mentioned table. . and most of the columns are unique index scan takes place.. anybody can help me to find the solution
    Oracle Database 10g Enterprise Edition Release - 64bi
    PL/SQL Release - Production
    CORE     Production
    TNS for Solaris: Version - Production
    NLSRTL Version - Production
    Edited by: 956684 on Feb 22, 2013 4:09 AM

  • How to create a tcode for abap query

    how to create a transaction code for abap query,
    i used a single table , my requirment is as i enter the tcode i should get the selectioin screen of my query.

    Follow this
    . Make a transaction with parameters transaction from se93 .
    2. Put START_REPORT in the transaction
    3. Check the skip intial screen checkbox
    4. in the table control in the end of screen put these values
    (G stands for GLOBAL AREA:)(Entered after a space)(G should come after 9
    chanracters(8 char for user group,one space and then G)
    refer this:

  • Creating TCODE for ABAP Query

    Hello everyone! I have created my very first ABAP Query, but I still need to create/assign TCODE for the said report.  Can anyone help me with it? Somebody told me to use SE93.  I found out that there are 5 options in SE93 to create a TCode, I tried all options but I could not get through it because I was asked for a program name or a transaction.  What should I put in there? The query name?  Please help.

    HI Ervyone! Got it Already. To Get the program name of the ABAP Query,
             1. Go to SQ01> Query Menu>More Function--> Generate Program
             2. Go to SQ01> Query Menu>More Function--> Display Report Name. Copy the Report Name that Will be displayed.
             3.  Go to SE93 Enter the TCODE that you want to use, then click on Create BUtton.  Choose the second option "Program 
                  and Selection Screen (Report Option)".  The next screen will ask for your program name,  Paste/copy the program
                  name and save it.
    Edited by: Ksbaizas on Jun 22, 2010 3:19 AM

  • Creating t.code for ABAP query and Transport  it TO Production and run it .

    Hi Friends
    Thanks for ur reply ,
    The requirement is that i want to create tcode for abap query and that query can be regenearted ,
    in case of regeneration programe name i got answer programame name will be change, i created and modified query but i saw the same programe name ,,, may be it changed when it is trasnported if so then what ??
    and also pls give me solution for asiging tcode for query which is going to be regenerated.
    thanks and regards

    Dear Farukh,
    As we know,
    Query is created in Production server and a corresponding program is generated by System.
    What we have to do is just to assign the program to the desired transaction code in Development server and transport it.
    If you have any doubts please let me know.
    Kindly assign points if you find this info usefull.
    Lijo Joseph

  • Performance Tuning for BAM 11G

    Hi All
    Can anyone guide me for any documents or any tips realted to performance tuning for BAM 11G on on Linux

    It would help to know if you have any specific issue. There are number of tweaks all they way from DB to Browser.
    Few key things to follow:
    1. Make sure you create index on DO. If there are too much old data in the DO and not useful then periodically delete it. Similar to relational database indexes, defining indexes in Oracle BAM creates and maintains an ordered list of data object elements for fast retrieval.
    2. Ensure that IE setup to do automatic caching. This will help with reducing server round trips.
    3. Tune DB performance. This would typically require DBA. Identify the SQL statements most likely to be causing the waits by looking at
    the drilldown Top SQL Statements Ordered by Wait Time. Use SQL Analyze, EXPLAIN PLAN, or the tkprof utility to tune the queries that were identified.
    Check the Dataobject tables involved in the query for missing indexes.
    4. Use batching (this is on by default for most cases)
    5. Fast network
    6. Use profilers to look at machine load/cpu usage and distribute components on different boxes if needed.
    7. Use better server AND client hardware. BAM dashboard are heavy users of ajax/javascript logic on the client

  • What are the steps doing a performance tuning for pertcular program

    What are the steps doing a performance tuning for pertcular program

    chk this link
    checkout these links: performance-tuning-for-data-selection-statement.htm SAPABAPPerformanceTuning_Introduction.asp
    Message was edited by: Chandrasekhar Jagarlamudi

  • Creting t.code for ABAP query and Transport  it TO Production and run it .

    Hi Friends
    Thanks for ur reply ,
    The requirement is that i want to create tcode for abap query and that query can be regenearted ,
    in case of regeneration programe name i got answer programame name will be change, i created and modified query but i saw the same programe name ,,, may be it changed when it is trasnported if so then what ??
    and also pls give me solution for asiging tcode for query which is going to be regenerated.
    thanks and regards

    Hi farukh,
    1. If any query is re-generatred,
       then some MANUAL INTERVENTION
       is absolutely required.
    2. Hence, what we prefer is this :
       1. Generate first query.
       2. Copy the code to a Z Program
       3. Attach tcode to THIS z program.
       4. Transport
    3. Now,
      whener the query is generated again,
                        (which has already been created)
    4. In such cases,
      (and it takes not more than 15 SECONDS)
    amit m.

  • Performance Tuning for Concurrent Reports

    Can you help me with Performance Tuning for Concurrent Reports/Requests ?
    It was running fine but suddenly running slow.
    Request Name : Participation Process: Compensation program

    What is your application release?
    Please see if (Performance Issues With Participation Process: Compensation Workbench [ID 389979.1]) is applicable.
    To enable trace/debug, please see (FAQ: Common Tracing Techniques within the Oracle Applications 11i/R12 [ID 296559.1] -- 5. How does one enable trace for a concurrent program INCLUDING bind variables and waits?).

  • Performance tuning for siebel CRM application on oracle database

    Please send me the link for Performance tuning for siebel CRM application on oracle database. If there are any white papers please send me the link.

    This metalink document is very useful, if you have any other documents or links please inform me.
    Thanks once again

  • Performance Tuning for a report

    We have developed a program which updates 2 fields namely Reorder Point and Rounding Value on the MRP1 tab in TCode MM03.
    To update the fields, we are using the BAPI BAPI_MATERIAL_SAVEDATA.
    The problem is that when we upload the data using a txt file, the program takes a very long time. Recently when we uploaded a file containing 2,00,000 records, it took 27 hours. Below is the main portion of the code (have ommitted the open data set etc). Please help us fine tune this, so that we can upload these 2,00,000 records in 2-3 hours.
    select matnr from mara into table t_mara.
    select werks from t001w into corresponding fields of table t_t001w .
    select matnr werks from marc into corresponding fields of table t_marc.
    loop at str_table into wa_table.
    if not wa_table-partnumber is initial.
         INPUT         =  wa_table-partnumber
        OUTPUT        = wa_table-partnumber
    clear wa_message.
    read table t_mara into wa_mara with key matnr = wa_table-partnumber.
    if sy-subrc is not initial.
    concatenate 'material ' wa_table-partnumber ' doesnot exists'
    into wa_message.
    append wa_message to t_message.
    read table t_t001w into wa_t001w with key werks = wa_table-HostLocID.
      if sy-subrc is not initial.
      concatenate 'plant ' wa_table-HostLocID  ' doesnot exists' into
      append wa_message to t_message.
      case wa_t001w-werks.
    when 'DE40'
    or  'DE42'
    or  'DE44'
    or  'CN61'
    or  'US62'
    or  'SG70'
    or  'FI40'
    read table t_marc into wa_marc with key matnr = wa_table-partnumber
                                            werks = wa_table-HostLocID.
    if sy-subrc is not initial.
    concatenate 'material' wa_table-partnumber  ' not extended to plant'
    wa_table-HostLocID  into  wa_message.
    append wa_message to t_message.
    when others.
    concatenate 'plant ' wa_table-HostLocID ' not allowed'
      into wa_message.
    append wa_message to t_message.
        if wa_message is initial.
          data: wa_headdata type BAPIMATHEAD,
          wa_PLANTDATA type BAPI_MARC,
          wa_PLANTDATAx type BAPI_MARCX.
          wa_headdata-MATERIAL = wa_table-PartNumber.
          wa_PLANTDATA-plant = wa_table-HostLocID.
          wa_PLANTDATAX-plant = wa_table-HostLocID.
          wa_PLANTDATA-REORDER_PT = wa_table-ROP.
          wa_PLANTDATAX-REORDER_PT = 'X'.
          wa_plantdata-ROUND_VAL = wa_table-EOQ.
          wa_plantdatax-round_val =  'X'.
              HEADDATA                   = wa_headdata
             PLANTDATA                  = wa_PLANTDATA
             PLANTDATAX                 = wa_PLANTDATAX
             RETURN                     =  t_bapiret
    write t_bapiret-message.
    clear: wa_mara, wa_t001w, wa_marc.
    loop at t_message into wa_message.
    write wa_message.
    Thanks in advance.
    Edited by: kishan P on Sep 17, 2010 4:50 PM

    Hi Peter,
    I would suggest few changes in your code. Please refer below procedure to optimize the code.
               Please run SE30 run time analysis and find out if ABAP code or Database fetch is taking time.
               Please run extended program check or code inspector to remove any errors and warnings.
               Few code changes that i would suggest in your code
              For select query from t001w & marc remove the corresponding clause as this also reduces the performance. ( For this you can define an Internal table with only the required fields in the order they are specified in the table and execute a select query to fetch these fields)
              Also put an initial check if str_table[] is not initial before you execute the loop.
              where ever you have used read table. Please sort these tables and use binary search.
              Please clear the work areas after every append statment.
              As i dont have a sap system handy. i would also check if my importing parameters for the bapi structure is a table. Incase its a table i would directly pass all the records to this table and then pass it to the bapi. Rather than looping every records and updating it.
    Hope this helps to resolve your problem.
    Have a nice day

  • Performance Tuning for OBIEE Reports

    Hi Experts,
    I had a requirement for which i have to end up building a snowflakt model in Physical layer i.e. One Dimension table with Three snowflake tables(Materialized views).
    The key point is the Dimension table is used in most of the OOTB reports.
    so all the reports use other three snowflakes tables in the Join conditions due to which the reports take longer time than ever like 10 mints.
    can anyone suggest good performance tuning tips to tune the reports.
    i created some indices on Materialized view columns and and on dimension table columns.
    i created the Materialized views with cache Enabled and refreshes only once in 24 hours etc
    is there anything i have to improve performance or have to consider re-designing the Physical layer without snowflake
    Please Provide valuable suggestions and comments
    Thank You

    Most of the Performance Tuning should be done at the Back End , So calculate all the aggregates in the Repository it self and Create a Fast Refresh for MV and you can also do one thing you can schedule an IBOT to run the report every 1 hour or some thing so that the report data will be cached and when the user runs the report the BI Server extracts the data from Cache
    Hope that helps

  • Authorization for ABAP Query

    Hello all,
    Can I benefit a little from your experience with SAP Query(ABAP) and Adhoc Query(ABAP)?
    My customer want to use both SAP Query and Adhoc Query.
    And they want to separate for SAP Query as preset report program and Adhoc Query as general-purpose reporting tool.
    And I want to know how to separate authorizations of SAP Query and Adhoc Query as below.
    As for SAP Query, users can only execute and cannnot change or delete it.
    As for Adhoc Query, users can save Queries they created or changed in Adhoc Query.
    I know there is only one authorization object for SAP Query:S_QUERY
    Is there any solution for that kind of request?
    Thanks and Regards,

    We have check in the abap program ask you functional to give the authorization object i.e. y_k_autchk
    and ask him for which filed we have to give authorizaion.
        AUTHORITY-CHECK OBJECT y_k_autchk
        ID 'WERKS' FIELD y_wa_tvarv-low.

Maybe you are looking for

  • Payment terms of Purchase Order and F-47

    Dear All, How can we link Payment terms of Purchase Order and Advance Payment made thru F-47. i.e if we have given payment terms in Purchase ORder as 50% advance then by advance payment (F-47) we shall allow to pay only 50% of Purchase Order value as

  • OBIEE 11g Scheduler installation error on Linux box. Please help!

    Hello, I'm trying to install OBIEE on a Linux box. The repository was created using a Windows PC on a separate Oracle database on another server. I have four of the five OBI components running but I keep getting this error for the Scheduler. [2011-09

  • What One Specification Should I Look for When Buying Optical 5.1 Speakers for the iMac 27" i7?

    Hi. I have an analog 5.1 (it came from my previous PC setup) now but only the subwoofer works, the controller for its satellite speakers maybe have been busted by the high voltage from the outlet (I've since gotten a nice AVR). If replace it since th

  • Download Movies to iPad

    I have some movies I've ripped and would like to sync to my iPad.  I've set up Home Sharing on iTunes, add the movies to the library and turned on Home Sharing on the iPad. When I launch the Videos App, I have an option for Sharing and can then acces

  • Calling database stored  function from Entity Object

    Hi, I want to call a database stored function from create() method of Entity Object. Database function returns some value. Can anybody suggest me some way to do it.