Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Performance tuning using ST05

Former Member
0 Likes
566

1) Please suggest alternative queries for the following SQL Statement which takes much time .

SELECT bukrs

belnr

gjahr

blart

bldat

budat

wwert

usnam

ppnam

FROM bkpf

INTO TABLE p_i_bkpf

WHERE bukrs = p_bukrs and

blart in s_blart and

budat in s_budat and

waers = p_waers and

ppnam ne space.

2) What is the difference between reopen and fech?

3) What it is PROCESS ID in Activate Trace with filter option?

4) What is Enter SQL Statement option?

2 REPLIES 2
Read only

Former Member
0 Likes
458

1. Include all the key fields BUKRS, BELNR, GJAHR to improve the performace in the where condition of your select statement.

Regards,

Santosh

Read only

Former Member
0 Likes
458

Hi,

For your query try to use some primary keys.

Each SQL statement is broken down into database operations by the SAP System The SQL Trace allows you to measure the runtime of each of these operations:

DECLARE

Defines a new cursor within an SAP work process and assigns the SQL statement to it. The short form of the statement is displayed in the list of trace records under statement. The cursor has a unique cursor ID. The Cursor ID is used in communication between the SAP System and the database system.

PREPARE

Converts the SQL statement and determines the execution plan.

OPEN

Opens a cursor for a prepared (converted) SELECT statement. OPEN passes the parameters for the database access. OPEN is used only for SELECT statements.

FETCH

Passes one or more records selected in the SELECT statement to the database interface of the SAP System The data records are identified by the cursor ID.

REOPEN

Reopens a cursor that the system prepared for a SELECT statement and transfers the new parameter to the database.

EXEC

Passes the parameters for the database statement, and executes the statements that change data in the database (such as UPDATE, DELETE, or INSERT).

REEXEC

Reopens a statement the system already prepared for a previous EXEC statement.

refer the link for your ques.

[http://help.sap.com/saphelp_nw04s/helpdata/en/0e/6a2442db42e22ce10000000a1550b0/frameset.htm]

Regards

Sourabh verma