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
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 class ZCL_CLASS_A, you use the statement DATA var TYPE ***
What may stand in place of ***? Note: There are 2 correct answers to this question.
Answer : B, D
A predefined ABAP type, such as i, f, c, string, xstring, and so on.
Therefore, the possible values for *** are B. the name of a data element from the ABAP Dictionary and D. the name of a domain from the ABAP Dictionary. The other options are not valid because:
C . The name of a type defined privately in another class is a private type and cannot be accessed from outside the class. A private type can only be used within the class that defines it.
Which ABAP SQL clause allows the use of inline declarations?
Answer : C
The following code snippet uses the INTO clause with an inline declaration to declare a local variable itab and store the result of the SELECT query into it:
SELECT * FROM scarr INTO TABLE @DATA (itab).
The following code snippet uses the INTO clause with an inline declaration to declare a field symbol <fs> and store the result of the SELECT query into it:
SELECT SINGLE * FROM scarr INTO @<fs>.
You cannot do any of the following: