What are valid statements? Note: There are 2 correct answers to this question.
##NEEDED is checked by the syntax checker.
The pragma is not checked by the syntax checker.
#EC_NEEDED is not checked by the syntax checker.
The pseudo-comment is checked by the syntax checker
Both statements are valid in ABAP, but they have different effects on the program.
##NEEDED is a pragma that can be used to hide warnings from the ABAP compiler syntax check. It tells the check tools that a variable or a parameter is needed for further processing, even if it is not used in the current statement. For example, if you declare a variable without assigning any value to it, you can use ##NEEDED to suppress the warning about unused variables12.
The pragma is not checked by the syntax checker means that you can use any pragma to hide any warning from the ABAP compiler syntax check, regardless of its effect on the program logic or performance. For example, if you use ##SHADOW to hide a warning about an obscured function, you can also use it to hide a warning about an invalid character in a string12.
You cannot do any of the following:
#EC_NEEDED is not checked by the syntax checker: This is not a valid statement in ABAP. There is no pseudo-comment with #EC_NEEDED in ABAP3.
The pseudo-comment is checked by the syntax checker: This is false. Pseudo-comments are obsolete and should no longer be used in ABAP. They were replaced by pragmas since SAP NW 7.0 EhP2 (Enhancement Package)4.
References: 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
Exhibit:
With Icl_super being superclass for Icl_subl and Icl_sub2 and with methods subl_methl and sub2_methl being subclass-specific methods of Id_subl or Icl_sub2, respectivel. What will happen when executing these casts? Note:
There are 2 correct answers to this question
go subl = CAST # go super), will not work
go_sub2 = CAST # go super), will work. go_subl CAST #go_super), will work
go_sub2 = CAST #(go_super). will not work. ] go sub2->sub2 meth 1(...). will work
go_subl->subl_meth !(...)• w'll work.
The following are the explanations for each statement:
A: This statement is correct. go_subl = CAST #(go_super) will not 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. 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_subl, but this is not possible, as go_super is not pointing to an instance of cl_subl, but to an instance of cl_super. Therefore, the CAST operator will raise an exception CX_SY_MOVE_CAST_ERROR at runtime12
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 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
References: NEW - ABAP Keyword Documentation, CAST - ABAP Keyword Documentation, Method Call - ABAP Keyword Documentation
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.
built-in ABAP type
A built-in ABAP Dictionary type
A data element
A component of an ABAP Dictionary structure
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 abap.char, abap.numc, abap.dec, 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 abap.cuky, which is a built-in ABAP type for currency key:
Define view entity Z_CONVERT With parameters currency : abap.cuky 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.
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.
References: 1: ABAP CDS - SELECT, parameter_list - ABAP Keyword Documentation - SAP Online Help 2: ABAP Data Types - ABAP Keyword Documentation - SAP Online Help
Which of the following are valid sort operations for internal tables? Note: There are 3 correct answers to this question.
Sort a standard table using
SORT itab ASCENDING.
Sort a sorted table using
SORT itab BY fieldl ASCENDING field2 DESCENDING.
Sort a standard table using
SORT itab BY field1 field2.
Sort a standard table using
SORT itab.
Sort a sorted table using
SORT itab DESCENDING.
What is the sequence priority when evaluating a logical expression?
NOT 1
OR 3
AND 2
A B C
CAB
A C B
B A C
The sequence priority when evaluating a logical expression is C. A C B, which means NOT, AND, OR. This is the order of precedence of the Boolean operators in ABAP, which determines how the system implicitly parenthesizes all logical expressions that are not closed by explicit parentheses. The operator with the highest priority is evaluated first, and the operator with the lowest priority is evaluated last. The order of precedence of the Boolean operators in ABAP is as follows12:
NOT: The NOT operator is a unary operator that negates the logical expression that follows it. It has the highest priority and is evaluated before any other operator. For example, in the expression NOT a AND b, the NOT operator is applied to a first, and then the AND operator is applied to the result and b.
AND: The AND operator is a binary operator that returns true if both logical expressions on its left and right are true, and false otherwise. It has the second highest priority and is evaluated before the OR and EQUIV operators. For example, in the expression a AND b OR c, the AND operator is applied to a and b first, and then the OR operator is applied to the result and c.
OR: The OR operator is a binary operator that returns true if either or both logical expressions on its left and right are true, and false otherwise. It has the third highest priority and is evaluated after the NOT and AND operators, but before the EQUIV operator. For example, in the expression a OR b EQUIV c, the OR operator is applied to a and b first, and then the EQUIV operator is applied to the result and c.
EQUIV: The EQUIV operator is a binary operator that returns true if both logical expressions on its left and right have the same truth value, and false otherwise. It has the lowest priority and is evaluated after all other operators. For example, in the expression a AND b EQUIV c OR d, the EQUIV operator is applied to a AND b and c last, after the AND and OR operators are applied.
References: 1: log_exp - Boolean Operators and Parentheses - ABAP Keyword Documentation - SAP Online Help 2: Logical Expressions (log_exp) - ABAP Keyword Documentation - SAP Online Help
In RESTful Application Programming, a business object contains which parts? Note: There are 2 correct answers to this question.
CDS view
Behavior definition
Authentication rules
Process definition
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.
References: 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
Which statement can you use to change the contents of a row of data in an internal table?
Append table
Modify table
Insert table
Update table
The statement that can be used to change the contents of a row of data in an internal table is MODIFY table. The MODIFY table statement can be used to change the contents of one or more rows of an internal table, either by specifying the table index, the table key, or a condition. The MODIFY table statement can also be used to change the contents of a database table, by specifying the table name and a work area or an internal table. The MODIFY table statement can use the TRANSPORTING addition to specify which fields should be changed, and the WHERE addition to specify which rows should be changed.
The other statements are not suitable for changing the contents of a row of data in an internal table, as they have different purposes and effects. These statements are:
APPEND table: This statement can be used to add a new row of data to the end of an internal table, either by specifying a work area or an inline declaration. The APPEND table statement does not change the existing rows of the internal table, but only increases the number of rows by one.
INSERT table: This statement can be used to insert a new row of data into an internal table, either by specifying the table index, the table key, or a sorted position. The INSERT table statement does not change the existing rows of the internal table, but only shifts them to make room for the new row. The INSERT table statement can also be used to insert a new row of data into a database table, by specifying the table name and a work area or an inline declaration.
UPDATE table: This statement can be used to update the contents of a database table, by specifying the table name and a work area or an internal table. The UPDATE table statement can use the SET addition to specify which fields should be updated, and the WHERE addition to specify which rows should be updated. The UPDATE table statement does not affect the internal table, but only the corresponding database table.
References: MODIFY table - ABAP Keyword Documentation, APPEND table - ABAP Keyword Documentation, INSERT table - ABAP Keyword Documentation, UPDATE table - ABAP Keyword Documentation
Which restrictions exist for ABAP SQL arithmetic expressions? Note: There are 2 correct answers to this question.
Floating point types and integer types can NOT be used in the same expression.
The operator/is allowed only in floating point expressions.
Decimal types and integer types can NOT be used in the same expression.
The operator is allowed only in floating point expressions.
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.
References: sql_exp - sql_arith - ABAP Keyword Documentation, SQL Expressions, Arithmetic Calculations - ABAP Keyword Documentation
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?
'ZF1' can be called whether it has been released or not for cloud development.
'ZF1' can be called via a wrapper that itself has been released for cloud development.
'ZF1' can be called via a wrapper that itself has not been released for cloud development.
'ZF1' must be released for cloud development to be called.
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 @EndUserText.label. 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:
@EndUserText.label: ‘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 = iv_a b = iv_b IMPORTING result = ev_result. ENDMETHOD. ENDCLASS.
CLASS zcl_demo_class DEFINITION. METHODS: m1. ENDCLASS.
CLASS zcl_demo_class IMPLEMENTATION. METHOD m1. DATA(lv_result) = zcl_wrapper_zf1=>call_zf1( iv_a = 2 iv_b = 3 ). WRITE: / lv_result. ENDMETHOD. ENDCLASS.
The output of this code is:
5
References: 1: SAP API Business Hub 2: Creating an ABAP Cloud Project | SAP Help Portal
You want to provide a short description of the data definition for developers that will be attached to the database view
Which of the following annotations would do this if you inserted it on line #27
@UI headerinto description label
@UI.badge.title.label
@EndUserText.quickInfo
@EndUserText label
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 @EndUserText.label 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 @EndUserText.label annotation to provide a short description of the data definition for the CDS view ZCDS_VIEW:
@AbapCatalog.sqlViewName: ‘ZCDS_VIEW’ @AbapCatalog.compiler.compareFilter: true @AbapCatalog.preserveKey: true @AccessControl.authorizationCheck: #CHECK @EndUserText.label: ‘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:
@UI.headerInfo.description.label: 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.
@UI.badge.title.label: 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.
@EndUserText.quickInfo: 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.
References: 1: ABAP CDS - SAP Annotations - ABAP Keyword Documentation - SAP Online Help 2: ABAP CDS - Data Definitions - ABAP Keyword Documentation - SAP Online Help
Which of the following types are permitted to be used for
A database table from the ABAP Dictionary
A CDS DDIC-based view
An external view from the ABAP Dictionary
A database view from the ABAP Dictionary
The
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.
References: 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
Class super has subclass sub. Which rules are valid for the sub constructor? Note: There are 2 correct answers to this question.
The method signature can be changed.
Import parameters can only be evaluated after calling the constructor of super.
The constructor of super must be called before using any components of your own instance.
Events of your own instance cannot be raised before the registration of a handler in super.
The sub constructor is the instance constructor of the subclass sub that inherits from the superclass super. The sub constructor has some rules that it must follow when it is defined and implemented12. Some of the valid rules are:
The method signature can be changed: This is true. The sub constructor can have a different method signature than the super constructor, which means that it can have different input parameters, output parameters, or exceptions. However, the sub constructor must still call the super constructor with appropriate actual parameters that match its interface12.
The constructor of super must be called before using any components of your own instance: This is true. The sub constructor must ensure that the super constructor is called explicitly using super->constructor before accessing any instance components of its own class, such as attributes or methods. This is because the super constructor initializes the inherited components of the subclass and sets the self-reference me-> to the current instance12.
You cannot do any of the following:
Import parameters can only be evaluated after calling the constructor of super: This is false. The sub constructor can evaluate its own import parameters before calling the constructor of super, as long as it does not access any instance components of its own class. For example, the sub constructor can use its import parameters to calculate some values or check some conditions that are needed for calling the super constructor12.
Events of your own instance cannot be raised before the registration of a handler in super: This is false. The sub constructor can raise events of its own instance before calling the constructor of super, as long as it does not access any instance components of its own class. For example, the sub constructor can raise an event to notify the consumers of the subclass about some status or error that occurred during the initialization of the subclass12.
References: 1: Inheritance and Constructors - ABAP Keyword Documentation - SAP Online Help 2: Using Static and Instance constructor methods | SAP Blogs
Which of the following ABAP SQL statements are valid? Note: There are 2 correct answers to this question.
SELECT FROM /dmo/connection FIELDS carrid O airpfrom,
MAX(distance) AS dist_max, MIN( distance) AS dist_min GROUP BY carrid, airpfrom INTO TABLE @DATA(It_hits)
SELECT FROM /dmo/connection FIELDS \/ O carrid, airpfrom,
MAX( distance) AS dist_max, MIN(distance) AS dist_min INTO TABLE @DATA(It_hits)
SELECT FROM /dmo/connection FIELDS V D MAX(distance) AS dist_max
MIN(distance) AS dist_min INTO TABLE @DATA(It_hits).
SELECT FROM /dmo/connection FIELDS r—i carrid, airpfrom u GROUP BY carrid, connid
INTO TABLE @DATA(It_hits).
The following are the explanations for each ABAP SQL statement:
A: This statement is valid. It selects the fields carrid, airpfrom, and the aggregate functions MAX(distance) and MIN(distance) from the table /dmo/connection, and groups the results by carrid and airpfrom. The aggregate functions are aliased as dist_max and dist_min. The results are stored in an internal table named It_hits, which is created using the inline declaration operator @DATA.
B: This statement is valid. It is similar to statement A, except that it does not specify the GROUP BY clause. This means that the aggregate functions are applied to the entire table, and the results are stored in an internal table named It_hits, which is created using the inline declaration operator @DATA.
C: This statement is invalid. It selects the aggregate functions MAX(distance) and MIN(distance) from the table /dmo/connection, but it does not specify any grouping or non-aggregate fields. This is not allowed in ABAP SQL, as the SELECT list must contain at least one non-aggregate field or a GROUP BY clause. The statement will cause a syntax error.
D: This statement is invalid. It selects the fields carrid and airpfrom from the table /dmo/connection, and groups the results by carrid and connid. However, the field connid is not included in the SELECT list, which is not allowed in ABAP SQL, as the GROUP BY clause must contain only fields that are also in the SELECT list. The statement will cause a syntax error.
References: SELECT - ABAP Keyword Documentation, GROUP BY - ABAP Keyword Documentation
In which products must you use the ABAP Cloud Development Model? Note: There are 2 correct answers to this question.
SAP S/4HANA Cloud, private edition
SAP BTP, ABAP environment
SAP S/4HANA on premise
SAP S/4HANA Cloud, public edition
The ABAP Cloud Development Model is the ABAP development model to build cloud-ready business apps, services, and extensions. It comes with SAP BTP and SAP S/4HANA. It works with public or private cloud, and even on-premise1. However, the complete ABAP Cloud Development Model, including the cloud-optimized ABAP language and public local SAP APIs and extension points, is available only in SAP BTP ABAP Environment and in the 2208/2022 versions of the SAP S/4HANA editions1. Therefore, you must use the ABAP Cloud Development Model in SAP BTP, ABAP environment and SAP S/4HANA Cloud, private edition. You can also use it in SAP S/4HANA on premise, but it is not mandatory. You cannot use it in SAP S/4HANA Cloud, public edition, because it does not allow custom ABAP code2. References: 1: ABAP Cloud | SAP Blogs 2: SAP S/4HANA Cloud Extensibility – Overview and Comparison | SAP Blogs
Which of the following are incomplete ABAP types? Note: There are 2 correct answers to this question.
String
T
C
P
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.
References: 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
Which of the following are features of Core Data Services? Note: There are 3 correct answers to this question.
Inheritance
Associations
Annotations
Delegation
Structured Query Language (SQL)
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 constraints, 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.
References: 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 - SAP Online Help] : [Object-Oriented Programming in ABAP | SAP Help Portal]
with which predicate condition can you ensure that the CAST will work?
IS SUPPLIED
IS NOT INITIAL
IS INSTANCE OF
IS BOUND
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.
References: 1: Predicate Expressions - ABAP Keyword Documentation - SAP Online Help 2: ABAP - Predicates | SAP Community
What RESTful Application Programming object contains only the fields required for a particular app?
Database view
Metadata extension
Projection View
Data model view
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 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.
References: CDS Projection Views - ABAP Keyword Documentation, CDS Projection Views in ABAP CDS: What’s Your Flavor, Business Object Projection - ABAP Keyword Documentation
When does SAP recommend to use a sorted or a hashed table respectively? Note: There are 2 correct answers to this question.
A hashed table, when you read a single record and specify the complete key.
A hashed table, when you read a subset in a loop and specify a part of the key from the left without gaps.
A sorted table, when you read a subset in a loop and specify a part of the key from the left ^ without gaps.
A sorted table, when you read a single record and specify non key fields.
For what kind of applications would you consider using on-stack developer extensions? Note: There are 2 correct answers to this question.
Applications that provide APIs for side by side SAP BTP apps
Applications that access SAP S/4HANA data using complex SQL
Applications that integrate data from several different systems
Applications that run separate from SAP S/4HANA
On-stack developer extensibility is a type of extensibility that allows you to create development projects directly on the SAP S/4HANA Cloud technology stack. It gives you the opportunity to develop cloud-ready and upgrade-stable custom ABAP applications and services inside the SAP S/4HANA Cloud, public edition system. You can use the ABAP Development Tools in Eclipse to create and deploy your on-stack extensions. On-stack developer extensibility is suitable for the following kinds of applications:
Applications that provide APIs for side by side SAP BTP apps. On-stack developer extensibility allows you to create OData services or RESTful APIs based on CDS view entities or projection views. These services or APIs can expose SAP S/4HANA data and logic to other applications that run on the SAP Business Technology Platform (SAP BTP) or other platforms. This way, you can create a loosely coupled integration between your SAP S/4HANA system and your side by side SAP BTP apps.
Applications that access SAP S/4HANA data using complex SQL. On-stack developer extensibility allows you to use ABAP SQL to access SAP S/4HANA data using complex queries, such as joins, aggregations, filters, parameters, and code pushdown techniques. You can also use ABAP SQL to perform data manipulation operations, such as insert, update, delete, and upsert. This way, you can create applications that require advanced data processing and analysis on SAP S/4HANA data.
The other kinds of applications are not suitable for on-stack developer extensibility, as they have different requirements and challenges. These kinds of applications are:
Applications that integrate data from several different systems. On-stack developer extensibility is not meant for creating applications that integrate data from multiple sources, such as other SAP systems, third-party systems, or cloud services. This is because on-stack developer extensibility does not support remote access or data replication, and it may cause performance or security issues. For this kind of applications, you should use side by side extensibility, which allows you to create applications that run on the SAP BTP and communicate with the SAP S/4HANA system via public APIs or events.
Applications that run separate from SAP S/4HANA. On-stack developer extensibility is not meant for creating applications that run independently from the SAP S/4HANA system, such as standalone apps, microservices, or web apps. This is because on-stack developer extensibility requires a tight coupling with the SAP S/4HANA system, and it may limit the scalability, flexibility, and portability of the applications. For this kind of applications, you should use side by side extensibility, which allows you to create applications that run on the SAP BTP and leverage the cloud-native features and services of the platform.
References: Developer Extensibility in SAP S/4HANA Cloud ABAP Environment, SAP S/4HANA Extensibility – Simplified Guide for Beginners
When accessing the subclass instance through go_super, what can you do? Note: There are 2 correct answers to this question.
Access the inherited private components.
Access the inherited public components.
Call a subclass specific public method
Call inherited public redefined methods.
When accessing the subclass instance through go_super, you can do both of the following:
Access the inherited private components: A subclass inherits all the private attributes and methods of its superclass, unless they are explicitly overridden by the subclass. Therefore, you can access the inherited private components of the superclass through go_super, as long as they are not hidden by other attributes or methods in the subclass12.
Access the inherited public components: A subclass inherits all the public attributes and methods of its superclass, unless they are explicitly overridden by the subclass. Therefore, you can access the inherited public components of the superclass through go_super, as long as they are not hidden by other attributes or methods in the subclass12.
You cannot do any of the following:
Call a subclass specific public method: A subclass does not have any public methods that are not inherited from its superclass. Therefore, you cannot call a subclass specific public method through go_super12.
Call inherited public redefined methods: A subclass does not have any public methods that are redefined from its superclass. Therefore, you cannot call inherited public redefined methods through go_super12.
References: 1: Object Oriented - ABAP Development - Support Wiki 2: Inheritance and Instantiation - ABAP Keyword Documentation
Exhibit
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
...SELECT * FROM deno_cds_param_view_entity (p_date = @ (cl_abap_context_info->get_system_date ())...
...SELECT * FROM deno_cds_param_view_entity (p_date - '20230101')... )
...SELECT * FROM demo_cds_param_view_entity (p_date: 20238181')... )
...SELECT * FROM demo_cds_param_view entity (p_date: $session.system_date)...
What are valid statements? Note: There are 3 correct answers to this question
In class CL1, the interface method is named if-ml.
Class CL2 uses the interface.
Class CL1 uses the interface.
In class CL2, the interface method is named ifl-ml.
Class CL1 implements the interface.
The following are the explanations for each statement:
C: This statement is valid. Class CL1 uses the interface. This is because class CL1 implements the interface ifl using the INTERFACES statement in the public section of the class definition. The INTERFACES statement makes the class compatible with the interface and inherits all the components of the interface. The class can then use the interface components, such as the method ml, by using the interface component selector ~, such as ifl~ml12
E: This statement is valid. Class CL1 implements the interface. This is because class CL1 implements the interface ifl using the INTERFACES statement in the public section of the class definition. The INTERFACES statement makes the class compatible with the interface and inherits all the components of the interface. The class must then provide an implementation for the interface method ml in the implementation part of the class, unless the method is declared as optional or abstract12
D: This statement is valid. In class CL2, the interface method is named ifl~ml. This is because class CL2 has a data member named m0_ifl of type REF TO ifl, which is a reference to the interface ifl. The interface ifl defines a method ml, which can be called using the reference variable m0_ifl. The interface method ml has the name ifl~ml in the class, where ifl is the name of the interface and the character ~ is the interface component selector12
The other statements are not valid, as they have syntax errors or logical errors. These statements are:
A: This statement is not valid. In class CL1, the interface method is named ifl~ml, not if-ml. This is because class CL1 implements the interface ifl using the INTERFACES statement in the public section of the class definition. The interface ifl defines a method ml, which can be called using the class name or a reference to the class. The interface method ml has the name ifl~ml in the class, where ifl is the name of the interface and the character ~ is the interface component selector. Using the character - instead of the character ~ will cause a syntax error12
B: This statement is not valid. Class CL2 does not use the interface, but only has a reference to the interface. This is because class CL2 has a data member named m0_ifl of type REF TO ifl, which is a reference to the interface ifl. The interface ifl defines a method ml, which can be called using the reference variable m0_ifl. However, class CL2 does not implement the interface ifl, nor does it inherit the interface components. Therefore, class CL2 does not use the interface, but only references the interface12
References: INTERFACES - ABAP Keyword Documentation, CLASS - ABAP Keyword Documentation
/DMO/I_Connection is a CDS view.
What variable type is connection full based on the following code? DATA connection full TYPE
/DMD/I_Connection.
Simple variable
Structure
Internal Table
Based on the following code, the variable type of connection_full is a structure. A structure is a complex data type that consists of a group of related data objects, called components, that have their own data types and names. A structure can be defined using the TYPES statement or based on an existing structure type, such as a CDS view entity or a CDS DDIC-based view. In this case, the variable connection_full is declared using the TYPE addition, which means that it has the same structure type as the CDS view entity /DMO/I_Connection. The CDS view entity /DMO/I_Connection is a data model view that defines a data model based on the database table /DMO/Connection. The CDS view entity /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.
References: CDS Data Model Views - ABAP Keyword Documentation, DATA - ABAP Keyword Documentation, Structure Types - ABAP Keyword Documentation
Copyright © 2021-2024 CertsTopics. All Rights Reserved