SAP C_ABAPD_2309 SAP Certified Associate - Back-End Developer - ABAP Cloud Exam Practice Test

Page: 1 / 14
Total 81 questions
Question 1

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


Question 2

Which of the following are incomplete ABAP types? Note: There are 2 correct answers to this question.



Answer : C, D

Incomplete ABAP types are types that do not specify all the attributes of a data type, such as the length, the number of decimal places, or the value range. Incomplete types can only be used for the typing of field symbols and formal parameters, not for the definition of data objects or constants.Incomplete types can be either predefined or user-defined1.

The following are incomplete ABAP types:

C . C is a type for character strings with a generic length. The length of the character string has to be specified when a data object or a constant is defined with this type.For example, DATA text TYPE c LENGTH 10 defines a data object named text with a type c and a length of 10 characters2.

D . P is a type for packed numbers with a generic length and a generic number of decimal places. The length and the number of decimal places of the packed number have to be specified when a data object or a constant is defined with this type.For example, DATA amount TYPE p LENGTH 8 DECIMALS 2 defines a data object named amount with a type p, a length of 8 bytes, and 2 decimal places3.

The following are not incomplete ABAP types, because they specify all the attributes of a data type:

A . String is a type for variable-length character strings. The length of the character string is determined at runtime and can vary from 0 to 2,147,483,647 characters. The length does not have to be specified when a data object or a constant is defined with this type.For example, DATA text TYPE string defines a data object named text with a type string and a variable length4.

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.


Question 3

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

This ON condition specifies the join condition between the CDS view Sprojection and the database table Z_Source2. The join condition is based on the field carrier_id, which is the primary key of both the CDS view and the database table.The ON condition ensures that only the records that have the same value for the carrier_id field are joined together1.

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.

B . ON Sprojection Camer=Source2 carrier_id is not valid because Sprojection and Source2 are not valid data sources in the given code. There is no CDS view or database table named Sprojection or Source2. The correct names are Sprojection and Z_Source2. Moreover, the field Camer is not a valid field in the given code. There is no field named Camer in any of the data sources. The correct name is carrier_id.Furthermore, the ON condition is missing the dot (.) operator between the data source name and the field name, which is required to access the fields of the data source1.

C . ON Sprojection. Carrier Source2.carrier is not valid because Carrier and carrier are not valid fields in the given code. There is no field named Carrier or carrier in any of the data sources. The correct name is carrier_id.Moreover, the ON condition is missing the dot (.) operator between the data source name and the field name, which is required to access the fields of the data source1.


Question 4

In ABAP SQL, which of the following retneves the association field _Airline-Name of a CDS view?



Answer : B


Question 5

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.



Question 6

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

In class ZCL_CLASS_A, you use the statement DATA var TYPE *** to declare a data object named var with a data type specified by ***.The data type can be any of the following1:

A predefined ABAP type, such as i, f, c, string, xstring, and so on.

A data element from the ABAP Dictionary, such as matnr, carrid, bukrs, and so on.A data element defines the semantic and technical attributes of a data field, such as the domain, the length, the data type, the description, and the value range2.

A domain from the ABAP Dictionary, such as matnr_d, carrid_d, bukrs_d, and so on.A domain defines the technical attributes of a data field, such as the data type, the length, the output length, the number of decimal places, and the value range3.

A type defined globally in a class, an interface, or a type pool, such as zcl_class_b=>type_a, zif_interface_c=>type_b, ztype_pool_d=>type_c, and so on.A global type is a type that is defined in a global repository object and can be used in any program or class4.

A type defined locally in the current class, such as type_a, type_b, type_c, and so on.A local type is a type that is defined in the declaration part of a class and can only be used within the class5.

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:

A . The name of a type defined privately in class ZCL_CLASS_A is a local type and cannot be used with the DATA statement.A local type can only be used with the TYPES statement5.

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.


Question 7

Which ABAP SQL clause allows the use of inline declarations?



Answer : C

The ABAP SQL clause that allows the use of inline declarations is the INTO clause. The INTO clause is used to specify the target variable or field symbol where the result of the SQL query is stored. The INTO clause can use inline declarations to declare the target variable or field symbol at the same position where it is used, without using a separate DATA or FIELD-SYMBOLS statement.The inline declaration is performed using the DATA or @DATA operators in the declaration expression12. For example:

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:

FROM: The FROM clause is used to specify the data source of the SQL query, such as a table, a view, or a join expression.The FROM clause does not allow the use of inline declarations12.

INTO CORRESPONDING FIELDS OF: The INTO CORRESPONDING FIELDS OF clause is used to specify the target structure or table where the result of the SQL query is stored. The INTO CORRESPONDING FIELDS OF clause does not allow the use of inline declarations.The target structure or table must be declared beforehand using a DATA or FIELD-SYMBOLS statement12.

FIELDS: The FIELDS clause is used to specify the columns or expressions that are selected from the data source of the SQL query. The FIELDS clause does not allow the use of inline declarations.The FIELDS clause must be followed by an INTO clause that specifies the target variable or field symbol where the result is stored12.


Page:    1 / 14   
Total 81 questions