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: 

What to do if abap is more than 50% (red) when I run runtime analysis?

aris_hidalgo
Contributor
0 Kudos

Hello Experts,

I was asked during an interview on what will I do if the ABAP bar is more than 50% or red when I run runtime anaylsis? I said that to improve performance I would check my select statements, use into table etc. Is my answer correct?Thank you guys!

7 REPLIES 7

Former Member
0 Kudos

Hi,

Select statement pertains to Database. For ABAP,

you can look into the following:

1. If SORT statement is used prior to reading the internal table using BINARY SEARCH.

2. Using BINARY SEARCH while reading an internal table.

3. Using of keys when reading an internal table

regards,

madhumitha

uwe_schieferstein
Active Contributor
0 Kudos

Hello Viraylab

Do no miss to read the interesting WebLog about Performance written by Rob Burbank:

<a href="/people/rob.burbank/blog/2006/02/07/performance-of-nested-loops of Nested Loops</a>

Regards

Uwe

Former Member
0 Kudos

Hi Viraylab,

All previous answer are correct use binary search, avoid select/endselect... ok

But don't trust too much this analysis as the result will depend of the amount of data treated.

What I want to say is that if you run your abap on few records, the ABAP runtime will be around 90%

If you run the same abap program selecting more records, the ABAP runtime can decrease a lot !

I've performed a test selecting data in database table for June-2006, ABAP runtime was 90%. Then I launch it from January to June 2006, ABAP runtime was 30% !

So don't trust it too much !

<i>If you want to track the bad perf. in your abap, plz use ST05.</i>

Hope this helps,

Erwan

Former Member

Former Member
0 Kudos

In general, I don't use the run time analysis very much. It may say that the ABAP portion is taking 90% of the time or the database is taking 90%. The important thing to do is to tune the program (both SQL and ABAP). Once that is done, the run time analysis isn't of much use.

For a poorly tuned program, it can help to point you in the right direction, but you can also scan it quickly using the M1 eyeball and find problems pretty quickly as well.

rob

Former Member
0 Kudos

By mentioning Select statements your answer was wrong. Select statements show up under database execution time, not ABAP.

Although more that 50% of the time was spent on ABAP this may not be a performance issue. Sometimes the code has to be complex to do the job required.

In addition to Rob's Blog avoid the following:

LOOP AT ITAB1.
  process ITAB1 header into ITAB2 header.
  APPEND ITAB2.
ENDLOOP. "ITAB1

LOOP AT ITAB2.
  process ITAB2 header into ITAB3 header.
  APPEND ITAB3.
ENDLOOP.  "ITAB2

This can be proccesed in a single loop.

LOOP AT ITAB1.
  process ITAB1 header into work area 2.
  process work area 2 into ITAB3 header.
  APPEND ITAB3.
ENDLOOP.  "ITAB1

MattG.

Former Member
0 Kudos

hi,

What you said is correct, ie it should be less than 50%(all 3 bars)

avoid using select *, rather then use select field clause.

ie declared only those field you want

eg : select matnr,maktx.....from mara.

avoid select/select single statements in loop.

avoid using nested selects

try to use field-symbols.

avoid using order by in select statements.

avoid using for all entries in joins.

if helpful give points.

cheers!

sri