In a test method you call method cl_abap_unit_assert=>assert_equals( .. ) in the following way:
CLASS Itcl1 DEFINITION FOR TESTING RISK LEVEL HARMLESS DURATION SHORT.
PRIVATE SECTION.
METHODS m1 FOR TESTING.
ENDCLASS.
CLASS Itcl1 IMPLEMENTATION.
METHOD m1.
DATA: go_test_object TYPE REF TO zcl_to_be_tested.
CONSTANTS: Ico_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?
Answer : D
What are valid statements? Note: There are 3 correct answers to this question
Answer : B, D, E
The following are the explanations for each statement:
The other statements are not valid, as they have syntax errors or logical errors. These statements are:
Which of the following are incomplete ABAP types? Note: There are 2 correct answers to this question.
Answer : C, D
The following are incomplete ABAP types:
The following are not incomplete ABAP types, because they specify all the attributes of a data type:
B . T is a type for time values in the format HHMMSS. The length of the time value is fixed at 6 characters and does not have to be specified when a data object or a constant is defined with this type. For example, DATA time TYPE t defines a data object named time with a type t and a length of 6 characters.
Which of the following ON conditions must you insert in place of "???"?
Answer : D
The correct ON condition that must be inserted in place of ''???'' is:
ON Sprojection.carrier_id=Z_Source2.carrier_id
The other options are not valid ON conditions, because:
A . ON Z_Sourcel.camer_id = 7_Source2 carrier_id is not valid because Z_Sourcel and 7_Source2 are not valid data sources in the given code. There is no CDS view or database table named Z_Sourcel or 7_Source2. The correct names are Z_Source1 and Z_Source2. Moreover, the field camer_id is not a valid field in the given code. There is no field named camer_id in any of the data sources. The correct name is carrier_id.
In ABAP SQL, which of the following retneves the association field _Airline-Name of a CDS view?
Answer : B
For the assignment, gv_target = gv_source.
which of the following data declarations will always work without truncation or rounding? Note: There
are 2 correct answers to this question.
Answer : B, C
You cannot do any of the following:
In ABAP SQL, which of the following can be assigned an alias? Note: There are 2 correct answers to this question.
Answer : B, C
The following are examples of how to assign an alias to a field or a database table in ABAP SQL:
B . field (from field list): A field is a column of a table or a view that contains data of a certain type. A field can be assigned an alias in the field list of a SELECT statement, which specifies the fields that are selected from the data source. For example, the following query assigns the alias name to the field carrname of the table scarr:
SELECT carrid, carrname AS name FROM scarr.
C . database table: A database table is a collection of data that is organized in rows and columns. A database table can be assigned an alias in the FROM clause of a SELECT statement, which specifies the data source that is selected from. For example, the following query assigns the alias c to the table scarr:
SELECT c.carrid, c.carrname FROM scarr AS c.
The following are not valid for assigning an alias in ABAP SQL: