In what order are objects created to generate a RESTful Application Programming application?
Correct Answer: C
Explanation The order in which objects are created to generate a RESTful Application Programming application is A, D, C, B. This means that the following steps are followed: First, a database table is created to store the data for the application. A database table is a CDS DDIC-based view that defines a join or union of database tables. A database table has an SQL view attached and can be accessed by Open SQL or native SQL. Second, a data model view is created to define a data model based on the database table or other CDS view entities. A data model view is a CDS view entity that can have associations, aggregations, filters, parameters, and annotations. A data model view can also define the behavior definition and implementation for the business object. Third, a service definition is created to define the service interface for the application. A service definition is a CDS view entity that defines a projection on a data model view or another service definition. A service definition can also define service metadata, such as service name, version, description, and annotations. Fourth, a service binding is created to define the service binding for the application. A service binding is a CDS view entity that defines a projection on a service definition. A service binding can also define the service protocol, such as OData V2, OData V4, or REST, and the service URL. References: CDS Data Model Views - ABAP Keyword Documentation, CDS Service Definitions - ABAP Keyword Documentation, CDS Service Bindings - ABAP Keyword Documentation, CDS Projection Views - ABAP Keyword Documentation
Question 47
Which of the following results in faster access to internal tables? Note: There are 3 correct answers to this question.
Correct Answer: B,D,E
The access to internal tables can be optimized by using the appropriate table type and specifying the table key. The table key is a set of fields that uniquely identifies a row in the table and determines the sorting order of the table. The table key can be either the primary key or a secondary key. The primary key is defined by the table type and the table definition, while the secondary key is defined by the user using the KEY statement1. The following results in faster access to internal tables: * B. In a sorted internal table, specifying the primary key completely. A sorted internal table is a table type that maintains a predefined sorting order, which is defined by the primary key in the table definition. The primary key can be either unique or non-unique. A sorted internal table can be accessed using the primary key or the table index. The access using the primary key is faster than the access using the table index, because the system can use a binary search algorithm to find the row. However, the primary key must be specified completely, meaning that all the fields of the primary key must be given in the correct order and without gaps2. * D. In a hashed internal table, specifying the primary key partially from the left without gaps. A hashed internal table is a table type that does not have a predefined sorting order, but uses a hash algorithm to store and access the rows. The primary key of a hashed internal table must be unique and cannot be changed. A hashed internal table can only be accessed using the primary key, not the table index. The access using the primary key is very fast, because the system can directly calculate the position of the row using the hash algorithm. The primary key can be specified partially from the left without gaps, meaning that some of the fields of the primary key can be omitted, as long as they are the rightmost fields and there are no gaps between the specified fields. * E. In a hashed internal table, specifying the primary key completely. A hashed internal table is a table type that does not have a predefined sorting order, but uses a hash algorithm to store and access the rows. The primary key of a hashed internal table must be unique and cannot be changed. A hashed internal table can only be accessed using the primary key, not the table index. The access using the primary key is very fast, because the system can directly calculate the position of the row using the hash algorithm. The primary key can be specified completely, meaning that all the fields of the primary key must be given in the correct order. The following do not result in faster access to internal tables, because: * A. In a sorted internal table, specifying the primary key partially from the left without gaps. A sorted internal table is a table type that maintains a predefined sorting order, which is defined by the primary key in the table definition. The primary key can be either unique or non-unique. A sorted internal table can be accessed using the primary key or the table index. The access using the primary key is faster than the access using the table index, because the system can use a binary search algorithm to find the row. However, the primary key must be specified completely, meaning that all the fields of the primary key must be given in the correct order and without gaps. If the primary key is specified partially from the left without gaps, the system cannot use the binary search algorithm and has to perform a linear search, which is slower2. * C. In a standard internal table, specifying the primary key partially from the left without gaps. A standard internal table is a table type that does not have a predefined sorting order, but uses a sequential storage and access of the rows. The primary key of a standard internal table is the standard key, which consists of all the fields of the table row in the order in which they are defined. A standard internal table can be accessed using the primary key or the table index. The access using the primary key is slower than the access using the table index, because the system has to perform a linear search to find the row. The primary key can be specified partially from the left without gaps, but this does not improve the access speed, because the system still has to perform a linear search. References: 1: Internal Tables - Overview - ABAP Keyword Documentation 2: Sorted Tables - ABAP Keyword Documentation : Hashed Tables - ABAP Keyword Documentation : Standard Tables - ABAP Keyword Documentation
Question 48
Which of the following actions cause an indirect change to a database table requiring a table conversion? Note: There are 2 correct answers to this question.
Correct Answer: A,C
The following are the explanations for each action: * A: Renaming a field in a structure that is included in the table definition causes an indirect change to the database table, as the field name in the table is derived from the structure. This change requires a table conversion, as the existing data in the table must be copied to a new table with the new field name, and the old table must be deleted. * B: Changing the field labels of a data element that is used in the table definition does not cause an indirect change to the database table, as the field labels are only used for documentation and display purposes. This change does not require a table conversion, as the existing data in the table is not affected by the change. * C: Deleting a field from a structure that is included in the table definition causes an indirect change to the database table, as the field is removed from the table as well. This change requires a table conversion, as the existing data in the table must be copied to a new table without the deleted field, and the old table must be deleted. * D: Shortening the length of a domain used in a data element that is used in the table definition causes an indirect change to the database table, as the field length in the table is derived from the domain. This change requires a table conversion, as the existing data in the table must be checked for compatibility with the new field length, and any data that exceeds the new length must be truncated or rejected. References: Converting Database Tables - ABAP Keyword Documentation, Adjustment of Database Structures - ABAP Keyword Documentation
Question 49
In which products must you use the ABAP Cloud Development Model? Note: There are 2 correct answers to this question.
Correct Answer: A,B
Explanation 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
Question 50
What would be the correct expression to change a given string value 'mr joe doe' into 'JOE' in an ABAP SQL field list?
Correct Answer: C
Explanation The correct expression to change a given string value 'mr joe doe' into 'JOE' in an ABAP SQL field list is C: SELECT FROM TABLE dbtabl FIELDS Of1, substring(upper('mr joe doe'), 4, 3) AS f2_sub_up, f3,... This expression uses the following SQL functions for strings12: upper: This function converts all lowercase characters in a string to uppercase. For example, upper('mr joe doe') returns 'MR JOE DOE'. substring: This function returns a substring of a given string starting from a specified position and with a specified length. For example, substring('MR JOE DOE', 4, 3) returns 'JOE'. AS: This keyword assigns an alias or a temporary name to a field or an expression in the field list. For example, AS f2_sub_up assigns the name f2_sub_up to the expression substring(upper('mr joe doe'), 4, 3). You cannot do any of the following: A: SELECT FROM TABLE dbtabl FIELDS Of1, upper(left( 'mr joe doe', 6)) AS f2_up_left, f3,...: This expression uses the wrong SQL function for strings to get the desired result. The left function returns the leftmost characters of a string with a specified length, ignoring the trailing blanks. For example, left( 'mr joe doe', 6) returns 'mr joe'. Applying the upper function to this result returns 'MR JOE', which is not the same as 'JOE'. B: SELECT FROM TABLE dbtabl FIELDS Of1, left(lower(substring( 'mr joe doe', 4, 3)), 3) AS f2_left_lo_sub, f3,...: This expression uses unnecessary and incorrect SQL functions for strings to get the desired result. The lower function converts all uppercase characters in a string to lowercase. For example, lower(substring( 'mr joe doe', 4, 3)) returns 'joe'. Applying the left function to this result with the same length returns 'joe' again, which is not the same as 'JOE'. D: SELECT FROM TABLE dbtabl FIELDS Of1, substring(lower(upper( 'mr joe doe' ) ), 4, 3) AS f2_sub_lo_up, f3,...: This expression uses unnecessary and incorrect SQL functions for strings to get the desired result. The lower function converts all uppercase characters in a string to lowercase, and the upper function converts all lowercase characters in a string to uppercase. Applying both functions to the same string cancels out the effect of each other and returns the original string. For example, lower(upper( 'mr joe doe' ) ) returns 'mr joe doe'. Applying the substring function to this result returns 'joe', which is not the same as 'JOE'. References: 1: SQL Functions for Strings - ABAP Keyword Documentation - SAP Online Help 2: sql_func - String Functions - ABAP Keyword Documentation - SAP Online Help