You have two internal tables itab1 and itab2.What is true for using the expression itab1 = corresponding #( itab2 )? Note: There are 2 correct answers to this question.
Fields with the same name but with different types may be copied from itab2 to itab1.
itab1 and itab2 must have at least one field name in common.
Fields with the same name and the same type will be copied from itab2 to itab1.
itab1 and itab2 must have the same data type.
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 precision, a truncation, or a runtime error, depending on the types involved1
D: itab1 and itab2 must have the same data type. This is not true, as the component operator CORRESPONDING can assign the contents of an internal table of one type to another internal table of a different type, as long as they have at least one field name in common. The target type of the expression is determined by the left-hand side of the assignment, which is itab1 in this case. The expression will create an internal table of the same type as itab1 and assign it to itab11
References: CORRESPONDING - Component Operator - ABAP Keyword Documentation
What are some properties of database tables? Note: There are 2 correct answers to this question.
They store information in two dimensions.
They may have key fields.
They can have any number of key fields.
They can have relationships to other tables.
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.
References: 1: Table (database) - Wikipedia 2: Database design basics - Microsoft Support
In the following ABAP SQL code, what are valid case distinctions? Note: There are 2 correct answers to this question.
A)
B)
C)
D)
Option A
Option B
Option C
Option D
What RESTful Application Programming feature is used to ensure the uniqueness of a semantic key?
Validation
Action
Determination
The RESTful Application Programming feature that is used to ensure the uniqueness of a semantic key is determination. A determination is a type of behavior implementation that defines a logic that is executed automatically when certain events occur, such as create, update, delete, or activate. A determination can be used to calculate or derive values for certain fields, such as semantic keys, based on other fields or external sources. A determination can also be used to check the uniqueness of a semantic key by comparing it with the existing values in the database or the transaction buffer. A determination can use the ABAP SQL or the EML syntax to access and manipulate data. A determination can be defined using the DETERMINE action clause in the behavior definition of a CDS view entity or a projection view. A determination can also be annotated with the @ObjectModel.determination annotation to specify the event, the timing, and the scope of the determination12
The other RESTful Application Programming features are not used to ensure the uniqueness of a semantic key, but have different purposes and effects. These features are:
Validation: A validation is a type of behavior implementation that defines a logic that is executed automatically when certain events occur, such as create, update, delete, or activate. A validation can be used to check the consistency and correctness of the data, such as mandatory fields, data types, value ranges, or business rules. A validation can use the ABAP SQL or the EML syntax to access and manipulate data. A validation can be defined using the VALIDATE action clause in the behavior definition of a CDS view entity or a projection view. A validation can also be annotated with the @ObjectModel.validation annotation to specify the event, the timing, and the scope of the validation12
Action: An action is a type of behavior implementation that defines a logic that is executed explicitly by the user or the application. An action can be used to perform a specific business operation, such as creating, updating, deleting, or activating an entity instance, or triggering a workflow or a notification. An action can use the ABAP SQL or the EML syntax to access and manipulate data. An action can be defined using the ACTION clause in the behavior definition of a CDS view entity or a projection view. An action can also be annotated with the @ObjectModel.action annotation to specify the name, the description, the parameters, and the visibility of the action12
References: Behavior Implementation - ABAP Keyword Documentation, Behavior Definition - ABAP Keyword Documentation
Which of the following is a generic internal table type?
SORTED TABLE
INDEX TABLE
STANDARD TABLE
HASHED TABLE
A generic internal table type is a table type that does not define all the attributes of an internal table in the ABAP Dictionary; it leaves some of these attributes undefined. A table type is generic in the following cases1:
You have selected Index Table or Not Specified as the access type.
You have not specified a table key or specified an incomplete table key.
You have specified a generic secondary table key.
A generic table type can be used only for typing formal parameters or field symbols. A generic table type cannot be used for defining data objects or constants2.
Therefore, the correct answer is B. INDEX TABLE, which is a generic table type that does not specify the access type or the table key. The other options are not generic table types, because:
A. SORTED TABLE is a table type that specifies the access type as sorted and the table key as a unique or non-unique primary key3.
C. STANDARD TABLE is a table type that specifies the access type as standard and the table key as a non-unique standard key that consists of all the fields of the table row in the order in which they are defined4.
D. HASHED TABLE is a table type that specifies the access type as hashed and the table key as a unique primary key5.
References: 1: Generic Table Types - ABAP Dictionary - SAP Online Help 2: Generic ABAP Types - ABAP Keyword Documentation - SAP Online Help 3: Sorted Tables - ABAP Keyword Documentation - SAP Online Help 4: Standard Tables - ABAP Keyword Documentation - SAP Online Help 5: Hashed Tables - ABAP Keyword Documentation - SAP Online Help
For the assignment, gv_target = gv_source.
which of the following data declarations will always work without truncation or rounding? Note: There
are 2 correct answers to this question.
DATA gv_source TYPE string, to DATA gv_target TYPE c.
DATA gv_source TYPE c. to DATA gv_target TYPE string.
DATA gv_source TYPE d. to DATA gv_target TYPE string.
DATA gv_source TYPE p LENGTH 8 DECIMALS 3. to DATA gv_target TYPE p LENGTH 16 DECIMALS 2.
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.
References: 1: ABAP Data Types - ABAP Keyword Documentation - SAP Online Help 2: ABAP Assignment Rules - ABAP Keyword Documentation - SAP Online Help
Given the following code,
DATA gv_text1 TYPE string. "#EC_NEEDED
DATA gv_text2 TYPE string ##NEEDED.
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
What are some characteristics of secondary keys for internal tables? Note: There are 3 correct answers to this question.
Secondary keys must be chosen explicitly when you actually read from an internal table.
Multiple secondary keys are allowed for any kind of internal table.
Hashed secondary keys do NOT have to be unique.
Sorted secondary keys do NOT have to be unique.
Secondary keys can only be created for standard tables.
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.
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.
References: 1: Secondary Table Key - ABAP Keyword Documentation 2: READ TABLE - ABAP Keyword Documentation 3: Sorted Tables - ABAP Keyword Documentation : Hashed Tables - ABAP Keyword Documentation
You have a superclass superl and a subclass subl of superl. Each class has an instance constructor and a static constructor. The first statement of your program creates an instance of subl. In which sequence will the constructors be executed?
The sequence in which the constructors will be executed is as follows:
Class constructor of superl. This is because the class constructor is a static method that is executed automatically before the class is accessed for the first time. The class constructor is used to initialize the static attributes and components of the class. The class constructor of the superclass is executed before the class constructor of the subclass, as the subclass inherits the static components of the superclass12
Class constructor of subl. This is because the class constructor is a static method that is executed automatically before the class is accessed for the first time. The class constructor is used to initialize the static attributes and components of the class. The class constructor of the subclass is executed after the class constructor of the superclass, as the subclass inherits the static components of the superclass12
Instance constructor of superl. This is because the instance constructor is an instance method that is executed automatically when an instance of the class is created using the statement CREATE OBJECT. The instance constructor is used to initialize the instance attributes and components of the class. The instance constructor of the superclass is executed before the instance constructor of the subclass, as the subclass inherits the instance components of the superclass. The instance constructor of the subclass must call the instance constructor of the superclass explicitly using super->constructor, unless the superclass is the root node object12
Instance constructor of subl. This is because the instance constructor is an instance method that is executed automatically when an instance of the class is created using the statement CREATE OBJECT. The instance constructor is used to initialize the instance attributes and components of the class. The instance constructor of the subclass is executed after the instance constructor of the superclass, as the subclass inherits the instance components of the superclass. The instance constructor of the subclass must call the instance constructor of the superclass explicitly using super->constructor, unless the superclass is the root node object12
References: Constructors of Classes - ABAP Keyword Documentation, METHODS - constructor - ABAP Keyword Documentation
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 of the following string functions are predicate functions? Note: There are 2 correct answers to this question.
find_any_not_of()
contains_any_of()
count_any_of()
matchesQ
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’ ).
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’ ).
References: 1: String Functions - ABAP Keyword Documentation
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
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.
They implement code pushdown.
They avoid data transfer completely.
They transfer computational results to the application server.
They compute results on the application server.
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.
References: 1: ABAP - Core Data Services (ABAP CDS) - ABAP Keyword Documentation 2: Open SQL - 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
/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
What is the purpose of a foreign key relationship between two tables in the ABAP Dictionary?
To document the relationship between the two tables
To ensure the integrity of data in the corresponding database tables
To create a corresponding foreign key relationship in the database
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.
References: Foreign Keys (SAP Library - ABAP Dictionary), Foreign Keys (SAP Library - BC - ABAP Dictionary)
https://help.sap.com/doc/saphelp_snc70/7.0/en-US/cf/21ea77446011d189700000e8322d00/content.htm
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.
Which ABAP SQL clause allows the use of inline declarations?
FROM
INTO CORRESPONDING FIELDS OF
INTO
FIELDS
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
SELECT SINGLE * FROM scarr INTO @
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.
References: 1: SELECT - ABAP Keyword Documentation - SAP Online Help 2: Inline Declarations - ABAP Keyword Documentation - SAP Online Help
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?
RAP BO Behavior Extension
SAP HANA database table extension
RAP BO Node Extension
Business Service Extension
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
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
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]
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
target_itab = VALUE #( FOR row IN source_itab (
field1 = row-field1
field2 = row-field2
field3 = row-field3 )
).
Which of the following statements are correct? Note: There are 2 correct answers to this question.
FOR defines a loop that runs over the content of source_itab
source_itab is only visible within the loop.
row is a predefined name and cannot be chosen arbitrarily.
row is only visible within the loop.
The code snippet in the image is an example of using the FOR statement to create an internal table with a constructor expression. The FOR statement introduces an iteration expression that runs over the content of source_itab and assigns each row to the variable row. The variable row is then used to populate the fields of target_itab12. Some of the correct statements about the code snippet are:
FOR defines a loop that runs over the content of source_itab: This is true. The FOR statement iterates over the rows of source_itab and assigns each row to the variable row. The iteration expression can also specify a range or a condition for the loop12.
row is only visible within the loop: This is true. The variable row is a local variable that is only visible within the scope of the iteration expression. It cannot be accessed outside the loop12.
You cannot do any of the following:
source_itab is only visible within the loop: This is false. The variable source_itab is not a local variable that is defined by the FOR statement. It is an existing internal table that is used as the data source for the iteration expression. It can be accessed outside the loop12.
row is a predefined name and cannot be chosen arbitrarily: This is false. The variable row is not a predefined name that is reserved by the FOR statement. It is a user-defined name that can be chosen arbitrarily. However, it must not conflict with any existing names in the program12.
References: 1: FOR - Iteration Expressions - ABAP Keyword Documentation - SAP Online Help 2: ABAP 7.4 Syntax - FOR Loop iteration | SAP Community
Copyright © 2014-2025 Certensure. All Rights Reserved