In RESTful Application Programming, which EML statement retrieves an object?
Find entity
Select entity
Get entity
Read entity
In RESTful Application Programming, the EML statement that retrieves an object is GET entity. The GET entity statement is used to read data of an entity instance from the database or the transaction buffer. The GET entity statement can specify the entity name, the entity key, and the entity elements to be retrieved. The GET entity statement can also use the IN LOCAL MODE addition to bypass the access control, authorization control, and feature control checks. The GET entity statement returns a single entity instance or raises an exception if no instance is found or multiple instances match the key.
The other EML statements are not used to retrieve an object, but have different purposes and effects. These statements are:
References: GET ENTITY - ABAP Keyword Documentation, FIND ENTITY, ENTITIES - ABAP Keyword Documentation, SELECT ENTITY, ENTITIES - ABAP Keyword Documentation, READ - ABAP Keyword Documentation
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:
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:
References: 1: Predicate Expressions - ABAP Keyword Documentation - SAP Online Help 2: ABAP - Predicates | SAP Community
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 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:
References: 1: ABAP - Core Data Services (ABAP CDS) - ABAP Keyword Documentation 2: Open SQL - ABAP Keyword Documentation
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
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
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
The "demo_ods_assoc_spfi data source referenced in line #4 contains a field "connid" which you would like to expose in the element list.
Which of the following statements would do this if inserted on line #8?
demo_ods_assoc_spfli.connid,
demo_ods_assoc_spfli-connid/
spfli-connid,
_spfli.connid/
The statement that can be used to expose the field “connid†of the data source “demo_ods_assoc_spfli†in the element list is A. demo_ods_assoc_spfli.connid,. This statement uses the dot notation to access the field “connid†of the data source “demo_ods_assoc_spfliâ€, which is an association defined on line #4. The association “demo_ods_assoc_spfli†links the data source “demo_ods†with the table “spfli†using the field “carridâ€. The statement also ends with a comma to separate it from the next element in the list12.
You cannot do any of the following:
References: 1: ABAP CDS - SELECT, select_list - ABAP Keyword Documentation - SAP Online Help 2: ABAP CDS - SELECT, from - 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:
References: 1: ABAP Data Types - ABAP Keyword Documentation - SAP Online Help 2: ABAP Assignment Rules - ABAP Keyword Documentation - SAP Online Help
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
Exhibit:
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:
You cannot do any of the following:
References: 1: FOR - Iteration Expressions - ABAP Keyword Documentation - SAP Online Help 2: ABAP 7.4 Syntax - FOR Loop iteration | SAP Community
Given the following Core Data Services View Entity Data Definition:?demo_cds_assoc_spfli? data source referenced in line #4 contains a field ?connid? which you would like to expose in the element list. Which of the following statements would do this if inserted on line #8?
spfli-connid,
demo_cds_assoc_spfli-connid,
demo_cds_assoc_spfli.connid,
_spfli.connid,
Exhibit:
What are valid statements? Note: There are 3 correct answers to this question.
go_if 1 may call method ml with go_ift->ml().
Instead of go ell = NEW #(...) you could use go ifl = NEW cll(. ... ).
go_cll may call method ml with go_dl->ifl-ml().
Instead of go_cll = NEW #() you could use go_iff - NEW #(...).
go_ifl may call method m2 with go if->m2(...).
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, NEW - ABAP Keyword Documentation
You are given the following information:
1.
The data source "spfli" on line #2 is an SAP HANA
database table
2.
"spfli" will be a large table with over one million rows.
3.
This program is the only one in the system that accesses
the table.
4.
This program will run rarely.
Based on this information, which of the following general
settings should you set for the spfli database table? Note:
There are 2 correct answers to this question.
"Storage Type" to "Column Store"
"Load Unit to "Column Loadable"
"Storage Type" to "Row Store"
"Load Unit' to 'Page Loadable"
Based on the given information, the spfli database table should have the following general settings:
References: 1: Table Types in SAP HANA | SAP Help Portal 2: [Row Store vs Column Store in SAP HANA | SAP Blogs] 3: [Load Unit | SAP Help Portal]
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:
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.
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.
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:
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.
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
Which patterns raise an exception? Note: There are 3 correct answers to this question.
DATA: gv_target TYPE p DECIMALS 2. CONSTANTS: go intl TYPE i VALUE 3. gv_target -U EXACT (2 gcojntl).
DATA: gv_target TYPE string. â–¡ CONSTANTS: gco_string TYPE LENGTH 16 VALUE 0123456789ABCDEF*. gv_target = EXACT # gco_string+5 (5) ).
DATA: gv_target TYPE c LENGTH 5. V â–¡ CONSTANTS: ECO string TYPE string VALUE 0123456789ABCDEF". gv_target - EXACT (gco_string + 5 (6) ).
DATA: Ev target TYPE p DECIMALS 3. CONSTANTS: gcojntl TYPE i VALUE 2. Ev_target -U EXACT #2 / gcojntl ).
DATA: gv_target TYPE d. s/ â–¡ CONSTANTS: gco_date TYPE d VALUE '20331233*. gv_target EXACT ( geo_date).
The patterns that raise an exception are those that use the constructor operator EXACT to perform a lossless assignment or calculation, but the result cannot be converted to the target data type without data loss. The following are the explanations for each pattern:
References: EXACT - Lossless Operator - ABAP Keyword Documentation, Lossless Assignments - ABAP Keyword Documentation
Which of the following are parts of the definition of a new database table? Note: There are 2 correct answers to this question.
Partitioning attributes
Extension
Semantic table attributes
Field list
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
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
Why would you use Access Controls with CDS Views? Note: There are 2 correct answers to this question.
Only the data corresponding to the user's authorization is transferred from the database to the application layer.
The system field sy-subrc is set, giving you the result of the authorization check
You do not have to remember to implement AUTHORITY CHECK statements.
All of the data from the data sources is loaded into your application automatically and filtered there according to the user's authorization.
You would use Access Controls with CDS Views for the following reasons:
The following reasons are not valid for using Access Controls with CDS Views:
References: 1: Access Controls | SAP Help Portal 2: ABAP CDS - Access Control - ABAP Keyword Documentation
In ABAP SQL, which of the following can be assigned an alias? Note: There are 2 correct answers to this question.
order criterion (from order by clause)
field (from field list)
database table
group criterion (from group by clause)
In ABAP SQL, an alias is a temporary name that can be assigned to a field or a database table in a query. An alias can be used to make the query more readable, to avoid name conflicts, or to access fields or tables with long names. An alias is created with the AS keyword and is only valid for the duration of the query1.
The following are examples of how to assign an alias to a field or a database table in ABAP SQL:
SELECT carrid, carrname AS name FROM scarr.
The alias name can be used instead of carrname in other clauses of the query, such as WHERE, GROUP BY, ORDER BY, and so on2.
SELECT c.carrid, c.carrname FROM scarr AS c.
The alias c can be used instead of scarr in other clauses of the query, such as WHERE, JOIN, GROUP BY, ORDER BY, and so on3.
The following are not valid for assigning an alias in ABAP SQL:
References: 1: ALIASES - ABAP Keyword Documentation 2: SELECT List - ABAP Keyword Documentation 3: FROM Clause - 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.
TESTED 03 Dec 2024