Code inspector, SQL trace

Hi all,
Can anyone help me to analyse the output of sql trace and  code inspector that we do for a program.
Thanks & regards,
Saroja.

SQL trace(ST05) provides the developer with the ability to analyse database select statements. Simply execute ST05 to turn on SQL trace, then execute the statement/program you want to analyse. Now turn off SQL trace using ST05
and click on list trace to view the details.
If you notice performance issue, you can perform an SQL trace :
1 - ST05
2 - Activate trace
3 - Run your prog.
4 - Deactivate trace & display it !
You'll see accessed tables, with runtime, etc...
You can also perform traces on other items such as authorisation objects.
Authorisation trace analysis 1. Open two sessions
2. Execute transaction ST01 in one of the sessions
3. Select the authorisation checkbox, note the other traces
you can perform (SQL, RFC, Table Buffer etc)
4. Click the 'Trace On' button
5. Within your other session execte the transaction/report
you want to trace or get the user in question to do it
6. Return to the session where you turned the trace on and
click on 'Trace Off' otherwise it will continue to record
all athorisation checks
7. Click on the 'Analysis' button
8. Enter appropriate data into selection screen such as
Username, type of trace records (i.e. Authorization check)
9. Click on the Execute button.
10. Report displaying trace results will now be displayed
http://www.sapdevelopment.co.uk/perform/perform_sqltrace.htm
Code inspector is a static check on your code. This check highlights statements that MAY cause long run times or inconsistant results.
This is new as of 6.10, it can be installed on 4.6C or 4.6D systems.
Code inspector includes the checks from the earlier 'Extended program check', (also transaction SLIN). The transation code for 'Code inspector' is SCII.
Regards,
Amey
Message was edited by:
        Amey Potale

Similar Messages

  • BDC,ALV,SQL trace

    1.How can we change the language setting while uploading BDC?
    2.How can we add a push button to the ALV report?
    3. What is SQL Trace, how would you carried out performance analysis of ABAP code Using SQL Trace? Give the steps?

    Hi
    SQL Trace transaction ST05: The trace list has many lines that are not related to the SELECT statement in the ABAP program. This is because the execution of any ABAP program requires additional administrative SQL calls. To restrict the list output, use the filter introducing the trace list.
    The trace list contains different SQL statements simultaneously related to the one SELECT statement in the ABAP program. This is because the R/3 Database Interface - a sophisticated component of the R/3 Application Server - maps every Open SQL statement to one or a series of physical database calls and brings it to execution. This mapping, crucial to R/3s performance, depends on the particular call and database system. For example, the SELECT-ENDSELECT loop on a particular database table of the ABAP program would be mapped to a sequence PREPARE-OPEN-FETCH of physical calls in an Oracle environment.
    The WHERE clause in the trace list's SQL statement is different from the WHERE clause in the ABAP statement. This is because in an R/3 system, a client is a self-contained unit with separate master records and its own set of table data (in commercial, organizational, and technical terms). With ABAP, every Open SQL statement automatically executes within the correct client environment. For this reason, a condition with the actual client code is added to every WHERE clause if a client field is a component of the searched table.
    To see a statement's execution plan, just position the cursor on the PREPARE statement and choose Explain SQL. A detailed explanation of the execution plan depends on the database system in use.
    SQL Trace – ST05
    Starting the Trace:
    To analyze a trace file, do the following:
    Choose the menu path Test  Performance Trace in the ABAP Workbench or go to Transaction ST05. The initial screen of the test tool appears. In the lower part of the screen, the status of the Performance Trace is displayed. This provides you with information as to whether any of the Performance Traces are switched on and the users for which they are enabled. It also tells you which user has switched the trace on.
    Using the selection buttons provided, set which trace functions you wish to have switched on (SWL trace, enqueue trace, RFC trace, table buffer trace).
    If you want to switch on the trace under your user name, choose Trace on. If you want to pass on values for one or several filter criteria, choose Trace with Filter. Typical filter criteria are: the name of the user, transaction name, process name, and program name.
    Now run the program to be analyzed.
    Stopping the Trace:
    To deactivate the trace:
    Choose Test Performance Trace in the ABAP Workbench. The initial screen of the test tool appears. It contains a status line displaying the traces that are active, the users for whom they are active, and the user who activated them.
    Select the trace functions that you want to switch off.
    Choose Deactivate Trace. If you started the trace yourself, you can now switch it off immediately. If the performance trace was started by a different user, a confirmation prompt appears before deactivation-
    Analyzing a Sample trace data:
    PREPARE: Prepares the OPEN statement for use and determines the access method.
    OPEN: Opens the cursor and specifies the selection result by filling the selection fields with concrete values.
    FETCH: Moves the cursor through the dataset created by the OPEN operation. The array size displayed beside the fetch data means that the system can transfer a maximum package size of 392 records at one time into the buffered area.

  • Starting SQL-Trace Automatically - Transaction Code: ST05

    Good Morning Experts!
    I have got a problem with my "SAP - Business Warehouse (BW) System".
    We have very much Traffic on this System every night (between 03:00 and 04:00 a.m.).
    Because nobody is at work so early in the morning, I wanted to ask you, if there is a possibility to start the SQL-Trace (which you can call by transaction code: ST05) automatically.....?
    Is there a possibility to write a short ABAP Code to start the SQL-Trace automatically?
    Thank's and best regards.

    Hello Rob.
    Thank you for replying.
    I tried to create a job with the "Job Wizard" with SM36.
    Now i realized, that i have to wirte my own ABAP-Report (Programme), which uses the ST05 SQL-Trace function.
    I am not an ABAP-Professional, so would you be so kind and give me the code-lines of this programme?
    I can not imagine if you have to write only 5-10 lines or if the code is much longer...
    Thank you and best regards.

  • Urgent : How to do the SQL trace analysis

    Hi Floks,
    How to do the SQL  Trace analysis and any another tools is there to test abap programming then this tools runtime analysis,extended Programming Checking,Code inspector .How to utilize that tools .please forward me
    thanks
    suresh

    HI,
    <b>SQL Trace Use:</b>
    The SQL Trace function is an on-demand log of selected SQL statements that are issued against the database through the Open SQL Engine. The SQL Trace can be switched on or off dynamically. The log format is database independent. Besides the SQL statement text, each log record contains information about the point in time when the statement was executed, its duration, its input parameters and results (where applicable) as well as context information.
    <b>
    Features</b>
    The SQL Trace is especially useful for:
    Development
    SQL Trace can help JDO, enterprise beans, servlet and JSP developers to learn which kind of database accesses their code produces.
    1.      Performance analysis
    Typically, performance issues are caused by inefficient database accesses. In this case SQL Trace can be used to show the issued SQL statements and their duration, thus helping to identify inefficient SQL statements.
    <b>Activities</b>
    Typically, you should use the SQL Trace when you need to check the behavior of a particular application. This is the following scenario:
    Look at the below links, you will get the idea
    http://help.sap.com/saphelp_erp2005/helpdata/en/d1/801f89454211d189710000e8322d00/content.htm
    Re: Runtime Analysis vs SQL Trace
    http://www.sapbrain.com/TOOLS/SQLTRACE/SQL_TRACE.html

  • Diff b/w Run time Analyizer(se30),Sql Trace (st05) and Performance Analyzie

    Can any one tell me the Diff b/w Run time Analyizer(se30),Sql Trace (st05) and Performance Analyzie(al21) ?

    Hi
    these all are doing t he same thing that is checking the program for better performance
    Tools for Performance Analysis
    Run time analysis transaction SE30
    SQL Trace transaction ST05
    Extended Program Check (SLIN)
    Code Inspector ( SCI)
    Run time analysis transaction SE30 :This transaction gives all the analysis of an ABAP program with respect to the database and the non-database processing. 
    SQL Trace transaction ST05: The trace list has many lines that are not related to the SELECT statement in the ABAP program. This is because the execution of any ABAP program requires additional administrative SQL calls. To restrict the list output, use the filter introducing the trace list.
    The trace list contains different SQL statements simultaneously related to the one SELECT statement in the ABAP program. This is because the R/3 Database Interface - a sophisticated component of the R/3 Application Server - maps every Open SQL statement to one or a series of physical database calls and brings it to execution. This mapping, crucial to R/3s performance, depends on the particular call and database system. For example, the SELECT-ENDSELECT loop on a particular database table of the ABAP program would be mapped to a sequence PREPARE-OPEN-FETCH of physical calls in an Oracle environment.
    The WHERE clause in the trace list's SQL statement is different from the WHERE clause in the ABAP statement. This is because in an R/3 system, a client is a self-contained unit with separate master records and its own set of table data (in commercial, organizational, and technical terms). With ABAP, every Open SQL statement automatically executes within the correct client environment. For this reason, a condition with the actual client code is added to every WHERE clause if a client field is a component of the searched table.
    To see a statement's execution plan, just position the cursor on the PREPARE statement and choose Explain SQL. A detailed explanation of the execution plan depends on the database system in use.
    Extended Program Check
    This can be called in through transaction SE38 or through transaction SLIN. This indicates possible problems that may cause performance problems.
    Code Inspector (SCI)
    You can call the Code Inspector from the ABAP Editor (SE38), the Function Builder (SE37), the Class Builder (SE24), or as a separate transaction (SCI).
    The Code Inspector indicates possible problems. However, note that, especially with performance issues: There is no rule without exception. If a program passes an inspection, it does not necessarily mean that this program will have no performance problems.
    reward if usefull

  • In SQL Trace how to see which statement getting more time .

    Hi Expart,
    In SQL Trace (T-code ST05) . I am running the standard transaction . how to see which statement
    running more time and less time . suppose one statement running more time so how resolve the
    performance .
    Plz. reply me
    Regards
    Razz

    > The ones in 'RED' color are the statement which are taking a lot of time and you need to
    > optimise the same.
    No, that is incorrect, the red ones show only the ones which need several hundret milliseconds in one execution. This can even be correct for hard tasks. And there are lots of problem, which you will not see
    I have said everything here:
    SQL trace:
    /people/siegfried.boes/blog/2007/09/05/the-sql-trace-st05-150-quick-and-easy
    Go to 'Tracelist' -> Summarize by SQL statements', this is the view which you want to see!
    I summarizes all executions of the same statement.
    There are even the checks explained, the slow ones are the one which need a lot of time per record!
    See MinTime/Rec > 10.000 microseconds.
    Check all number of records, executions, buffer, identicals.
    The SE30 Tipps and Tricks will not help much.
    Siegfried

  • Analysing details of SQL trace and runtime analysis for a report.

    Hi,
    I am trying to tune the performance of a Z ABAP report for target group export. A brief overview of what is done in the report is the retrieval of BP details present in the Target group including BP general, address, marketing attributes, person responsible and contact person details. As the target groups can be quite huge (around 6000 BPs), the report gives performance issues. I want to understand on how to analyse the details which I obtained from the run time analysis and SQL trace and on how to take it forward.
    Any inputs in this regard would be helpful.
    Thanks in advance,
    Anushree

    In Runtime analysis Look for
    ABAP -  In your ABAP code
    DATABASE  -  It shows the performance of your SELECT statements in your program.
    Just check how much % it is showing for both.
    Check for following in your code.
    1) Avoid SELECT *
    2) Clear internal tables values which are not required at the ending of program, as it saves memory
    etc.

  • What is SQL Trace and How to Use it .

    Dear Experts .
    1.) May You Please tell me What is the Purpose of SQL-Trace and How to use it ?
    2.) What is purpose of T-codes SE30 and ST22 ?
    Please it is urgent ...
    Regards :  Rajneesh

    Hi
    SQL Trace transaction ST05: The trace list has many lines that are not related to the SELECT statement in the ABAP program. This is because the execution of any ABAP program requires additional administrative SQL calls. To restrict the list output, use the filter introducing the trace list.
    The trace list contains different SQL statements simultaneously related to the one SELECT statement in the ABAP program. This is because the R/3 Database Interface - a sophisticated component of the R/3 Application Server - maps every Open SQL statement to one or a series of physical database calls and brings it to execution. This mapping, crucial to R/3s performance, depends on the particular call and database system. For example, the SELECT-ENDSELECT loop on a particular database table of the ABAP program would be mapped to a sequence PREPARE-OPEN-FETCH of physical calls in an Oracle environment.
    The WHERE clause in the trace list's SQL statement is different from the WHERE clause in the ABAP statement. This is because in an R/3 system, a client is a self-contained unit with separate master records and its own set of table data (in commercial, organizational, and technical terms). With ABAP, every Open SQL statement automatically executes within the correct client environment. For this reason, a condition with the actual client code is added to every WHERE clause if a client field is a component of the searched table.
    To see a statement's execution plan, just position the cursor on the PREPARE statement and choose Explain SQL. A detailed explanation of the execution plan depends on the database system in use.
    Run time analysis transaction SE30 :This transaction gives all the analysis of an ABAP program with respect to the database and the non-database processing. 
    STEPS
    Run time analysis transaction SE30
    In Transaction SE30, fill in the transaction name or the program name which needs to be analyzed for performance tuning.
    For our case, let this be “ZABAP_PERF_TUNING”
    After giving the required inputs to the program, execute it. After the final output list has been displayed, PRESS the “BACK” button.
    On the original SE30 screen, now click on “ANALYZE” button.
    The percentage across each of the areas ABAP/ Database/System shows the percentage of total time used for those areas and load on these areas while running the program . The lesser the database load faster the program runs.
    SQL Trace – ST05
    Starting the Trace:
    To analyze a trace file, do the following:
    Choose the menu path Test  Performance Trace in the ABAP Workbench or go to Transaction ST05. The initial screen of the test tool appears. In the lower part of the screen, the status of the Performance Trace is displayed. This provides you with information as to whether any of the Performance Traces are switched on and the users for which they are enabled. It also tells you which user has switched the trace on.
    Using the selection buttons provided, set which trace functions you wish to have switched on (SWL trace, enqueue trace, RFC trace, table buffer trace).
    If you want to switch on the trace under your user name, choose Trace on. If you want to pass on values for one or several filter criteria, choose Trace with Filter.
    Typical filter criteria are: the name of the user, transaction name, process name, and program name.
    Now run the program to be analyzed.
    Stopping the Trace:
    To deactivate the trace:
    Choose Test Performance Trace in the ABAP Workbench. The initial screen of the test tool appears. It contains a status line displaying the traces that are active, the users for whom they are active, and the user who activated them.
    Select the trace functions that you want to switch off.
    Choose Deactivate Trace. If you started the trace yourself, you can now switch it off immediately. If the performance trace was started by a different user, a confirmation prompt appears before deactivation-
    Analyzing a Sample trace data: PREPARE: Prepares the OPEN statement for use and determines the access method.
    OPEN: Opens the cursor and specifies the selection result by filling the selection fields with concrete values.
    FETCH: Moves the cursor through the dataset created by the OPEN operation. The array size displayed beside the fetch data means that the system can transfer a maximum package size of 392 records at one time into the buffered area.

  • How to set SQL trace in OCI session ?

    Hello,
    In a SQL*Plus session, I can use the SQL statement "alter session set sql_trace=true;" to set SQL trace in that session only. I assume I could execute the same SQL statement from C code in an OCI client and achieve the same goal.
    However, if I cannot change the code of this OCI client, is there a way to set SQL trace for that single session alone, without changing the C code? Say, through an environment variable, configuration file, etc.?
    Thanks.

    I am not aware of a way to selectively enable the server-side tracing without modifying the client code.
    There is client tracing available by setting the environment variable EVENT_10842 as follows:
    "server=<>;user=<>;stmt=<>;level=<>;interval=<>"
    e.g.
    setenv EVENT_10842 "server=inst1,inst2;user=scott,system;stmt=all;level=15"
    Where:
    "server" is a comma separated list or "all"
    "user" is a comma separated list or "all"
    "stmt" can be INSERT,UPDATE,DELETE,SELECT or "all"
    The following levels are supported:
    1 - Trace all server attach and server detach calls for servers listed in "server" attribute of the environment variable.
    2 - Trace all session begin, logon, session end, logoff calls for the users listed in "user" attribute of the environment variable.
    3 - Trace all prepare, execute, fetch calls for the specified statement types listed in "stmt" attribute of environment variable.
    4 - Trace all Bind, Define, Describe calls.
    5 - Trace all OCI LOB calls
    7 - Get statistical info on all connection pooling /connection related calls
    8 - Get statistical info on all session info
    9 - Get statistical info on all handle info
    10 - Get statistical info on time taken in execute and fetch calls
    11 - Get statistical info on transaction related calls
    15 - Trace all calls with statistical info.

  • Change the mapping generation code from sql*loader to pl/sql

    I want to use a mapping with a flat file operator to generate pl/sql code even if a mapping generate sql*loader code as default.
    I tried to change the Language generation property of the mapping but an API8548 error message is shown. The suggested solution by OWB is to change the language generation code in the property inspector of the mapping.
    I can't use external table because I have to work with a remote machine.
    What i have to do to change the generation code from SQL*Loader to PL/SQL?

    How about breaking this out into 2 mappings? In the first mapping, map a flat file operator to an table using SQL*Loader code. Then define a second mapping using the table as source and therefore generate PL/SQL. Then use process flow to launch the 2nd map to run after completion of first.

  • About SQL tracer

    Hi, I want to know about SQL tracer i.e. how can we perform SQL tracer on our program specifically.
    Please do this needful
    Thanks
    Suren

    Hi
    SQL Trace transaction ST05: The trace list has many lines that are not related to the SELECT statement in the ABAP program. This is because the execution of any ABAP program requires additional administrative SQL calls. To restrict the list output, use the filter introducing the trace list.
    The trace list contains different SQL statements simultaneously related to the one SELECT statement in the ABAP program. This is because the R/3 Database Interface - a sophisticated component of the R/3 Application Server - maps every Open SQL statement to one or a series of physical database calls and brings it to execution. This mapping, crucial to R/3s performance, depends on the particular call and database system. For example, the SELECT-ENDSELECT loop on a particular database table of the ABAP program would be mapped to a sequence PREPARE-OPEN-FETCH of physical calls in an Oracle environment.
    The WHERE clause in the trace list's SQL statement is different from the WHERE clause in the ABAP statement. This is because in an R/3 system, a client is a self-contained unit with separate master records and its own set of table data (in commercial, organizational, and technical terms). With ABAP, every Open SQL statement automatically executes within the correct client environment. For this reason, a condition with the actual client code is added to every WHERE clause if a client field is a component of the searched table.
    To see a statement's execution plan, just position the cursor on the PREPARE statement and choose Explain SQL. A detailed explanation of the execution plan depends on the database system in use.
    Starting the Trace:
    To analyze a trace file, do the following:
    Choose the menu path Test &#61614; Performance Trace in the ABAP Workbench or go to Transaction ST05. The initial screen of the test tool appears. In the lower part of the screen, the status of the
    Performance Trace is displayed. This provides you with information as to whether any of the Performance Traces are switched on and the users for which they are enabled. It also tells you which user has switched the trace on.
    Using the selection buttons provided, set which trace functions you wish to have switched on (SWL trace, enqueue trace, RFC trace, table buffer trace).
    If you want to switch on the trace under your user name, choose Trace on.  If you want to pass on values for one or several filter criteria, choose Trace with Filter.  Typical filter criteria are: the name of the user, transaction name, process name, and program name.
    Now run the program to be analyzed.
    Stopping the Trace:
    To deactivate the trace:
    Choose Test &#61614;Performance Trace in the ABAP Workbench. The initial screen of the test tool appears. It contains a status line displaying the traces that are active, the users for whom they are active, and the user who activated them.
    Select the trace functions that you want to switch off.
    Choose Deactivate Trace. If you started the trace yourself, you can now switch it off immediately. If the performance trace was started by a different user, a confirmation prompt appears before deactivation-
    Analyzing a Sample trace data:
    PREPARE: Prepares the OPEN statement for use and determines the access method.
    OPEN: Opens the cursor and specifies the selection result by filling the selection fields with concrete values.
    FETCH: Moves the cursor through the dataset created by the OPEN operation. The array size displayed beside the fetch data means that the system can transfer a maximum package size of 392 records at one time into the buffered area.

  • How to use the transaction STO5 (SQL Trace)

    Hi,
        I want to check the performance of program using the ST05 transaction. Please send me the step by step procedure to trace my program.
    Thanks & Regards,
    Santhosh Kumar.R

    Hi,
    following explanation clearly you abt ST05
    Hi,
    SQL trace(ST05) provides the developer with the ability to analyse database select statements. Simply execute ST05 to turn on SQL trace, then execute the statement/program you want to analyse. Now turn off SQL trace using ST05
    and click on list trace to view the details.
    You can also perform traces on other items such as authorisation objects.
    The trace list has many lines that are not related to the SELECT statement in the ABAP program. This is because the execution of any ABAP program requires additional administrative SQL calls. To restrict the list output, use the filter introducing the trace list.
    The trace list contains different SQL statements simultaneously related to the one SELECT statement in the ABAP program. This is because the R/3 Database Interface - a sophisticated component of the R/3 Application Server - maps every Open SQL statement to one or a series of physical database calls and brings it to execution. This mapping, crucial to R/3s performance, depends on the particular call and database system. For example, the SELECT-ENDSELECT loop on the SPFLI table in our test program is mapped to a sequence PREPARE-OPEN-FETCH of physical calls in an Oracle environment.
    The WHERE clause in the trace list's SQL statement is different from the WHERE clause in the ABAP statement. This is because in an R/3 system, a client is a self-contained unit with separate master records and its own set of table data (in commercial, organizational, and technical terms). With ABAP, every Open SQL statement automatically executes within the correct client environment. For this reason, a condition with the actual client code is added to every WHERE clause if a client field is a component of the searched table.
    To see a statement's execution plan, just position the cursor on the PREPARE statement and choose Explain SQL. A detailed explanation of the execution plan depends on the database system in use.
    Performance Tuning is useful mainly reducing load on database. It is very important aspect while writing the programs/FM etc.....
    SQL Trace
    Use
    The SQL Trace function is an on-demand log of selected SQL statements that are issued against the database through the Open SQL Engine. The SQL Trace can be switched on or off dynamically. The log format is database independent. Besides the SQL statement text, each log record contains information about the point in time when the statement was executed, its duration, its input parameters and results (where applicable) as well as context information.
    Features
    The SQL Trace is especially useful for:
    Development:
    SQL Trace can help JDO, enterprise beans, servlet and JSP developers to learn which kind of database accesses their code produces.
    &#61489;&#61486; Performance analysis
    Typically, performance issues are caused by inefficient database accesses. In this case SQL Trace can be used to show the issued SQL statements and their duration, thus helping to identify inefficient SQL statements.
    Functions
    <b>The following functions are available on the initial screen</b>:
    Select trace:
    • Select the trace mode SQL Trace, Enqueue Trace, RFC Trace, or Table Buffer Trace. You can select mutliple trace modes simultaneously.
    Select trace function:
    • Start the trace recording.
    • Stop the trace recording.
    • Branch to trace list, detailed list, or time-sorted list.
    • Branch to Explain SQL to analyze an SQL statement without an explicit trace file.
    Trace files are managed by the system. Thus they can be saved, like any other object;
    saved trace files can be displayed and deleted.
    Trace Status
    A trace can only be activated once on any application server. The Trace Status display informs you whether another user in the system has already activated a particular trace.
    Starting the Trace
    Prerequisites
    <b>You can only switch on the Performance Trace for a single instance</b>. You should already have decided the scope and targets of your performance analysis.
    Procedure
    <b>To analyze a trace file, do the following</b>:
    ... 1. Choose the menu path Test &#61614; Performance Trace in the ABAP Workbench.
    The initial screen of the test tool appears. In the lower part of the screen, the status of the Performance Trace is displayed. This provides you with information as to whether any of the Performance Traces are switched on and the users for which they are enabled. It also tells you which user has switched the trace on.
    2. Using the selection buttons provided, set which trace functions you wish to have switched on (SWL trace, enqueue trace, RFC trace, table buffer trace).
    3. If you want to switch on the trace under your user name, choose Trace on.
    If you want to pass on values for one or several filter criteria, choose Trace with Filter.
    Typical filter criteria are: the name of the user, transaction name, process name, and program name.
    4. Now run the program to be analyzed.
    You will normally analyze the performance trace file immediately. In this case, it is a good idea to use a separate session to start, stop, and analyze the Performance Trace
    If you are shown trace kernel errors on the initial screen (for example, not enough storage space available), you must first remove the errors or have them removed by your system administrator.
    The selected trace types can be changed as required during a performance trace interval (time between switching on and off the trace). The user (user group) must remain unchanged.
    Result
    The results of the trace recording are written to a trace file. If trace records are overwritten during the trace interval, the system displays a message to inform you when you analyze the trace file.
    The results of the trace recording are stored to ten trace files. Overwriting trace records, however, cannot be entirely excluded in this case either.
    The Performance Trace records all database access calls, table buffer calls, remote calls, or calls for user lock activity. These measurements can affect the performance of the application server where the trace is running. To preserve system performance, you should therefore turn off the trace as soon as you finish recording your application.
    Stopping the Trace
    Prerequisites
    You have started the trace and finished running the program that you want to analyze.
    <b>For performance reasons, you should switch off the traces as soon as you have finished recording.</b>
    Procedure
    <b>To deactivate the trace:</b>
    ... 1. Choose Test &#61614;Performance Trace in the ABAP Workbench.
    The initial screen of the test tool appears. It contains a status line displaying the traces that are active, the users for whom they are active, and the user who activated them.
    2. Select the trace functions that you want to switch off.
    3. Choose Deactivate Trace.
    If you started the trace yourself, you can now switch it off immediately. If the performance trace was started by a different user, a confirmation prompt appears before deactivation-
    Result
    The results of the trace are stored in one or more trace files. You can then analyze the performance data stored in the trace file. See also, Analyzing Performance Data.
    Look at the below link
    http://www.sapbrainsonline.com/TOOLS/SQLTRACE/SQL_TRACE.html
    <b>Reward with points if helpful.</b>
    Regards,
    Vijay

  • My first Code Inspector extension

    I'm trying to write my first own extension of Code Inspector. I don't like to discover again new wheel so I'm asking You:
    Is in ABAP any test which check how long is procedure (how many lines is beetwene FORM ENDFORM statement?) which return warnings when length is just a little bit to big and errors when exceed a lot maximum length?
    <b>I'm only interesting that is already in SAP this kind of test.</b>
    Cheers, Tomek

    Hello Thomasz,
    you will see all SAP checks when starting SCI. Only with the newer releases there is a check on program metrics.
    Regards,
      Klaus
    <b>Documentation</b>
    Determining Complexity of Procedures in ABAP Programs
    The check calculates different complexity measurements for procedures in ABAP programs. These measurements are:
    Number of Statements. Cyclical complexity. Here there is also the variant through a test parameter as to whether a CASE statement is treated as a simple or multiple branch.
    Number of Versions. This measurement can only be determined in the original system of the respective program since these versions are only there.
    In the results display, there is only one single information message. The results list is displayed when you double-click this message. In this list, the above-mentioned complexity measurements are specified after the procedure type and the procedure name. In addition, the Include and the line where the respective procedure begins are displayed. By double-clicking here, you can branch to the source code. The list can be sorted, as usual, by any column you wish. In addition, the standard procedures for exporting (for example, to Excel) are provided.
    The test specifies the various procedure types in the  results list in the following manner:
    METH : Methods
    FORM: Forms
    FUNC: Function modules
    MOD: Modules
    STAS: START-OF-SELECTION event
    TOPS: TOP-OF-PAGE event
    <b>Some code excerpt</b>
    method RUN .
      data:
        L_EXCP  type ref to CX_EXCEPTION,
        L_NAME  type STRING,
        L_CLASS type STRING.
      if REF_SCAN is initial.
        check GET( ) = 'X'.
      endif.
      check REF_SCAN->SUBRC = 0.
      if PA_VERSION = 'X'.
        GET_PROC_VERSIONS( ).
      endif.
      STATEMENT_INDEX = 1.
      try.
          do.
            read table REF_SCAN->STATEMENTS index STATEMENT_INDEX into STATEMENT_WA.
            if SY-SUBRC <> 0. exit. endif.
            add 1 to STATEMENT_INDEX.
            check STATEMENT_WA-FROM <= STATEMENT_WA-TO.
    *-- avoid native SQL
            check STATEMENT_WA-TYPE na 'EMPSDR'.
            case KEYWORD( ).
              when 'PROGRAM'
                or 'REPORT'
                or 'START-OF-SELECTION'.
                CHECK( P_PROC_TYPE = 'SSEL' P_PROC_NAME = '%' ).
              when 'END-OF-SELECTION'.
                CHECK( P_PROC_TYPE = 'ESEL' P_PROC_NAME = '%' ).
              when 'FORM'.
                L_NAME = GET_TOKEN_REL( 2 ).
                CHECK( P_PROC_TYPE = 'FORM' P_PROC_NAME = L_NAME ).
              when 'FUNCTION'.
                L_NAME = GET_TOKEN_REL( 2 ).
                CHECK( P_PROC_TYPE = 'FUNC' P_PROC_NAME = L_NAME  ).
              when 'METHOD'.
                L_NAME = GET_TOKEN_REL( 2 ).
                concatenate L_CLASS '=>' L_NAME into L_NAME.
                CHECK( P_PROC_TYPE = 'METH' P_PROC_NAME = L_NAME  ).
              when 'MODULE'.
                L_NAME = GET_TOKEN_REL( 2 ).
                if GET_TOKEN_REL( 3 ) = 'OUTPUT'.
                  CHECK( P_PROC_TYPE = 'MODO' P_PROC_NAME = L_NAME ).
                else.
                  CHECK( P_PROC_TYPE = 'MODI' P_PROC_NAME = L_NAME ).
                endif.
              when 'CLASS'.
                L_CLASS = GET_TOKEN_REL( 2 ).
              when 'INITIALIZATION'.
                CHECK( P_PROC_TYPE = 'INIT' P_PROC_NAME = '%' ).
              when 'GET'.
                L_NAME = GET_TOKEN_REL( 2 ).
                if  GET_TOKEN_REL( 3 ) = 'LATE'.
                  CHECK( P_PROC_TYPE = 'GETL' P_PROC_NAME = L_NAME ).
                else.
                  CHECK( P_PROC_TYPE = 'GET' P_PROC_NAME = L_NAME ).
                endif.
              when 'AT'.
                L_NAME = GET_TOKEN_REL( 2 ).
                if strlen( L_NAME ) > 2 and L_NAME(2) = 'PF'.
                  L_NAME = L_NAME+2.
                  CHECK( P_PROC_TYPE = 'ATPF' P_PROC_NAME = L_NAME ).
                else.
                  case L_NAME.
                    when 'USER-COMMAND'.
                      CHECK( P_PROC_TYPE = 'ATUC' P_PROC_NAME = '%' ).
                    when 'LINE-SELECTION'.
                      CHECK( P_PROC_TYPE = 'LISE' P_PROC_NAME = '%' ).
                    when 'SELECTION-SCREEN'.
                      L_NAME = GET_TOKEN_REL( 3 ).
                      if L_NAME is initial.
                        CHECK( P_PROC_TYPE = 'ATSS' P_PROC_NAME = '%' ).
                      else.
                        CHECK( P_PROC_TYPE = 'ATSS' P_PROC_NAME = L_NAME ).
                      endif.
                  endcase.
                endif.
              when 'TOP-OF-PAGE'.
                if GET_TOKEN_REL( 2 ) = 'DURING'.
                  CHECK( P_PROC_TYPE = 'TOPS' P_PROC_NAME = '%' ).
                else.
                  CHECK( P_PROC_TYPE = 'TOPA' P_PROC_NAME = '%' ).
                endif.
              when 'END-OF-PAGE'.
                CHECK( P_PROC_TYPE = 'ENPA' P_PROC_NAME = '%' ).
              when 'LOAD-OF-PROGRAM'.
                CHECK( P_PROC_TYPE = 'LDPR' P_PROC_NAME = '%' ).
            endcase.
          enddo.
        catch CX_EXCEPTION into L_EXCP.
          raise event MESSAGE exporting
                     P_SUB_OBJ_TYPE = C_TYPE_INCLUDE
                     P_SUB_OBJ_NAME = L_EXCP->INCLUDE
                     P_LINE         = L_EXCP->LINE
                     P_COLUMN       = L_EXCP->COLUMN
                     P_KIND         = C_WARNING
                     P_TEST         = C_MY_NAME
                     P_CODE         = 'SYNTAX'.
      endtry.
    endmethod.
    method CHECK .
      data:
        L_INCLUDE      type PROGRAM,
        L_LINE         type I,
        L_COLUMN       type TOKEN_COL,
        L_COMPLEXITY   type I value 1,
        L_STMNTS       type I,
        L_VERSIONS     type I,
        L_COMPLEXITY_C type SYCHAR10,
        L_STMNTS_C     type SYCHAR10,
        L_VERSIONS_C   type SYCHAR10,
        L_NESTED_C     type SYCHAR10,
        L_PARAM_1      type STRING,
        L_TOKEN        type STRING,
        L_PROC_VERSION like line of PROC_VERSIONS,
        L_NESTED       type I,
        L_MAX_NESTED   type I.
      L_INCLUDE = GET_INCLUDE( ).
      L_LINE    = TOKEN_WA-ROW.
      L_COLUMN  = TOKEN_WA-COL.
      do.
        read table REF_SCAN->STATEMENTS index STATEMENT_INDEX into STATEMENT_WA.
        if SY-SUBRC <> 0.
          exit.
        endif.
        add 1 to STATEMENT_INDEX.
        check STATEMENT_WA-FROM <= STATEMENT_WA-TO.
        check STATEMENT_WA-TYPE na 'PS'.
    *-- avoid native SQL
    *  check STATEMENT_WA-TYPE na 'EMDR'.
        case KEYWORD( ).
          when 'IF' or 'WHILE' or 'LOOP' or 'DO' or 'PROVIDE'.
            if TOKEN_WA-ROW <> 0.
              add 1 to L_COMPLEXITY.
              add 1 to L_NESTED.
              if L_NESTED > L_MAX_NESTED.
                L_MAX_NESTED = L_NESTED.
              endif.
            endif.
          when 'ELSEIF'.
            if TOKEN_WA-ROW <> 0.
              add 1 to L_COMPLEXITY.
            endif.
          when 'ENDIF' or 'ENDWHILE' or 'ENDLOOP' or 'ENDDO' or 'ENDTRY'.
            subtract 1 from L_NESTED.
          when 'TRY'.
            add 1 to L_NESTED.
            if L_NESTED > L_MAX_NESTED.
              L_MAX_NESTED = L_NESTED.
            endif.
          when 'SELECT'.
          when 'ENDSELECT'.
            if TOKEN_WA-ROW <> 0.
              add 1 to L_COMPLEXITY.
              add 1 to L_NESTED.
              if L_NESTED > L_MAX_NESTED.
                L_MAX_NESTED = L_NESTED.
              endif.
              subtract 1 from L_NESTED.
            endif.
          when 'CHECK'.
            if TOKEN_WA-ROW <> 0.
              add 1 to L_COMPLEXITY.
            endif.
          when 'CASE'.
            if PA_WITH_CASE = 'X'.
              add 1 to L_COMPLEXITY.
            endif.
            add 1 to L_NESTED.
            if L_NESTED > L_MAX_NESTED.
              L_MAX_NESTED = L_NESTED.
            endif.
          when 'ENDCASE'.
            subtract 1 from L_NESTED.
          when 'WHEN'.
            if PA_WITH_CASE <> 'X' and TOKEN_WA-ROW <> 0.
              if GET_TOKEN_REL( 2 ) <> 'OTHERS'.
                add 1 to L_COMPLEXITY.
              endif.
            endif.
          when 'ENDFORM' or 'ENDFUNCTION' or 'ENDMETHOD' or 'ENDMODULE'.
            exit.
          when 'FORM'
            or 'FUNCTION'
            or 'MODULE'
            or 'START-OF-SELECTION'
            or 'END-OF-SELECTION'
            or 'TOP-OF-PAGE'
            or 'END-OF-PAGE'
            or 'LOAD-OF-PROGRAM'
            or 'INITIALIZATION'
            or 'CLASS'.
            subtract 1 from STATEMENT_INDEX.
            exit.
          when 'GET'.
            if GET_TOKEN_REL( 2 ) <> 'TIME'.
              case GET_TOKEN_REL( 3 ).
                when 'LATE' or 'FIELDS' or ''.
                  subtract 1 from STATEMENT_INDEX.
                  exit.
              endcase.
            endif.
          when 'AT'.
            L_TOKEN = GET_TOKEN_REL( 2 ).
            if strlen( L_TOKEN ) > 2 and L_TOKEN(2) = 'PF'.
              subtract 1 from STATEMENT_INDEX.
              exit.
            else.
              case L_TOKEN.
                when 'USER-COMMAND'.
                  subtract 1 from STATEMENT_INDEX.
                  exit.
                when 'LINE-SELECTION'.
                  subtract 1 from STATEMENT_INDEX.
                  exit.
                when 'SELECTION-SCREEN'.
                  subtract 1 from STATEMENT_INDEX.
                  exit.
              endcase.
            endif.
            add 1 to L_NESTED.
            if L_NESTED > L_MAX_NESTED.
              L_MAX_NESTED = L_NESTED.
            endif.
            add 1 to L_COMPLEXITY.
          when 'ENDAT'.
            subtract 1 from L_NESTED.
        endcase.
        if PA_VERSION = 'X'.
          loop at REF_SCAN->TOKENS from STATEMENT_WA-FROM to STATEMENT_WA-TO into TOKEN_WA.
            check TOKEN_WA-ROW <> 0.
            CL_CI_PROVIDE_CHECKSUM=>GEN_CHKSUM_FROM_STRING( exporting P_PARAM     = TOKEN_WA-STR
                                                            changing  P_CRC_VALUE = L_PROC_VERSION-CRC ).
          endloop.
        endif.
        add 1 to L_STMNTS.
      enddo.
      L_PROC_VERSION-PROC_TYPE = P_PROC_TYPE.
      L_PROC_VERSION-PROC_NAME = P_PROC_NAME.
      collect L_PROC_VERSION into PROC_VERSIONS.
      loop at PROC_VERSIONS transporting no fields where PROC_TYPE = P_PROC_TYPE and PROC_NAME = P_PROC_NAME.
        add 1 to L_VERSIONS.
      endloop.
      L_COMPLEXITY_C = L_COMPLEXITY.
      L_NESTED_C     = L_MAX_NESTED.
      L_STMNTS_C     = L_STMNTS.
      L_VERSIONS_C   = L_VERSIONS.
      concatenate P_PROC_TYPE P_PROC_NAME L_STMNTS_C L_COMPLEXITY_C L_NESTED_C L_VERSIONS_C into L_PARAM_1 separated by ' '.
      condense L_PARAM_1.
      raise event MESSAGE exporting
                      P_SUB_OBJ_TYPE = C_TYPE_INCLUDE
                      P_SUB_OBJ_NAME = L_INCLUDE
                      P_LINE         = L_LINE
                      P_COLUMN       = L_COLUMN
                      P_KIND         = C_NOTE
                      P_TEST         = C_MY_NAME
                      P_CODE         = C_CODE_SUMMARY
                      P_PARAM_1      = L_PARAM_1.
      if L_COMPLEXITY >= PA_COMPLEXITY.
        raise event MESSAGE exporting
                      P_SUB_OBJ_TYPE = C_TYPE_INCLUDE
                      P_SUB_OBJ_NAME = L_INCLUDE
                      P_LINE         = L_LINE
                      P_COLUMN       = L_COLUMN
                      P_KIND         = C_WARNING
                      P_TEST         = C_MY_NAME
                      P_CODE         = C_CODE_COMPLEXITY
                      P_PARAM_1      = L_COMPLEXITY_C.
      endif.
      if L_STMNTS >= PA_STMNTS.
        raise event MESSAGE exporting
                      P_SUB_OBJ_TYPE = C_TYPE_INCLUDE
                      P_SUB_OBJ_NAME = L_INCLUDE
                      P_LINE         = L_LINE
                      P_COLUMN       = L_COLUMN
                      P_KIND         = C_WARNING
                      P_TEST         = C_MY_NAME
                      P_CODE         = C_CODE_STMNTS
                      P_PARAM_1      = L_STMNTS_C.
      endif.
      if L_NESTED >= PA_NESTED.
        raise event MESSAGE exporting
                      P_SUB_OBJ_TYPE = C_TYPE_INCLUDE
                      P_SUB_OBJ_NAME = L_INCLUDE
                      P_LINE         = L_LINE
                      P_COLUMN       = L_COLUMN
                      P_KIND         = C_WARNING
                      P_TEST         = C_MY_NAME
                      P_CODE         = C_CODE_NESTED
                      P_PARAM_1      = L_NESTED_C.
      endif.
      if L_VERSIONS >= PA_VERSIONS.
        raise event MESSAGE exporting
                      P_SUB_OBJ_TYPE = C_TYPE_INCLUDE
                      P_SUB_OBJ_NAME = L_INCLUDE
                      P_LINE         = L_LINE
                      P_COLUMN       = L_COLUMN
                      P_KIND         = C_WARNING
                      P_TEST         = C_MY_NAME
                      P_CODE         = C_CODE_VERSIONS
                      P_PARAM_1      = L_VERSIONS_C.
      endif.
    endmethod.

  • SQL Trace(ST05) and Run Time Analysys(SE30)

    Hi ABAP Experts,
    Can any one explain what is the use of
    1) ST05 and
    2) SE30
    ponits will be given for clear cut explanation
    Thanks and Regards
    Vijaya

    Hi,
    The SQL Trace part of the Performance Trace tool allows you to see how the OPEN SQL statements that you use in ABAP programs are converted to standard SQL statements (see Embedded SQL) and the parameters with which the embedded SQL statements are passed to the database system.
    Overview
    From the time you turn on the trace function to the time you turn it off again, all database activity occurring either for a specific user or for an entire system is recorded. The SAP System takes OPEN SQL statements and converts them in to embedded SQL statements that it passes to the database and makes the results available. The embedded SQL statement and its parameters are recorded in the SQL Trace file. The results of the SQL statement, like return code, number of entries retrieved, inserted, or deleted by the database are recorded in the SQL Trace file as well. The log file also contains the runtime of the statement and the place in the application program, respectively transaction, from which it was called which enables additional analyses (supported by the SQL Trace function).
    From the recorded SQL trace you can deduce:
    ·        which SQL statements your application carries out
    ·        which values the system uses for specific database accesses and changes
    ·        how the system translates ABAP OPEN SQL commands (such as SELECT) into standard SQL commands
    ·        where your application positions COMMIT statements
    ·        where your application makes repeated database accesses
    ·        what database accesses or changes occur in the update section of your application
    Create a Trace (SQL Server Profiler)
    To create a trace
    On the File menu, click New Trace, and connect to an instance of SQL Server.
    The Trace Properties dialog box appears.
    Note: 
    The Trace Properties dialog box fails to appear, and the trace begins instead, if Start tracing immediately after making connection is selected. To turn off this setting, on the Tools menu, click Options, and clear the Start tracing immediately after making connection check box.
    In the Trace name box, type a name for the trace.
    In the Use the template list, select a trace template on which to base the trace, or select Blank if you do not want to use a template.
    To save the trace results, do one of the following:
    Click Save to file to capture the trace to a file. Specify a value for Set maximum file size. The default value is 5 megabytes (MB).
    Optionally, select Enable file rollover to automatically create new files when the maximum file size is reached. You can also optionally select Server processes trace data, which causes the service that is running the trace to process trace data instead of the client application. When the server processes trace data, no events are skipped even under stress conditions, but server performance may be affected.
    Click Save to table to capture the trace to a database table.
    Optionally, click Set maximum rows, and specify a value.
    Caution: 
    When you do not save the trace results to a file or table, you can view the trace while SQL Server Profiler is open. However, you lose the trace results after you stop the trace and close SQL Server Profiler. To avoid losing the trace results in this way, click Save on the File menu to save the results before you close SQL Server Profiler.
    Optionally, select the Enable trace stop time check box, and specify a stop date and time.
    To add or remove events, data columns or filters, click the Events Selection tab. For more information, see: How to: Specify Events and Data Columns for a Trace File (SQL Server Profiler)
    Click Run to start the trace.
    Runtime analysis:
    se30 is the tcode for run time analysis, is a tool it
    display report based on lps for abap pragram execution
    time , data base load, system load. these are all will
    display in micro seconds.this tool will use for Transaction
    code, function modules , abap progrmes
    In Transaction SE30, fill in the transaction name or the program name which needs to be analyzed for performance tuning.
    For our case, let this be “ZABAP_PERF_TUNING”
    After giving the required inputs to the program, execute it. After the final output list has been displayed, PRESS the “BACK” button.
    On the original SE30 screen, now click on “ANALYZE” button.
    The percentage across each of the areas ABAP/ Database/System shows the percentage of total time used for those areas and load on these areas while running the program . The lesser the database load faster the program runs.
    SQL trace:
    /people/siegfried.boes/blog/2007/09/05/the-sql-trace-st05-150-quick-and-easy
    SE30
    /people/siegfried.boes/blog/2007/11/13/the-abap-runtime-trace-se30--quick-and-easy
    regards,
    vasavi.
    kindly reward if helpful.

  • Sql trace

    Hi All,
    I am new to this ABAP field..
    I know how to do SQL trace ....But what I am not getting is " <b>HOW CAN WE TELL FROM THE OUTPUT OF SQL TRACE, THAT THIS IS THE CAUSE OF SLOW PERFORMANCE OF A REPORT</b>" Based on what are we determining the performance?
    Can Anybody help me here pls?............
    Kelly

    Hi Kelly,
    if you really have no idea, why a report is slow, then you have to start with SE30 (runtime analysis).
    There are three bargraphs: ABAP / database / system.
    System should be more or less nothing.
    If ABAP is bigger than database: have a look at slow abap-statements (normally operations with internal tables: read, delete, loop where,...); classic reason: to much reads without binary search / sorted table / hashed table use.
    If database is bigger than ABAP: have a look at your SQL statements. If you can see already forgotten key fields, fine - otherwise SQL trace will bring help in analyzing.
    A SQL trace itself says nothing about overall performance (which is done by runtime analysis), only about database part. But 'normally' programmers have their ABAP-part in control and struggle only with slow selects: that's the reason, why often SQL trace is used immediately.
    I hope, this brings a little bit light in your question,
    regards,
    Christian

Maybe you are looking for

  • Checkbox in Tabular Form

    Hi, I am fairly new to APEX and need some help please. I am nrunning Apex 4.1 on 11g database. I have a tabular formrunning off the rowid which needs to show a checkbox for several columns which contain Y or N. When I set the field type to simple che

  • Error while loading data from FDM (EPM 11.1.1.3)

    Hi, We are loading data into HFM from FDM. While loading data from FDM it is throwing an error which as below. "Load data started: 5/20/2012 9:30:45 PM Line 27, Error: Cell for Period Mar is not an input cell. Actual,2011,Mar,YTD,ENT_JJ,JPY,A23232323

  • Payment card category

    hi all. I need to create a new payment card category in CRM. I tried to do it in spro cross-application components/payment cards/basic settings/maintain payment card category, but when I try to assign that category to a payment card type, there is no

  • Flash crashes when I insert frames and I loose all my work

    I created a long movie with many layers sliding in and out of the stage...then when I realize I need a frame to stay up for longer I hold [Ctrl] and drag across about 15-20 frames in the layers that need to stay up, then I Right-click and choose Inse

  • Invalid String literal in a String

    Hi, I have some trouble dealing with the following line(s) of code: rtfFile.addElement("{\rtf1\ansi\ansicpg1252 \deff0\deflang1033\deflangfe1031{\fonttbl{\f0\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f1\fswiss\fcharset0