What are valid statements? Note: There are 2 correct answers to this question.
"zcxl" is a dictionary structure, and "paraml" and "param2" are this structure.
"paraml11 and "param2" are predefined names.
The code creates an exception object and raises an exception.
"previous" expects the reference to a previous exception
The code snippet in the image is an example of using the RAISE EXCEPTION statement to raise a class-based exception and create a corresponding exception object. The code snippet also uses the EXPORTING addition to pass parameters to the instance constructor of the exception class12. Some of the valid statements about the code snippet are:
You cannot do any of the following:
References: 1: RAISE EXCEPTION - ABAP Keyword Documentation - SAP Online Help 2: Class-Based Exceptions - ABAP Keyword Documentation - SAP Online Help
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:
You cannot do any of the following:
References: 1: Object Oriented - ABAP Development - Support Wiki 2: Inheritance and Instantiation - ABAP Keyword Documentation
In RESTful Application Programming, which EML statement retrieves an object?
Find entity
Select entity
Get entity
Read entity
In RESTful Application Programming, the EML statement that retrieves an object is GET entity. The GET entity statement is used to read data of an entity instance from the database or the transaction buffer. The GET entity statement can specify the entity name, the entity key, and the entity elements to be retrieved. The GET entity statement can also use the IN LOCAL MODE addition to bypass the access control, authorization control, and feature control checks. The GET entity statement returns a single entity instance or raises an exception if no instance is found or multiple instances match the key.
The other EML statements are not used to retrieve an object, but have different purposes and effects. These statements are:
References: GET ENTITY - ABAP Keyword Documentation, FIND ENTITY, ENTITIES - ABAP Keyword Documentation, SELECT ENTITY, ENTITIES - ABAP Keyword Documentation, READ - ABAP Keyword Documentation
The class zcl_demo_class is in a software component with the language version set to "Standard ABAP". The function module "ZF11 is in a software component with the language version set to "ABAP Cloud". Both the class and function module are customer created. Regarding line #6, which of the following is a valid statement?
'ZF1' can be called whether it has been released or not for cloud development.
'ZF1' can be called via a wrapper that itself has been released for cloud development.
'ZF1' can be called via a wrapper that itself has not been released for cloud development.
'ZF1' must be released for cloud development to be called.
The function module ZF1 is in a software component with the language version set to “ABAP Cloud”. This means that it follows the ABAP Cloud Development Model, which requires the usage of public SAP APIs and extension points to access SAP functionality and data. These APIs and extension points are released by SAP and documented in the SAP API Business Hub1. Customer-created function modules are not part of the public SAP APIs and are not released for cloud development. Therefore, calling a function module directly from a class with the language version set to “Standard ABAP” is not allowed and will result in a syntax error. However, there is a possible way to call a function module indirectly from a class with the language version set to “Standard ABAP”:
For example, the following code snippet shows how to create a wrapper class for the function module ZF1 and call it from the class zcl_demo_class:
@EndUserText.label: ‘Wrapper for ZF1’ CLASS zcl_wrapper_zf1 DEFINITION PUBLIC FINAL CREATE PUBLIC. PUBLIC SECTION. CLASS-METHODS: call_zf1 IMPORTING iv_a TYPE i iv_b TYPE i EXPORTING ev_result TYPE i. ENDCLASS.
CLASS zcl_wrapper_zf1 IMPLEMENTATION. METHOD call_zf1. CALL FUNCTION ‘ZF1’ EXPORTING a = iv_a b = iv_b IMPORTING result = ev_result. ENDMETHOD. ENDCLASS.
CLASS zcl_demo_class DEFINITION. METHODS: m1. ENDCLASS.
CLASS zcl_demo_class IMPLEMENTATION. METHOD m1. DATA(lv_result) = zcl_wrapper_zf1=>call_zf1( iv_a = 2 iv_b = 3 ). WRITE: / lv_result. ENDMETHOD. ENDCLASS.
The output of this code is:
5
References: 1: SAP API Business Hub 2: Creating an ABAP Cloud Project | SAP Help Portal
Which field is defined incorrectly?
field1
field3
field4
field2
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
Which of the following actions cause an indirect change to a database table requiring a table conversion? Note: There are 2 correct answers to this question.
Renaming a field in a structure that is included in the table definition
Changing the field labels of a data element that is used in the table definition.
Deleting a field from a structure that is included in the table definition.
Shortening the length of a domain used in a data element that is used in the table definition.
The following are the explanations for each action:
References: Converting Database Tables - ABAP Keyword Documentation, Adjustment of Database Structures - ABAP Keyword Documentation
Which of the following string functions are predicate functions? Note: There are 2 correct answers to this question.
find_any_not_of()
contains_any_of()
count_any_of()
matchesQ
String functions are expressions that can be used to manipulate character-like data in ABAP. String functions can be either predicate functions or non-predicate functions. Predicate functions are string functions that return a truth value (true or false) for a condition of the argument text. Non-predicate functions are string functions that return a character-like result for an operation on the argument text1.
The following string functions are predicate functions:
contains_any_of( val = ‘ABAP’ set = ‘ABC’ ).
matches( val = ‘ABAP’ regex = ‘[A-Z]{4}’ ).
The following string functions are not predicate functions, because they return a character-like result, not a truth value:
find_any_not_of( val = ‘ABAP’ set = ‘ABC’ ).
count_any_of( val = ‘ABAP’ set = ‘ABC’ ).
References: 1: String Functions - ABAP Keyword Documentation
Which of the following results in faster access to internal tables? Note: There are 3 correct answers to this question.
In a sorted internal table, specifying the primary key partially from the left without gaps.
In a sorted internal table, specifying the primary key completely.
In a standard internal table, specifying the primary key partially from the left without gaps.
In a hashed internal table, specifying the primary key partially from the left without gaps.
In a hashed internal table, specifying the primary key completely.
The access to internal tables can be optimized by using the appropriate table type and specifying the table key. The table key is a set of fields that uniquely identifies a row in the table and determines the sorting order of the table. The table key can be either the primary key or a secondary key. The primary key is defined by the table type and the table definition, while the secondary key is defined by the user using the KEY statement1.
The following results in faster access to internal tables:
The following do not result in faster access to internal tables, because:
References: 1: Internal Tables - Overview - ABAP Keyword Documentation 2: Sorted Tables - ABAP Keyword Documentation : Hashed Tables - ABAP Keyword Documentation : Standard Tables - ABAP Keyword Documentation
Why would you use Access Controls with CDS Views? Note: There are 2 correct answers to this question.
Only the data corresponding to the user's authorization is transferred from the database to the application layer.
The system field sy-subrc is set, giving you the result of the authorization check
You do not have to remember to implement AUTHORITY CHECK statements.
All of the data from the data sources is loaded into your application automatically and filtered there according to the user's authorization.
You would use Access Controls with CDS Views for the following reasons:
The following reasons are not valid for using Access Controls with CDS Views:
References: 1: Access Controls | SAP Help Portal 2: ABAP CDS - Access Control - ABAP Keyword Documentation
When does SAP recommend to use a sorted or a hashed table respectively? Note: There are 2 correct answers to this question.
A hashed table, when you read a single record and specify the complete key.
A hashed table, when you read a subset in a loop and specify a part of the key from the left without gaps.
A sorted table, when you read a subset in a loop and specify a part of the key from the left ^ without gaps.
A sorted table, when you read a single record and specify non key fields.
You want to define the following CDS view entity with an input parameter:
Define view entity Z_CONVERT With parameters currency : ???
Which of the following can you use to replace "???? Note: There are 2 correct answers to this
question.
built-in ABAP type
A built-in ABAP Dictionary type
A data element
A component of an ABAP Dictionary structure
The possible replacements for “???” in the CDS view entity definition with an input parameter are A. built-in ABAP type and C. A data element. These are the valid types that can be used to specify the data type of an input parameter in a CDS view entity. A built-in ABAP type is a predefined elementary type in the ABAP language, such as abap.char, abap.numc, abap.dec, etc. A data element is a reusable semantic element in the ABAP Dictionary that defines the technical attributes and the meaning of a field12. For example:
Define view entity Z_CONVERT With parameters currency : abap.cuky as select from … { … }
Define view entity Z_CONVERT With parameters currency : waers as select from … { … }
You cannot do any of the following:
References: 1: ABAP CDS - SELECT, parameter_list - ABAP Keyword Documentation - SAP Online Help 2: ABAP Data Types - ABAP Keyword Documentation - SAP Online Help
Which of the following are ABAP Cloud Development Model rules?
Note: There are 2 correct answers to this question.
Use public SAP APIs and SAP extension points.
Build ABAP RESTful application programming model-based services.
Reverse modifications when a suitable public SAP API becomes available.
Build ABAP reports with either ABAP List Viewer (ALV) or SAP Fiori.
To adhere to the most recent ABAP SQL syntax conventions from SAP, on which line must you insert the "INTO TABLE @gt flights" clause to complete the SQL statement?
#15
#4
#6
#8
To adhere to the most recent ABAP SQL syntax conventions from SAP, you must insert the “INTO TABLE @gt flights” clause on line #4 to complete the SQL statement. This is because the INTO or APPENDING clause should be specified immediately after the SELECT clause, according to the ABAP SQL syntax conventions1. The INTO or APPENDING clause defines the data object to which the results set of the SELECT statement is assigned. The data object can be an internal table, a work area, or an inline declaration. In this case, the data object is an internal table named gt_flights, which is created using the inline declaration operator @DATA. The inline declaration operator allows you to declare and create a data object in the same statement where it is used, without the need for a separate DATA statement2.
The other lines are not suitable for inserting the “INTO TABLE @gt flights” clause, as they would violate the ABAP SQL syntax conventions or cause syntax errors. These lines are:
References: SELECT - ABAP Keyword Documentation, Inline Declarations - ABAP Keyword Documentation
/DMO/I_Connection is a CDS view.
What variable type is connection full based on the following code? DATA connection full TYPE
/DMD/I_Connection.
Simple variable
Structure
Internal Table
Based on the following code, the variable type of connection_full is a structure. A structure is a complex data type that consists of a group of related data objects, called components, that have their own data types and names. A structure can be defined using the TYPES statement or based on an existing structure type, such as a CDS view entity or a CDS DDIC-based view. In this case, the variable connection_full is declared using the TYPE addition, which means that it has the same structure type as the CDS view entity /DMO/I_Connection. The CDS view entity /DMO/I_Connection is a data model view that defines a data model based on the database table /DMO/Connection. The CDS view entity /DMO/I_Connection has the following components: carrid, connid, airpfrom, airpto, distance, and fltime. Therefore, the variable connection_full has the same components as the CDS view entity /DMO/I_Connection, and each component has the same data type and length as the corresponding field in the database table /DMO/Connection.
References: CDS Data Model Views - ABAP Keyword Documentation, DATA - ABAP Keyword Documentation, Structure Types - ABAP Keyword Documentation
Exhibit:
What are valid statements? Note: There are 3 correct answers to this question.
go_if 1 may call method ml with go_ift->ml().
Instead of go ell = NEW #(...) you could use go ifl = NEW cll(. ... ).
go_cll may call method ml with go_dl->ifl-ml().
Instead of go_cll = NEW #() you could use go_iff - NEW #(...).
go_ifl may call method m2 with go if->m2(...).
The following are the explanations for each statement:
The other statements are not valid, as they have syntax errors or logical errors. These statements are:
References: INTERFACES - ABAP Keyword Documentation, CLASS - ABAP Keyword Documentation, NEW - ABAP Keyword Documentation
What are valid statements? Note: There are 2 correct answers to this question.
##NEEDED is checked by the syntax checker.
The pragma is not checked by the syntax checker.
#EC_NEEDED is not checked by the syntax checker.
The pseudo-comment is checked by the syntax checker
Both statements are valid in ABAP, but they have different effects on the program.
You cannot do any of the following:
References: 1: Pragmas - ABAP Keyword Documentation - SAP Online Help 2: [What are pragmas and pseudo comments in ABAP? | SAP Blogs - SAP Community] 3: ABAP Keyword Documentation - SAP Online Help 4: What are PRAGMAS and Pseudo comments in SAP ABAP
Which of the following are incomplete ABAP types? Note: There are 2 correct answers to this question.
String
T
C
P
Incomplete ABAP types are types that do not specify all the attributes of a data type, such as the length, the number of decimal places, or the value range. Incomplete types can only be used for the typing of field symbols and formal parameters, not for the definition of data objects or constants. Incomplete types can be either predefined or user-defined1.
The following are incomplete ABAP types:
The following are not incomplete ABAP types, because they specify all the attributes of a data type:
References: 1: Generic ABAP Types - ABAP Keyword Documentation 2: C - ABAP Keyword Documentation 3: P - ABAP Keyword Documentation 4: String - ABAP Keyword Documentation : T - ABAP Keyword Documentation
with which predicate condition can you ensure that the CAST will work?
IS SUPPLIED
IS NOT INITIAL
IS INSTANCE OF
IS BOUND
The predicate condition that can be used to ensure that the CAST will work is IS INSTANCE OF. The IS INSTANCE OF predicate condition checks whether the operand is an instance of the specified class or interface. This is useful when you want to perform a downcast, which is a conversion from a more general type to a more specific type. A downcast can fail if the operand is not an instance of the target type, and this can cause a runtime error. Therefore, you can use the IS INSTANCE OF predicate condition to check whether the downcast is possible before using the CAST operator12. For example:
DATA: g_super TYPE REF TO lcl_super, g_sub1 TYPE REF TO lcl_sub1. IF g_super IS INSTANCE OF lcl_super. g_sub1 = CAST #( g_super ). g_sub1->method( … ). ENDIF.
You cannot do any of the following:
References: 1: Predicate Expressions - ABAP Keyword Documentation - SAP Online Help 2: ABAP - Predicates | SAP Community
What are the effects of this annotation? Note: There are 2 correct answers to this question.
The value of sy-langu will be passed to the CDS view automatically both when you use the -1 CDS view in ABAP and in another CDS view entity (view on view).
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
It is no longer possible to pass your own value to the parameter.
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:
define view ZI_FLIGHT_TEXTS with parameters p_langu : syst_langu @ SELECT carrid, connid, fldate, carrname, carrtext FROM zi_flight_texts INTO TABLE @DATA(lt_flights). 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: SELECT carrid, connid, fldate, carrname, carrtext FROM zi_flight_texts WHERE p_langu = ‘E’ INTO TABLE @DATA(lt_flights). 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
What would be the correct expression to change a given string value 'mr joe doe' into 'JOE' in an ABAP SQL field list?
SELECT FROM TABLE dbtabl FIELDS
Of1,
upper(left( 'mr joe doe', 6)) AS f2_up_left, f3,
SELECT FROM TABLE dbtabl FIELDS
Of1,
left(lower(substring( 'mr joe doe', 4, 3)), 3) AS f2_left_lo_sub, f3,
SELECT FROM TABLE dbtabl FIELDS
Of1,
substring(upper('mr joe doe'), 4, 3) AS f2_sub_up, f3,...
SELECT FROM TABLE dbtabl FIELDS
Of1,
substring(lower(upper( 'mr joe doe' ) ), 4, 3) AS f2_sub_lo_up, f3,
The correct expression to change a given string value ‘mr joe doe’ into ‘JOE’ in an ABAP SQL field list is C. SELECT FROM TABLE dbtabl FIELDS Of1, substring(upper(‘mr joe doe’), 4, 3) AS f2_sub_up, f3,… This expression uses the following SQL functions for strings12:
You cannot do any of the following:
References: 1: SQL Functions for Strings - ABAP Keyword Documentation - SAP Online Help 2: sql_func - String Functions - ABAP Keyword Documentation - SAP Online Help
Which of the following ON conditions must you insert in place of "???"?
ON Z_Sourcel.camer_id = 7_Source2 carrier_id
ON Sprojection Camer=Source2 carrier_id
ON Sprojection. Carrier Source2.carrier
ON Sprojection.carrier_id=Z_Source2.carrier_id
The correct ON condition that must be inserted in place of “???” is:
ON Sprojection.carrier_id=Z_Source2.carrier_id
This ON condition specifies the join condition between the CDS view Sprojection and the database table Z_Source2. The join condition is based on the field carrier_id, which is the primary key of both the CDS view and the database table. The ON condition ensures that only the records that have the same value for the carrier_id field are joined together1.
The other options are not valid ON conditions, because:
References: 1: ON Condition - ABAP Keyword Documentation
In class ZCL_CLASS_A, you use the statement DATA var TYPE ***
What may stand in place of ***? Note: There are 2 correct answers to this question.
The name of a type defined privately in class ZCL_CLASS_A
The name of a data element from the ABAP Dictionary
The name of a type defined privately in another class
The name of a domain from the ABAP Dictionary
In class ZCL_CLASS_A, you use the statement DATA var TYPE *** to declare a data object named var with a data type specified by ***. The data type can be any of the following1:
Therefore, the possible values for *** are B. the name of a data element from the ABAP Dictionary and D. the name of a domain from the ABAP Dictionary. The other options are not valid because:
References: 1: DATA - ABAP Keyword Documentation 2: Data Elements - ABAP Dictionary - SAP Online Help 3: Domains - ABAP Dictionary - SAP Online Help 4: Global Types - ABAP Keyword Documentation 5: Local Types - ABAP Keyword Documentation : Private Types - ABAP Keyword Documentation
Image:
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
Exhibit:
Which of the following statements are correct? Note: There are 2 correct answers to this question.
FOR defines a loop that runs over the content of source_itab
source_itab is only visible within the loop.
row is a predefined name and cannot be chosen arbitrarily.
row is only visible within the loop.
The code snippet in the image is an example of using the FOR statement to create an internal table with a constructor expression. The FOR statement introduces an iteration expression that runs over the content of source_itab and assigns each row to the variable row. The variable row is then used to populate the fields of target_itab12. Some of the correct statements about the code snippet are:
You cannot do any of the following:
References: 1: FOR - Iteration Expressions - ABAP Keyword Documentation - SAP Online Help 2: ABAP 7.4 Syntax - FOR Loop iteration | SAP Community
Copyright © 2014-2024 CertsTopics. All Rights Reserved