C Abapd Certeed
C Abapd Certeed
Provider!
Exam : C_ABAPD_2309
Version : V12.03
1 / 59
The safer , easier way to help you pass any IT exams.
2. In which products must you use the ABAP Cloud Development Model? Note: There are 2
correct answers to this question.
[Link]
abap-development-tools-for-eclipse/ba-p/13558622#:~:text=The%20ABAP%20cloud
%20development%20model%20is%20available%20and%20mandatory%20for,is
%20recommended%2C%20but%20not%20mandatory.
A. SAP S/4HANA Cloud, private edition
B. SAP BTP, ABAP environment
C. SAP S/4HANA on premise
D. SAP S/4HANA Cloud, public edition
Answer: BA
Explanation:
The ABAP Cloud Development Model is designed for environments that are managed and updated by
SAP, which typically means cloud environments. The correct answers where this development model
must be used are:
SAP BTP, ABAP environment - SAP Business Technology Platform (BTP), ABAP environment (also
known as Steampunk), which is SAP’s PaaS (Platform as a Service) offering, requires the use of the
ABAP Cloud Development Model.
SAP S/4HANA Cloud, public edition - The public edition of SAP S/4HANA Cloud is a SaaS (Software as
a Service) offering that is fully managed by SAP, and it requires the use of the ABAP Cloud
Development Model.
3. Which RESTful Application Programming object can be used to organize the display of
fields in an app?
Building an ABAP RESTful Application
A. Data model view
2 / 59
The safer , easier way to help you pass any IT exams.
B. Metadata extension
C. Service definition
D. Projection view
3 / 59
The safer , easier way to help you pass any IT exams.
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
When accessing the subclass instance through go_super, what can you do? Note: There are 2
correct answers to this question.
A. Access the inherited private components.
B. Access the inherited public components.
C. Call a subclass specific public method
D. Call inherited public redefined methods.
Answer: BD ok
Explanation:
In object-oriented programming (OOP), particularly in ABAP OOP, when you have a reference to a
superclass and you're working with an instance of a subclass, here's what you can do:
Access the inherited public components - This is correct. You can always access public components of
the superclass through a reference to the superclass, even if the actual object is an instance of a
subclass.
Call inherited public redefined methods - This is also correct. If the subclass has redefined a method that
was public in the superclass, and you call this method through a reference of the superclass type, the
redefined version in the subclass will be executed. This is known as polymorphism.
5. Given the following code in an SAP S/4HANA Cloud private edition tenant:
4 / 59
The safer , easier way to help you pass any IT exams.
The class zcl_demo_class is in a software component with the language version set to "ABAP Cloud".
The function module ZF1' is in a different software component with the language version set to "Standard
ABAP". Both the class and function module are customer created.
Regarding line #6, which of the following are valid statements? Note: There are 2 correct answers to this
question.
[Link]
[Link]
A. ZF1' can be called only if it is released for cloud development.
B. 'ZF1' can be called if a wrapper is created for it and the wrapper itself is released
for cloud development.
C. "ZF1" can be called whether it is released or not for cloud development
D. ZF1" can be called if a wrapper is created for it but the wrapper itself is not released for cloud
development.
Answer: AB
Explanation:
The ABAP Cloud Development Model requires that only public SAP APIs and extension points are used
to access SAP functionality and data. These APIs and extension points are released by SAP and
documented in the SAP API Business Hub1. Customer-created function modules are not part of the
public SAP APIs and are not released for cloud development. Therefore, calling a function module
directly from an ABAP Cloud class is not allowed and will result in a syntax error. However, there are
two possible ways to call a function module indirectly from an ABAP Cloud class:
Create a wrapper class or interface for the function module and release it for cloud development. A
wrapper is a class or interface that encapsulates the function module and exposes its functionality
through public methods or attributes. The wrapper must be created in a software component with the
language version set to “Standard ABAP” and must be marked as released for cloud development using
the annotation @[Link]. The wrapper can then be called from an ABAP Cloud class using
the public methods or attributes2.
Use the ABAP Cloud Connector to call the function module as a remote function call (RFC) from an
ABAP Cloud class. The ABAP Cloud Connector is a service that enables the secure and reliable
communication between SAP BTP, ABAP environment and on-premise systems. The function
module must be exposed as an RFC-enabled function module in the on-premise system and must be
registered in the ABAP Cloud Connector. The ABAP Cloud class can then use the class
cl_rfc_destination_service to get the destination name and the class cl_abap_system to create a
proxy object for the function module. The proxy object can then be used to call the function
module3.
Reference: 1: SAP API Business Hub 2: Creating an ABAP Cloud Project | SAP Help Portal 3: Calling
Remote Function Modules | SAP Help Portal
5 / 59
The safer , easier way to help you pass any IT exams.
6. 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
7 / 59
The safer , easier way to help you pass any IT exams.
#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
8 / 59
The safer , easier way to help you pass any IT exams.
SQL JOIN operations are typically evaluated based on the sequence they are written in the query, from
top to bottom. Given the structure of the SQL statement in the exhibit and standard SQL evaluation rules,
here is the logical evaluation of the joins:
From the left to the right in the order of the tables:
a is joined with b
The result of a JOIN b is then joined with c
This is the correct sequence because the ON clauses define how the joins should be processed. The
first ON clause associates table c with b, and the second ON clause associates table b with a. The LEFT
OUTER JOIN operation indicates that all records from the left table (a, and then b in the first join) are
returned, along with the matched records from the right table (b, and then c in the second join). If there is
no match, the result is NULL on the side of the table where there is no match.
10. Which extensibility type does SAP recommend you use to enhance the existing UI for an
SAP Fiori app?
A. Key user
B. Classic
C. Side-by-side
D. Developer
Answer: D
ok
E. Explanati
on:
SAP recommends different extensibility types for enhancing the UI of an SAP Fiori app based on the
specific needs and the environment in which the app is running. Among the provided options:
Key user - This type of extensibility is typically recommended for business users or key users who need
to make layout changes or adaptations without writing code. It uses in-app extensibility tools.
Classic - This term is not commonly used in the context of SAP Fiori extensibility. It may refer to more
traditional methods of customization within the SAP GUI environment, not Fiori.
Side-by-side - This is recommended when you want to extend the functionality of an SAP Fiori app
without modifying the backend SAP S/4HANA system. Extensions are built on SAP BTP
(Business Technology Platform) and integrate with the existing app.
Developer - This extensibility is for developers who need to create more complex enhancements that
require coding. It might involve both backend and frontend development and is often done in the
development system with a subsequent transport to the production system.
11. Image:
In the following ABAP SQL code, what are valid case distinctions? Note: There are 2 correct answers
to this question.
9 / 59
The safer , easier way to help you pass any IT exams.
[Link]
abensql_expr_searched_case_abexa.htm
10 / 59
The safer , easier way to help you pass any IT exams.
A)
11 / 59
The safer , easier way to help you pass any IT exams.
A. Option A
B. Option B
C. Option C
D. Option D
Answer: BD
Explanation:
12. What are some features of a unique secondary key? Note: There are 2 correct answers to this
question.
[Link]
A. It is created when a table is filled.
B. It is updated when the modified table is read again.
C. It is created with the first read access of a table.
12 / 59
The safer , easier way to help you pass any IT exams.
Given the following Core Data Services View Entity Data Definition,
1 @[Link]: #NOT_REQUIRED
2 DEFINE VIEW ENTITY demo_cds_data_source_matrix
3 AS SELECT FROM
4 <source>
5 {
6 KEY field_1,
7 field_2,
8 field_3
9 }
Which of the following types are permitted to be used for <source> on line #4? Note: There are 2
correct answers to this question.
A. A database table from the ABAP Dictionary
B. A CDS DDIC-based view
C. An external view from the ABAP Dictionary
D. A database view from the ABAP Dictionary
Answer: AB ok
Explanation:
13 / 59
The safer , easier way to help you pass any IT exams.
The <source> clause in the CDS View Entity Data Definition can be used to specify the data source for
the view entity. The <source> clause can accept different types of data sources, depending on the
type of the view entity1.
A database table from the ABAP Dictionary: This is a valid type of data source for a CDS View Entity
Data Definition. A database table from the ABAP Dictionary is a table that is defined in the ABAP
Dictionary using the keyword TABLE or TABLE OF. The name of the database table must be unique
within its namespace and must not contain any special characters2.
A CDS DDIC-based view: This is also a valid type of data source for a CDS View Entity Data Definition.
A CDS DDIC-based view is a view that is defined in the Core Data Services using the keyword DEFINE
VIEW ENTITY. The name of the CDS DDIC-based view must be unique within its namespace and
must not contain any special characters3.
You cannot do any of the following:
An external view from the ABAP Dictionary: This is not a valid type of data source for a CDS View Entity
Data Definition. An external view from the ABAP Dictionary is a view that is defined in an
external application using any language supported by SAP, such as SQL, PL/SQL, or Java. The name of
the external view must be unique within its namespace and must not contain any special characters4.
A database view from the ABAP Dictionary: This is not a valid type of data source for a CDS View Entity
Data Definition. A database view from the ABAP Dictionary is a view that is defined in an external
application using any language supported by SAP, such as SQL, PL/SQL, or Java. The name of the
database view must be unique within its namespace and must not contain any special characters4.
Reference: 1: CDS DDL - DEFINE VIEW ENTITY - ABAP Keyword Documentation - SAP Online Help
2: ABAP Dictionary Tables - SAP Online Help 3: CDS DDL - DEFINE VIEW ENTITY - ABAP Keyword
Documentation - SAP Online Help 4: ABAP Dictionary Views - SAP Online Help
14. When processing a loop with the statement DO... ENDDO, what system variable contains the
implicit loop counter?
A. sy-linno
B. sy-tabix
C. sy-subrc
D. sy-index
Answer: D
ok
Explanation:
When processing a loop with the statement DO… ENDDO, the system variable that contains the implicit
loop counter is sy-index. The loop counter is a numeric value that indicates how many times the loop has
been executed. The loop counter is initialized to 1 before the first execution of the loop and is
incremented by 1 after each execution. The loop counter can be used to control the number of loop
iterations or to access the loop elements by index. The loop counter can also be accessed or modified
within the loop body, but this is not recommended as it may cause unexpected results or errors1.
For example, the following code snippet uses the loop counter sy-index to display the numbers from 1 to
10:
DO 10 TIMES. WRITE: / sy-index. ENDDO.
The output of this code is:
12345678910
Reference: 1: DO - ABAP Keyword Documentation
14 / 59
The safer , easier way to help you pass any IT exams.
15. Which patterns raise an exception? Note: There are 3 correct answers to this question.
[Link]
and-compute/ba-p/13011526
A. DATA: gv_target TYPE p DECIMALS 2.
CONSTANTS: go_int1 TYPE i VALUE 3.
gv_target = EXACT (2 / go_int1).
B. DATA: gv_target TYPE string.
CONSTANTS: gco_string TYPE c LENGTH 16 VALUE ‘0123456789ABCDEF’.
gv_target = EXACT # (gco_string+5 (5) ).
C. DATA: gv_target TYPE c LENGTH 5.
CONSTANTS: gco_string TYPE string VALUE “0123456789ABCDEF”.
gv_target = EXACT (gco_string + 5 (6) ).
D. DATA: Ev target TYPE p DECIMALS 3.
CONSTANTS: gco_int TYPE i VALUE 2.
Ev_target = EXACT #( 2 / gco_int ).
E. DATA: gv_target TYPE d.
CONSTANTS: gco_date TYPE d VALUE '20331233’.
gv_target = EXACT#( gco_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
15 / 59
The safer , easier way to help you pass any IT exams.
A. field1
B. field3
C. field4
D. field2
Answer: C
Explanation:
The field4 is defined incorrectly in the ABAP code snippet. The reason is that the data type c (character)
cannot have a decimal places specification. The decimal places specification is only valid for the data
types p (packed number) and f (floating point number)1. Therefore, the field4 definition should either omit
the decimal places specification or change the data type to p or f.
Explanation:
Reference: 1: Data Types and Data Objects - ABAP Keyword Documentation - SAP Online Help
16 / 59
The safer , easier way to help you pass any IT exams.
The class zcl_demo_class is in a software component with the language version set to "Standard
ABAP". The function module "ZF11 is in a software component with the language version set to "ABAP
Cloud".
Both the class and function module are customer created. Regarding line #6, which of
the following is a valid statement?
A. 'ZF1' can be called whether it has been released or not for cloud development.
B. 'ZF1' can be called via a wrapper that itself has been released for cloud development.
C. 'ZF1' can be called via a wrapper that itself has not been released for cloud development.
D. 'ZF1' must be released for cloud development to be called.
Answer: B
Explanation:
The function module ZF1 is in a software component with the language version set to “ABAP Cloud”.
This means that it follows the ABAP Cloud Development Model, which requires the usage of public SAP
APIs and extension points to access SAP functionality and data. These APIs and extension points are
released by SAP and documented in the SAP API Business Hub1. Customer-created function modules
are not part of the public SAP APIs and are not released for cloud development. Therefore, calling a
function module directly from a class with the language version set to “Standard ABAP” is not allowed
and will result in a syntax error. However, there is a possible way to call a function module indirectly
from a class with the language version set to “Standard ABAP”:
Create a wrapper class or interface for the function module and release it for cloud development. A
wrapper is a class or interface that encapsulates the function module and exposes its functionality
through public methods or attributes. The wrapper must be created in a software component with the
language version set to “ABAP Cloud” and must be marked as released for cloud development using the
annotation @[Link]. The wrapper can then be called from a class with the language version
set to “Standard ABAP” using the public methods or attributes2.
For example, the following code snippet shows how to create a wrapper class for the function module
ZF1 and call it from the class zcl_demo_class:
@[Link]: ‘Wrapper for ZF1’ CLASS zcl_wrapper_zf1 DEFINITION PUBLIC FINAL CREATE
PUBLIC. PUBLIC SECTION. CLASS-METHODS: call_zf1 IMPORTING iv_a TYPE i iv_b TYPE i
EXPORTING ev_result TYPE i. ENDCLASS.
CLASS zcl_wrapper_zf1 IMPLEMENTATION. METHOD call_zf1. CALL FUNCTION ‘ZF1’ EXPORTING a
17 / 59
The safer , easier way to help you pass any IT exams.
18. Which of the following are features of Core Data Services? Note: There are 3 correct answers
to this question.
A. Inheritance
B. Associations
C. Annotations
D. Delegation
E. Structured Query Language (SQL)
Answer: BCE
Explanation:
Core Data Services (CDS) is a framework for defining and consuming semantically rich data models in
SAP HANA. CDS supports various features that enhance the capabilities of SQL and enable developers
to create data models that are optimized for performance, readability, and extensibility12. Some of the
features of CDS are:
Associations: Associations are a way of defining relationships between CDS entities, such as tables or
views. Associations enable navigation and path expressions in CDS queries, which allow accessing data
from related entities without explicit joins. Associations also support cardinality, referential consstraints,
and cascading options34.
Annotations: Annotations are a way of adding metadata to CDS entities or their elements, such as fields
or parameters. Annotations provide additional information or instructions for the CDS compiler, the
database, or the consumers of the CDS views. Annotations can be used for various purposes, such as
defining access control, UI rendering, OData exposure, or search capabilities5 . Structured Query
Language (SQL): SQL is the standard language for querying and manipulating data in relational
databases. CDS is based on SQL and extends it with additional features and syntax. CDS supports SQL
features such as joins, aggregations, filters, expressions, functions, and subqueries. CDS also supports
SQL Script, which is a scripting language for stored procedures and functions in SAP HANA .
You cannot do any of the following:
Inheritance: Inheritance is not a feature of CDS. Inheritance is a concept in object-oriented programming
that allows a class to inherit the properties and methods of another class. CDS does not support object-
oriented programming or classes.
Delegation: Delegation is not a feature of CDS. Delegation is a concept in object-oriented programming
that allows an object to delegate some of its responsibilities to another object. CDS does not support
object-oriented programming or objects.
Reference: 1: Core Data Services (CDS) | CAPire 2: Core Data Services [CDS] in SAP S/4 HANA | SAP
Blogs 3: Associations in Core Data Services (CDS) | SAP Help Portal 4: [CDS DDL - Association -
ABAP Keyword Documentation - SAP Online Help] 5: [Annotations in Core Data Services (CDS) | SAP
Help Portal] : [CDS DDL - Annotation - ABAP Keyword Documentation - SAP Online Help] : [Structured
Query Language (SQL) | SAP Help Portal] : [CDS DDL - SQL Features - ABAP Keyword Documentation
18 / 59
The safer , easier way to help you pass any IT exams.
-
SAP Online Help] : [Object-Oriented Programming in ABAP | SAP Help Portal]
19. What is the purpose of a foreign key relationship between two tables in the ABAP Dictionary?
[Link]
no_cache=true
A. To document the relationship between the two tables
B. To ensure the integrity of data in the corresponding database tables
C. To create a corresponding foreign key relationship in the database
Answer: B
Explanation:
The purpose of a foreign key relationship between two tables in the ABAP Dictionary is to ensure the
integrity of data in the corresponding database tables. A foreign key relationship defines a logical link
between a foreign key table and a check table, where the foreign key fields of the former are assigned to
the primary key fields of the latter. This means that the values entered in the foreign key fields must exist
in the check table, otherwise the system will reject the entry. This way, the foreign key relationship
prevents the insertion of invalid or inconsistent data in the database tables.
A foreign key relationship also serves to document the relationship between the two tables in the ABAP
Dictionary, but this is not its primary purpose. A foreign key relationship does not necessarily create a
corresponding foreign key relationship in the database, as this depends on the database system and the
settings of the ABAP Dictionary. Some database systems do not support foreign keys at all, while others
require additional steps to activate them. Therefore, the foreign key relationship in the ABAP Dictionary is
mainly a logical concept that is enforced by the ABAP runtime environment.
Reference: Foreign Keys (SAP Library - ABAP Dictionary), Foreign Keys (SAP Library - BC - ABAP
Dictionary)
[Link]
20. When does SAP recommend to use a sorted or a hashed table respectively? Note: There
are 2 correct answers to this question.
A. A hashed table, when you read a single record and specify the complete key.
B. A hashed table, when you read a subset in a loop and specify a part of the key from the left without
gaps.
C. A sorted table, when you read a subset in a loop and specify a part of the key from the left
without gaps.
D. A sorted table, when you read a single record and specify non key fields.
Answer: B, C
Explanation:
SAP recommends using different types of internal tables based on the operation and access pattern to
optimize performance:
A hashed table, when you read a single record and specify the complete key - This is correct. Hashed
tables are optimized for single-record access where the entire key is specified. They offer the fastest
access time for such operations because the hash algorithm computes the storage location of the record
directly from the key.
A sorted table, when you read a subset in a loop and specify a part of the key from the left without gaps -
This is correct. Sorted tables are optimized for binary search when part of the key is specified, as long as
it is from the leftmost part of the key and without gaps.
19 / 59
The safer , easier way to help you pass any IT exams.
22. 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. Grant (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 ok
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 @[Link] or @AccessControl.grant12.
Revoke (to remove access to the data source): This clause is used to explicitly deny access to the data
20 / 59
The safer , easier way to help you pass any IT exams.
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
23. What are some of the reasons that Core Data Services are preferable to the classical
approach to data modeling? Note: There are 2 correct answers to this question.
A. They implement code pushdown.
B. They avoid data transfer completely.
C. They transfer computational results to the application server.
D. They compute results on the application server.
Answer: A, C ok
Explanation:
Core Data Services (CDS) are preferable to the classical approach to data modeling for several reasons,
but two of them are:
They implement code pushdown. Code pushdown is the principle of moving data-intensive logic from the
application server to the database server, where the data resides. This reduces the data transfer
between the application server and the database server, which improves the performance and scalability
of the application. CDS enable code pushdown by allowing the definition of semantic data models and
business logic in the database layer, using SQL and SQL-based expressions1.
They transfer computational results to the application server. CDS allow the application server to access
the data and the logic defined in the database layer by using Open SQL statements. Open SQL is a
standardized and simplified subset of SQL that can be used across different database platforms. Open
SQL statements are translated into native SQL statements by the ABAP runtime environment and
executed on the database server. The results of the computation are then transferred to the application
server, where they can be further processed or displayed2.
Reference: 1: ABAP - Core Data Services (ABAP CDS) - ABAP Keyword Documentation 2: Open SQL -
ABAP Keyword Documentation
21 / 59
The safer , easier way to help you pass any IT exams.
24. Exhibit:
Which of the following statements are correct? Note: There are 2 correct answers to this question.
22 / 59
The safer , easier way to help you pass any IT exams.
25. Which of the following ABAP SQL statements are valid? Note: There are 2 correct answers
to this question.
A. SELECT FROM /dmo/connection
FIELDS carrid, airpfrom,
MAX(distance) AS dist_max,
MIN( distance) AS dist_min
GROUP BY carrid, airpfrom
INTO TABLE @DATA(It_hits)
B. SELECT FROM /dmo/connection
FIELDS carrid, airpfrom,
MAX( distance) AS dist_max,
MIN(distance) AS dist_min
INTO TABLE @DATA(It_hits)
C. SELECT FROM /dmo/connection
FIELDS
MAX(distance) AS dist_max
MIN(distance) AS dist_min
INTO TABLE @DATA(It_hits).
D. SELECT FROM /dmo/connection
FIELDS carrid, airpfrom
23 / 59
The safer , easier way to help you pass any IT exams.
GROUP BY carrid, connid
INTO TABLE @DATA(It_hits).
Answer: AC
Explanation:
In ABAP SQL, to write valid SELECT statements that aggregate data and use GROUP BY clauses, you
need to follow the syntax rules for SELECT statements, including the proper use of GROUP BY and
aggregate functions. Analyzing the options given:
This statement is using FIELDS followed by a group of fields and aggregate functions (MAX and MIN),
and then uses GROUP BY for the non-aggregate fields. This syntax is generally correct for ABAP SQL
as long as the fields listed in the GROUP BY clause match the non-aggregated fields in the SELECT list.
24 / 59
The safer , easier way to help you pass any IT exams.
This statement seems to contain typos or incorrect characters ("/ O" and "/ O"), making it invalid syntax.
This statement appears to be missing a comma between the aggregate function calls for MAX and MIN.
Otherwise, it might be valid if properly formatted with the right fields and a proper GROUP BY clause.
This statement has a mix of characters that do not form a valid ABAP SQL statement ("r—i" seems to
be a typo or formatting error).
Based on standard ABAP SQL syntax, the valid SELECT statements from the options provided,
assuming the proper correction of typos and formatting, would likely be:
SELECT FROM /dmo/connection FIELDS carrid, airpfrom, MAX(distance) AS dist_max, MIN(distance)
AS dist_min GROUP BY carrid, airpfrom INTO TABLE @DATA(It_hits)
With the correct syntax and assuming no other typos or context-specific issues, option A would be a valid
statement. However, because of the potential for typographical errors in the other options, it is difficult to
definitively choose a second valid statement without further clarification or correction. If option C had a
comma added between the aggregate functions, it could be considered a potentially valid statement:
SELECT FROM /dmo/connection FIELDS MAX(distance) AS dist_max, MIN(distance) AS dist_min INTO
TABLE @DATA(It_hits).
26. In ABAP SQL, which of the following retrieves the association field _Airline-Name of a CDS view?
[Link]
expressions_daff758b-a544-4613-9a6e-aa1a2df73a33
A. \_Airline-Name
B. /_Airline Name
C. @_Airline-Name
D. *_Airline Name
Answer: C
Explanation:
In ABAP SQL, the syntax to retrieve the association field of a CDS view is to use the @ sign followed by
the association name and the field name, separated by a period sign (.). For example, to retrieve the
association field _Airline-Name of a CDS view, the syntax is @_Airline.Name. This syntax allows the
access to the fields of the target data source of the association without explicitly joining the data
sources1. The other options are incorrect because they use the wrong symbols or formats to access the
association field.
Reference: 1: Path Expressions - ABAP Keyword Documentation
25 / 59
The safer , easier way to help you pass any IT exams.
What are valid statements? Note: There are 2 correct answers to this question.
A. "zcx1" is a dictionary structure, and "param1" and "param2" are this structure.
B. "param1” 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
26 / 59
The safer , easier way to help you pass any IT exams.
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
28. What RESTful Application Programming object contains only the fields required for a particular
app?
A. Database view
B. Metadata extension
C. Projection View
D. Data model view
Answer: C ok
Explanation:
A projection view is a RESTful Application Programming object that contains only the fields required for a
particular app. A projection view is a CDS view entity that defines a projection on an existing CDS view
entity or CDS DDIC-based view. A projection view exposes a subset of the elements of the projected
entity, which are relevant for a specific business service. A projection view can also define aliases, virtual
elements, and annotations for the projected elements. A projection view is the top-most layer of a CDS
data model and prepares data for a particular use case. A projection view can have different provider
contracts depending on the type of service it supports, such as transactional query, analytical query, or
transactional interface.
A database view is a CDS DDIC-based view that defines a join or union of database tables. A database
view has an SQL view attached and can be accessed by Open SQL or native SQL. A database view
can be used as a projected entity for a projection view, but it does not contain only the fields required for
a
27 / 59
The safer , easier way to help you pass any IT exams.
particular app.
A metadata extension is a RESTful Application Programming object that defines additional annotations
for a CDS view entity or a projection view. A metadata extension can be used to enhance the metadata
of a CDS data model without changing the original definition. A metadata extension does not contain
any fields, but only annotations.
A data model view is a CDS view entity that defines a data model based on database tables or other
CDS view entities. A data model view can have associations, aggregations, filters, parameters, and
annotations. A data model view can be used as a projected entity for a projection view, but it does
not contain only the fields required for a particular app.
Reference: CDS Projection Views - ABAP Keyword Documentation, CDS Projection Views in ABAP
CDS: What’s Your Flavor, Business Object Projection - ABAP Keyword Documentation
29. In a RESTful Application Programming application, in which objects do you bind a CDS view
to create a value help? Note: There are 3 correct answers to this question.
A. Data model view
B. Behavior definition
C. Metadata Extension
D. Service Definition
E. Projection
View
F. Answer: ACE
Explanation:
In a RESTful Application Programming (RAP) application, you can bind a CDS view to create a value
help in the following objects:
Data model view: A data model view is a CDS view that defines the data structure and the associations
of an entity in the RAP application. You can use the annotation @[Link] to
bind a value help provider CDS view to an element of the data model view. The value help provider CDS
view must contain the key fields of the value help entity and the fields that are displayed in the value help
dialog. The value help annotation specifies the entity name, the element name, and optionally the
additional binding conditions for the value help provider1.
Metadata Extension: A metadata extension is a CDS view that extends the metadata of another CDS
view without changing its data structure. You can use the annotation @[Link]
to specify the target CDS view that you want to extend. You can then use the same annotation
@[Link] to bind a value help provider CDS view to an element of the target
CDS view. The metadata extension allows you to add value help definitions to existing CDS views
without modifying them2.
Projection View: A projection view is a CDS view that defines the projection of another CDS view. You
can use the annotation @[Link]: #PROJECTION to specify that the CDS view is a
projection view. You can then use the same annotation @[Link] to bind a
value help provider CDS view to an element of the projection view. The projection view allows you to add
value help definitions to projected elements of another CDS view3.
You cannot bind a value help provider CDS view to a behavior definition or a service definition, because
these objects do not define the data structure or the metadata of an entity in the RAP application. A
behavior definition defines the behavior and the validation rules of an entity, such as the create, read,
update, and delete (CRUD) operations, the draft handling, the authorization checks, and the side
28 / 59
The safer , easier way to help you pass any IT exams.
effects4. A service definition defines the service exposure and the service binding of an entity, such as
the protocol, the version, the namespace, and the service name5.
Reference: 1: Value Help with Additional Binding | SAP Help Portal 2: Metadata Extensions - ABAP
Keyword Documentation 3: Projection Views - ABAP Keyword Documentation 4: Behavior Definition -
ABAP Keyword Documentation 5: Service Definition - ABAP Keyword Documentation
30. What are advantages of using a field symbol for internal table row access? Note: There are 2
correct answers to this question.
A. The field symbol can be reused for other programs.
B. A MODIFY statement to write changed contents back to the table is not required.
C. The row content is copied to the field symbol instead to a work area
D. Using a field symbol is faster than using a work area.
Answer: B, D ok
Explanation:
A field symbol is a pointer that allows direct access to a row of an internal table without copying it to a
work area. Using a field symbol for internal table row access has some advantages over using a work
area, such as12:
A MODIFY statement to write changed contents back to the table is not required: This is true. When you
use a work area, you have to copy the row content from the internal table to the work area, modify it, and
then copy it back to the internal table using the MODIFY statement. This can be costly in terms of
performance and memory consumption. When you use a field symbol, you can modify the row content
directly in the internal table without any copying. Therefore, you do not need the MODIFY statement12.
Using a field symbol is faster than using a work area: This is true. As explained above, using a field
symbol avoids the overhead of copying data between the internal table and the work area. This can
improve the performance of the loop considerably, especially for large internal tables. According to some
benchmarks, using a field symbol can save 25–40% of the runtime compared to using a work area12.
You cannot do any of the following:
The field symbol can be reused for other programs: This is false. A field symbol is a local variable that is
only visible within the scope of its declaration. It cannot be reused for other programs unless it is
declared globally or passed as a parameter. Moreover, a field symbol must have the same type as the
line type of the internal table that it accesses. Therefore, it cannot be used for any internal table with a
different line type12.
The row content is copied to the field symbol instead to a work area: This is false. As explained above,
using a field symbol does not copy the row content to the field symbol. Instead, the field symbol points to
the memory address of the row in the internal table and allows direct access to it. Therefore, there is no
copying involved when using a field symbol12.
Reference: 1: Using Field Symbols to Process Internal Tables - SAP Learning 2: Access to Internal
Tables - ABAP Keyword Documentation - SAP Online Help
31. In what order are objects created to generate a RESTful Application Programming application?
A) Database table 1
B) Service binding 5
C) Projection view 3
D) Service definition 4
E) Data model view 2
ok
29 / 59
The safer , easier way to help you pass any IT exams.
A. DABC
B. BDCA
C. ADCB
D. CBAB
Answer: C
Explanation:
The order in which objects are created to generate a RESTful Application Programming application is A,
D, C, B.
This means that the following steps are followed:
First, a database table is created to store the data for the application. A database table is a CDS
DDIC- based view that defines a join or union of database tables. A database table has an SQL view
attached and can be accessed by Open SQL or native SQL.
Second, a data model view is created to define a data model based on the database table or other CDS
view entities. A data model view is a CDS view entity that can have associations, aggregations, filters,
parameters, and annotations. A data model view can also define the behavior definition and
implementation for the business object.
Third, a service definition is created to define the service interface for the application. A service definition
is a CDS view entity that defines a projection on a data model view or another service definition. A
service definition can also define service metadata, such as service name, version, description, and
annotations.
Fourth, a service binding is created to define the service binding for the application. A service binding is
a CDS view entity that defines a projection on a service definition. A service binding can also define the
service protocol, such as OData V2, OData V4, or REST, and the service URL.
Reference: CDS Data Model Views - ABAP Keyword Documentation, CDS Service Definitions - ABAP
Keyword Documentation, CDS Service Bindings - ABAP Keyword Documentation, CDS Projection Views
- ABAP Keyword Documentation
31 / 59
The safer , easier way to help you pass any IT exams.
34. 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
32 / 59
The safer , easier way to help you pass any IT exams.
35. Which of the following are parts of the definition of a new database table?
Note: There are 2 correct answers to this question.
A. Partitioning attributes
B. Extension
C. Field list
D. Semantic table attributes
Answer: BC
Explanation:
A CDS view is a data definition that defines a data structure and a data selection from one or more data
sources.
A CDS view consists of several parts, but two of them are:
Extension: An extension is an optional clause that allows a CDS view to extend another CDS view by
adding new elements, annotations, or associations. The extension clause has the syntax EXTEND
VIEW view_name WITH view_name. The first view_name is the name of the CDS view that is being
extended, and the second view_name is the name of the CDS view that is doing the extension1. Field
list: A field list is a mandatory clause that specifies the elements of the CDS view. The field list has the
syntax SELECT FROM data_source { element_list }. The data_source is the name of the data source
that the CDS view selects data from, and the element_list is a comma-separated list of elements that the
CDS view exposes. The elements can be fields of the data source, expressions, associations, or
annotations2.
The following example shows a CDS view that extends another CDS view and defines a field list:
@[Link]: ‘ZCDS_EXT’ define view Z_CDS_Extension extend view Z_CDS_Base
with Z_CDS_Extension as select from ztable { // field list key [Link] as ID, [Link] as Name,
[Link] as Age, // extension @[Link]: true [Link] as Currency } The other
options are not parts of a CDS view, but rather related concepts:
Partitioning attributes: Partitioning attributes are attributes that are used to partition a table into smaller
subsets of data. Partitioning attributes are defined in the ABAP Dictionary for transparent tables and can
improve the performance and scalability of data access. Partitioning attributes are not part of the CDS
view definition, but rather the underlying table definition3.
Semantic table attributes: Semantic table attributes are attributes that provide additional information
about the meaning and usage of a table. Semantic table attributes are defined in the ABAP Dictionary
for transparent tables and can be used to enhance the data modeling and consumption of the table.
Semantic table attributes are not part of the CDS view definition, but rather the underlying table
33 / 59
The safer , easier way to help you pass any IT exams.
definition4.
Reference: 1: Extending CDS Views | SAP Help Portal 2: SELECT List - ABAP Keyword
Documentation 3: Partitioning Attributes - ABAP Keyword Documentation 4: Semantic Table Attributes -
ABAP Keyword Documentation
36. What are some properties of database tables? Note: There are 2 correct answers to this question.
A. They store information in two dimensions.
B. They may have key fields.
C. They can have any number of key fields.
D. They can have relationships to other tables.
Answer: AD ok
Explanation:
Database tables are data structures that store information in two dimensions, using rows and columns.
Each row represents a record or an entity, and each column represents an attribute or a field. Database
tables may have key fields, which are columns that uniquely identify each row or a subset of rows. Key
fields can be used to enforce data integrity, perform efficient searches, and establish relationships to
other tables. Database tables can have relationships to other tables, which are associations or links
between the key fields of two or more tables. Relationships can be used to model the logical connections
between different entities, join data from multiple tables, and enforce referential integrity12.
Reference: 1: Table (database) - Wikipedia 2: Database design basics - Microsoft Support
37. 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
34 / 59
The safer , easier way to help you pass any IT exams.
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
38. Why would you use Access Controls with CDS Views? Note: There are 2 correct answers
to this question.
A. Only the data corresponding to the user's authorization is transferred from the
database to the application layer.
B. The system field sy-subrc is set, giving you the result of the authorization check
C. You do not have to remember to implement AUTHORITY CHECK statements.
D. All of the data from the data sources is loaded into your application automatically and filtered there
according to the user's authorization.
Answer: A, C
Explanation:
You would use Access Controls with CDS Views for the following reasons:
A) Only the data corresponding to the user’s authorization is transferred from the database to the
application layer. This is true because Access Controls allow you to define CDS roles that specify the
authorization conditions for accessing a CDS view. The CDS roles are evaluated for every user at
runtime and the system automatically adds the restrictions to the selection conditions of the CDS view.
This ensures that only the data that the user is authorized to see is read from the database and
transferred to the application layer. This improves the security and the performance of the data
access1.
C) You do not have to remember to implement AUTHORITY CHECK statements. This is true because
Access Controls provide a declarative and centralized way of defining the authorization logic for a CDS
view. You do not have to write any procedural code or use the AUTHORITY CHECK statement to check
the user’s authorization for each data source or field. The system handles the authorization check
automatically and transparently for you2.
The following reasons are not valid for using Access Controls with CDS Views:
B) The system field sy-subrc is set, giving you the result of the authorization check. This is false
because the system field sy-subrc is not used by Access Controls. The sy-subrc field is used by the
AUTHORITY CHECK statement to indicate the result of the authorization check, but Access Controls
do not use this statement. Instead, Access Controls use CDS roles to filter the data according to the
user’s authorization2.
D) All of the data from the data sources is loaded into your application automatically and filtered there
according to the user’s authorization. This is false because Access Controls do not load all the data from
the data sources into the application layer. Access Controls filter the data at the database
layer, where the data resides, and only transfer the data that the user is authorized to see to the
application layer. This reduces the data transfer and the memory consumption of the application layer1.
35 / 59
The safer , easier way to help you pass any IT exams.
Reference: 1: Access Controls | SAP Help Portal 2: ABAP CDS - Access Control - ABAP Keyword
Documentation
39. Which ABAP SQL clause allows the use of inline declarations?
A. FROM
B. INTO CORRESPONDING FIELDS OF
C. INTO
D. FIELDS
Answer: C ok
Explanation:
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.
Reference: 1: SELECT - ABAP Keyword Documentation - SAP Online Help 2: Inline Declarations - ABAP
Keyword Documentation - SAP Online Help
40. 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.
A. The name of a type defined privately in class ZCL_CLASS_A
B. The name of a data element from the ABAP Dictionary
C. The name of a type defined privately in another class
D. The name of a domain from the ABAP Dictionary
Answer: AB
Explanation:
In an ABAP class, the DATA statement is used to declare a variable with a specific data type. The
possible types that can be used in place of *** in the DATA statement are:
36 / 59
The safer , easier way to help you pass any IT exams.
The name of a type defined privately in class ZCL_CLASS_A - This is correct. Within a class, you can
declare variables using types that are defined within the same class, whether they are defined publicly or
privately.
The name of a data element from the ABAP Dictionary - This is also correct. Data elements defined
in the ABAP Dictionary are global types that can be used in any ABAP program, including classes, to
declare variables.
41. Which of the following integration frameworks have been released for ABAP cloud
development? Note: There are 3 correct answers to this question.
A. SOAP consumption
B. CDS Views
C. Business Add-ins (BAdls)
D. Business Events
E. OData
services
Answer: A, D, E
ok
Explanation:
The following are the integration frameworks that have been released for ABAP cloud development:
SOAP consumption: This framework allows you to consume SOAP web services from ABAP cloud
applications. You can use the ABAP Development Tools in Eclipse to create a service consumption
model based on a WSDL file or URL. The service consumption model generates the required ABAP
artifacts, such as proxy classes, data types, and constants, to access the web service. You can then
use the proxy classes to call the web service operations from your ABAP code1
Business Events: This framework allows you to publish and subscribe to business events from ABAP
cloud applications. Business events are messages that represent a change in the state of a business
object or process. You can use the ABAP Development Tools in Eclipse to create a business event
definition based on a CDS view entity or a projection view. The business event definition specifies the
event key, the event payload, and the event metadata. You can then use the ABAP Messaging Channel
(AMC) framework to publish and subscribe to business events using the AMC API2
OData services: This framework allows you to expose and consume OData services from ABAP cloud
applications. OData is a standardized protocol for creating and consuming RESTful APIs. You can use
the ABAP RESTful Application Programming Model (RAP) to create OData services based on CDS
view entities or projection views. The RAP framework generates the required OData metadata and
runtime artifacts, such as service definitions, service bindings, and service implementations. You can
then use the SAP Gateway framework to register and activate your OData services. You can also use
the ABAP Development Tools in Eclipse to consume OData services from other sources using the
service consumption model3
The other integration frameworks are not released for ABAP cloud development, as they are either not
supported or not recommended for cloud scenarios.
These frameworks are:
CDS Views: CDS views are not an integration framework, but a data modeling framework. CDS views
are used to define data models based on database tables or other CDS view entities. CDS views can
have associations, aggregations, filters, parameters, and annotations. CDS views can also be used as
the basis for other integration frameworks, such as OData services or business events4
37 / 59
The safer , easier way to help you pass any IT exams.
Business Add-ins (BAdls): BAdls are not supported for ABAP cloud development, as they are part of the
38 / 59
The safer , easier way to help you pass any IT exams.
classic ABAP enhancement framework. BAdls are used to implement custom logic in predefined
enhancement spots in the standard SAP code. BAdls are not compatible with the cloud strategy and the
clean core paradigm, as they modify the SAP code and can cause upgrade and maintenance issues. For
ABAP cloud development, SAP recommends using the key user extensibility tools or the side-by-side
extensibility approach instead of BAdls.
Reference: Consuming SOAP Services - ABAP Keyword Documentation, Business Events - ABAP
Keyword Documentation, OData Services - ABAP Keyword Documentation, CDS Data Model Views -
ABAP Keyword Documentation, [Business Add-Ins (BAdIs) - ABAP Keyword Documentation]
42. When processing an internal table with the statement LOOP AT itab... ENDLOOP, what
system variable contains the current row number?
A. sy-index
B. sy-subrc
C. sy-linno
D. sy-tabix
Answer: D
Explanation:
When processing an internal table with the statement LOOP AT itab… ENDLOOP, the system variable
that contains the current row number is sy-tabix. The sy-tabix variable is a predefined field of the system
structure sy that holds the index or the row number of the current line in an internal table loop. The sy-
tabix variable is initialized with the value 1 for the first loop pass and is incremented by 1 for each
subsequent loop pass. The sy-tabix variable can be used to access or modify the current line of the
internal table using the index access12.
Reference: 1: LOOP AT itab - ABAP Keyword Documentation - SAP Online Help 2: System Fields -
ABAP Keyword Documentation - SAP Online Help
43. For what kind of applications would you consider using on-stack developer extensions?
Note: There are 2 correct answers to this question.
A. Applications that provide APIs for side by side SAP BTP apps
B. Applications that access SAP S/4HANA data using complex SQL
C. Applications that integrate data from several different systems
D. Applications that run separate from SAP S/4HANA
Answer: BA ok
Explanation:
On-stack developer extensions are used when you need to extend the capabilities of an existing system
with tightly integrated custom code that runs in the same environment as the core system. Here are the
applications for which you would consider using on-stack developer extensions:
Applications that access SAP S/4HANA data using complex SQL - On-stack extensions are suitable for
scenarios that require complex SQL queries executed within the same environment as the core SAP
S/4HANA system.
Applications that integrate data from several different systems - If the integration logic needs to be
closely coupled with the SAP S/4HANA system and potentially involves complex data processing that
benefits from the high-performance capabilities of being on-stack, then on-stack extensions would be
appropriate.
39 / 59
The safer , easier way to help you pass any IT exams.
1 @[Link]: #NOT_REQUIERED
2 DEFINE VIEW ENTITY demo_sales_cds_so_i_ve
3 AS SELECT FROM demo_sales_so_i
4 ASSOCIATION TO PARENT demo_sales_cds_so_ve AS _SalesOrder
5 ON $projection.parent_key = _SlesOrder.so_kry
6 COMPOSITION [0..*] of demo_sales_cds_i_sl_ve AS _ScheduleLine
7 ASSOCIATION [0..1] TO demo_sales_cds_material_ve AS _Material
8 ON $[Link] = _Material.material
9 {
10
11 KEY so_item_key,
12 parent_key,
13 posnr,
14
15 _SalesOrder,
16 _ScheduleLine,
17 _Material.material as mat
18 }
Using ABAP SQL, which select statement selects the mat field on line #17?
A. SELECT mat FROM Material...
B. SELECT mat FROM demo_sales_cds_so_i_ve...
C. SELECT mat FROM demo_sales_so_i...
D. SELECT mat FROM demo sales cds material ve...
Answer: B
Explanation:
Using ABAP SQL, the select statement that selects the mat field on line #17 is:
SELECT mat FROM demo_sales_cds_so_i_ve…
This statement selects the mat field from the CDS view demo_sales_cds_so_i_ve, which is defined on
line #1. The CDS view demo_sales_cds_so_i_ve is a projection view that projects the fields of the
CDS view demo_sales_cds_so_i, which is defined on line #2. The CDS view demo_sales_cds_so_i is a
join view that joins the fields of the database table demo_sales_so_i, which is defined on line #3, and
the CDS view demo_sales_cds_material_ve, which is defined on line #4. The CDS view
demo_sales_cds_material_ve is a value help view that provides value help for the material field of
the database table demo_sales_so_i. The mat field is an alias for the material field of the database
table demo_sales_so_i, which is defined on line #91.
The other options are not valid because:
A) SELECT mat FROM Material… is not valid because Material is not a valid data source in the given
code. There is no CDS view or database table named Material.
C) SELECT mat FROM demo_sales_so_i… is not valid because demo_sales_so_i is not a valid data
source in the given code. There is no CDS view named demo_sales_so_i, only a database table. To
access a database table, the keyword TABLE must be used, such as SELECT mat FROM TABLE
demo_sales_so_i…
D) SELECT mat FROM demo sales cds material ve… is not valid because demo sales cds material ve is
40 / 59
The safer , easier way to help you pass any IT exams.
not a valid data source in the given code. There is no CDS view or database table named demo sales
cds material ve. The correct name of the CDS view is demo_sales_cds_material_ve, with underscores
instead of spaces.
Reference: 1: Projection Views - ABAP Keyword Documentation
41 / 59
The safer , easier way to help you pass any IT exams.
with which predicate condition can you ensure that the CAST will work?
A. IS SUPPLIED
B. IS NOT INITIAL
C. IS INSTANCE OF
D. IS BOUND
Answer: C ok
Explanation:
The predicate condition that can be used to ensure that the CAST will work is IS INSTANCE OF. The IS
INSTANCE OF predicate condition checks whether the operand is an instance of the specified class or
interface. This is useful when you want to perform a downcast, which is a conversion from a more
general type to a more specific type. A downcast can fail if the operand is not an instance of the target
type, and this can cause a runtime error. Therefore, you can use the IS INSTANCE OF predicate
condition to check whether the downcast is possible before using the CAST operator12. For example:
The following code snippet uses the IS INSTANCE OF predicate condition to check whether the
variable g_super is an instance of the class lcl_super. If it is, the CAST will work and the variable
g_sub1 will be assigned the value of g_super.
DATA: g_super TYPE REF TO lcl_super, g_sub1 TYPE REF TO lcl_sub1. IF g_super IS INSTANCE
OF lcl_super. g_sub1 = CAST #( g_super ). g_sub1->method( … ). ENDIF. You cannot do any of the
following:
IS SUPPLIED: The IS SUPPLIED predicate condition checks whether an optional parameter of a method
or a function module has been supplied by the caller. This is useful when you want to handle different
cases depending on whether the parameter has a value or not. However, this predicate condition has
nothing to do with the CAST operator or the type of the operand12.
IS NOT INITIAL: The IS NOT INITIAL predicate condition checks whether the operand has a non-initial
value. This is useful when you want to check whether the operand has been assigned a value or not.
However, this predicate condition does not guarantee that the CAST will work, because the operand may
have a value but not be an instance of the target type12.
IS BOUND: The IS BOUND predicate condition checks whether the operand is a bound reference
variable. This is useful when you want to check whether the operand points to an existing object or not.
However, this predicate condition does not guarantee that the CAST will work, because the operand may
point to an object but not be an instance of the target type12.
Reference: 1: Predicate Expressions - ABAP Keyword Documentation - SAP Online Help 2: ABAP -
Predicates | SAP Community
46. In ABAP SQL, which of the following can be assigned an alias? Note: There are 2 correct
answers to this question.
A. order criterion (from order by clause)
B. field (from field list)
C. database table
D. group criterion (from group by clause)
Answer: BC ok
Explanation:
In ABAP SQL, an alias is a temporary name that can be assigned to a field or a database table in a
query. An alias can be used to make the query more readable, to avoid name conflicts, or to access
42 / 59
The safer , easier way to help you pass any IT exams.
fields or tables with long names. An alias is created with the AS keyword and is only valid for the duration
of the query1.
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.
The alias name can be used instead of carrname in other clauses of the query, such as WHERE,
GROUP BY, ORDER BY, and so on2.
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 [Link], [Link] FROM scarr AS c.
The alias c can be used instead of scarr in other clauses of the query, such as WHERE, JOIN, GROUP
BY, ORDER BY, and so on3.
The following are not valid for assigning an alias in ABAP SQL:
A) order criterion (from order by clause): An order criterion is a field or an expression that is used to sort
the result set of a query in ascending or descending order. An order criterion cannot be assigned an
alias in the ORDER BY clause of a SELECT statement, because the alias is not visible in this clause.
The alias can only be used in the clauses that follow the clause where it is defined1.
D) group criterion (from group by clause): A group criterion is a field or an expression that is used to
group the result set of a query into subsets that share the same values. A group criterion cannot be
assigned an alias in the GROUP BY clause of a SELECT statement, because the alias is not visible in
this clause. The alias can only be used in the clauses that follow the clause where it is defined1.
Reference: 1: ALIASES - ABAP Keyword Documentation 2: SELECT List - ABAP Keyword
Documentation 3: FROM Clause - ABAP Keyword Documentation
43 / 59
The safer , easier way to help you pass any IT exams.
/DMO/I_Connection has the following components: carrid, connid, airpfrom, airpto, distance, and fltime.
Therefore, the variable connection_full has the same components as the CDS view entity
/DMO/I_Connection, and each component has the same data type and length as the corresponding field
in the database table /DMO/Connection.
Reference: CDS Data Model Views - ABAP Keyword Documentation, DATA - ABAP Keyword
Documentation, Structure Types - ABAP Keyword Documentation
48. Exhibit.
1 @[Link]: #NOT_REQUIRED
2 DEFINE VIEW ENTITY demo_cds_param_view_entity
3 WITH PARAMETERS
4 p_date : [Link]
5 AS SELECT FROM
6 sflight
7 {
8 KEY carrid,
9 KEY connid,
10 KEY fldate,
11 price,
12 seatsmax,
13 seatsocc,
14 }
15 WHERE fldate >- $parameters.p_date;
Which of the following ABAP SQL snippets are syntactically correct ways to provide a value for
the parameter on line #4? Note: There are 2 correct answers to this question
A. _SELECT * FROM demo_cds_param_view_entity (p_date = @( cl_abap_context_info=>get_system( )
)..
B. _SELECT * FROM demo_cds_param_view_entity (p_date = '20230101')_
C. _SELECT * FROM demo_cds_param_view_entity (p_date: 20230101')_
D. _SELECT * FROM demo_cds_param_view entity (p_date: $session.system_date)_
Answer: AC
Explanation:
49. Which of the following are valid sort operations for internal tables? Note: There are 3 correct
answers to this question.
A. Sort a standard table using
SORT itab ASCENDING.
B. Sort a sorted table using
SORT itab BY fieldl ASCENDING field2 DESCENDING.
[Link] a standard table using
SORT itab BY field1 field2.
[Link] a standard table using
SORT itab.
44 / 59
The safer , easier way to help you pass any IT exams.
[Link] a sorted table using
SORT itab DESCENDING.
Answer: A,E, D
Explanation:
50. You want to provide a short description of the data definition for developers that will be attached to
the database view
1 @[Link]: #NOT_REQUIRED
2 ?
3 DEFINE VIEW ENTITY demo_sales_cds_so_ve_simple
4 AS SELECTE FROM deme_sales_order AS SalesOrder
5 {
6 KEY so_key,
7 buyer_id AS BuyerID,
8 currency_sum AS currencySum
9 }
Which of the following annotations would do this if you inserted it on line #2?
45 / 59
The safer , easier way to help you pass any IT exams.
A. @[Link]
B. @[Link]
C. @[Link]
D. @[Link]
Answer: D
Explanation:
The annotation that can be used to provide a short description of the data definition for developers that
will be attached to the database view is the @[Link] annotation. This annotation is used to
specify a text label for the data definition that can be displayed in the development tools or in the
documentation. The annotation can be inserted on line #27 in the code snippet provided in the
question12. For example:
The following code snippet uses the @[Link] annotation to provide a short description of the
data definition for the CDS view ZCDS_VIEW:
@[Link]: ‘ZCDS_VIEW’ @[Link]: true
@[Link]: true @[Link]: #CHECK @[Link]:
‘CDS view for flight data’ "short description for developers define view ZCDS_VIEW as select from sflight
{ key carrid, key connid, key fldate, seatsmax, seatsocc } You cannot do any of the following:
@[Link]: This annotation is used to specify a text label for the description field
of the header information of a UI element. This annotation is not relevant for the data definition of a
database view12.
@[Link]: This annotation is used to specify a text label for the title field of a badge UI
element. This annotation is not relevant for the data definition of a database view12.
@[Link]: This annotation is used to specify a quick information text for the data
definition that can be displayed as a tooltip in the development tools or in the documentation. This
annotation is not the same as a short description or a label for the data definition12.
Reference: 1: ABAP CDS - SAP Annotations - ABAP Keyword Documentation - SAP Online
Help 2: ABAP CDS - Data Definitions - ABAP Keyword Documentation - SAP Online Help
51. 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:
46 / 59
The safer , easier way to help you pass any IT exams.
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
52. As a consultant you are posed the following question from a client who is using SAP S/4HANA Cloud,
public edition and also SAP BTP, ABAP environment.
"We are currently using an SAP Fiori app based on SAP Fiori elements that analyzes open orders. We
have determined that it should be extended via a new button on the UI which will perform an on-the-fly
calculation and display the result in a quick popup for the enduser. We have been informed by SAP that
all underlying stack layers for the SAP Fiori app have been extensibility enabled."
Based on this which of the following extension types would you recommend to the customer to add
the new button?
A. RAP BO Behavior Extension
B. SAP HANA database table extension
C. RAP BO Node Extension
D. Business Service Extension
Answer: C
47 / 59
The safer , easier way to help you pass any IT exams.
The "demo_ods_assoc_spfi data source referenced in line #4 contains a field "connid" which you would
like to expose in the element list.
Which of the following statements would do this if inserted on line #8?
A. demo_cds_assoc_spfli.connid,
B. demo_cds_assoc_spfli-connid/
C. spfli-connid,
D. _spfli.connid,
Answer: C
Explanation:
In ABAP Core Data Services (CDS), when you define a CDS view with associations to other CDS views
or tables, you reference fields from the associated view or table by using the alias provided for the
association.
Given the CDS view definition in the exhibit, the demo_cds_assoc_spfli data source is aliased as _spfli.
To expose the "connid" field from this data source in the element list, you would use the alias followed by
the field name.
The correct statement to insert on line #8 to expose the "connid" field would be:
C. spfli-connid,
This follows the ABAP CDS view syntax where you reference fields from an association by using the
alias of the association followed by a hyphen and then the field name. The correct syntax does not use a
period or a slash after the alias, and it should not use the original data source name when an alias has
been defined.
48 / 59
The safer , easier way to help you pass any IT exams.
STANDARD TABLE - This is considered a generic internal table type. It does not have any inherent
sorting or unique key constraints, making it the most generic form of internal tables in ABAP.
49 / 59
The safer , easier way to help you pass any IT exams.
DECIMALS 2.
Answer: B, C
Explanation:
The data declarations that will always work without truncation or rounding for the assignment gv_target =
gv_source are B and C. This is because the target data type string is a variable-length character type
that can hold any character string, including those of data types c (fixed-length character) and d (date).
The assignment of a character or date value to a string variable will not cause any loss of information or
precision, as the string variable will adjust its length to match the source value12.
You cannot do any of the following:
A) DATA gv_source TYPE string, to DATA gv_target TYPE c.: This data declaration may cause
truncation for the assignment gv_target = gv_source. This is because the target data type c is a fixed-
length character type that has a predefined length. If the source value of type string is longer than the
target length of type c, the source value will be truncated on the right to fit the target length12.
D) DATA gv_source TYPE p LENGTH 8 DECIMALS 3. to DATA gv_target TYPE p LENGTH 16
DECIMALS 2.: This data declaration may cause rounding for the assignment gv_target = gv_source.
This is because the target data type p is a packed decimal type that has a predefined length and number
of decimal places. If the source value of type p has more decimal places than the target type p, the
source value will be rounded to the target number of decimal places12.
Reference: 1: ABAP Data Types - ABAP Keyword Documentation - SAP Online Help 2: ABAP
Assignment Rules - ABAP Keyword Documentation - SAP Online Help
To adhere to the most recent ABAP SQL syntax conventions from SAP, on which line must you insert
the "INTO TABLE @gt flights" clause to complete the SQL statement?
A. #15
B. #4
C. #6
D. #8
Answer: B
50 / 59
The safer , easier way to help you pass any IT exams.
Explanation:
To adhere to the most recent ABAP SQL syntax conventions from SAP, you must insert the “INTO
TABLE @gt flights” clause on line #4 to complete the SQL statement. This is because the INTO or
APPENDING clause should be specified immediately after the SELECT clause, according to the ABAP
SQL syntax conventions1. The INTO or APPENDING clause defines the data object to which the results
set of the SELECT statement is assigned. The data object can be an internal table, a work area, or an
inline declaration. In this case, the data object is an internal table named gt_flights, which is created
using the inline declaration operator @DATA. The inline declaration operator allows you to declare and
create a data object in the same statement where it is used, without the need for a separate DATA
statement2.
The other lines are not suitable for inserting the “INTO TABLE @gt flights” clause, as they would violate
the ABAP SQL syntax conventions or cause syntax errors. These lines are:
51 / 59
The safer , easier way to help you pass any IT exams.
#6: This line is not suitable for inserting the “INTO TABLE @gt flights” clause, as it would cause a syntax
error. This is because the FROM clause must be specified before the INTO or APPENDING clause,
according to the ABAP SQL syntax conventions1. The FROM clause defines the data sources from
which the data is read, such as database tables, CDS view entities, or CDS DDIC-based views. In this
case, the data source is the database table flights.
#8: This line is not suitable for inserting the “INTO TABLE @gt flights” clause, as it would cause a syntax
error. This is because the ORDER BY clause must be specified after the INTO or APPENDING clause,
according to the ABAP SQL syntax conventions1. The ORDER BY clause defines the sort order of the
results set of the SELECT statement. In this case, the results set is sorted by the fields carrid, connid,
and fltime.
#15: This line is not suitable for inserting the “INTO TABLE @gt flights” clause, as it would violate the
ABAP SQL syntax conventions. This is because the INTO or APPENDING clause should be specified as
close as possible to the SELECT clause, according to the ABAP SQL syntax conventions1. The INTO or
APPENDING clause should not be separated from the SELECT clause by other clauses, such as the
WHERE clause, the GROUP BY clause, the HAVING clause, the UNION clause, or the ORDER BY
clause. This is to improve the readability and maintainability of the ABAP SQL statement.
Reference: SELECT - ABAP Keyword Documentation, Inline Declarations - ABAP Keyword
Documentation
52 / 59
The safer , easier way to help you pass any IT exams.
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 [Link] 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.
Reference: 1: ON Condition - ABAP Keyword Documentation
59. You want to define the following CDS view entity with an input
parameter: Define view entity Z_CONVERT With parameters currency: ???
Which of the following can you use to replace "???? Note: There are 2 correct answers to this question.
A. built-in ABAP type
B. A built-in ABAP Dictionary type
C. A data element
D. A component of an ABAP Dictionary structure
Answer: CA
Explanation:
The possible replacements for “???” in the CDS view entity definition with an input parameter are A.
built-in ABAP type and C. A data element. These are the valid types that can be used to specify the
data type of an input parameter in a CDS view entity. A built-in ABAP type is a predefined elementary
type in the ABAP language, such as [Link], [Link], [Link], etc. A data element is a
reusable semantic element in the ABAP Dictionary that defines the technical attributes and the meaning
of a field12. For example:
The following code snippet defines a CDS view entity with an input parameter currency of type
[Link], which is a built-in ABAP type for currency key:
Define view entity Z_CONVERT With parameters currency: [Link] as select from … { … } The
following code snippet defines a CDS view entity with an input parameter currency of type waers, which
is a data element for currency key:
Define view entity Z_CONVERT With parameters currency: waers as select from … { … }
You cannot do any of the following:
B) A built-in ABAP Dictionary type: This is not a valid type for an input parameter in a CDS view entity.
A built-in ABAP Dictionary type is a predefined elementary type in the ABAP Dictionary, such as CHAR,
NUMC, DEC, etc. However, these types cannot be used directly in a CDS view entity definition.
Instead, they have to be prefixed with abap. to form a built-in ABAP type, as explained above12.
53 / 59
The safer , easier way to help you pass any IT exams.
D) A component of an ABAP Dictionary structure: This is not a valid type for an input parameter in a
CDS view entity. A component of an ABAP Dictionary structure is a field that belongs to a structure type,
which is a complex type that consists of multiple fields. However, an input parameter in a CDS view
entity can only be typed with an elementary type, which is a simple type that has no internal structure12.
Reference: 1: ABAP CDS - SELECT, parameter_list - ABAP Keyword Documentation - SAP Online Help
2: ABAP Data Types - ABAP Keyword Documentation - SAP Online Help
60. In the assignment, data (gv_result) = 1/8. what will be the data type of gv_result?
A. TYPE I
B. TYPE DEFLOAT 16
C. TYPE P DECIMALS 3
D. TYPE P DECIMALS 2
Answer: B
Explanation:
In ABAP, when you perfor
m an assignment like data (gv_result) = 1/8, without explicitly specifying the data type of gv_result, the
system will infer the data type based on the context of the assignment.
In this case, 1/8 is a fractional number, and ABAP would typically infer the data type to be a floating-point
type to accommodate the fractional part. Since no specific data type is mentioned, ABAP would choose
a data type that can handle fractional numbers and typically defaults to a floating-point type.
ABAP does not have a data type called DEFLOAT 16 (option B seems to be a typo), and the TYPE I
(option A) is an integer type and would not be chosen for a fractional result as it cannot store decimal
places.
The correct inferred type would be a packed number with decimals, but since ABAP defaults to 2 decimal
places, the closest correct answer would be:
D. TYPE P DECIMALS 2
This means that gv_result will be a packed number with space for two decimal places, which is sufficient
to store the result of 1/8 without any rounding.
61. What RESTful Application Programming feature is used to ensure the uniqueness of a semantic key?
A. Validation
B. Action
C. Determination
Answer: C
Explanation:
In RESTful Application Programming (RAP) within the SAP context, validation is the feature used to
ensure data integrity constraints like the uniqueness of a semantic key. During the validation phase,
checks are performed to ensure that data modifications adhere to defined business rules, which would
include the uniqueness of certain key fields.
62. Which of the following are incomplete ABAP types? Note: There are 2 correct answers
to this question.
A. String
B. T
54 / 59
The safer , easier way to help you pass any IT exams.
C. C
55 / 59
The safer , easier way to help you pass any IT exams.
D. P
Answer: BD
Explanation:
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.
Reference: 1: Generic ABAP Types - ABAP Keyword Documentation 2: C - ABAP Keyword
Documentation 3: P - ABAP Keyword Documentation 4: String - ABAP Keyword Documentation : T -
ABAP Keyword Documentation
63. Setting a field to read-only in which object would make the field read-only in all
applications of the RESTful Application Programming model?
A. Service definition
B. Behaviour definition
C. Projection view
D. Metadata extension
Answer: B ok
Explanation:
The object that can be used to set a field to read-only in all applications of the RESTful Application
Programming model (RAP) is the behaviour definition. The behaviour definition is a CDS artefact that
defines the business logic and the UI behaviour of a business object. A business object is a CDS entity
that represents a business entity or concept, such as a customer, an order, or a product. The behaviour
definition can specify the properties of the fields of a business object, such as whether they are
mandatory, read-only, or transient. These properties are valid for all applications that use the business
object, such as transactional, analytical, or draft-enabled apps12.
For example:
The following code snippet defines a behaviour definition for a business object ZI_PB_APPLICATION.
56 / 59
The safer , easier way to help you pass any IT exams.
It sets the field APPLICATION to read-only for all applications that use this business object:
define behavior for ZI_PB_APPLICATION { field ( read only ) APPLICATION; … }
You cannot do any of the following:
A) Service definition: A service definition is a CDS artefact that defines the interface and the binding of a
service. A service is a CDS entity that exposes the data and the functionality of one or more business
objects as OData, InA, or SQL services. A service definition can specify the properties of the fields of a
service, such as whether they are filterable, sortable, or aggregatable. However, these properties are
only valid for the specific service that uses the business object, not for all applications that use the
business object12.
C) Projection view: A projection view is a CDS artefact that defines a view on one or more data sources,
such as tables, views, or associations. A projection view can select, rename, or aggregate the fields of
the data sources, but it cannot change the properties of the fields, such as whether they are read-only or
not. The properties of the fields are inherited from the data sources or the behaviour definitions of the
business objects12.
D) Metadata extension: A metadata extension is a CDS artefact that defines additional annotations for a
CDS entity, such as a business object, a service, or a projection view. A metadata extension can specify
the properties of the fields of a CDS entity for UI or analytical purposes, such as whether they are visible,
editable, or hidden. However, these properties are only valid for the specific UI or analytical application
that uses the metadata extension, not for all applications that use the CDS entity12.
Reference: 1: ABAP CDS - Data Definitions - ABAP Keyword Documentation - SAP Online Help 2:
ABAP CDS - Behavior Definitions - ABAP Keyword Documentation - SAP Online Help
65. Which of the following results in faster access to internal tables? Note: There are 3 correct answers to
this question.
A. In a sorted internal table, specifying the primary key partially from the left without gaps.
57 / 59
The safer , easier way to help you pass any IT exams.
B. In a sorted internal table, specifying the primary key completely.
C. In a standard internal table, specifying the primary key partially from the left without gaps.
D. In a hashed internal table, specifying the primary key partially from the left without gaps.
E. In a hashed internal table, specifying the primary key completely.
Answer: DBE
Explanation:
When accessing internal tables in ABAP, certain types of tables and methods of specifying keys can
lead to faster data retrieval:
In a sorted internal table, specifying the primary key partially from the left without gaps - This is correct.
Sorted tables are organized according to the key, and partial key access from the left without gaps
allows for efficient binary searches.
In a sorted internal table, specifying the primary key completely - This is also correct. When the entire
key is specified for a sorted table, the system can quickly locate the record using a binary search.
In a hashed internal table, specifying the primary key completely - This is correct. Hashed tables provide
the fastest access when the entire primary key is specified, as the hash algorithm used will directly
access the storage location of the record.
66. Exhibit:
What are valid statements? Note: There are 3 correct answers to this question.
A. go_if1 may call method m1 with go_if1-> m1(…).
B. Instead of go_cl1 = NEW #(...) you could use go if1 = NEW cl1(…).
C. go_cl1 may call method m1 with go_cl1->if1~m1(…).
D. Instead of go_cl1 = NEW #(…) you could use go_if1 = NEW #(…).
E. go_if1 may call method m2 with go if->m2(…).
Answer: ABE
Explanation:
Based on the exhibit and standard ABAP object-oriented programming concepts, let's evaluate each
statement:
go_if1 may call method m1 with go_if1->m1(). - This is correct. go_if1 is typed as a reference to interface
if1, which contains the method m1. Hence, go_if1 can be used to call m1.
58 / 59
The safer , easier way to help you pass any IT exams.
Instead of go_cl1 = NEW #(…), you could use go_if1 = NEW cl1(…). - This is correct. Since cl1
implements interface if1, you can create an instance of cl1 and assign it to a variable typed with the
interface if1.
go_cl1 may call method m1 with go_cl1->if1~m1(). - This is correct. The syntax go_cl1->if1~m1() is used
to call an interface method implemented by a class in ABAP, and since cl1 implements if1, which has
method m1, this is valid.
What are valid statements? Note: There are 3 correct answers to this question
A. In class CL1, the interface method is named if1~m1.
B. Class CL2 uses the interface.
C. Class CL1 uses the interface.
D. In class CL2, the interface method is named if1~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
59 / 59
The safer , easier way to help you pass any IT exams.
68. 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,
upper(left( 'mr joe doe', 6)) AS f2_up_left, f3,
B. SELECT FROM TABLE dbtabl
FIELDS Of1,
left(lower(substring( 'mr joe doe', 4, 3)), 3) AS f2_left_lo_sub, f3,
C. SELECT FROM TABLE dbtabl FIELDS Of1,
substring(upper('mr joe doe'), 4, 3) AS f2_sub_up, f3,...
D. SELECT FROM TABLE dbtabl
FIELDS Of1,
substring(lower(upper( 'mr joe doe' ) ), 4, 3) AS f2_sub_lo_up, f3,
Answer: C
Explanation:
The correct expression to change a given string value ‘mr joe doe’ into ‘JOE’ in an ABAP SQL field list is
C. SELECT FROM TABLE dbtabl FIELDS Of1, substring(upper(‘mr joe doe’), 4, 3) AS f2_sub_up, f3,…
This expression uses the following SQL functions for strings12:
upper: This function converts all lowercase characters in a string to uppercase. For example, upper(‘mr
joe doe’) returns ‘MR JOE DOE’.
substring: This function returns a substring of a given string starting from a specified position and with a
specified length. For example, substring(‘MR JOE DOE’, 4, 3) returns ‘JOE’.
AS: This keyword assigns an alias or a temporary name to a field or an expression in the field list. For
example, AS f2_sub_up assigns the name f2_sub_up to the expression substring(upper(‘mr joe doe’), 4,
3).
You cannot do any of the following:
60 / 59
The safer , easier way to help you pass any IT exams.
A) SELECT FROM TABLE dbtabl FIELDS Of1, upper(left( ‘mr joe doe’, 6)) AS f2_up_left, f3,…: This
expression uses the wrong SQL function for strings to get the desired result. The left function returns
the leftmost characters of a string with a specified length, ignoring the trailing blanks. For example,
left( ‘mr joe doe’, 6) returns ‘mr joe’. Applying the upper function to this result returns ‘MR JOE’, which is
not the same as ‘JOE’.
B) SELECT FROM TABLE dbtabl FIELDS Of1, left(lower(substring( ‘mr joe doe’, 4, 3)), 3) AS
f2_left_lo_sub, f3,…: This expression uses unnecessary and incorrect SQL functions for strings to get
the desired result. The lower function converts all uppercase characters in a string to lowercase. For
example, lower(substring( ‘mr joe doe’, 4, 3)) returns ‘joe’. Applying the left function to this result with the
same length returns ‘joe’ again, which is not the same as ‘JOE’.
D) SELECT FROM TABLE dbtabl FIELDS Of1, substring(lower(upper( ‘mr joe doe’ ) ), 4, 3) AS
f2_sub_lo_up, f3,…: This expression uses unnecessary and incorrect SQL functions for strings to get
the desired result. The lower function converts all uppercase characters in a string to lowercase, and the
upper function converts all lowercase characters in a string to uppercase. Applying both functions to the
same string cancels out the effect of each other and returns the original string. For example,
lower(upper( ‘mr joe doe’ ) ) returns ‘mr joe doe’. Applying the substring function to this result returns
‘joe’, which is not the same as ‘JOE’.
Reference: 1: SQL Functions for Strings - ABAP Keyword Documentation - SAP Online Help 2: sql_func
- String Functions - ABAP Keyword Documentation - SAP Online Help
69. What are some characteristics of secondary keys for internal tables? Note: There are 3
correct answers to this question.
A. Secondary keys must be chosen explicitly when you actually read from an internal table.
B. Multiple secondary keys are allowed for any kind of internal table.
C. Hashed secondary keys do NOT have to be unique.
D. Sorted secondary keys do NOT have to be unique.
E. Secondary keys can only be created for standard tables.
Answer: A, B, D ok
Explanation:
Secondary keys are additional keys that can be defined for internal tables to optimize the access to the
table using fields that are not part of the primary key. Secondary keys can be either sorted or hashed,
depending on the table type and the uniqueness of the key. Secondary keys have the following
characteristics1:
A) Secondary keys must be chosen explicitly when you actually read from an internal table. This means
that when you use a READ TABLE or a LOOP AT statement to access an internal table, you have to
specify the secondary key that you want to use with the USING KEY addition. For example, the following
statement reads an internal table itab using a secondary key sec_key:
READ TABLE itab USING KEY sec_key INTO DATA(wa).
If you do not specify the secondary key, the system will use the primary key by default2.
B) Multiple secondary keys are allowed for any kind of internal table. This means that you can define
more than one secondary key for an internal table, regardless of the table type. For example, the
following statement defines an internal table itab with two secondary keys sec_key_1 and sec_key_2:
DATA itab TYPE SORTED TABLE OF ty_itab WITH NON-UNIQUE KEY sec_key_1 COMPONENTS
field1 field2 sec_key_2 COMPONENTS field3 field4.
61 / 59
The safer , easier way to help you pass any IT exams.
You can then choose which secondary key to use when you access the internal table1.
D) Sorted secondary keys do NOT have to be unique. This means that you can define a sorted
secondary key for an internal table that allows duplicate values for the key fields. A sorted secondary
key maintains a predefined sorting order for the internal table, which is defined by the key fields in the
order in which they are specified. For example, the following statement defines a sorted secondary key
sec_key for an internal table itab that sorts the table by field1 in ascending order and field2 in
descending order:
DATA itab TYPE STANDARD TABLE OF ty_itab WITH NON-UNIQUE SORTED KEY sec_key
COMPONENTS field1 ASCENDING field2 DESCENDING.
You can then access the internal table using the sorted secondary key with a binary search algorithm,
which is faster than a linear search3.
The following are not characteristics of secondary keys for internal tables, because:
C) Hashed secondary keys do NOT have to be unique. This is false because hashed secondary keys
must be unique. This means that you can only define a hashed secondary key for an internal table that
does not allow duplicate values for the key fields. A hashed secondary key does not have a predefined
sorting order for the internal table, but uses a hash algorithm to store and access the table rows. For
example, the following statement defines a hashed secondary key sec_key for an internal table itab that
hashes the table by field1 and field2:
DATA itab TYPE STANDARD TABLE OF ty_itab WITH UNIQUE HASHED KEY sec_key COMPONENTS
field1 field2.
You can then access the internal table using the hashed secondary key with a direct access algorithm,
which is very fast.
E) Secondary keys can only be created for standard tables. This is false because secondary keys can
be created for any kind of internal table, such as standard tables, sorted tables, and hashed tables.
However, the type of the secondary key depends on the type of the internal table. For example, a
standard table can have sorted or hashed secondary keys, a sorted table can have sorted secondary
keys, and a hashed table can have hashed secondary keys1.
Reference: 1: Secondary Table Key - ABAP Keyword Documentation 2: READ TABLE - ABAP Keyword
Documentation 3: Sorted Tables - ABAP Keyword Documentation : Hashed Tables - ABAP Keyword
Documentation
70. You have attached a system field to an input parameter of a CDS view entity as follows:
What are the effects of this annotation? Note: There are 2 correct answers to this question.
A. The value of sy-langu will be passed to the CDS view automatically both when you use the
CDS view in ABAP and in another CDS view entity (view on view).
B. You can still override the default value with a value of your own.
C. The value of sy-langu will be passed to the CDS view automatically when you use the CDS view in
ABAP but not when you use it in another view entity
D. It is no longer possible to pass your own value to the parameter.
Answer: A, B
Explanation:
62 / 59
The safer , easier way to help you pass any IT exams.
The annotation @[Link]: #LANGUAGE is used to assign the ABAP system field sy-
langu to an input parameter of a CDS view or a CDS table function. This enables the implicit parameter
63 / 59
The safer , easier way to help you pass any IT exams.
passing in Open SQL, which means that the value of sy-langu will be automatically passed to the CDS
view without explicitly specifying it in the WHERE clause. This also applies to the CDS views that use the
annotated CDS view as a data source, which means that the value of sy-langu will be propagated to the
nested CDS views (view on view)12.
For example:
The following code snippet defines a CDS view ZI_FLIGHT_TEXTS with an input parameter p_langu
that is annotated with @[Link]: #LANGUAGE:
define view ZI_FLIGHT_TEXTS with parameters p_langu : syst_langu @<[Link]:
#LANGUAGE as select from sflight left outer join scarr on [Link] = [Link] left outer join stext
on [Link] = [Link] { [Link], [Link], [Link], [Link], [Link] as
carrtext } where [Link] = :p_langu
The following code snippet shows how to use the CDS view ZI_FLIGHT_TEXTS in ABAP without
specifying the value of p_langu in the WHERE clause. The value of sy-langu will be automatically
passed to the CDS view:
SELECT carrid, connid, fldate, carrname, carrtext FROM zi_flight_texts INTO TABLE
@DATA(lt_flights). The following code snippet shows how to use the CDS view ZI_FLIGHT_TEXTS in
another CDS view ZI_FLIGHT_REPORT. The value of sy-langu will be automatically passed to the
nested CDS view ZI_FLIGHT_TEXTS:
define view ZI_FLIGHT_REPORT with parameters p_langu : syst_langu @<[Link]:
#LANGUAGE as select from zi_flight_texts(p_langu) { carrid, connid, fldate, carrname, carrtext, count(*)
as flight_count } group by carrid, connid, fldate, carrname, carrtext
The annotation @[Link]: #LANGUAGE does not prevent the possibility of overriding
the default value with a value of your own. You can still specify a different value for the input parameter
p_langu in the WHERE clause, either in ABAP or in another CDS view. This will override the value of
sy- langu and pass the specified value to the CDS view12. For example:
The following code snippet shows how to use the CDS view ZI_FLIGHT_TEXTS in ABAP with a
specified value of p_langu in the WHERE clause. The value ‘E’ will be passed to the CDS view instead
of the value of sy-langu:
SELECT carrid, connid, fldate, carrname, carrtext FROM zi_flight_texts WHERE p_langu = ‘E’ INTO
TABLE @DATA(lt_flights).
The following code snippet shows how to use the CDS view ZI_FLIGHT_TEXTS in another CDS view
ZI_FLIGHT_REPORT with a specified value of p_langu in the WHERE clause. The value ‘E’ will be
passed to the nested CDS view ZI_FLIGHT_TEXTS instead of the value of sy-langu:
define view ZI_FLIGHT_REPORT with parameters p_langu : syst_langu @<[Link]:
#LANGUAGE as select from zi_flight_texts(p_langu) { carrid, connid, fldate, carrname, carrtext, count(*)
as flight_count } where p_langu = ‘E’ group by carrid, connid, fldate, carrname, carrtext Explanation:
Reference: 1: ABAP CDS - parameter_annot - ABAP Keyword Documentation - SAP Online Help 2:
ABAP CDS - session_variable - ABAP Keyword Documentation - SAP Online Help
71. In RESTful Application Programming, a business object contains which parts? Note:
There are 2 correct answers to this question.
A. CDS view
B. Behavior definition
C. Authentication rules
64 / 59
The safer , easier way to help you pass any IT exams.
D. Process definition
Answer: A, B ok
Explanation:
In RESTful Application Programming, a business object contains two main parts: a CDS view and a
behavior definition1.
A) CDS view: A CDS view is a data definition that defines the structure and the data source of a
business object. A CDS view can consist of one or more entities that are linked by associations or
compositions. An entity is a CDS view element that represents a node or a projection of a business
object. An entity can have various annotations that define the metadata and the semantics of the
business object2.
B) Behavior definition: A behavior definition is a source code artifact that defines the behavior and the
validation rules of a business object. A behavior definition can specify the standard CRUD (create,
read, update, delete) operations, the draft handling, the authorization checks, and the side effects for a
business object. A behavior definition can also define custom actions, validations, and determinations
that implement the business logic of a business object3.
The following are not parts of a business object in RESTful Application Programming, because:
C) Authentication rules: Authentication rules are not part of a business object, but part of a service
binding. A service binding is a configuration artifact that defines how a business object is exposed as
an OData service. A service binding can specify the authentication method, the authorization scope,
the protocol version, and the service options for the OData service4.
D) Process definition: Process definition is not part of a business object, but part of a workflow. A
workflow is a business process that orchestrates the tasks and the events of a business object. A
workflow can be defined using the Workflow Editor in the SAP Business Application Studio or the SAP
Web IDE. A workflow can use the business object’s APIs to trigger or consume events, execute
actions, or read or update data5.
Reference: 1: Business Object | SAP Help Portal 2: CDS View Entities | SAP Help Portal 3: Behavior
Definition | SAP Help Portal 4: Service Binding | SAP Help Portal 5: Workflow | SAP Help Portal
65 / 59
The safer , easier way to help you pass any IT exams.
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
66 / 59
The safer , easier way to help you pass any IT exams.
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
67 / 59
The safer , easier way to help you pass any IT exams.
subclass is the one that needs to indicate that the component is redefined by adding the REDEFINITION
clause to the component declaration in the subclass.
Reference: 1: METHODS - REDEFINITION - ABAP Keyword Documentation - SAP Online Help 2:
Redefining Methods - ABAP Keyword Documentation - SAP Online Help
74. Exhibit:
With Icl_super being superclass for Icl_sub1 and Icl_sub2 and with methods sub1_meth1 and
sub2_meth1 being subclass-specific methods of lcl_sub1 or Icl_sub2, respectively
What will happen when executing these casts? Note: There are 2 correct answers to this question
A. go sub1 = CAST #( go super), will not work.
go_sub2 = CAST #( go super), will work.
68 / 59
The safer , easier way to help you pass any IT exams.
B: This statement is incorrect. go_sub2 = CAST #(go_super) will work. go_subl = CAST #(go_super) will
not work. This is because go_sub2 is a data object of type REF TO cl_sub2, which is a reference to the
subclass cl_sub2. go_super is a data object of type REF TO cl_super, which is a reference to the
superclass cl_super. The CAST operator is used to perform a downcast or an upcast of a reference
variable to another reference variable of a compatible type. A downcast is a conversion from a more
general type to a more specific type, while an upcast is a conversion from a more specific type to a more
general type. In this case, the CAST operator is trying to perform a downcast from go_super to go_sub2,
and this is possible, as go_super is pointing to an instance of cl_sub2, which is a subclass of cl_super.
Therefore, the CAST operator will assign the reference of go_super to go_sub2 without raising an
exception. However, the CAST operator will not work for go_subl, as explained in statement A12
C: This statement is incorrect. go_sub2 = CAST #(go_super) will work. go_sub2->sub2_meth1(…) will
not work. This is because go_sub2 is a data object of type REF TO cl_sub2, which is a reference to the
subclass cl_sub2. go_super is a data object of type REF TO cl_super, which is a reference to the
superclass cl_super. The CAST operator is used to perform a downcast or an upcast of a reference
69 / 59
The safer , easier way to help you pass any IT exams.
variable to another reference variable of a compatible type. A downcast is a conversion from a more
general type to a more specific type, while an upcast is a conversion from a more specific type to a more
general type. In this case, the CAST operator is trying to perform a downcast from go_super to go_sub2,
and this is possible, as go_super is pointing to an instance of cl_sub2, which is a subclass of cl_super.
Therefore, the CAST operator will assign the reference of go_super to go_sub2 without raising an
exception. However, the method call go_sub2->sub2_meth1(…) will not work, as sub2_meth1 is a
subclass-specific method of cl_sub2, which is not inherited by cl_super. Therefore, the method call
will raise an exception CX_SY_DYN_CALL_ILLEGAL_METHOD at runtime123
D: This statement is correct. go_subl->subl_meth1(…) will work. This is because go_subl is a data object
of type REF TO cl_subl, which is a reference to the subclass cl_subl. subl_meth1 is a subclass-specific
method of cl_subl, which is not inherited by cl_super. Therefore, the method call
go_subl->subl_meth1(…) will work, as go_subl is pointing to an instance of cl_subl, which has the
method subl_meth1123
Reference: NEW - ABAP Keyword Documentation, CAST - ABAP Keyword Documentation, Method Call
- ABAP Keyword Documentation
75. Which of the following string functions are predicate functions? Note: There are 2 correct
answers to this question.
A. find_any_not_of()
B. contains_any_of()
C. count_any_of()
D. matches()
Answer: B, D
ok
Explanation:
String functions are expressions that can be used to manipulate character-like data in ABAP. String
functions can be either predicate functions or non-predicate functions. Predicate functions are string
functions that return a truth value (true or false) for a condition of the argument text. Non-predicate
functions are string functions that return a character-like result for an operation on the argument text1.
The following string functions are predicate functions:
B) contains_any_of(): This function returns true if the argument text contains at least one of the
characters specified in the character set. For example, the following expression returns true, because
the text ‘ABAP’ contains at least one of the characters ‘A’, ‘B’, or ‘C’:
contains_any_of( val = ‘ABAP’ set = ‘ABC’ ).
D) matches(): This function returns true if the argument text matches the pattern specified in the regular
expression. For example, the following expression returns true, because the text ‘ABAP’ matches the
pattern that consists of four uppercase letters:
matches( val = ‘ABAP’ regex = ‘[A-Z]{4}’ ).
The following string functions are not predicate functions, because they return a character-like result, not
a truth value:
A) find_any_not_of(): This function returns the position of the first character in the argument text that is
not contained in the character set. If no such character is found, the function returns 0. For example, the
following expression returns 3, because the third character of the text ‘ABAP’ is not contained in the
character set ‘ABC’:
find_any_not_of( val = ‘ABAP’ set = ‘ABC’ ).
70 / 59
The safer , easier way to help you pass any IT exams.
C) count_any_of(): This function returns the number of characters in the argument text that are
contained in the character set. For example, the following expression returns 2, because there are two
characters in the text ‘ABAP’ that are contained in the character set ‘ABC’: count_any_of( val = ‘ABAP’
set = ‘ABC’ ). Reference: 1: String Functions - ABAP Keyword Documentation
76. After you created a database table in the RESTful Application Programming model, what
do you create next?
[Link]
building-an-abap-restful-application
A. A metadata extension
B) A projection view
C) A data model view
D) A service
definition
Answer: B
Explanation:
In the RESTful Application Programming (RAP) model, after creating a database table, the next step is
typically to create:
A data model view
A data model view in RAP, usually defined as a Core Data Services (CDS) view, is used to structure
the underlying data in a meaningful way for the application's services. It provides a semantic layer over
the physical database table(s).
When you attempt to activate the definition, what will be the response?
A. Activation error because the field names of the union do not match
B. Activation error because the field types of the union do not match
C. Activation error because the key fields of the union do not match
D. Activation successful
71 / 59
The safer , easier way to help you pass any IT exams.
Answer: A
Explanation:
72 / 59
The safer , easier way to help you pass any IT exams.
When using the UNION clause in SQL or in Core Data Services (CDS) views, the requirement is that the
number and types of the columns that are being unioned match in both SELECT sta|tements. The column
names themselves do not need to match, but the positions and data types do.
From the exhibit, we can see that both parts of the union have fields that are seemingly aliased correctly
to ensure that the resulting unioned dataset has a consistent structure. The fields id, name, city, and
country are present in both SELECT statements and have been given the same aliases, and there is a
consistent partner alias that corresponds to Customer in the first SELECT and Agency in the second
SELECT.
However, without knowing the exact data types of each field, we cannot definitively say whether there
will be an activation error due to a mismatch in field types (option B). Assuming that the data types do
match and that the key fields being referred to by the alias id are compatible for the purpose of the
union, the response would likely be:
D. Activation successful
This assumes that the exhibit shows correct aliasing and compatible data types for the UNION operation.
If the data types for the corresponding columns do not match, then there would be an activation error as
per option B. But since the exhibit does not provide data type information, we have to base our answer
on the typical requirements for a UNION to be successful.
78. You have two internal tables itab1 and [Link] is true for using the expression
itab1 = corresponding #( itab2 )? Note: There are 2 correct answers to this question.
A. Fields with the same name but with different types may be copied from itab2 to itab1.
B. itab1 and itab2 must have at least one field name in common.
C. Fields with the same name and the same type will be copied from itab2 to itab1.
D. itab1 and itab2 must have the same data type.
Answer: B, C ok
Explanation:
The expression itab1 = corresponding #( itab2 ) is a constructor expression with the component operator
CORRESPONDING that assigns the contents of the internal table itab2 to the internal table itab1.
The following statements are true for using this expression:
B: itab1 and itab2 must have at least one field name in common. This is because the component
operator CORRESPONDING assigns the identically named columns of itab2 to the identically named
columns of itab1 by default, according to the rules of MOVE-CORRESPONDING for internal tables. If
itab1 and itab2 do not have any field name in common, the expression will not assign any value to itab1
and it will remain initial or unchanged1
C: Fields with the same name and the same type will be copied from itab2 to itab1. This is because the
component operator CORRESPONDING assigns the identically named columns of itab2 to the
identically named columns of itab1 by default, according to the rules of MOVE-CORRESPONDING for
internal tables. If the columns have the same name but different types, the assignment will try to
perform a conversion between the types, which may result in a loss of precision, a truncation, or a
runtime error, depending on the types involved1
The following statements are false for using this expression:
A: Fields with the same name but with different types may be copied from itab2 to itab1. This is not true,
as explained in statement
C. The assignment will try to perform a conversion between the types, which may result in a loss of
73 / 59
The safer , easier way to help you pass any IT exams.
79. Given the following Core Data Service View Entity Data Definition:
1 @[Link]: #NOT_REQUIRED
2 DEFINE VIEW ENTITY demo_flight_info_join
3 AS SELECT
4 FROM scarr AS a
5 LEFT OUTER JOIN scounter AS c
6 LEFT OUTER JOIN sairport AS p
7 ON [Link] = [Link]
8 ON [Link] = [Link]
9{
10 [Link] AS carrier_id,
11 [Link] AS airport_id,
12 [Link] AS counter_number
13 }
In what order will the join statements be executed?
A. scarr will be joined with scounter first and the result will be joined with sairport.
B. sairport will be joined to scounter first and the result will be joined with scarr.
C. scarr will be joined with sairport first and the result will be joined with scounter.
D. scounter will be joined to sairport first and the result will be joined with scarr.
Answer: A
Explanation:
The order in which the join statements will be executed is:
scarr will be joined with scounter first and the result will be joined with sairport.
This is because the join statements are nested from left to right, meaning that the leftmost data source is
joined with the next data source, and the result is joined with the next data source, and so on. The join
condition for each pair of data sources is specified by the ON clause that follows the data source name.
The join type for each pair of data sources is specified by the join operator that precedes the data source
name. In this case, the join operator is LEFT OUTER JOIN, which means that all the rows from the left
data source are included in the result, and only the matching rows from the right data source are
included. If there is no matching row from the right data source, the corresponding fields are filled with
initial values1.
Therefore, the join statements will be executed as follows:
First, scarr AS a will be joined with scounter AS c using the join condition [Link] = [Link]. This means
that all the rows from scarr will be included in the result, and only the rows from scounter that have the
same value for the carrid field will be included. If there is no matching row from scounter, the countnum
field will be filled with an initial value.
74 / 59
The safer , easier way to help you pass any IT exams.
Second, the result of the first join will be joined with sairport AS p using the join condition [Link] =
[Link]. This means that all the rows from the first join will be included in the result, and only the rows
from sairport that have the same value for the id field as the airport field from the first join will be
included. If there is no matching row from sairport, the id field will be filled with an initial value.
Reference: 1: Join - ABAP Keyword Documentation
81. 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
75 / 59
The safer , easier way to help you pass any IT exams.
ENDMETHOD.
ENDCLASS.
What will happen if method parameters act and exp are not equal?
A. The tested unit will automatically be appended to a default ABAP Test Cockpit Variant.
B. The tested unit cannot be transported.
C. The test will be aborted.
D. There will be a message in the test log.
Answer: C
76 / 59