Which internal table type allows unique and non-unique keys?
Sorted
Hashed
Standard
The internal table type that allows both unique and non-unique keys is the standard table. A standard table has an internal linear index that can be used to access the table entries. The key of a standard table is always non-unique, which means that the table can contain duplicate entries. However, the system does not check the uniqueness of the key when inserting new entries, so the programmer can ensure that the key is unique by using appropriate logic. A standard table can be accessed either by using the table index or the key, but the response time for key access is proportional to the table size.
The other two internal table types, sorted and hashed, do not allow non-unique keys. A sorted table is filled in sorted order according to the defined table key, which must be unique. A sorted table can be accessed either by using the table index or the key, but the response time for key access is logarithmically proportional to the table size. A hashed table can only be accessed by using a unique key, which must be specified when declaring the table. A hashed table has no index, and the response time for key access is constant, regardless of the table size.
References: Internal Tables - ABAP Keyword Documentation, SAP ABAP: Types Of Internal Table Declaration - dan852.com
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
You cannot do any of the following:
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
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:
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:
References: Developer Extensibility in SAP S/4HANA Cloud ABAP Environment, SAP S/4HANA Extensibility – Simplified Guide for Beginners
Which of the following results in faster access to internal tables? Note: There are 3 correct answers to this question.
In a sorted internal table, specifying the primary key partially from the left without gaps.
In a sorted internal table, specifying the primary key completely.
In a standard internal table, specifying the primary key partially from the left without gaps.
In a hashed internal table, specifying the primary key partially from the left without gaps.
In a hashed internal table, specifying the primary key completely.
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:
The following do not result in faster access to internal tables, because:
References: 1: Internal Tables - Overview - ABAP Keyword Documentation 2: Sorted Tables - ABAP Keyword Documentation : Hashed Tables - ABAP Keyword Documentation : Standard Tables - 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.
After you created a database table in the RESTful Application Programming model, what do you create next?
A metadata extension
A projection view
A data model view
A service definition
After you created a database table in the RESTful Application Programming model (RAP), the next step is to create a projection view on the database table. A projection view is a CDS artefact that defines a view on one or more data sources, such as tables, views, or associations. A projection view can select, rename, or aggregate the fields of the data sources, but it cannot change the properties of the fields, such as whether they are read-only or not. The properties of the fields are inherited from the data sources or the behaviour definitions of the business objects12. For example:
define view ZI_AGENCY as select from /dmo/agency { key agency_id, agency_name, street, city, region, postal_code, country, phone_number, url }
The projection view is used to expose the data of the database table to the service definition, which is the next step in the RAP. The service definition is a CDS artefact that defines the interface and the binding of a service. A service is a CDS entity that exposes the data and the functionality of one or more business objects as OData, InA, or SQL services. A service definition can specify the properties of the fields of a service, such as whether they are filterable, sortable, or aggregatable12. For example:
define service ZI_AGENCY_SRV { expose ZI_AGENCY as Agency; }
You cannot do any of the following:
References: 1: ABAP CDS - Data Definitions - ABAP Keyword Documentation - SAP Online Help 2: ABAP CDS - Service Definitions - ABAP Keyword Documentation - SAP Online Help
Setting a field to read-only in which object would make the field read-only in all applications of the RESTful Application Programming model?
Service definition
Behaviour definition
Projection view
Metadata extension
The object that can be used to set a field to read-only in all applications of the RESTful Application Programming model (RAP) is the behaviour definition. The behaviour definition is a CDS artefact that defines the business logic and the UI behaviour of a business object. A business object is a CDS entity that represents a business entity or concept, such as a customer, an order, or a product. The behaviour definition can specify the properties of the fields of a business object, such as whether they are mandatory, read-only, or transient. These properties are valid for all applications that use the business object, such as transactional, analytical, or draft-enabled apps12. For example:
define behavior for ZI_PB_APPLICATION { field ( read only ) APPLICATION; … }
You cannot do any of the following:
References: 1: ABAP CDS - Data Definitions - ABAP Keyword Documentation - SAP Online Help 2: ABAP CDS - Behavior Definitions - ABAP Keyword Documentation - SAP Online Help
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:
References: sql_exp - sql_arith - ABAP Keyword Documentation, SQL Expressions, Arithmetic Calculations - ABAP Keyword Documentation
Which of the following are ABAP Cloud Development Model rules?
Note: There are 2 correct answers to this question.
Use public SAP APIs and SAP extension points.
Build ABAP RESTful application programming model-based services.
Reverse modifications when a suitable public SAP API becomes available.
Build ABAP reports with either ABAP List Viewer (ALV) or SAP Fiori.
Which RESTful Application Programming object can be used to organize the display of fields in an app?
Data model view
Metadata extension
Service definition
Projection view
A metadata extension is a RESTful Application Programming object that can be used to organize the display of fields in an app. A metadata extension is a CDS view that annotates another CDS view with UI annotations, such as labels, icons, or facets. These annotations define how the data should be presented in the app, such as which fields should be shown on the object page, which fields should be editable, or which fields should be used for filtering or sorting. A metadata extension can also be used to add custom actions or validations to the app12. References: 1: Refine the Object Page with Annotations | SAP Tutorials 2: ABAP RAP : Enabling custom actions with a dialog for additional input fields | SAP Blogs
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:
References: Behavior Implementation - ABAP Keyword Documentation, Behavior Definition - ABAP Keyword Documentation
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:
contains_any_of( val = ‘ABAP’ set = ‘ABC’ ).
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:
find_any_not_of( val = ‘ABAP’ set = ‘ABC’ ).
count_any_of( val = ‘ABAP’ set = ‘ABC’ ).
References: 1: String Functions - ABAP Keyword Documentation
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:
References: 1: ABAP Data Types - ABAP Keyword Documentation - SAP Online Help 2: ABAP Assignment Rules - ABAP Keyword Documentation - SAP Online Help
What would be the correct expression to change a given string value 'mr joe doe' into 'JOE' in an ABAP SQL field list?
SELECT FROM TABLE dbtabl FIELDS
Of1,
upper(left( 'mr joe doe', 6)) AS f2_up_left, f3,
SELECT FROM TABLE dbtabl FIELDS
Of1,
left(lower(substring( 'mr joe doe', 4, 3)), 3) AS f2_left_lo_sub, f3,
SELECT FROM TABLE dbtabl FIELDS
Of1,
substring(upper('mr joe doe'), 4, 3) AS f2_sub_up, f3,...
SELECT FROM TABLE dbtabl FIELDS
Of1,
substring(lower(upper( 'mr joe doe' ) ), 4, 3) AS f2_sub_lo_up, f3,
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:
You cannot do any of the following:
References: 1: SQL Functions for Strings - ABAP Keyword Documentation - SAP Online Help 2: sql_func - String Functions - ABAP Keyword Documentation - SAP Online Help
Which function call returns 0?
Count_any_of ( val - ‘ABAP ABAP abap' sub "AB" )
Count (val - 'ABAP ABAP abap' sub - 'AB' )
find_any_of (val = "ABAP ABAP abap' sub = "AB")
find_any_not_of( val 'ABAP ABAP abap’ sub = 'AB')
The function find_any_not_of returns the position of the first character in the string val that is not contained in the string sub. If no such character is found, the function returns 0. In this case, the string val contains only the characters A, B, and a, which are all contained in the string sub, so the function returns 0. The other functions return positive values, as follows:
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
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:
Define view entity Z_CONVERT With parameters currency : abap.cuky as select from … { … }
Define view entity Z_CONVERT With parameters currency : waers as select from … { … }
You cannot do any of the following:
References: 1: ABAP CDS - SELECT, parameter_list - ABAP Keyword Documentation - SAP Online Help 2: ABAP Data Types - ABAP Keyword Documentation - SAP Online Help
In ABAP SQL, which of the following retrieves the association field_Airline-Name of a CDS view?
\_Airline-Name
/_Airline Name
@_Airline-Name
"_Airline Name
In ABAP SQL, the syntax to retrieve the association field of a CDS view is to use the @ sign followed by the association name and the field name, separated by a period sign (.). For example, to retrieve the association field _Airline-Name of a CDS view, the syntax is @_Airline.Name. This syntax allows the access to the fields of the target data source of the association without explicitly joining the data sources1. The other options are incorrect because they use the wrong symbols or formats to access the association field.
References: 1: Path Expressions - 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:
References: Constructors of Classes - ABAP Keyword Documentation, METHODS - constructor - 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 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
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:
The other statements are not valid, as they have syntax errors or logical errors. These statements are:
References: INTERFACES - ABAP Keyword Documentation, CLASS - ABAP Keyword Documentation
TESTED 22 Nov 2024