Given the following code which defines an SAP HANA database table in SAP S/4HANA Cloud, public edition: @EndUserText.label : 'Draft table for entity /DMO/R_AGENCY' @AbapCatalog.tableCategory : #TRANSPARENT @AbapCatalog.deliveryClass : #A @AbapCatalog.dataMaintenance : #RESTRICTED define table /dmo/agency_d { key mandt : mandt not null; key agencyid : /dmo/agency_id not null; key draftuuid : sdraft_uuid not null; name : /dmo/agency_name; street : /dmo/street; postalcode : /dmo/postal_code; city : /dmo/city; } You are a consultant and the client wants you to extend this SAP database table with a new field called zz_countrycode on line #14. Which of the following is the correct response?
-
A
The database table can be extended whether extensibility enabled or not if it is assigned to a software component of type "Standard ABAP".
-
B
The database table cannot be extended since it has not been extensibility enabled by SAP.
-
C
The database table can be extended once it has extensibility been enabled by the customer.
-
D
The database table can be extended whether extensibility enabled or not if it is assigned to a software component of type "ABAP Cloud".
Reveal answer details
Close answer details
Correct answerB
ExplanationIn SAP S/4HANA Cloud, public edition , database tables are only extendable if SAP has explicitly enabled extensibility for them via metadata. This is a strict limitation in the ABAP Cloud model to ensure upgrade-stability and isolation of extensions from SAP-owned objects. Key facts: The annotation @AbapCatalog.dataMaintenance : #RESTRICTED implies that this table is not editable or extensible by default. The table resides in a delivered component and unless SAP marks it as extensible , customers cannot add fields like zz_countrycode. Even if the table is in an ABAP Cloud-compliant software component, extensibility must be explicitly enabled by SAP. Therefore, Option B is the only correct and valid answer. Incorrect options: Option A and D are wrong because extensibility is not determined by the software component type alone. Option C is wrong because customers cannot enable extensibility for SAP-delivered tables; it must be pre- approved by SAP. References: ABAP Extension Guidelines for SAP S/4HANA Cloud (ABAP Extension.pdf, section 2.3 ? Extensibility Enablement and Restrictions in Tier 1)
What is a class defined as part of an ABAP program called?
-
A
-
B
-
C
-
D
Reveal answer details
Close answer details
Correct answerD
ExplanationIn ABAP Cloud/RAP examples, test classes are created inside the development object (e.g., inside the behavior implementation) and are marked FOR TESTING--these are local classes (they live in the program/class include, not as separate global repository classes). The guides show creating test classes under the Test Classes tab and referencing the Local Types section of the implementation (friends etc.), i.e., local to the program/object. This contrasts with global classes that exist as standalone repository objects; the RAP test patterns explicitly model the former (local) for unit tests within the object's context.
Which function call produces the string 'LORE_IPSUM_FACTUM'?
-
A
from_mixed( val = 'LorelpsumFactum' sep = '_' )
-
B
condense( to_upper( 'LorelpsumFactum' ) )
-
C
to_upper( condense( 'LorelpsumFactum' ) )
-
D
to_mixed( val = 'LorelpsumFactum' sep = '_' )
Reveal answer details
Close answer details
Correct answerA
Explanationfrom_mixed converts a mixed-case string into uppercase with a chosen separator between words. Given input 'LorelpsumFactum', the function splits at uppercase letters, uppercases the parts, and joins them with _. Output: LORE_IPSUM_FACTUM. condense only removes extra spaces, to_upper only changes case, and to_mixed does the reverse of from_mixed. References: ABAP Keyword Documentation ?String Functions (from_mixed, to_mixed) .
Which of the following pre-defined ABAP data types is a complete data type?
-
A
-
B
-
C
-
D
Reveal answer details
Close answer details
Correct answerA
Explanationp (packed number) is a complete type , as it includes decimal places and precision definition. d (date), c (character), n (numeric text) are incomplete types ; they require length specification. References: ABAP Keyword Documentation ?Predefined ABAP Types .
In a booking record, how can you calculate the difference in days between the order date (type D) and the flight date (type D) of a flight?
-
A
data(gv_diff_days) = conv d( gs_booking-flight_date - gs_booking-order_date ).
-
B
data(gv_diff_days) = gs_booking-flight_date - gs_booking-order_date.
-
C
data(gv_diff_days) = gs_booking-order_date - gs_booking-flight_date.
-
D
data(gv_diff_days) = conv d( gs_booking-order_date - gs_booking-flight_date ).
Reveal answer details
Close answer details
Correct answerB
ExplanationIn ABAP, when calculating the difference between two date fields (type DATS) , the result is directly a type i (integer) representing the difference in days. Statement B is correct: data(gv_diff_days) = gs_booking-flight_date - gs_booking-order_date. This directly subtracts two DATS fields, resulting in an integer value for the number of days difference. No conversion is necessary. Statements A and D are incorrect because the conv d( ... ) attempts to convert the result back to a DATS type, which is invalid since the result is an integer (number of days), not a date. Statement C is syntactically correct but would produce the negative of the desired value (flight date - order date). It is semantically incorrect for the use case. This approach is consistent with ABAP for Cloud Development , which requires explicit typing , and ABAP language version strict mode , where automatic type inference is restricted. References: ABAP Language Documentation ?DATS arithmetic and date operations section consistent with ABAP Cloud version restrictions.
Question 6
Multiple choice
Given this code, DATA(structure_variable) = REDUCE structure_type( INIT h_structure_variable TYPE structure_type FOR row IN source_itab NEXT h_structure_variable-f1 += row-f1 h_structure_variable-f2 += row-f2 ). Which of the following statements are correct? (Select 2 correct answers)
-
A
row is a predefined name and cannot be changed.
-
B
This REDUCE expression may produce a result of multiple rows.
-
C
Components of h_structure_variable will be copied to same-named components of structure_variable.
-
D
The REDUCE expression creates a loop over source_itab.
Reveal answer details
Close answer details
Correct answersC, D
ExplanationRAP and ABAP Cloud emphasize expression-based coding , and REDUCE is a key reduction expression. The code above defines an accumulator (h_structure_variable) and iterates over an internal table (source_itab) with FOR ... IN ..., so a loop over the source table is created (D). In each iteration, fields are accumulated and, when the expression finishes, the final accumulator value is returned and assigned to structure_variable. With compatible structured types, components are copied name-by-name (C). In ABAP Cloud, the language is explicitly described as "aligned and extended to support RAP ... The application developer uses typed APIs ... and benefits from static code checks." This underpins the use of typed, expression-based constructs like REDUCE for safe, declarative logic.
Setting a field to read-only in which object would make the field read-only in all applications of the RAP model?
-
A
-
B
-
C
-
D
Reveal answer details
Close answer details
Correct answerB
ExplanationBehavior Definition (BDEF) is where read-only, mandatory, and transactional rules are enforced across all RAP applications. Projection view # restricts fields per app, not globally. Metadata extension # UI annotations only. Service definition # defines exposure, not behavior. Therefore, setting field read-only in the behavior definition enforces it globally across all RAP BO usages. References: RAP Development Guide ?Behavior Definitions and Field Control .
You have two database tables - ZDEPARTMENTS and ZEMPLOYEES. They are linked by a foreign key relationship: ZEMPLOYEES is the foreign key table and ZDEPARTMENTS is the check table. A department may have any number of employees (including none at all). What is the correct cardinality of the foreign key relationship?
-
A
-
B
-
C
-
D
Reveal answer details
Close answer details
Correct answerA
ExplanationThe situation described is a classic one-to-many relationship from department#employees, with "including none at all" implying 0.. * employees per department. In SAP modeling, cardinalities are expressed with ranges like [0..*] to denote zero-to-many. This notation is used consistently in ABAP Cloud/RAP documentation for compositions/associations as well (e.g., tables/structures or nested lists), where [0..*] means "any number (including none)". Therefore, the correct foreign-key cardinality that matches "a department may have any number of employees (including none)" is [0..*,1] (many employees per one department). The same documentation set also uses "pure foreign key" associations with multiplicities to model such relationships.
Question 9
Multiple choice
You want to join two database tables, T_CARRIER and T_CONNECTIONS, to retrieve all carriers, whether they have corresponding connections or not. Which statements would achieve this? Note: There are 2 correct answers to this question.
-
A
SELECT FROM t_carrier INNER JOIN t_connections ON ...
-
B
SELECT FROM t_carrier LEFT OUTER JOIN t_connections ON ...
-
C
SELECT FROM t_carrier LEFT INNER JOIN t_connections ON ...
-
D
SELECT FROM t_connections RIGHT OUTER JOIN t_carrier ON ...
Reveal answer details
Close answer details
Correct answersB, D
ExplanationThe requirement is: Retrieve all carriers from T_CARRIER Include them even if no corresponding connections exist in T_CONNECTIONS. Evaluation of each join type: A-. INNER JOIN:Only returns rows where a carrier has at least one matching connection .# Incorrect, since carriers without connections would be excluded. B-. LEFT OUTER JOIN (correct):Returns all rows from the left table (T_CARRIER) , and connections if they exist.Missing connections are represented with NULL.# Correct answer. C-. LEFT INNER JOIN:This is syntactically invalid in ABAP SQL. INNER JOIN and LEFT OUTER JOIN are separate join types, not combined.# Incorrect. D-. RIGHT OUTER JOIN (correct):Equivalent to LEFT OUTER JOIN when the tables are reversed. Returns all rows from T_CARRIER , whether or not connections exist.# Correct answer. Thus, LEFT OUTER JOIN and RIGHT OUTER JOIN are the valid solutions to retrieve all carriers regardless of connections. References: ABAP CDS Development Guide ?section on SQL Joins ABAP SQL join semantics for INNER, LEFT OUTER, and RIGHT OUTER joins.
Question 10
Multiple choice
Which of the following are rules that extensions in SAP S/4HANA Cloud, public edition must adhere to? (Select 3 correct answers)
-
A
Modify SAP objects in exceptional cases only.
-
B
Use tier 2 wrappers to enable access to non-released SAP APIs.
-
C
Use released remote or local SAP APIs.
-
D
Use cloud-enabled and released technologies.
-
E
Extend SAP objects through predefined extension points.
Reveal answer details
Close answer details
Correct answersC, D, E
ExplanationTier 1 (cloud-ready) extensions "follow ABAP Cloud rules and hence by default can only access the public SAP interfaces (objects released for cloud development )." This directly supports using released APIs (C) and cloud-enabled/released technologies (D). The three-tier extensibility model separates safe cloud extensions (Tier 1) from classic code; Tier 2 wrappers exist only to mitigate missing public APIs , but they are not the recommended pattern for S /4HANA Cloud public-edition extensions (therefore B is not a rule). In S/4HANA Cloud, object changes are not allowed ; instead, customers must use predefined extension points (E)--for example, whitelisted extension includes , released BAdIs, or CDS extension points exposed for cloud usage--consistent with the ABAP Cloud principle of public, released artifacts only. (This is the prescribed approach in the ABAP Cloud extensibility guidance that accompanies the three-tier model.)
Question 11
Single choice
What is the syntax to access component carrier_name of structure connection?
-
A
-
B
-
C
-
D
Reveal answer details
Close answer details
Correct answerC
ExplanationIn ABAP, structure component access uses the hyphen (-): structure-component. The other tokens are used for different purposes: -> for object reference attributes, => for static components, and / is not a field selector in ABAP. ABAP Cloud stresses typed APIs and static checks , ensuring misuse of component selectors is caught early; correct structure access with - is part of the enforced style.
Question 12
Single choice
You have the following CDS definition (aliases shown): define view entity Z_ENTITY as select from Z_SOURCE1 as_Source1 association to Z_SOURCE2 as Source2 on ??? {key carrier_id as Carrier, key connection_id as Connection, cityfrom as DepartureCity, cityto as ArrivalCity, Source2 } (The data sources are joined by the field carrier_id. The corresponding field in Z_SOURCE2 is also carrier_id. ) Which ON condition must you insert?
-
A
ON Z_SOURCE1.carrier_id = Z_SOURCE2.carrier_id
-
B
ON $projection.carrier_id = Z_SOURCE2.carrier_id
-
C
ON $projection.Carrier = _Source2.carrier_id
-
D
ON_Source1.carrier_id = Source2.carrier_id
Reveal answer details
Close answer details
Correct answerD
ExplanationIn a CDS view entity defined AS SELECT FROM , the association ON condition must use the source aliases defined in the FROM clause. $projection is used in projection views (AS PROJECTION ON ...), not in a basic select view entity. Therefore, options using $projection (B, C) are invalid here. Using global names (Z_SOURCE1, Z_SOURCE2) in the ON (A) ignores the declared aliases and is not the recommended/valid form within the view definition. The correct ON clause uses the aliases_Source1 and Source2 with the matching key fields:ON _Source1.carrier_id = Source2.carrier_id (D). This aligns with CDS modeling rules in RAP: use aliases consistently and model associations with precise ON conditions based on keys. References: ABAP CDS Development--Associations & ON conditions RAP Data Modeling.
Question 13
Multiple choice
What are some principles of encapsulation? (Select 2 correct answers)
-
A
Attributes can be changed through public class methods.
-
B
Attributes can be changed by the client program directly.
-
C
Attributes cannot be changed.
-
D
Attributes can only be changed by the class.
Reveal answer details
Close answer details
Correct answersA, D
ExplanationEncapsulation in ABAP OO and ABAP Cloud ensures that internal object details are hidden from outside consumers. A-. Attributes can be changed through public methods # # Correct, because controlled access is provided through getter/setter or other methods. B-. Attributes can be changed by the client program directly # # Incorrect, this violates encapsulation. C-. Attributes cannot be changed # # Incorrect, they can be changed, but only via allowed mechanisms. D-. Attributes can only be changed by the class itself # # Correct, ensuring business logic consistency. This aligns with RAP behavior definitions (BDEF) where internal attributes are encapsulated and only manipulated through behavior implementation methods. References: ABAP Objects Programming Guide Encapsulation Principles .
Question 14
Multiple choice
When you create an exception class, what does SAP recommend you do? (Select 3 correct answers)
-
A
Define corresponding public attributes, if you want to pass context-specific values to placeholders of a message.
-
B
Inherit from cx_static_check, if you want a warning at design time that the exception can never be raised.
-
C
Inherit from cx_static_check, if you want a warning at design time that the exception will not be caught.
-
D
Inherit from cx_no_check, if you want to reuse messages from a system exception class.
-
E
Implement interface if_t100_message, if you want to reuse messages from a message class.
Reveal answer details
Close answer details
Correct answersA, C, E
ExplanationA # Recommended to define attributes for message placeholders. C # Inheriting from cx_static_check enforces compile-time checks to ensure exceptions are handled. E # Implementing if_t100_message allows integration with message classes. B # Misleading, design-time warning is about handling, not raising. D # Not a recommended practice in ABAP Cloud (system classes are not extendable). References: ABAP Objects Guide ?Defining Exception Classes .
Question 15
Single choice
Which pattern is Tier 1 (clean-core) compliant in S/4HANA Cloud, public edition?
-
A
Call unreleased APIs via custom wrapper
-
B
Add a custom field using a released extension include on a released table/view
-
C
Modify SAP-delivered DDIC object directly in the customer system
-
D
Implement classic user exit (MV45A) inside SAP object
Reveal answer details
Close answer details
Correct answerB
ExplanationClean-core development requires extending only through released APIs and extension points; direct modifications or unreleased calls break upgrade safety.
|