Given the Code:
INTERFACE if1.
METHODS m1.
ENDINTERFACE.
CLASS cl1 DEFINITION.
...
INTERFACES if1.
ENDCLASS.
CLASS cl2 DEFINITION.
...
DATA mo_if1 TYPE REF TO if1.
ENDCLASS.
What are valid statements? (Note: There are 3 correct answers to this question.)
In class cl2, the interface method is named if1~m1.
Class cl2 uses the interface.
In class cl1, the interface method is named if1~m1.
Class cl1 uses the interface.
Class cl1 implements the interface.
Comprehensive and Detailed Step-by-Step Explanation:
Interface Implementation in cl1
The INTERFACES if1 statement in the cl1 definition explicitly declares that cl1 implements the interface if1.
Therefore, option E is correct.
Interface Method Naming in cl1
When an interface is implemented in a class, its methods are accessed using the syntax if1~m1 to distinguish them from other methods in the class.
This makes option C correct.
Usage of if1 in cl2
The DATA mo_if1 TYPE REF TO if1 in cl2 creates a reference variable of type if1. However, it does not mean that cl2 implements or uses the interface if1.
This makes option B incorrect.
Interface Method Naming in cl2
Since cl2 does not implement the interface, it does not inherit its methods. Hence, the method if1~m1 is not available in cl2.
This makes option A incorrect.
Class cl1 and Interface Usage
Class cl1 explicitly states INTERFACES if1, which means it not only implements the interface but also uses it.
This makes option D correct.
References:
SAP ABAP Documentation: Interfaces
SAP Training for Back-End Developer - ABAP Cloud
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:
B. field (from field list): A field is a column of a table or a view that contains data of a certain type. A field can be assigned an alias in the field list of a SELECT statement, which specifies the fields that are selected from the data source. For example, the following query assigns the alias name to the field carrname of the table scarr:
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.
C. database table: A database table is a collection of data that is organized in rows and columns. A database table can be assigned an alias in the FROM clause of a SELECT statement, which specifies the data source that is selected from. For example, the following query assigns the alias c to the table scarr:
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:
A. order criterion (from order by clause): An order criterion is a field or an expression that is used to sort the result set of a query in ascending or descending order. An order criterion cannot be assigned an alias in the ORDER BY clause of a SELECT statement, because the alias is not visible in this clause. The alias can only be used in the clauses that follow the clause where it is defined1.
D. group criterion (from group by clause): A group criterion is a field or an expression that is used to group the result set of a query into subsets that share the same values. A group criterion cannot be assigned an alias in the GROUP BY clause of a SELECT statement, because the alias is not visible in this clause. The alias can only be used in the clauses that follow the clause where it is defined1.
References: 1: ALIASES - ABAP Keyword Documentation 2: SELECT List - ABAP Keyword Documentation 3: FROM Clause - ABAP Keyword Documentation
What RESTful Application Programming feature is used to ensure the uniqueness of a semantic key?
Validation
Action
Determination
The RESTful Application Programming feature that is used to ensure the uniqueness of a semantic key is determination. A determination is a type of behavior implementation that defines a logic that is executed automatically when certain events occur, such as create, update, delete, or activate. A determination can be used to calculate or derive values for certain fields, such as semantic keys, based on other fields or external sources. A determination can also be used to check the uniqueness of a semantic key by comparing it with the existing values in the database or the transaction buffer. A determination can use the ABAP SQL or the EML syntax to access and manipulate data. A determination can be defined using the DETERMINE action clause in the behavior definition of a CDS view entity or a projection view. A determination can also be annotated with the @ObjectModel.determination annotation to specify the event, the timing, and the scope of the determination12
The other RESTful Application Programming features are not used to ensure the uniqueness of a semantic key, but have different purposes and effects. These features are:
Validation: A validation is a type of behavior implementation that defines a logic that is executed automatically when certain events occur, such as create, update, delete, or activate. A validation can be used to check the consistency and correctness of the data, such as mandatory fields, data types, value ranges, or business rules. A validation can use the ABAP SQL or the EML syntax to access and manipulate data. A validation can be defined using the VALIDATE action clause in the behavior definition of a CDS view entity or a projection view. A validation can also be annotated with the @ObjectModel.validation annotation to specify the event, the timing, and the scope of the validation12
Action: An action is a type of behavior implementation that defines a logic that is executed explicitly by the user or the application. An action can be used to perform a specific business operation, such as creating, updating, deleting, or activating an entity instance, or triggering a workflow or a notification. An action can use the ABAP SQL or the EML syntax to access and manipulate data. An action can be defined using the ACTION clause in the behavior definition of a CDS view entity or a projection view. An action can also be annotated with the @ObjectModel.action annotation to specify the name, the description, the parameters, and the visibility of the action12
References: Behavior Implementation - ABAP Keyword Documentation, Behavior Definition - ABAP Keyword Documentation
In what order are objects created to generate a RESTful Application Programming application?
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
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
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
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 call = NEW #(...) you could use go ifl = NEW cll(. ... ).
go_cll may call method ml with go_dl->ifl-ml().
Instead of go_call = 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:
A: This statement is valid. go_ifl may call method ml with go_ifl->ml(). This is because go_ifl is a data object 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 go_ifl. The class cll implements the interface ifl, which means that it provides an implementation of the method ml. The data object go_ifl is assigned to a new instance of the class cll using the NEW operator and the inline declaration operator @DATA. Therefore, when go_ifl->ml() is called, the implementation of the method ml in the class cll is executed123
B: This statement is valid. Instead of go_cll = NEW #(…) you could use go_ifl = NEW cll(…). This is because go_ifl is a data object of type REF TO ifl, which is a reference to the interface ifl. The class cll implements the interface ifl, which means that it is compatible with the interface ifl. Therefore, go_ifl can be assigned to a new instance of the class cll using the NEW operator and the class name cll. The inline declaration operator @DATA is optional in this case, as go_ifl is already declared. The parentheses after the class name cll can be used to pass parameters to the constructor of the class cll, if any123
E: This statement is valid. go_ifl may call method m2 with go_ifl->m2(…). This is because go_ifl is a data object of type REF TO ifl, which is a reference to the interface ifl. The class cll implements the interface ifl, which means that it inherits all the components of the interface ifl. The class cll also defines a method m2, which is a public method of the class cll. Therefore, go_ifl can call the method m2 using the reference variable go_ifl. The method m2 is not defined in the interface ifl, but it is accessible through the interface ifl, as the interface ifl is implemented by the class cll. The parentheses after the method name m2 can be used to pass parameters to the method m2, if any123
The other statements are not valid, as they have syntax errors or logical errors. These statements are:
C: This statement is not valid. go_cll may call method ml with go_cll->ifl~ml(). This is because go_cll is a data object of type REF TO cll, which is a reference to the class cll. The class cll implements the interface ifl, which means that it inherits all the components of the interface ifl. The interface ifl defines a method ml, which can be called using the reference variable go_cll. However, the syntax for calling an interface method using a class reference is go_cll->ml(), not go_cll->ifl~ml(). The interface component selector ~ is only used when calling an interface method using an interface reference, such as go_ifl->ifl~ml(). Using the interface component selector ~ with a class reference will cause a syntax error123
D: This statement is not valid. Instead of go_cll = NEW #() you could use go_ifl = NEW #(…). This is because go_ifl is a data object of type REF TO ifl, which is a reference to the interface ifl. The interface ifl cannot be instantiated, as it does not have an implementation. Therefore, go_ifl cannot be assigned to a new instance of the interface ifl using the NEW operator and the inline declaration operator @DATA. This will cause a syntax error or a runtime error. To instantiate an interface, you need to use a class that implements the interface, such as the class cll123
References: INTERFACES - ABAP Keyword Documentation, CLASS - ABAP Keyword Documentation, NEW - ABAP Keyword Documentation
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.
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.
You have attached a system field to an input parameter of a CDS view entity as follows:
What are the effects of this annotation? Note: There are 2 correct answers to this question.
It is no longer possible to pass your own value to the parameter.
You can still override the default value with a value of your own.
The value of sy-langu will be passed to the CDS view automatically when you use the CDS view in ABAP but not when you use it in another view entity
The value of sy-langu will be passed to the CDS view automatically both when you use the CDS view in ABAP and in another CDS view entity (view on view).
The annotation @Environment.systemField: #LANGUAGE is used to assign the ABAP system field sy-langu to an input parameter of a CDS view or a CDS table function. This enables the implicit parameter passing in Open SQL, which means that the value of sy-langu will be automatically passed to the CDS view without explicitly specifying it in the WHERE clause. This also applies to the CDS views that use the annotated CDS view as a data source, which means that the value of sy-langu will be propagated to the nested CDS views (view on view)12. For example:
The following code snippet defines a CDS view ZI_FLIGHT_TEXTS with an input parameter p_langu that is annotated with @Environment.systemField: #LANGUAGE:
define view ZI_FLIGHT_TEXTS with parameters p_langu : syst_langu @ The following code snippet shows how to use the CDS view ZI_FLIGHT_TEXTS in ABAP without specifying the value of p_langu in the WHERE clause. The value of sy-langu will be automatically passed to the CDS view: SELECT carrid, connid, fldate, carrname, carrtext FROM zi_flight_texts INTO TABLE @DATA(lt_flights). The following code snippet shows how to use the CDS view ZI_FLIGHT_TEXTS in another CDS view ZI_FLIGHT_REPORT. The value of sy-langu will be automatically passed to the nested CDS view ZI_FLIGHT_TEXTS: define view ZI_FLIGHT_REPORT with parameters p_langu : syst_langu @ The annotation @Environment.systemField: #LANGUAGE does not prevent the possibility of overriding the default value with a value of your own. You can still specify a different value for the input parameter p_langu in the WHERE clause, either in ABAP or in another CDS view. This will override the value of sy-langu and pass the specified value to the CDS view12. For example: The following code snippet shows how to use the CDS view ZI_FLIGHT_TEXTS in ABAP with a specified value of p_langu in the WHERE clause. The value ‘E’ will be passed to the CDS view instead of the value of sy-langu: SELECT carrid, connid, fldate, carrname, carrtext FROM zi_flight_texts WHERE p_langu = ‘E’ INTO TABLE @DATA(lt_flights). The following code snippet shows how to use the CDS view ZI_FLIGHT_TEXTS in another CDS view ZI_FLIGHT_REPORT with a specified value of p_langu in the WHERE clause. The value ‘E’ will be passed to the nested CDS view ZI_FLIGHT_TEXTS instead of the value of sy-langu: define view ZI_FLIGHT_REPORT with parameters p_langu : syst_langu @ References: 1: ABAP CDS - parameter_annot - ABAP Keyword Documentation - SAP Online Help 2: ABAP CDS - session_variable - ABAP Keyword Documentation - SAP Online Help
Exhibit:
DEFINE TABLE demo_table {
KEY field1 : REFERENCE TO abap.cint(3);
KEY field2 : abap.char(133);
@Semantics.quantity.unitOfMeasure : 'demo_table.field4'
field3 : abap.quan(2);
field4 : abap.unit(2);
}
Which field is defined incorrectly?
field2
field4
field1
field3
Field 1 (field1)
The syntax REFERENCE TO abap.cint(3) is incorrect for defining a database table field. Database table fields must be based on valid HANA-compatible data types or ABAP dictionary data types.
REFERENCE TO is used for object references in ABAP classes and is not valid in this context.
Therefore, field1 is defined incorrectly, making option C correct.
Field 2 (field2)
The data type abap.char(133) is valid for defining a character-based field in a table.
This field is correctly defined.
Field 3 (field3)
The data type abap.quan(2) is valid for defining a quantity field. The @Semantics.quantity.unitOfMeasure annotation correctly links this field to field4, which is a unit of measure field.
This field is correctly defined.
Field 4 (field4)
The data type abap.unit(2) is valid for defining a unit of measure field.
This field is correctly defined.
References:
SAP ABAP Documentation: ABAP Data Types for SAP HANA Tables
SAP Training for Back-End Developer - ABAP Cloud
In this nested join below in which way is the join evaluated?
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
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
In the following ABAP SQL code, what are valid case distinctions? Note: There are 2 correct answers to this question.
A)
B)
C)
D)
Option A
Option B
Option C
Option D
When accessing the subclass instance through go_super, what can you do? Note: There are 2 correct answers to this question.
Access the inherited private components.
Access the inherited public components.
Call a subclass specific public method
Call inherited public redefined methods.
When accessing the subclass instance through go_super, you can do both of the following:
Access the inherited private components: A subclass inherits all the private attributes and methods of its superclass, unless they are explicitly overridden by the subclass. Therefore, you can access the inherited private components of the superclass through go_super, as long as they are not hidden by other attributes or methods in the subclass12.
Access the inherited public components: A subclass inherits all the public attributes and methods of its superclass, unless they are explicitly overridden by the subclass. Therefore, you can access the inherited public components of the superclass through go_super, as long as they are not hidden by other attributes or methods in the subclass12.
You cannot do any of the following:
Call a subclass specific public method: A subclass does not have any public methods that are not inherited from its superclass. Therefore, you cannot call a subclass specific public method through go_super12.
Call inherited public redefined methods: A subclass does not have any public methods that are redefined from its superclass. Therefore, you cannot call inherited public redefined methods through go_super12.
References: 1: Object Oriented - ABAP Development - Support Wiki 2: Inheritance and Instantiation - ABAP Keyword Documentation
For what kind of applications would you consider using on-stack developer extensions? Note: There are 2 correct answers to this question.
Applications that provide APIs for side by side SAP BTP apps
Applications that access SAP S/4HANA data using complex SQL
Applications that integrate data from several different systems
Applications that run separate from SAP S/4HANA
On-stack developer extensibility is a type of extensibility that allows you to create development projects directly on the SAP S/4HANA Cloud technology stack. It gives you the opportunity to develop cloud-ready and upgrade-stable custom ABAP applications and services inside the SAP S/4HANA Cloud, public edition system. You can use the ABAP Development Tools in Eclipse to create and deploy your on-stack extensions. On-stack developer extensibility is suitable for the following kinds of applications:
Applications that provide APIs for side by side SAP BTP apps. On-stack developer extensibility allows you to create OData services or RESTful APIs based on CDS view entities or projection views. These services or APIs can expose SAP S/4HANA data and logic to other applications that run on the SAP Business Technology Platform (SAP BTP) or other platforms. This way, you can create a loosely coupled integration between your SAP S/4HANA system and your side by side SAP BTP apps.
Applications that access SAP S/4HANA data using complex SQL. On-stack developer extensibility allows you to use ABAP SQL to access SAP S/4HANA data using complex queries, such as joins, aggregations, filters, parameters, and code pushdown techniques. You can also use ABAP SQL to perform data manipulation operations, such as insert, update, delete, and upsert. This way, you can create applications that require advanced data processing and analysis on SAP S/4HANA data.
The other kinds of applications are not suitable for on-stack developer extensibility, as they have different requirements and challenges. These kinds of applications are:
Applications that integrate data from several different systems. On-stack developer extensibility is not meant for creating applications that integrate data from multiple sources, such as other SAP systems, third-party systems, or cloud services. This is because on-stack developer extensibility does not support remote access or data replication, and it may cause performance or security issues. For this kind of applications, you should use side by side extensibility, which allows you to create applications that run on the SAP BTP and communicate with the SAP S/4HANA system via public APIs or events.
Applications that run separate from SAP S/4HANA. On-stack developer extensibility is not meant for creating applications that run independently from the SAP S/4HANA system, such as standalone apps, microservices, or web apps. This is because on-stack developer extensibility requires a tight coupling with the SAP S/4HANA system, and it may limit the scalability, flexibility, and portability of the applications. For this kind of applications, you should use side by side extensibility, which allows you to create applications that run on the SAP BTP and leverage the cloud-native features and services of the platform.
References: Developer Extensibility in SAP S/4HANA Cloud ABAP Environment, SAP S/4HANA Extensibility – Simplified Guide for Beginners
Which of the following 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:
B. In a sorted internal table, specifying the primary key completely. A sorted internal table is a table type that maintains a predefined sorting order, which is defined by the primary key in the table definition. The primary key can be either unique or non-unique. A sorted internal table can be accessed using the primary key or the table index. The access using the primary key is faster than the access using the table index, because the system can use a binary search algorithm to find the row. However, the primary key must be specified completely, meaning that all the fields of the primary key must be given in the correct order and without gaps2.
D. In a hashed internal table, specifying the primary key partially from the left without gaps. A hashed internal table is a table type that does not have a predefined sorting order, but uses a hash algorithm to store and access the rows. The primary key of a hashed internal table must be unique and cannot be changed. A hashed internal table can only be accessed using the primary key, not the table index. The access using the primary key is very fast, because the system can directly calculate the position of the row using the hash algorithm. The primary key can be specified partially from the left without gaps, meaning that some of the fields of the primary key can be omitted, as long as they are the rightmost fields and there are no gaps between the specified fields.
E. In a hashed internal table, specifying the primary key completely. A hashed internal table is a table type that does not have a predefined sorting order, but uses a hash algorithm to store and access the rows. The primary key of a hashed internal table must be unique and cannot be changed. A hashed internal table can only be accessed using the primary key, not the table index. The access using the primary key is very fast, because the system can directly calculate the position of the row using the hash algorithm. The primary key can be specified completely, meaning that all the fields of the primary key must be given in the correct order.
The following do not result in faster access to internal tables, because:
A. In a sorted internal table, specifying the primary key partially from the left without gaps. A sorted internal table is a table type that maintains a predefined sorting order, which is defined by the primary key in the table definition. The primary key can be either unique or non-unique. A sorted internal table can be accessed using the primary key or the table index. The access using the primary key is faster than the access using the table index, because the system can use a binary search algorithm to find the row. However, the primary key must be specified completely, meaning that all the fields of the primary key must be given in the correct order and without gaps. If the primary key is specified partially from the left without gaps, the system cannot use the binary search algorithm and has to perform a linear search, which is slower2.
C. In a standard internal table, specifying the primary key partially from the left without gaps. A standard internal table is a table type that does not have a predefined sorting order, but uses a sequential storage and access of the rows. The primary key of a standard internal table is the standard key, which consists of all the fields of the table row in the order in which they are defined. A standard internal table can be accessed using the primary key or the table index. The access using the primary key is slower than the access using the table index, because the system has to perform a linear search to find the row. The primary key can be specified partially from the left without gaps, but this does not improve the access speed, because the system still has to perform a linear search.
References: 1: Internal Tables - Overview - ABAP Keyword Documentation 2: Sorted Tables - ABAP Keyword Documentation : Hashed Tables - ABAP Keyword Documentation : Standard Tables - ABAP Keyword Documentation
You want to provide a short description of the data definition for developers that will be attached to the database view
Which of the following annotations would do this if you inserted it on line #27
@UI headerinto description label
@UI.badge.title.label
@EndUserText.quickInfo
@EndUserText label
The annotation that can be used to provide a short description of the data definition for developers that will be attached to the database view is the @EndUserText.label annotation. This annotation is used to specify a text label for the data definition that can be displayed in the development tools or in the documentation. The annotation can be inserted on line #27 in the code snippet provided in the question12. For example:
The following code snippet uses the @EndUserText.label annotation to provide a short description of the data definition for the CDS view ZCDS_VIEW:
@AbapCatalog.sqlViewName: ‘ZCDS_VIEW’ @AbapCatalog.compiler.compareFilter: true @AbapCatalog.preserveKey: true @AccessControl.authorizationCheck: #CHECK @EndUserText.label: ‘CDS view for flight data’ "short description for developers define view ZCDS_VIEW as select from sflight { key carrid, key connid, key fldate, seatsmax, seatsocc }
You cannot do any of the following:
@UI.headerInfo.description.label: This annotation is used to specify a text label for the description field of the header information of a UI element. This annotation is not relevant for the data definition of a database view12.
@UI.badge.title.label: This annotation is used to specify a text label for the title field of a badge UI element. This annotation is not relevant for the data definition of a database view12.
@EndUserText.quickInfo: This annotation is used to specify a quick information text for the data definition that can be displayed as a tooltip in the development tools or in the documentation. This annotation is not the same as a short description or a label for the data definition12.
References: 1: ABAP CDS - SAP Annotations - ABAP Keyword Documentation - SAP Online Help 2: ABAP CDS - Data Definitions - ABAP Keyword Documentation - SAP Online Help
You have a superclass superl and a subclass subl of superl. Each class has an instance constructor and a static constructor. The first statement of your program creates an instance of subl. In which sequence will the constructors be executed?
The sequence in which the constructors will be executed is as follows:
Class constructor of superl. This is because the class constructor is a static method that is executed automatically before the class is accessed for the first time. The class constructor is used to initialize the static attributes and components of the class. The class constructor of the superclass is executed before the class constructor of the subclass, as the subclass inherits the static components of the superclass12
Class constructor of subl. This is because the class constructor is a static method that is executed automatically before the class is accessed for the first time. The class constructor is used to initialize the static attributes and components of the class. The class constructor of the subclass is executed after the class constructor of the superclass, as the subclass inherits the static components of the superclass12
Instance constructor of superl. This is because the instance constructor is an instance method that is executed automatically when an instance of the class is created using the statement CREATE OBJECT. The instance constructor is used to initialize the instance attributes and components of the class. The instance constructor of the superclass is executed before the instance constructor of the subclass, as the subclass inherits the instance components of the superclass. The instance constructor of the subclass must call the instance constructor of the superclass explicitly using super->constructor, unless the superclass is the root node object12
Instance constructor of subl. This is because the instance constructor is an instance method that is executed automatically when an instance of the class is created using the statement CREATE OBJECT. The instance constructor is used to initialize the instance attributes and components of the class. The instance constructor of the subclass is executed after the instance constructor of the superclass, as the subclass inherits the instance components of the superclass. The instance constructor of the subclass must call the instance constructor of the superclass explicitly using super->constructor, unless the superclass is the root node object12
References: Constructors of Classes - ABAP Keyword Documentation, METHODS - constructor - ABAP Keyword Documentation
In 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
Using ABAP SQL, which select statement selects the mat field on line #17?
SELECT mat FROM Material...
SELECT mat FROM demo_sales_cds_so_i_ve...
SELECT mat FROM demo_sales_so_i...
SELECT mat FROM demo sales cds material ve...
Using ABAP SQL, the select statement that selects the mat field on line #17 is:
SELECT mat FROM demo_sales_cds_so_i_ve…
This statement selects the mat field from the CDS view demo_sales_cds_so_i_ve, which is defined on line #1. The CDS view demo_sales_cds_so_i_ve is a projection view that projects the fields of the CDS view demo_sales_cds_so_i, which is defined on line #2. The CDS view demo_sales_cds_so_i is a join view that joins the fields of the database table demo_sales_so_i, which is defined on line #3, and the CDS view demo_sales_cds_material_ve, which is defined on line #4. The CDS view demo_sales_cds_material_ve is a value help view that provides value help for the material field of the database table demo_sales_so_i. The mat field is an alias for the material field of the database table demo_sales_so_i, which is defined on line #91.
The other options are not valid because:
A. SELECT mat FROM Material… is not valid because Material is not a valid data source in the given code. There is no CDS view or database table named Material.
C. SELECT mat FROM demo_sales_so_i… is not valid because demo_sales_so_i is not a valid data source in the given code. There is no CDS view named demo_sales_so_i, only a database table. To access a database table, the keyword TABLE must be used, such as SELECT mat FROM TABLE demo_sales_so_i…
D. SELECT mat FROM demo sales cds material ve… is not valid because demo sales cds material ve is not a valid data source in the given code. There is no CDS view or database table named demo sales cds material ve. The correct name of the CDS view is demo_sales_cds_material_ve, with underscores instead of spaces.
References: 1: Projection Views - ABAP Keyword Documentation
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:
Count_any_of returns the number of occurrences of any character in the string sub within the string val. In this case, it returns 8, since there are 8 A’s and B’s in val.
Count returns the number of occurrences of the string sub within the string val. In this case, it returns 2, since there are 2 AB’s in val.
find_any_of returns the position of the first character in the string val that is contained in the string sub. In this case, it returns 1, since the first character A is in sub. References: String Functions - ABAP Keyword Documentation, Examples of String Functions - ABAP Keyword Documentation
Which of the following are valid sort operations for internal tables? Note: There are 3 correct answers to this question.
Sort a standard table using
SORT itab ASCENDING.
Sort a sorted table using
SORT itab BY fieldl ASCENDING field2 DESCENDING.
Sort a standard table using
SORT itab BY field1 field2.
Sort a standard table using
SORT itab.
Sort a sorted table using
SORT itab DESCENDING.
Which of the following types are permitted to be used for
A database table from the ABAP Dictionary
A CDS DDIC-based view
An external view from the ABAP Dictionary
A database view from the ABAP Dictionary
The
A database table from the ABAP Dictionary: This is a valid type of data source for a CDS View Entity Data Definition. A database table from the ABAP Dictionary is a table that is defined in the ABAP Dictionary using the keyword TABLE or TABLE OF. The name of the database table must be unique within its namespace and must not contain any special characters2.
A CDS DDIC-based view: This is also a valid type of data source for a CDS View Entity Data Definition. A CDS DDIC-based view is a view that is defined in the Core Data Services using the keyword DEFINE VIEW ENTITY. The name of the CDS DDIC-based view must be unique within its namespace and must not contain any special characters3.
You cannot do any of the following:
An external view from the ABAP Dictionary: This is not a valid type of data source for a CDS View Entity Data Definition. An external view from the ABAP Dictionary is a view that is defined in an external application using any language supported by SAP, such as SQL, PL/SQL, or Java. The name of the external view must be unique within its namespace and must not contain any special characters4.
A database view from the ABAP Dictionary: This is not a valid type of data source for a CDS View Entity Data Definition. A database view from the ABAP Dictionary is a view that is defined in an external application using any language supported by SAP, such as SQL, PL/SQL, or Java. The name of the database view must be unique within its namespace and must not contain any special characters4.
References: 1: CDS DDL - DEFINE VIEW ENTITY - ABAP Keyword Documentation - SAP Online Help 2: ABAP Dictionary Tables - SAP Online Help 3: CDS DDL - DEFINE VIEW ENTITY - ABAP Keyword Documentation - SAP Online Help 4: ABAP Dictionary Views - SAP Online Help
TESTED 30 Jan 2025