Just 3 Changes to Improve the SAP ABAP Performance by 95 Percent

Just 3 Changes to Improve the SAP ABAP Performance by 95 Percent

Just 3 Changes to Improve the SAP ABAP Performance by 95 Percent. For one of our custom program, assuming the Business Group executed it totally open, it required very nearly 10,000 seconds. So they were encouraged to continuously run the report for certain information values in the determination screen. Regardless of whether they need to execute for every one of the clients (clear open) in the determination screen, they were asked not to leave it clear. All things considered, they were approached to put clients input field in reaches and afterward run various positions. Let’s get started with Just 3 Changes to Improve the SAP ABAP Performance by 95 Percent.

For example:

Users 00000001 – 00005000 – Job 1
Users 00005001 – 00010000 – Job 2
Users 00010001 – 00015000 – Job 3
Users 00015001 – 00020000 – Job 4 – and so on.

sap abap selection screen

Be that as it may, one of the Business Colleagues was troubled. He could have done without the plan to run different positions and afterward collect the outcomes. He needed to run the report completely open and have only one spool with the result. He made his voice clearly, made it heard and persuaded the administration to tune this program. Therefore, this feared program came to our plate to break down in the event that we can make some improvement.

performance tuning abap

Our most memorable move was to run the work completely open and check what amount of time it required. It required 9991 seconds unequivocally. We ran it completely open on numerous occasions to check assuming any support would do any deceive. Yet, the occupation got some margin to wrap up.

Then we took a gander at the program and did two or three changes, which we accepted had the most extreme effect. So, we followed “The Pareto Guideline”, otherwise called the “80/20 Rule”. I’m certain a large portion of you have caught wind of this 80-20 Rule. That’s what the law expresses, for some occasions, generally 80% of the impacts come from 20% of the causes.

In our unique situation, 80% of Execution Issues have 20% causes. Or on the other hand, 80% of Execution can be improved by fixing the main 20% terrible programming.

We did only 3 changes and the effect was colossal. Check the underneath work run Length. With only 3 changes, the run time tumbled from 9991 seconds to 496 seconds.

Indeed, an improvement of more than 95%. Isn’t it staggering? Albeit 496 seconds is definitely not an optimal opportunity to finish a report. Yet, to get that decrease in time with only some minor code change was truly worth focusing on.

The Pareto Principle

A few people might request evidence. How might we accept assuming both the positions ran for same information and gave a similar output.?Yes, it did. Also, here is the confirmation.

This is the Info. We need for all Clients. And every one of our clients start with 0.

The work which ran for 9991 seconds gave 632 Pages yield.

The work which ran for minimal under 500 seconds likewise gave 632 Pages yield

Presently, you could be interested to be aware, what was the mysterious change which we did? However, not a big deal.

You may be frustrated in the wake of learning the change.

Yet at the same time, we needed to distribute this article on the grounds that occasionally we don’t have to move the mountain to achieve something. Now and again, the arrangement is straightforward and inside our span. We generally need NOT must have In that frame of mind to see the exhibition improvement.

Now and again, tweaking our code in the conventional data set could get the job done. This is only a guide to illustrate, how awful we can program. On the off chance that all ABAPers deal with minor things like displayed underneath, the client’s SAP Framework would be a lot quicker, smoother and all the more significantly upgraded even without HANA.

This doesn’t mean we can keep away from HANA.

Changes done:

  1. Change Standard Table Types to Hashed and Sorted Internal Tables wherever possible.

Really take a look at the remarked Information in green. All Standard Inward Tables are supplant by Hashed and Arranged Inside table.

Hashed internal table
  1. Alternative for ‘For All Entries’

HRP1001 has more than 4.5 million passages in our framework and the beneath FOR ALL Sections (FAE) select took until the end of time.

Before Code Change

    SELECT * FROM hrp1001 INTO TABLE it_hrp1001
      FOR ALL ENTRIES IN it_pa0001
      WHERE objid = it_pa0001-plans
      AND begda LE sy-datum
      AND endda GE sy-datum.

After Code Change

In the wake of breaking down the runtime information, we found that the FAE driver table IT_PA0001 had just 7000 one of a kind passages, yet the FOR ALL Sections took practically enduring to finish on the grounds that the chose data set had over 4.5 million records. So we chose to put these 7000 odd passages to Reach Table and use it in the WHERE provision.

  RANGES: lr_objid   FOR hrp1001-objid.
  DATA:   lwa_objid  LIKE LINE OF lr_objid.

  DATA:   lit_pa0001 TYPE STANDARD TABLE OF pa0001.

  IF it_pa0001 IS NOT INITIAL.
*   Keep a local copy
    lit_pa0001 = it_pa0001[].

    SORT lit_pa0001[] BY plans.

*   Keep unique entries
    DELETE ADJACENT DUPLICATES FROM lit_pa0001 COMPARING plans.

*   Populate the range table which can be used in WHERE clause
    lwa_objid-sign = 'I'.
    lwa_objid-option = 'EQ'.
    LOOP AT lit_pa0001 INTO DATA(lwa_pa0001).
      lwa_objid-low = lwa_pa0001-plans.
      APPEND lwa_objid TO lr_objid.
    ENDLOOP.

*   FAE replaced by Range Table
    SELECT * FROM hrp1001 INTO TABLE it_hrp1001
      WHERE objid IN lr_objid[]        
      AND begda LE sy-datum
      AND endda GE sy-datum.

  ENDIF.

3. As a matter of fact, there is no Third point. This is the eventual outcome of Primary point. The Circles and Peruses of HASHED and Arranged tables are of course proficient than STANDARD Interior Tables.

There’s nothing more to it. Only the over two changes further developed the presentation decisively (by 95%). Ideally, this article would rouse you to utilize the Arranged and HASHed table more frequently than STANDARD.

Question: Before we close today, let me ask you, Do you have any idea about what number of kinds of interior tables we have in SAP?

Reply: Did you say 3? Standard/Arranged/Hashed? Ideally not.

As a general rule, are just 2 kinds of Interior tables. File Table and HASHED Tables.

Then what might be said about Norm and Arranged? The two of them fall under Record Table umbrella.

This picture would explain, Kinds of Inward Tables in SAP.

Types of Internal Tables in SAP

Yet, for what reason would we say we are covering Inside Tables here?

Isn’t Inward Tables hypothesis for novices in ABAP?

Valid, inward tables are the fundamental idea which is told to novices. In any case, now and again, we want to remind our accomplished people also that the second conspicuous guilty party for a large portion of the Presentation Issues after Data set Admittance is tasks with Inner tables. Off-base or Inaccurate Data set Get presumably causes issue, yet off-base Interior Table at some unacceptable spot likewise adds affront to the injury.

In this way, Inside Tables being the focal build inside the application improvement with ABAP, its significance can’t be subverted.

How to chose the internal table type?

Standard Interior Table (Listed)

I. Assuming that you are certain, your inner table would not very many records (under 100) it could be fitting to swear off an unequivocal key by and large (which is required in arranged and hashed tables) then, at that point, Standard Inside tables can be utilized. Standard tables are appropriate for information which are once in a long while or not the slightest bit looked for explicit

ii. On the off chance that the interior table information are seldom or not by any stretch of the imagination looked for explicit models then Standard Inner Table would be reasonable for such information.

iii. Thumb Rule – In the event that searches are not required in the inner table, it does not merit the expenses to make and to keep the extra key-structures required for the other table sorts (arranged/hashed). Utilize Standard Inside Table securely.

Arranged Inward Table (Recorded)

I. If you have any desire to Circle with WHERE condition. On the off chance that this is finished with appropriate Keys (even fractional), the inside fabricated key-designs will be utilized to track down the relating sections as fast as could be expected.

ii. In the event that the information should be looked with Keys. On the off chance that the Peruses would be finished with Incomplete Keys, Arranged is the best table sort not Hashed table.

iii. Thumb Rule – In the event that the unambiguity of the Keys can’t be ensured for example just Halfway Keys are known, then Arranged Inward Tables ought to be utilized.

Hashed Interior Table (Hashed)

I. Assuming you have the Total Key (NOT Fractional), Hashed Inner Table is your most ideal decision.

ii. On the off chance that unambiguity of the Keys CAN be ensured for example Full Keys are accessible for the hunts, Hashed in the Best.

iii. Thumb Rule – In the event that the pursuit term generally utilizes the total key (every one of the fields of the key are checked against the comparing esteem) Hashed table sort is normally awesome.

Outline of the above clarification of Time Expenses for Key Access.

BEST PRACTICE GUIDELINES FOR DEVELOPMENT

Rundown of the above clarification for When to Utilize Which Table Sort?

When to Use Which Table Type?

As our SAP Tutors generally say, on the off chance that we could advance our custom codes in the conventional data set, we could accomplish enormous improvement in execution even before we move to HANA. Hope enjoyed “Just 3 Changes to Improve the SAP ABAP Performance by 95 Percent” blog.

 

YOU MAY BE INTERESTED IN

Oracle Interview Questions and Answers

Best Practices for SAP ABAP Development: A Comprehensive Guide

Best Oracle certification course in Pune

 

WhatsApp WhatsApp us