Showing posts with label ABAP Class. Show all posts
Showing posts with label ABAP Class. Show all posts

How to find problem area in ABAP Programming?

Using transaction SAT to find problem areas

we will see the steps needed to investigate the execution of any report,
transaction, or operate module using the transaction SAT.


we will analyze the runtime of a standard program RIBELF00. We will execute the program on the order number (aufnr) and see the behavior.

For carrying out runtime analysis using transaction SAT, proceed as follows:

1. Call transaction SAT. The screen appears as shown:





2. Enter a suitable name for the variant (in our case, YPERF_VARIANT) and click the Create button below it. This will take you to the Variant creation screen.




3. On the Duration and Type tab, switch on Aggregation by choosing the Per Call
Position radio-button.

4. Then, click on the Statements tab. On the Statements tab, make sure Internal
Tables, the Read Operations checkbox and the Change Operations checkbox,
and the Open SQL checkbox under Database Access are checked.



5. Save your variant. Come back to the main screen of SAT.

6. Make sure that within Data Formatting on the initial screen of SAT, the checkbox for
Determine Names of Internal Tables is selected.

7. Next, enter the name of the program that is to be traced in the field provided (in our
case, it is RIBELF00). Then click the button.

8. The screen of the program appears as shown. We will enter an order number range
and execute the program.

9. Once the program output is generated, click on the Back key to come back to
program selection screen.

10. Click on the Back key once again to generate the evaluation results.


We carried out the execution of the program through the transaction SAT and the evaluation
results were generated. On the left are the Trace Results (in tree form) listing the statements/
events with the most runtime. These are like a summary report of the entire measurement
of the program. They are listed in descending order of the Net time in microseconds and the
percentage of the total time. For example, in our case, the OPEN CURSOR event takes 68
percent of the total runtime of the program.



Selecting the Hit List tab will show the top time consumer components of the program. In this
example, the access of database tables AFRU and VBAK takes most of the time.



Double-clicking any item in the Trace Results window on the left-hand side will display (in the
Hit List area on the right-hand pane) details of contained items along with execution time
of each item. From the Hit List window, double-clicking a particular item will take us to the
relevant line in the program code. For example, when we double-click the Open Cursor VBAK
line, it will take us to the corresponding program code.



We have carried out analysis with Aggregation switched on. The switching on of Aggregation
shows one single entry for a multiple calls of a particular line of code. Because of this, the
results are less detailed and easier to read, since the hit list and the call hierarchy in the
results are much more simplified.
Also within the results, by default, the names of the internal table used are not shown.
In order for the internal table names to appear in the evaluation result, the Determine
Names checkbox of Internal tables indicator is checked.
As a general recommendation, the runtime analysis should be carried out several times for
best results. The reason being that the DB-measurement time could be dependent on a
variety of factors, such as system load, network performance, and so on.

SAP Certification Associate Developer - ABAP Developer Certification


SAP Certification Associate Developer - NetWeaver 7.02 

Class Identification Analysis and Design


1.            What is unique about a singleton?

A. It must be instantiated using a private instance constructor.
B. It must be instantiated using a public instance constructor.
C. It must be instantiated using a protected instance constructor.
D. It must be instantiated using a static private constructor.
E. It must be instantiated using a static public constructor.
F. It must be instantiated using a static protected constructor.
G.It must be defined as FINAL.
H. It cannot be defined as FINAL.

Correct answers: D. G


2.                            What statements are true about a class that has granted friendship to another class:

A. The friend has access to private attributes.
B. The friend has access to protected attributes.
C. The friend has access to public attributes.
D. All of classes the friend has granted friendship access status to also have the same access.
E. All classes that inherit  from the friend (subclasses) also have the same access.

Correct answers: A, B. C.E



3.            There can only be one level in the inheritance tree.

A. True
B.False

Correct answer: B


4.            What statements are true regarding ABAP inheritance?

A. You can access the superclass component with the prefix SUPER.
B.The instance constructor can be overwritten as part of inheritance.
C. The static constructor can be overwritten as pa rt of inheritance.
D. Overloading allows a method to have several definitions with different signatures.
E. Instance constructors must call the superclass's constructor.
F. Static constructors do not need to call the superclass's constructor.
G. Polymorphism requires the developer to specify which method to use with inheritance.

Correct answers: A, B.E. F


5.            Which statements are considered obsolete and cannot be used in ABAP
Objects:

A.TABLES
B. DATA .. . TYPE . .. OCCURS
C.DATA ... BEGIN OF ...OCCURS
D. I NFOTYPES
E.RANGES
F. LEAVE
G. ON CHANGE OF
H.SEARCH
I. LOOP AT dbtab

Correct answers: A, B. C.D. E.F, G, H, I


6.            You can simulate multiple inheritances with:

A. REDEFINITION
B. INHERITING FROM
C. I NTERFACES

Correct answer: C


7. What is unique about a functional method?

A. It must contain a returning parameter.
B. It can contain a n importing parameter.
C.It can contain an exporting parameter.
D.I t can contain a changing parameter.
E.It can be used in logical expressions.
F. It can be used in SELECT statements.
G. It must be a singleton.

Correct answer: A, B. E