ABAP OO Flashcards

1
Q

With the following class definition, what is the correct syntax for calling method b?
(Note: lo_a is a reference variable for class ZCL_A.)

CLASS zcl_a DEFINITION PUBLIC.
PUBLIC SECTION.
CLASS-METHODS b.
ENDCLASS.

A

zcl=>b.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

In a test method you call method cl_abap_unit_assert=>assert_equals( ..) in the following way:

CLASS ltcl1 DEFINITION FOR TESTING RISK LEVEL HARMLESS DURATION SHORT.
PRIVATE SECTION.
METHODS m1 FOR TESTING.
ENDCLASS.
CLASS ltcl1 IMPLEMENTATION.
METHOD m1.
DATA: go_test_object TYPE REF TO zcl_to_be_tested.
CONSTANTS: lco_exp TYPE string VALUE ‘test2’.
CREATE OBJECT go_test_object.
cl_abap_unit_assert=>assert_equals(
EXPORTING
act = go_class->mv_attribute
exp = lco_exp
msg = assert equals failed && go_test_object->mv_attribute && ` ` && lco_exp
).
ENDMETHOD.
ENDCLASS.

What will happen if method parameters act and exp are not equal?

A

There will be a message in the test log.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What do you have to consider when working with interfaces?

A
  • Static methods, instance methods, static events, and instance events are possible interface components.
  • Instance methods are not implemented in an interface.
  • Implementing classes must declare the interface in their public section.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Which statement reads a single row from a database table?

A

SELECT SINGLE <tablename> ...</tablename>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Which function call returns 0?

A

find_any_not_of( val ‘ABAP ABAP abap’ sub = ‘AB’).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the significance of ‘ALV IDA’ (ALV with Integrated Data Access) in ABAP for SAP HANA?

A

It enables efficient data display by leveraging the power of the HANA database.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

In ABAP Object-Oriented programming, what is a Class?

A

A template for creating objects.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How does the ‘Composite’ design pattern apply in ABAP OO?

A

It allows the creation of complex objects by combining simpler ones.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How does the ‘Observer’ pattern function in ABAP OO?

A

By allowing objects to publish changes to their state to interested subscribers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Which of the following are essential principles of ABAP programming?

A
  • Modularization
  • Layered architecture
  • Code pushdown
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

In ABAP SQL, which of the following can be assigned an alias?

A
  • field (from field list)
  • database table
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How does the ‘ABAP Test Cockpit’ (ATC) enhance code quality in ABAP development?

A

By performing static code checks and analysis.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Scenario: A developer is optimizing an ABAP program for SAP HANA. The program contains several nested loops for data processing. What strategy should be used to optimize this program?

A

Convert nested loops into single SQL statements using New ABAP SQL.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Which of the following are incomplete ABAP types?

A
  • P
  • C
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

In class ZCL_CLASS_A, you use the statement DATA var TYPE ** What may stand in place of **?

A
  • The name of a domain from the ABAP Dictionary
  • The name of a data element from the ABAP Dictionary
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are valid statements?

A
  • go_if 1 may call method ml with go_ift->ml().
  • go_ifl may call method m2 with go if->m2(…).
  • Instead of go ell = NEW #(…) you could use go ifl = NEW cll(. … ).
16
Q

In the context of SAP S/4HANA Cloud, what is a Side-by-Side Extension?

A

An extension built on a separate platform, like SAP BTP.

17
Q

What is the purpose of the ABAP Test Cockpit (ATC)?

A

To perform static code checks and unit tests.

18
Q

What is the role of the Enhancement Framework in ABAP?

A

To enable the modification of standard SAP code

19
Q

Class super has subclass sub. Which rules are valid for the sub constructor?

A
  • The method signature can be changed.
  • The constructor of super must be called before using any components of your own instance.
20
Q

Scenario: In a vehicle management system, there is a need to define a method ‘displayDetails’ differently for each type of vehicle (Car, Truck, Motorcycle).

Which Object-Oriented concept should be used to achieve this?

A

Polymorphism.

21
Q

In ABAP OO, what is the significance of the ‘Friend’ relationship between classes?

A

It enables classes to access each other’s private components.

22
Q

Which ABAP SQL clause allows the use of inline declarations?

A

Into.

23
Q

Which of the following is a characteristic of ABAP Managed Database Procedures (AMDP)?

A

They are stored in the SAP HANA database.

24
Q

How do ‘Expression-Based Indexes’ enhance performance in ABAP for SAP HANA?

A

By creating indexes based on calculated expressions.

25
Q

AUTHORITY-CHECK OBJECT ‘/DWO/TRVL ( ID ‘CNTRY’ FIELD ‘DE* ID ACTVT FIELD ‘03”.

Which of the following apply?

A
  • If the user is authorized for ‘CNTRY = ‘DE’ AND for ‘ACTVT = ‘03 then the return code is 0.
  • AUTHORITY CHECK verifies whether a user is authorized for/DMO/TRVL” with the listed field values.
26
Q

What are valid statements?

A
  • The pragma is not checked by the syntax checker.
  • ## NEEDED is checked by the syntax checker.
27
Q

Which internal table type allows unique and non-unique keys?

A

Standard

28
Q

In ABAP OO, which keyword is used to define a method that can be overridden in a subclass?

A

REDEFINITION

29
Q

In the ABAP RAP, what is the purpose of the Business Object Processing Framework (BOPF)?

A

To manage the lifecycle of business objects

30
Q

In ABAP for SAP HANA, how does ‘Parallel Processing’ improve application performance?

A

By dividing tasks into smaller sub-tasks that are executed simultaneously.

31
Q

Scenario: A developer is designing a system for managing vehicles. They have classes for different types of vehicles like ‘Car’, ‘Truck’, and ‘Motorcycle’.
Which Object-Oriented concept is best to create a common structure for these classes?

A

Inheritance

32
Q

What would be the correct expression to change a given string value ‘mr joe doe’ into ‘JOE’ in an ABAP SQL field list?

A

SELECT FROM TABLE dbtabl FIELDS Of1, substring(upper(‘mr joe doe’), 4, 3) AS f2_sub_up, f3,…

33
Q

In ABAP, what is a “Transport Request”?

A

A package for transporting changes across systems