SAP Certified Associate - Back-End Developer - ABAP Cloud Questions and Answers
What are valid statements? Note: There are 3 correct answers to this question
Options:
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.
Answer:
C, D, EExplanation:
The following are the explanations for each statement:
- C: This statement is valid. Class CL1 uses the interface. This is because class CL1 implements the interface ifl using the INTERFACES statement in the public section of the class definition. The INTERFACES statement makes the class compatible with the interface and inherits all the components of the interface. The class can then use the interface components, such as the method ml, by using the interface component selector ~, such as ifl~ml12
- E: This statement is valid. Class CL1 implements the interface. This is because class CL1 implements the interface ifl using the INTERFACES statement in the public section of the class definition. The INTERFACES statement makes the class compatible with the interface and inherits all the components of the interface. The class must then provide an implementation for the interface method ml in the implementation part of the class, unless the method is declared as optional or abstract12
- D: This statement is valid. In class CL2, the interface method is named ifl~ml. This is because class CL2 has a data member named m0_ifl of type REF TO ifl, which is a reference to the interface ifl. The interface ifl defines a method ml, which can be called using the reference variable m0_ifl. The interface method ml has the name ifl~ml in the class, where ifl is the name of the interface and the character ~ is the interface component selector12
The other statements are not valid, as they have syntax errors or logical errors. These statements are:
- A: This statement is not valid. In class CL1, the interface method is named ifl~ml, not if-ml. This is because class CL1 implements the interface ifl using the INTERFACES statement in the public section of the class definition. The interface ifl defines a method ml, which can be called using the class name or a reference to the class. The interface method ml has the name ifl~ml in the class, where ifl is the name of the interface and the character ~ is the interface component selector. Using the character - instead of the character ~ will cause a syntax error12
- B: This statement is not valid. Class CL2 does not use the interface, but only has a reference to the interface. This is because class CL2 has a data member named m0_ifl of type REF TO ifl, which is a reference to the interface ifl. The interface ifl defines a method ml, which can be called using the reference variable m0_ifl. However, class CL2 does not implement the interface ifl, nor does it inherit the interface components. Therefore, class CL2 does not use the interface, but only references the interface12
References: INTERFACES - ABAP Keyword Documentation, CLASS - ABAP Keyword Documentation
In what order are objects created to generate a RESTful Application Programming application?
Options:
Database table 1
Service binding Projection view 4
Service definition 3
Data model view 2
D A B C
B D C A
A D C B
Answer:
CExplanation:
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
After you created a database table in the RESTful Application Programming model, what do you create next?
Options:
A metadata extension
A projection view
A data model view
A service definition
Answer:
BExplanation:
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:
- The following code snippet defines a projection view ZI_AGENCY on the database table /DMO/AGENCY:
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:
- The following code snippet defines a service definition ZI_AGENCY_SRV that exposes the projection view ZI_AGENCY as an OData service:
define service ZI_AGENCY_SRV { expose ZI_AGENCY as Agency; }
You cannot do any of the following:
- A. A metadata extension: A metadata extension is a CDS artefact that defines additional annotations for a CDS entity, such as a business object, a service, or a projection view. A metadata extension can specify the properties of the fields of a CDS entity for UI or analytical purposes, such as whether they are visible, editable, or hidden. However, a metadata extension is not the next step after creating a database table in the RAP, as it is not required to expose the data of the database table to the service definition. A metadata extension can be created later to customize the UI or analytical application that uses the service12.
- C. A data model view: A data model view is a CDS artefact that defines a view on one or more data sources, such as tables, views, or associations. A data model view can select, rename, or aggregate the fields of the data sources, and it can also change the properties of the fields, such as whether they are read-only or not. The properties of the fields are defined by the annotations or the behaviour definitions of the data model view. A data model view is used to define the data model of a business object, which is a CDS entity that represents a business entity or concept, such as a customer, an order, or a product. However, a data model view is not the next step after creating a database table in the RAP, as it is not required to expose the data of the database table to the service definition. A data model view can be created later to define a business object that uses the database table as a data source12.
- D. A service definition: A 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 aggregatable. However, a service definition is not the next step after creating a database table in the RAP, as it requires a projection view or a data model view to expose the data of the database table. A service definition can be created after creating a projection view or a data model view on the database table12.
References: 1: ABAP CDS - Data Definitions - ABAP Keyword Documentation - SAP Online Help 2: ABAP CDS - Service Definitions - ABAP Keyword Documentation - SAP Online Help
Which patterns raise an exception? Note: There are 3 correct answers to this question.
Options:
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).
Answer:
A, C, EExplanation:
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:
- A: This pattern raises the exception CX_SY_CONVERSION_LOST because the result of the calculation 2 * 3 is 6, which cannot be assigned to a packed number with two decimal places without losing the integer part. The operator -U is used to perform a lossless calculation with the calculation type decfloat34.
- B: This pattern does not raise an exception because the result of the substring expression gco_string+5(5) is ‘6789A’, which can be assigned to a string without data loss. The operator EXACT # is used to perform a lossless assignment with the data type of the argument.
- C: This pattern raises the exception CX_SY_CONVERSION_LOST because the result of the substring expression gco_string+5(6) is ‘6789AB’, which cannot be assigned to a character field with length 5 without losing the last character. The operator EXACT is used to perform a lossless assignment with the data type of the target field.
- D: This pattern does not raise an exception because the result of the calculation 2 / 2 is 1, which can be assigned to a packed number with three decimal places without data loss. The operator -U is used to perform a lossless calculation with the calculation type decfloat34.
- E: This pattern raises the exception CX_SY_CONVERSION_ERROR because the constant gco_date contains an invalid value ‘20331233’ for a date data type, which cannot be converted to a valid date. The operator EXACT is used to perform a lossless assignment with the data type of the target field.
References: EXACT - Lossless Operator - ABAP Keyword Documentation, Lossless Assignments - ABAP Keyword Documentation
Which field is defined incorrectly?
Options:
field1
field3
field4
field2
Answer:
CExplanation:
The field4 is defined incorrectly in the ABAP code snippet. The reason is that the data type c (character) cannot have a decimal places specification. The decimal places specification is only valid for the data types p (packed number) and f (floating point number)1. Therefore, the field4 definition should either omit the decimal places specification or change the data type to p or f.
References: 1: Data Types and Data Objects - ABAP Keyword Documentation - SAP Online Help
Exhibit:
With Icl_super being superclass for Icl_subl and Icl_sub2 and with methods subl_methl and sub2_methl being subclass-specific methods of Id_subl or Icl_sub2, respectivel. What will happen when executing these casts? Note:
There are 2 correct answers to this question
Options:
go subl = CAST # go super), will not work
go_sub2 = CAST # go super), will work. go_subl CAST #go_super), will work
go_sub2 = CAST #(go_super). will not work. ] go sub2->sub2 meth 1(...). will work
go_subl->subl_meth !(...)• w'll work.
Answer:
A, DExplanation:
The following are the explanations for each statement:
- A: This statement is correct. go_subl = CAST #(go_super) will not work. This is because go_subl is a data object of type REF TO cl_subl, which is a reference to the subclass cl_subl. go_super is a data object of type REF TO cl_super, which is a reference to the superclass cl_super. The CAST operator is used to perform a downcast or an upcast of a reference variable to another reference variable of a compatible type. A downcast is a conversion from a more general type to a more specific type, while an upcast is a conversion from a more specific type to a more general type. In this case, the CAST operator is trying to perform a downcast from go_super to go_subl, but this is not possible, as go_super is not pointing to an instance of cl_subl, but to an instance of cl_super. Therefore, the CAST operator will raise an exception CX_SY_MOVE_CAST_ERROR at runtime12
- B: This statement is incorrect. go_sub2 = CAST #(go_super) will work. go_subl = CAST #(go_super) will not work. This is because go_sub2 is a data object of type REF TO cl_sub2, which is a reference to the subclass cl_sub2. go_super is a data object of type REF TO cl_super, which is a reference to the superclass cl_super. The CAST operator is used to perform a downcast or an upcast of a reference variable to another reference variable of a compatible type. A downcast is a conversion from a more general type to a more specific type, while an upcast is a conversion from a more specific type to a more general type. In this case, the CAST operator is trying to perform a downcast from go_super to go_sub2, and this is possible, as go_super is pointing to an instance of cl_sub2, which is a subclass of cl_super. Therefore, the CAST operator will assign the reference of go_super to go_sub2 without raising an exception. However, the CAST operator will not work for go_subl, as explained in statement A12
- C: This statement is incorrect. go_sub2 = CAST #(go_super) will work. go_sub2->sub2_meth1(…) will not work. This is because go_sub2 is a data object of type REF TO cl_sub2, which is a reference to the subclass cl_sub2. go_super is a data object of type REF TO cl_super, which is a reference to the superclass cl_super. The CAST operator is used to perform a downcast or an upcast of a reference variable to another reference variable of a compatible type. A downcast is a conversion from a more general type to a more specific type, while an upcast is a conversion from a more specific type to a more general type. In this case, the CAST operator is trying to perform a downcast from go_super to go_sub2, and this is possible, as go_super is pointing to an instance of cl_sub2, which is a subclass of cl_super. Therefore, the CAST operator will assign the reference of go_super to go_sub2 without raising an exception. However, the method call go_sub2->sub2_meth1(…) will not work, as sub2_meth1 is a subclass-specific method of cl_sub2, which is not inherited by cl_super. Therefore, the method call will raise an exception CX_SY_DYN_CALL_ILLEGAL_METHOD at runtime123
- D: This statement is correct. go_subl->subl_meth1(…) will work. This is because go_subl is a data object of type REF TO cl_subl, which is a reference to the subclass cl_subl. subl_meth1 is a subclass-specific method of cl_subl, which is not inherited by cl_super. Therefore, the method call go_subl->subl_meth1(…) will work, as go_subl is pointing to an instance of cl_subl, which has the method subl_meth1123
References: NEW - ABAP Keyword Documentation, CAST - ABAP Keyword Documentation, Method Call - ABAP Keyword Documentation
In ABAP SQL, which of the following retneves the association field _Airline-Name of a CDS view?
Options:
\ Airnline-Name
@_Airline-Name
/_Anine-Name
*_Airline-Name
Answer:
BWhat 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.
Options:
They implement code pushdown.
They avoid data transfer completely.
They transfer computational results to the application server.
They compute results on the application server.
Answer:
A, CExplanation:
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
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.
Options:
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.
Answer:
B, CExplanation:
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
In a program you find this source code
AUTHORITY-CHECK OBJECT '/DWO/TRVL ( ID 'CNTRY' FIELD 'DE*
ID ACTVT FIELD '03".
Which of the following apply? Note: There are 2 correct answers to this question.
Options:
If the user is authorized for 'CNTRY = 'DE' then the return code is always 0.
If the user is NOT authorized for 'CNTRY' = 'DE' OR for 'ACTVT' = '03 then the program will terminate.
If the user is authorized for 'CNTRY = 'DE' AND for 'ACTVT = '03 then the return code is 0.
AUTHORITY CHECK verifies whether a user is authorized for/DMO/TRVL" with the listed field values.
Answer:
C, DYou 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.
Options:
built-in ABAP type
A built-in ABAP Dictionary type
A data element
A component of an ABAP Dictionary structure
Answer:
A, CExplanation:
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
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?
Options:
demo_ods_assoc_spfli.connid,
demo_ods_assoc_spfli-connid/
spfli-connid,
_spfli.connid/
Answer:
AExplanation:
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:
- B. demo_ods_assoc_spfli-connid/: This statement uses the wrong syntax to access the field “connid” of the data source “demo_ods_assoc_spfli”. The dash notation is used to access the components of a structure or a table, not the fields of a data source. The statement also ends with a slash, which is not a valid separator for the element list12.
- C. spfli-connid,: This statement uses the wrong data source name to access the field “connid”. The data source name should be “demo_ods_assoc_spfli”, not “spfli”. The statement also uses the wrong syntax to access the field “connid”, as explained above12.
- D. _spfli.connid/: This statement uses the wrong data source name and the wrong separator to access the field “connid”. The data source name should be “demo_ods_assoc_spfli”, not “_spfli”. The statement also ends with a slash, which is not a valid separator for the element list12.
References: 1: ABAP CDS - SELECT, select_list - ABAP Keyword Documentation - SAP Online Help 2: ABAP CDS - SELECT, from - ABAP Keyword Documentation - SAP Online Help
Which of the following integration frameworks have been released for ABAP cloud development? Note: There are 3 correct answers to this question.
Options:
SOAP consumption
CDS Views
Business Add-ins (BAdls)
Business Events
OData services
Answer:
A, D, EExplanation:
The following are the integration frameworks that have been released for ABAP cloud development:
- SOAP consumption: This framework allows you to consume SOAP web services from ABAP cloud applications. You can use the ABAP Development Tools in Eclipse to create a service consumption model based on a WSDL file or URL. The service consumption model generates the required ABAP artifacts, such as proxy classes, data types, and constants, to access the web service. You can then use the proxy classes to call the web service operations from your ABAP code1
- Business Events: This framework allows you to publish and subscribe to business events from ABAP cloud applications. Business events are messages that represent a change in the state of a business object or process. You can use the ABAP Development Tools in Eclipse to create a business event definition based on a CDS view entity or a projection view. The business event definition specifies the event key, the event payload, and the event metadata. You can then use the ABAP Messaging Channel (AMC) framework to publish and subscribe to business events using the AMC API2
- OData services: This framework allows you to expose and consume OData services from ABAP cloud applications. OData is a standardized protocol for creating and consuming RESTful APIs. You can use the ABAP RESTful Application Programming Model (RAP) to create OData services based on CDS view entities or projection views. The RAP framework generates the required OData metadata and runtime artifacts, such as service definitions, service bindings, and service implementations. You can then use the SAP Gateway framework to register and activate your OData services. You can also use the ABAP Development Tools in Eclipse to consume OData services from other sources using the service consumption model3
The other integration frameworks are not released for ABAP cloud development, as they are either not supported or not recommended for cloud scenarios. These frameworks are:
- CDS Views: CDS views are not an integration framework, but a data modeling framework. CDS views are used to define data models based on database tables or other CDS view entities. CDS views can have associations, aggregations, filters, parameters, and annotations. CDS views can also be used as the basis for other integration frameworks, such as OData services or business events4
- Business Add-ins (BAdls): BAdls are not supported for ABAP cloud development, as they are part of the classic ABAP enhancement framework. BAdls are used to implement custom logic in predefined enhancement spots in the standard SAP code. BAdls are not compatible with the cloud strategy and the clean core paradigm, as they modify the SAP code and can cause upgrade and maintenance issues. For ABAP cloud development, SAP recommends using the key user extensibility tools or the side-by-side extensibility approach instead of BAdls.
References: Consuming SOAP Services - ABAP Keyword Documentation, Business Events - ABAP Keyword Documentation, OData Services - ABAP Keyword Documentation, CDS Data Model Views - ABAP Keyword Documentation, [Business Add-Ins (BAdIs) - ABAP Keyword Documentation]
Given the following Core Data Service View Entity Data Definition:
1 @AccessControl.authorizationCheck: #NOT_REQUIRED
2 DEFINE VIEW ENTITY demo_flight_info_join
3 AS SELECT
4 FROM scarr AS a
5 LEFT OUTER JOIN scounter AS c
6 LEFT OUTER JOIN sairport AS p
7 ON p.id = c.airport
8 ON a.carrid = c.carrid
9 {
10 a.carridAS carrier_id,
11 p.idAS airport_id,
12 c.countnumAS counter_number
13 }
In what order will the join statements be executed?
Options:
scarr will be joined with scounter first and the result will be joined with sairport.
sairport will be joined to scounter first and the result will be joined with scarr.
scarr will be joined with sairport first and the result will be joined with scounter.
scounter will be joined to sairport first and the result will be joined with scarr.
Answer:
AExplanation:
The order in which the join statements will be executed is:
scarr will be joined with scounter first and the result will be joined with sairport.
This is because the join statements are nested from left to right, meaning that the leftmost data source is joined with the next data source, and the result is joined with the next data source, and so on. The join condition for each pair of data sources is specified by the ON clause that follows the data source name. The join type for each pair of data sources is specified by the join operator that precedes the data source name. In this case, the join operator is LEFT OUTER JOIN, which means that all the rows from the left data source are included in the result, and only the matching rows from the right data source are included. If there is no matching row from the right data source, the corresponding fields are filled with initial values1.
Therefore, the join statements will be executed as follows:
- First, scarr AS a will be joined with scounter AS c using the join condition a.carrid = c.carrid. This means that all the rows from scarr will be included in the result, and only the rows from scounter that have the same value for the carrid field will be included. If there is no matching row from scounter, the countnum field will be filled with an initial value.
- Second, the result of the first join will be joined with sairport AS p using the join condition p.id = c.airport. This means that all the rows from the first join will be included in the result, and only the rows from sairport that have the same value for the id field as the airport field from the first join will be included. If there is no matching row from sairport, the id field will be filled with an initial value.
References: 1: Join - ABAP Keyword Documentation
In this nested join below in which way is the join evaluated?
Options:
From the left to the right in the order of the tables:
1.
a is joined with b
2.
b is joined with c
From the right to the left in the order of the tables:
1.
b is joined with c.
2.
b is joined with a.
From the top to the bottom in the order of the on conditions
1.
b is joined with c
2.
a is joined with b
From the bottom to the top in the order of the on conditions:
1.
a is joined with b
2.
b is joined with c
Answer:
CExplanation:
The nested join is evaluated from the top to the bottom in the order of the ON conditions. This means that the join expression is formed by assigning each ON condition to the directly preceding JOIN from left to right. The join expression can be parenthesized implicitly or explicitly to show the order of evaluation. In this case, the implicit parentheses are as follows:
SELECT * FROM (a INNER JOIN (b INNER JOIN c ON b~c = c~c) ON a~b = b~b)
This means that the first join expression is b INNER JOIN c ON b~c = c~c, which joins the columns of tables b and c based on the condition that b~c equals c~c. The second join expression is a INNER JOIN (b INNER JOIN c ON b~c = c~c) ON a~b = b~b, which joins the columns of table a and the result of the first join expression based on the condition that a~b equals b~b. The final result set contains all combinations of rows from tables a, b, and c that satisfy both join conditions.
References: 1: SELECT, FROM JOIN - ABAP Keyword Documentation - SAP Online Help
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.
Options:
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.
Answer:
B, CExplanation:
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
Exhibit:
Which of the following statements are correct? Note: There are 2 correct answers to this question.
Options:
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.
Answer:
A, DExplanation:
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
In the assignment, data (gv_result) = 1/8. what will be the data type of gv_result?
Options:
OTYPE I
TYPE DEFLOAT 16
TYPE P DECIMALS 3
TYPE P DECIMALS 2
Answer:
BExplanation:
The data type of gv_result in the assignment data (gv_result) = 1/8 will be TYPE DECFLOAT 16. This is because the assignment operator (=) in ABAP performs an implicit type conversion from the source type to the target type, according to the following rules12:
- If the target type is specified explicitly, the source value is converted to the target type.
- If the target type is not specified explicitly, the source type is used as the target type, unless the source type is a literal or an expression, in which case the target type is determined by the following priority order: DECFLOAT34, DECFLOAT16, P, F, I, C, N, X, STRING, XSTRING.
In this case, the target type is not specified explicitly, and the source type is an expression (1/8). Therefore, the target type is determined by the priority order, and the first matching type is DECFLOAT16, which is a decimal floating point type with 16 digits of precision12.
References: 1: ABAP Assignment Rules - ABAP Keyword Documentation - SAP Online Help 2: ABAP Data Types - ABAP Keyword Documentation - SAP Online Help
Why would you use Access Controls with CDS Views? Note: There are 2 correct answers to this question.
Options:
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.
Answer:
A, CExplanation:
You would use Access Controls with CDS Views for the following reasons:
- A. Only the data corresponding to the user’s authorization is transferred from the database to the application layer. This is true because Access Controls allow you to define CDS roles that specify the authorization conditions for accessing a CDS view. The CDS roles are evaluated for every user at runtime and the system automatically adds the restrictions to the selection conditions of the CDS view. This ensures that only the data that the user is authorized to see is read from the database and transferred to the application layer. This improves the security and the performance of the data access1.
- C. You do not have to remember to implement AUTHORITY CHECK statements. This is true because Access Controls provide a declarative and centralized way of defining the authorization logic for a CDS view. You do not have to write any procedural code or use the AUTHORITY CHECK statement to check the user’s authorization for each data source or field. The system handles the authorization check automatically and transparently for you2.
The following reasons are not valid for using Access Controls with CDS Views:
- B. The system field sy-subrc is set, giving you the result of the authorization check. This is false because the system field sy-subrc is not used by Access Controls. The sy-subrc field is used by the AUTHORITY CHECK statement to indicate the result of the authorization check, but Access Controls do not use this statement. Instead, Access Controls use CDS roles to filter the data according to the user’s authorization2.
- D. All of the data from the data sources is loaded into your application automatically and filtered there according to the user’s authorization. This is false because Access Controls do not load all the data from the data sources into the application layer. Access Controls filter the data at the database layer, where the data resides, and only transfer the data that the user is authorized to see to the application layer. This reduces the data transfer and the memory consumption of the application layer1.
References: 1: Access Controls | SAP Help Portal 2: ABAP CDS - Access Control - ABAP Keyword Documentation
What are some properties of database tables? Note: There are 2 correct answers to this question.
Options:
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.
Answer:
A, DExplanation:
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
When does SAP recommend to use a sorted or a hashed table respectively? Note: There are 2 correct answers to this question.
Options:
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.
Answer:
A, BWhich type of legacy code does SAP recommend you eliminate when you review modifications as part of an SAP S/4HANA system conversion? Note: There are 2 correct answers to this question.
Options:
Code that supports a critical business process
Code that now is identical to a standard SAP object
Code that has less than 10% usage according to usage statistics
Code that can be redesigned as a key user extension
Answer:
B, DExplanation:
SAP recommends that you eliminate the following types of legacy code when you review modifications as part of an SAP S/4HANA system conversion:
- Code that now is identical to a standard SAP object. This type of code is redundant and unnecessary, as it does not provide any additional functionality or customization. It can also cause conflicts or errors during the system conversion, as the standard SAP object may have changed or been replaced in SAP S/4HANA. Therefore, you should delete this type of code and use the standard SAP object instead.
- Code that can be redesigned as a key user extension. This type of code is usually related to UI or business logic adaptations that can be achieved using the in-app tools provided by SAP S/4HANA. By redesigning this type of code as a key user extension, you can simplify and standardize your code base, reduce maintenance efforts, and avoid compatibility issues during the system conversion. Therefore, you should migrate this type of code to the key user extensibility framework and delete the original code.
The other types of legacy code are not recommended to be eliminated, as they may still be relevant or necessary for your business processes. However, you should still review and adjust them according to the SAP S/4HANA simplification items and best practices. These types of code are:
- Code that supports a critical business process. This type of code is essential for your business operations and cannot be easily replaced or removed. However, you should check if this type of code is compatible with SAP S/4HANA, and if not, you should adapt it accordingly. You should also consider if this type of code can be optimized or enhanced using the new features and capabilities of SAP S/4HANA.
- Code that has less than 10% usage according to usage statistics. This type of code is rarely used and may not be worth maintaining or converting. However, you should not delete this type of code without verifying its relevance and impact on your business processes. You should also consider if this type of code can be replaced or consolidated with other code that has higher usage or better performance.
References: Custom Code Management (CCM) During an SAP S/4HANA Conversion, Custom Code Migration Guide for SAP S/4HANA 2020
Which restrictions exist for ABAP SQL arithmetic expressions? Note: There are 2 correct answers to this question.
Options:
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.
Answer:
B, DExplanation:
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
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.
Options:
"Storage Type" to "Column Store"
"Load Unit to "Column Loadable"
"Storage Type" to "Row Store"
"Load Unit' to 'Page Loadable"
Answer:
C, DExplanation:
Based on the given information, the spfli database table should have the following general settings:
- “Storage Type” to “Row Store”: This setting determines how the data is stored in the SAP HANA database. Row store is suitable for tables that are accessed by primary key or by a small number of columns. Column store is suitable for tables that are accessed by a large number of columns or by complex analytical queries. Since the spfli table is a large table with over one million rows, and this program is the only one in the system that accesses the table, it is likely that the program will use primary key access or simple queries to access the table. Therefore, row store is a better choice than column store for this table12.
- “Load Unit” to “Page Loadable”: This setting determines how the data is loaded into the memory when the table is accessed. Page loadable means that the data is loaded in pages of 16 KB each, and only the pages that are needed are loaded. Column loadable means that the data is loaded in columns, and only the columns that are needed are loaded. Since the spfli table is a row store table, and this program will run rarely, it is more efficient to use page loadable than column loadable for this table. Page loadable will reduce the memory consumption and the loading time of the table13.
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]
In a subclass subl you want to redefine a component of a superclass superl. How do you achieve this? Note: There are 2 correct answers to this question.
Options:
You add the clause REDEFINITION to the component in subl.
You implement the redefined component for a second time in superl.
You implement the redefined component in subl.
You add the clause REDEFINITION to the component in superl.
Answer:
A, CExplanation:
To redefine a component of a superclass in a subclass, you need to do the following12:
- You add the clause REDEFINITION to the component declaration in the subclass. This indicates that the component is inherited from the superclass and needs to be reimplemented in the subclass. The redefinition must happen in the same visibility section as the component declaration in the superclass. For example, if the superclass has a public method m1, the subclass must also declare the redefined method m1 as public with the REDEFINITION clause.
- You implement the redefined component in the subclass. This means that you provide the new logic or behavior for the component that is specific to the subclass. The redefined component in the subclass will override the original component in the superclass when the subclass object is used. For example, if the superclass has a method m1 that returns ‘Hello’, the subclass can redefine the method m1 to return ‘Hi’ instead.
You cannot do any of the following:
- You implement the redefined component for a second time in the superclass. This is not possible, because the superclass already has an implementation for the component that is inherited by the subclass. The subclass is responsible for providing the new implementation for the redefined component, not the superclass.
- You add the clause REDEFINITION to the component in the superclass. This is not necessary, because the superclass does not need to indicate that the component can be redefined by the subclass. The subclass is the one that needs to indicate that the component is redefined by adding the REDEFINITION clause to the component declaration in the subclass.
References: 1: METHODS - REDEFINITION - ABAP Keyword Documentation - SAP Online Help 2: Redefining Methods - ABAP Keyword Documentation - SAP Online Help