C - ABAPD - 2309 Updated Dumps - SAP Certified Associate - Back-End Developer - ABAP Cloud
C - ABAPD - 2309 Updated Dumps - SAP Certified Associate - Back-End Developer - ABAP Cloud
1. Which patterns raise an exception? Note: There are 3 correct answers to this question.
A. DATA: gv_target TYPE p DECIMALS 2. CONSTANTS: go intl TYPE i VALUE 3. gv_target -U
EXACT (2 gcojntl).
B. DATA: gv_target TYPE string. ? CONSTANTS: gco_string TYPE LENGTH 16 VALUE
0123456789ABCDEF*. gv_target = EXACT # gco_string+5 (5) ).
C. DATA: gv_target TYPE c LENGTH 5. V ? CONSTANTS: ECO string TYPE string VALUE
0123456789ABCDEF". gv_target - EXACT (gco_string + 5 (6) ).
D. DATA: Ev target TYPE p DECIMALS 3. CONSTANTS: gcojntl TYPE i VALUE 2. Ev_target
-U EXACT #2 / gcojntl ).
E. DATA: gv_target TYPE d. s/ ? CONSTANTS: gco_date TYPE d VALUE '20331233*.
gv_target EXACT ( geo_date).
Answer: A, C, E
Explanation:
The patterns that raise an exception are those that use the constructor operator EXACT to
perform a lossless assignment or calculation, but the result cannot be converted to the target
data type without data loss.
The following are the explanations for each pattern:
A: This pattern raises the exception CX_SY_CONVERSION_LOST because the result of the
calculation 2 * 3 is 6, which cannot be assigned to a packed number with two decimal places
without losing the integer part. The operator -U is used to perform a lossless calculation with the
calculation type decfloat34.
B: This pattern does not raise an exception because the result of the substring expression
gco_string+5(5) is ‘6789A’, which can be assigned to a string without data loss. The operator
EXACT # is used to perform a lossless assignment with the data type of the argument.
C: This pattern raises the exception CX_SY_CONVERSION_LOST because the result of the
substring expression gco_string+5(6) is ‘6789AB’, which cannot be assigned to a character
field with length 5 without losing the last character. The operator EXACT is used to perform a
lossless assignment with the data type of the target field.
D: This pattern does not raise an exception because the result of the calculation 2 / 2 is 1, which
can be assigned to a packed number with three decimal places without data loss. The operator
-U is used to perform a lossless calculation with the calculation type decfloat34.
E: This pattern raises the exception CX_SY_CONVERSION_ERROR because the constant
gco_date contains an invalid value ‘20331233’ for a date data type, which cannot be converted
to a valid date. The operator EXACT is used to perform a lossless assignment with the data
type of the target field.
Reference: EXACT - Lossless Operator - ABAP Keyword Documentation, Lossless
Assignments - ABAP Keyword Documentation
2. Which type of legacy code does SAP recommend you eliminate when you review
modifications as part of an SAP S/4HANA system conversion? Note: There are 2 correct
answers to this question.
A. Code that supports a critical business process
B. Code that now is identical to a standard SAP object
C. Code that has less than 10% usage according to usage statistics
D. Code that can be redesigned as a key user extension
Answer: B, D
Explanation:
SAP recommends that you eliminate the following types of legacy code when you review
modifications as part of an SAP S/4HANA system conversion:
Code that now is identical to a standard SAP object. This type of code is redundant and
unnecessary, as it does not provide any additional functionality or customization. It can also
cause conflicts or errors during the system conversion, as the standard SAP object may have
changed or been replaced in SAP S/4HANA. Therefore, you should delete this type of code and
use the standard SAP object instead.
Code that can be redesigned as a key user extension. This type of code is usually related to UI
or business logic adaptations that can be achieved using the in-app tools provided by SAP
S/4HANA. By redesigning this type of code as a key user extension, you can simplify and
standardize your code base, reduce maintenance efforts, and avoid compatibility issues during
the system conversion. Therefore, you should migrate this type of code to the key user
extensibility framework and delete the original code.
The other types of legacy code are not recommended to be eliminated, as they may still be
relevant or necessary for your business processes. However, you should still review and adjust
them according to the SAP S/4HANA simplification items and best practices. These types of
code are:
Code that supports a critical business process. This type of code is essential for your business
operations and cannot be easily replaced or removed. However, you should check if this type of
code
is compatible with SAP S/4HANA, and if not, you should adapt it accordingly. You should also
consider if this type of code can be optimized or enhanced using the new features and
capabilities of SAP S/4HANA.
Code that has less than 10% usage according to usage statistics. This type of code is rarely
used and may not be worth maintaining or converting. However, you should not delete this type
of code without verifying its relevance and impact on your business processes. You should also
consider if this type of code can be replaced or consolidated with other code that has higher
usage or better performance.
Reference: Custom Code Management (CCM) During an SAP S/4HANA Conversion, Custom
Code Migration Guide for SAP S/4HANA 2020
3. DRAG DROP
You have a superclass superl and a subclass subl of superl. Each class has an instance
constructor and a static constructor. The first statement of your program creates an instance of
subl. In which sequence will the constructors be executed?
Answer:
Explanation:
The sequence in which the constructors will be executed is as follows:
Class constructor of superl. This is because the class constructor is a static method that is
executed
automatically before the class is accessed for the first time. The class constructor is used to
initialize the static attributes and components of the class. The class constructor of the
superclass is executed before the class constructor of the subclass, as the subclass inherits the
static components of the superclass12
Class constructor of subl. This is because the class constructor is a static method that is
executed automatically before the class is accessed for the first time. The class constructor is
used to initialize the static attributes and components of the class. The class constructor of the
subclass is executed after the class constructor of the superclass, as the subclass inherits the
static components of the superclass12
Instance constructor of superl. This is because the instance constructor is an instance method
that is executed automatically when an instance of the class is created using the statement
CREATE OBJECT. The instance constructor is used to initialize the instance attributes and
components of the class. The instance constructor of the superclass is executed before the
instance constructor of the subclass, as the subclass inherits the instance components of the
superclass. The instance constructor of the subclass must call the instance constructor of the
superclass explicitly using super->constructor, unless the superclass is the root node object12
Instance constructor of subl. This is because the instance constructor is an instance method
that is executed automatically when an instance of the class is created using the statement
CREATE OBJECT. The instance constructor is used to initialize the instance attributes and
components of the class. The instance constructor of the subclass is executed after the
instance constructor of the superclass, as the subclass inherits the instance components of the
superclass. The instance constructor of the subclass must call the instance constructor of the
superclass explicitly using super->constructor, unless the superclass is the root node object12
Reference: Constructors of Classes - ABAP Keyword Documentation, METHODS - constructor -
ABAP Keyword Documentation
4. Refer to exhibit.
What are valid statements? Note: There are 3 correct answers to this question
A. In class CL1, the interface method is named if-ml.
B. Class CL2 uses the interface.
C. Class CL1 uses the interface.
D. In class CL2, the interface method is named ifl-ml.
E. Class CL1 implements the interface.
Answer: CDE
Explanation:
Based on the code snippet provided and standard ABAP object-oriented programming
principles, let's analyze each statement:
In class CL1, the interface method is named if1~m1. - This is correct. When a class implements
an interface, the methods from the interface can be referred to using the interface name
followed by a tilde (~) and the method name.
Class CL2 uses the interface. - This is correct. The declaration DATA mo_if1 TYPE REF TO if1
within class CL2 indicates that this class has a reference to the interface if1, which means it is
using the interface.
Class CL1 uses the interface. - This is correct. The INTERFACES if1 statement in the class CL1
definition indicates that CL1 is using the interface if1.
In class CL2, the interface method is named if1~m1. - This statement is not directly supported
by the given code snippet. While class CL2 has a reference to the interface, the method naming
convention if1~m1 applies when calling the method via an interface reference, not for declaring
a method within the class.
Class CL1 implements the interface. - This is correct. The INTERFACES if1 statement in the
class CL1 definition indicates that CL1 implements the interface if1.
Based on the code snippet and the principles of ABAP object-oriented programming, the three
correct statements are:
A. In class CL1, the interface method is named if1~m1.
C. Class CL1 uses the interface.
E. Class CL1 implements the interface.
7. Which RESTful Application Programming object can be used to organize the display of fields
in an app?
A. Data model view
B. Metadata extension
C. Service definition
D. Projection view
Answer: B
Explanation:
A metadata extension is a RESTful Application Programming object that can be used to
organize the display of fields in an app. A metadata extension is a CDS view that annotates
another CDS view with UI annotations, such as labels, icons, or facets. These annotations
define how the data should be presented in the app, such as which fields should be shown on
the object page, which fields should be editable, or which fields should be used for filtering or
sorting. A metadata extension can also be used to add custom actions or validations to the
app12.
Reference: 1: Refine the Object Page with Annotations | SAP Tutorials 2: ABAP RAP : Enabling
custom actions with a dialog for additional input fields | SAP Blogs
8. Which function call returns 0?
A. Count_any_of ( val - ‘ABAP ABAP abap' sub "AB" )
B. Count (val - 'ABAP ABAP abap' sub - 'AB' )
C. find_any_of (val = "ABAP ABAP abap' sub = "AB")
D. find_any_not_of( val 'ABAP ABAP abap’ sub = 'AB')
Answer: D
Explanation:
The function find_any_not_of returns the position of the first character in the string val that is not
contained in the string sub. If no such character is found, the function returns 0. In this case, the
string val contains only the characters A, B, and a, which are all contained in the string sub, so
the function returns 0. The other functions return positive values, as follows:
Count_any_of returns the number of occurrences of any character in the string sub within the
string val. In this case, it returns 8, since there are 8 A’s and B’s in val.
Count returns the number of occurrences of the string sub within the string val. In this case, it
returns 2, since there are 2 AB’s in val.
find_any_of returns the position of the first character in the string val that is contained in the
string sub. In this case, it returns 1, since the first character A is in sub.
Reference: String Functions - ABAP Keyword Documentation, Examples of String Functions -
ABAP Keyword Documentation
9. Which restrictions exist for ABAP SQL arithmetic expressions? Note: There are 2 correct
answers to this question.
A. Floating point types and integer types can NOT be used in the same expression.
B. The operator/is allowed only in floating point expressions.
C. Decimal types and integer types can NOT be used in the same expression.
D. The operator is allowed only in floating point expressions.
Answer: BD
Explanation:
ABAP SQL arithmetic expressions have different restrictions depending on the data type of the
operands. The following are some of the restrictions:
Floating point types and integer types can be used in the same expression, as long as the
integer types are cast to floating point types using the cast function. For example, CAST ( num1
AS FLTP ) / CAST ( num2 AS FLTP ) is a valid expression, where num1 and num2 are integer
types.
The operator / is allowed only in floating point expressions, where both operands have the type
FLTP or f. For example, num1 / num2 is a valid expression, where num1 and num2 are floating
point types. If the operator / is used in an integer expression or a decimal expression, a syntax
error occurs.
Decimal types and integer types can be used in the same expression, as long as the expression
is a decimal expression. A decimal expression has at least one operand with the type DEC,
CURR, or QUAN or p with decimal places. For example, num1 + num2 is a valid expression,
where num1 is a decimal type and num2 is an integer type.
The operator ** is allowed only in floating point expressions, where both operands have the type
FLTP or f. For example, num1 ** num2 is a valid expression, where num1 and num2 are floating
point types. If the operator ** is used in an integer expression or a decimal expression, a syntax
error occurs.
Reference: sql_exp - sql_arith - ABAP Keyword Documentation, SQL Expressions, Arithmetic
Calculations - ABAP Keyword Documentation
10. Which statement can you use to change the contents of a row of data in an internal table?
A. Append table
B. Modify table
C. Insert table
D. Update table
Answer: B
Explanation:
The statement that can be used to change the contents of a row of data in an internal table is
MODIFY table. The MODIFY table statement can be used to change the contents of one or
more rows of an internal table, either by specifying the table index, the table key, or a condition.
The MODIFY table statement can also be used to change the contents of a database table, by
specifying the table name and a work area or an internal table. The MODIFY table statement
can use the TRANSPORTING addition to specify which fields should be changed, and the
WHERE addition to specify which rows should be changed.
The other statements are not suitable for changing the contents of a row of data in an internal
table, as they have different purposes and effects. These statements are:
APPEND table: This statement can be used to add a new row of data to the end of an internal
table, either by specifying a work area or an inline declaration. The APPEND table statement
does not change the existing rows of the internal table, but only increases the number of rows
by one. INSERT table: This statement can be used to insert a new row of data into an internal
table, either by specifying the table index, the table key, or a sorted position. The INSERT table
statement does not change the existing rows of the internal table, but only shifts them to make
room for the new row. The INSERT table statement can also be used to insert a new row of
data into a database table, by specifying the table name and a work area or an inline
declaration.
UPDATE table: This statement can be used to update the contents of a database table, by
specifying the table name and a work area or an internal table. The UPDATE table statement
can use the SET addition to specify which fields should be updated, and the WHERE addition to
specify which rows should be updated. The UPDATE table statement does not affect the
internal table, but only the corresponding database table.
Reference: MODIFY table - ABAP Keyword Documentation, APPEND table - ABAP Keyword
Documentation, INSERT table - ABAP Keyword Documentation, UPDATE table - ABAP
Keyword Documentation
What are valid statements? Note: There are 2 correct answers to this question.
A. "zcxl" is a dictionary structure, and "paraml" and "param2" are this structure.
B. "paraml11 and "param2" are predefined names.
C. The code creates an exception object and raises an exception.
D. "previous" expects the reference to a previous exception
Answer: CD
Explanation:
The code snippet in the image is an example of using the RAISE EXCEPTION statement to
raise a class-based exception and create a corresponding exception object. The code snippet
also uses the EXPORTING addition to pass parameters to the instance constructor of the
exception class12. Some of the valid statements about the code snippet are:
The code creates an exception object and raises an exception: This is true. The RAISE
EXCEPTION statement raises the exception linked to the exception class zcxl and generates a
corresponding exception object. The exception object contains the information about the
exception, such as the message, the source position, and the previous exception12.
“previous” expects the reference to a previous exception: This is true. The previous parameter
is a predefined parameter of the instance constructor of the exception class cx_root, which is
the root class of all class-based exceptions. The previous parameter expects the reference to a
previous
exception object that was caught during exception handling. The previous parameter can be
used to chain multiple exceptions and preserve the original cause of the exception12. You
cannot do any of the following:
“zcxl” is a dictionary structure, and “paraml” and “param2” are this structure: This is false. zcxl
is not a dictionary structure, but a user-defined exception class that inherits from the predefined
exception class cx_static_check. param1 and param2 are not components of this structure, but
input parameters of the instance constructor of the exception class zcxl. The input parameters
can be used to pass additional information to the exception object, such as the values that
caused the exception12.
“paraml” and “param2” are predefined names: This is false. param1 and param2 are not
predefined names, but user-defined names that can be chosen arbitrarily. However, they must
match the names of the input parameters of the instance constructor of the exception class zcxl.
The names of the input parameters can be declared in the interface of the exception class using
the RAISING addition12.
Explanation:
Reference: 1: RAISE EXCEPTION - ABAP Keyword Documentation - SAP Online Help 2: Class-
Based Exceptions - ABAP Keyword Documentation - SAP Online Help
12. Which of the following actions cause an indirect change to a database table requiring a table
conversion? Note: There are 2 correct answers to this question.
A. Renaming a field in a structure that is included in the table definition
B. Changing the field labels of a data element that is used in the table definition.
C. Deleting a field from a structure that is included in the table definition.
D. Shortening the length of a domain used in a data element that is used in the table definition.
Answer: A, C
Explanation:
The following are the explanations for each action:
A: Renaming a field in a structure that is included in the table definition causes an indirect
change to the database table, as the field name in the table is derived from the structure. This
change requires a table conversion, as the existing data in the table must be copied to a new
table with the new field name, and the old table must be deleted.
B: Changing the field labels of a data element that is used in the table definition does not cause
an indirect change to the database table, as the field labels are only used for documentation
and display purposes. This change does not require a table conversion, as the existing data in
the table is not affected by the change.
C: Deleting a field from a structure that is included in the table definition causes an indirect
change to the database table, as the field is removed from the table as well. This change
requires a table conversion, as the existing data in the table must be copied to a new table
without the deleted field, and the old table must be deleted.
D: Shortening the length of a domain used in a data element that is used in the table definition
causes an indirect change to the database table, as the field length in the table is derived from
the domain. This change requires a table conversion, as the existing data in the table must be
checked for compatibility with the new field length, and any data that exceeds the new length
must be truncated or rejected.
Reference: Converting Database Tables - ABAP Keyword Documentation, Adjustment of
Database Structures - ABAP Keyword Documentation
13. What are valid statements? Note: There are 2 correct answers to this question.
A. ##NEEDED is checked by the syntax checker.
B. The pragma is not checked by the syntax checker.
C. #EC_NEEDED is not checked by the syntax checker.
D. The pseudo-comment is checked by the syntax checker
Answer: AC
Explanation:
Both statements are valid in ABAP, but they have different effects on the program.
##NEEDED is a pragma that can be used to hide warnings from the ABAP compiler syntax
check. It tells the check tools that a variable or a parameter is needed for further processing,
even if it is not used in the current statement. For example, if you declare a variable without
assigning any value to it, you can use ##NEEDED to suppress the warning about unused
variables12.
The pragma is not checked by the syntax checker means that you can use any pragma to hide
any warning from the ABAP compiler syntax check, regardless of its effect on the program logic
or performance. For example, if you use ##SHADOW to hide a warning about an obscured
function, you can also use it to hide a warning about an invalid character in a string12. You
cannot do any of the following:
#EC_NEEDED is not checked by the syntax checker: This is not a valid statement in ABAP.
There is no pseudo-comment with #EC_NEEDED in ABAP3.
The pseudo-comment is checked by the syntax checker: This is false. Pseudo-comments are
obsolete and should no longer be used in ABAP. They were replaced by pragmas since SAP
NW 7.0 EhP2 (Enhancement Package)4.
Reference: 1: Pragmas - ABAP Keyword Documentation - SAP Online Help 2: [What are
pragmas and
pseudo comments in ABAP? | SAP Blogs - SAP Community] 3: ABAP Keyword Documentation
- SAP
Online Help 4: What are PRAGMAS and Pseudo comments in SAP ABAP
14. In an Access Control Object, which clauses are used? Note: There are 3 correct answers to
this question.
A. Where (to specify the access conditions)
B. Crant (to identify the data source)
C. Return code (to assign the return code of the authority check)
D. Define role (to specify the role name)
E. Revoke (to remove access to the data source)
Answer: A, D, E
Explanation:
An Access Control Object (ACO) is a CDS annotation that defines the access control rules for a
CDS view entity. An ACO consists of one or more clauses that specify the role name, the data
source, the access conditions, and the return code of the authority check12.
Some of the clauses that are used in an ACO are:
Where (to specify the access conditions): This clause is used to define the logical expression
that
determines whether a user has access to the data source or not. The expression can use the
fields of
the data source, the parameters of the CDS view entity, or the predefined variables $user and
$session. The expression can also use the functions check_authorization and check_role to
perform
additional authority checks12.
Define role (to specify the role name): This clause is used to assign a name to the role that is
defined by the ACO. The role name must be unique within the namespace of the CDS view
entity and must not contain any special characters. The role name can be used to reference the
ACO in other annotations, such as @AccessControl.authorizationCheck or
@AccessControl.grant12.
Revoke (to remove access to the data source): This clause is used to explicitly deny access to
the data source for a user who meets the conditions of the where clause. The revoke clause
overrides any grant clause that might grant access to the same user. The revoke clause can be
used to implement the principle of least privilege or to enforce data segregation12.
You cannot do any of the following:
Grant (to identify the data source): This is not a valid clause in an ACO. The grant clause is a
separate annotation that is used to grant access to a CDS view entity or a data source for a
user who has a specific role. The grant clause can reference an ACO by its role name to apply
the access conditions defined by the ACO12.
Return code (to assign the return code of the authority check): This is not a valid clause in an
ACO. The return code of the authority check is a predefined variable that is set by the system
after performing the access control check. The return code can be used in the where clause of
the ACO to specify different access conditions based on the outcome of the check12.
Reference: 1: Access Control Objects - ABAP Keyword Documentation - SAP Online Help 2:
Access Control in Core Data Services (CDS) | SAP Help Portal