Application Development 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: 

How to check the performance

Former Member
0 Kudos

Hi all,

I have created a secondary index for BSIP table for fields

mandt,lifnr,waers .

i want to see how performance has been improved if i use these secondary indexs.

Please help me to write a select statment using this secondary indexs and how do i check performance.

why do i need to include mandt field in secondary index.

do i need to include my primary key too in my select statement .

pLEASE CLARIFY THIS

SWATHI

9 REPLIES 9

Former Member
0 Kudos

BSIP itself is an indexed table in accounting to be used in reporting.

Any ways for the databse to use the secondary index while accessing data u need to provide the fields in the index in the where clause.

For eg if the flds in the index are f1 f2 f3 then ur where clause shud be where f1 = '' and f2 = '' and f3 = ''.

You do not need to include the primary key in ur select. This will not help if u want the databse to select the 2ndary index.

-Kiran

Former Member
0 Kudos

Hello Swathi,

Always use MANDT field in your secondary indexs. Some time bacause of that index does not work. Create secondary index using mandt and requred where cause field in same sequence. Then you can do the run time analysis and SQL trace to find our your index is in use or not.

Regards,

Amit

0 Kudos

Hi am trying to compare the run time for following piece of code

1)only primary key is included in select statment

tables : mara.

data: begin of itab occurs 100.

include structure mara.

data :end of itab.

select * from mara into itab

where matnr = '00-380-C'.

*and mtart = 'NSTK'.

endselect.

write : / itab-matnr, 40 itab-MATKL.

2)primary and second index are included.

tables : mara.

data: begin of itab occurs 100.

include structure mara.

data :end of itab.

select * from mara into itab

where matnr = '00-380-C'

and mtart = 'NSTK'.

endselect.

write : / itab-matnr, 40 itab-MATKL.

is this right way .WHERE DO I NEED TO CHECK THE RUN TIME ANALYSIS, I.E T CODE ETC

0 Kudos

Hello Swathi,

I think you need a book. Please find online book here

---> http://cma.zdnet.com/book/abap/index.htm

Well if your are doing performance tunning never ever use select endselect.

Below examples will never give you any improvements.

For run time analysis

se38-Excute-runtime

run program and after program will display data hit back and then back and click on analysis. you will see where program is consuming more time.

Regards,

Amit

0 Kudos

Hi swathi,

goto utilitiese-> moreutilities->runtime analysis.

give the program name and execute it.after gettinf the output, come back to this screen and press analyse.

hope this helps u.

regards,

keerthi.

0 Kudos

hi swathi,

goto TRANSACTION SE30 OR

UTILITIES->MORE UTILITIES->RUNTIME ANALYSIS AND EXECUTE YOUR PROGRAM AND COME BACK AND CLICK ON ANALYSE.

0 Kudos

Hi Dyapa ,

For Performance run ST05 .

data :end of itab.

<b>select * from mara into corresponding fields table

itab

where matnr = '00-380-C'.</b>.

and write stmt in loop.

loop at itab.

write: itab.

endloop.

Former Member
0 Kudos

I really don't think you need a secondary index. You can use the primary index by selecting all of the company codes into a range table:


REPORT ztest NO STANDARD PAGE HEADING LINE-SIZE 255.

TABLES: t001, bsip.

SELECT-OPTIONS: s_lifnr FOR bsip-lifnr,
                s_waers FOR bsip-waers.

DATA: BEGIN OF bsip_int OCCURS 0.
        INCLUDE STRUCTURE bsip.
DATA: END   OF bsip_int.

RANGES: r_bukrs FOR bsip-bukrs.

* Populate range table with all company codes
r_bukrs-option = 'EQ'.
r_bukrs-sign   = 'I'.
SELECT bukrs FROM  t001
  INTO r_bukrs-low.
  APPEND r_bukrs.
ENDSELECT.

REFRESH bsip_int.
SELECT        * FROM  bsip
  INTO TABLE bsip_int
  WHERE  bukrs IN r_bukrs
  AND    lifnr IN s_lifnr
  AND    waers IN s_waers.

Rob

sushant_singh
Participant
0 Kudos

u can use transaction st05 for an sql trace and check the performance here.