‎2008 Mar 21 8:09 AM
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?
‎2008 Mar 21 8:11 AM
1. Include all the key fields BUKRS, BELNR, GJAHR to improve the performace in the where condition of your select statement.
Regards,
Santosh
‎2008 Mar 21 11:17 AM
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