[2025年04月]更新のC_ABAPD_2309日本語問題集で時間限定!無料アクセスせよ!
C_ABAPD_2309日本語問題集で2025年最新のSAP C_ABAPD_2309日本語試験問題
質問 # 22
/DMO/I_Connection は CDS ビューです。
次のコードに基づくと、接続が完全である変数タイプは何ですか? DATA 接続が完全である TYPE
/DMD/I_接続。
- A. 構造
- B. 内部テーブル
- C. 単純な変数
正解:A
解説:
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
質問 # 23
展示する:
次の記述のうち正しいものはどれですか? 注: この質問には 2 つの正解があります。
- A. FORはsource_itabの内容を実行するループを定義します。
- B. 行は定義済みの名前であり、任意に選択することはできません。
- C. source_itab はループ内でのみ表示されます。
- D. 行はループ内でのみ表示されます。
正解:A、D
解説:
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
質問 # 24
展示する
次の ABAP SQL スニペットのうち、行番号 4 のパラメータに値を提供する構文的に正しい方法はどれですか? 注: この質問には 2 つの正解があります。
- A. ...demo_cds_param_view エンティティ (p_date: $session.system_date) から * を選択...
- B. ...demo_cds_param_view_entity (p_date: 20238181') から * を選択...)
- C. ...SELECT * FROM deno_cds_param_view_entity (p_date = @
(cl_abap_context_info->get_system_date())... - D. ... deno_cds_param_view_entity (p_date - '20230101') から * を選択... )
正解:C、D
質問 # 25
DO...ENDDO ステートメントを使用してループを処理する場合、暗黙的なループ カウンターが含まれるシステム変数は何ですか?
- A. sy-linno
- B. およびインデックス
- C. sy-labix
- D. and-subrc
正解:B
解説:
When processing a loop with the statement DO... ENDDO, the system variable that contains the implicit loop counter is sy-index. The loop counter is a numeric value that indicates how many times the loop has been executed. The loop counter is initialized to 1 before the first execution of the loop and is incremented by 1 after each execution. The loop counter can be used to control the number of loop iterations or to access the loop elements by index. The loop counter can also be accessed or modified within the loop body, but this is not recommended as it may cause unexpected results or errors1.
For example, the following code snippet uses the loop counter sy-index to display the numbers from 1 to 10:
DO 10 TIMES. WRITE: / sy-index. ENDDO.
The output of this code is:
1 2 3 4 5 6 7 8 9 10
References: 1: DO - ABAP Keyword Documentation
質問 # 26
次の Core Data Service ビュー エンティティ データ定義があるとします。
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 }
結合ステートメントはどのような順序で実行されますか?
- A. sairport は最初に scounter に結合され、その結果が scarr に結合されます。
- B. 最初に scarr が sairport と結合され、その結果が scounter と結合されます。
- C. 最初に scarr が scounter と結合され、その結果が sairport と結合されます。
- D. 最初に scounter が sairport に結合され、その結果が scarr に結合されます。
正解:C
解説:
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
質問 # 27 
有効なステートメントは何ですか? 注: この質問には 2 つの正解があります。
- A. 「zcxl」は辞書構造であり、「paraml」と「param2」はこの構造です。
- B. 「paraml11」と「param2」は定義済みの名前です。
- C. 「previous」は前の例外への参照を期待します
- D. コードは例外オブジェクトを作成し、例外を発生させます。
正解:C、D
解説:
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:
* The code creates an exception object and raises an exception: This is true. The RAISE EXCEPTION statement raises the exception linked to the exception class zcxl and generates a corresponding exception object. The exception object contains the information about the exception, such as the message, the source position, and the previous exception12.
* "previous" expects the reference to a previous exception: This is true. The previous parameter is a predefined parameter of the instance constructor of the exception class cx_root, which is the root class of all class-based exceptions. The previous parameter expects the reference to a previous exception object that was caught during exception handling. The previous parameter can be used to chain multiple exceptions and preserve the original cause of the exception12.
You cannot do any of the following:
* "zcxl" is a dictionary structure, and "paraml" and "param2" are this structure: This is false. zcxl is not a dictionary structure, but a user-defined exception class that inherits from the predefined exception class cx_static_check. param1 and param2 are not components of this structure, but input parameters of the instance constructor of the exception class zcxl. The input parameters can be used to pass additional information to the exception object, such as the values that caused the exception12.
* "paraml" and "param2" are predefined names: This is false. param1 and param2 are not predefined names, but user-defined names that can be chosen arbitrarily. However, they must match the names of the input parameters of the instance constructor of the exception class zcxl. The names of the input parameters can be declared in the interface of the exception class using the RAISING addition12.
References: 1: RAISE EXCEPTION - ABAP Keyword Documentation - SAP Online Help 2: Class-Based Exceptions - ABAP Keyword Documentation - SAP Online Help
質問 # 28
論理式を評価するときのシーケンスの優先順位は何ですか?
- A. ACB
- B. 血中アルコール濃度
- C. または 3
- D. 1ではない
- E. CAB
- F. かつ 2
- G. ABC
正解:F
解説:
The sequence priority when evaluating a logical expression is C. A C B, which means NOT, AND, OR. This is the order of precedence of the Boolean operators in ABAP, which determines how the system implicitly parenthesizes all logical expressions that are not closed by explicit parentheses. The operator with the highest priority is evaluated first, and the operator with the lowest priority is evaluated last. The order of precedence of the Boolean operators in ABAP is as follows12:
* NOT: The NOT operator is a unary operator that negates the logical expression that follows it. It has the highest priority and is evaluated before any other operator. For example, in the expression NOT a AND b, the NOT operator is applied to a first, and then the AND operator is applied to the result and b.
* AND: The AND operator is a binary operator that returns true if both logical expressions on its left and right are true, and false otherwise. It has the second highest priority and is evaluated before the OR and EQUIV operators. For example, in the expression a AND b OR c, the AND operator is applied to a and b first, and then the OR operator is applied to the result and c.
* OR: The OR operator is a binary operator that returns true if either or both logical expressions on its left and right are true, and false otherwise. It has the third highest priority and is evaluated after the NOT and AND operators, but before the EQUIV operator. For example, in the expression a OR b EQUIV c, the OR operator is applied to a and b first, and then the EQUIV operator is applied to the result and c.
* EQUIV: The EQUIV operator is a binary operator that returns true if both logical expressions on its left and right have the same truth value, and false otherwise. It has the lowest priority and is evaluated after all other operators. For example, in the expression a AND b EQUIV c OR d, the EQUIV operator is applied to a AND b and c last, after the AND and OR operators are applied.
References: 1: log_exp - Boolean Operators and Parentheses - ABAP Keyword Documentation - SAP Online Help 2: Logical Expressions (log_exp) - ABAP Keyword Documentation - SAP Online Help
質問 # 29
次のアクションのうち、テーブル変換を必要とするデータベース テーブルへの間接的な変更を引き起こすものはどれですか? 注:
この質問には正解が2つあります。
- A. テーブル定義に含まれる構造内のフィールドの名前を変更する
- B. テーブル定義で使用されるデータ要素のフィールド ラベルを変更します。
- C. テーブル定義で使用されるデータ要素で使用されるドメインの長さを短縮します。
- D. テーブル定義に含まれる構造からフィールドを削除します。
正解:A、D
解説:
The following are the explanations for each action:
* A: Renaming a field in a structure that is included in the table definition causes an indirect change to the database table, as the field name in the table is derived from the structure. This change requires a table conversion, as the existing data in the table must be copied to a new table with the new field name, and the old table must be deleted.
* B: Changing the field labels of a data element that is used in the table definition does not cause an indirect change to the database table, as the field labels are only used for documentation and display purposes. This change does not require a table conversion, as the existing data in the table is not affected by the change.
* C: Deleting a field from a structure that is included in the table definition causes an indirect change to the database table, as the field is removed from the table as well. This change requires a table conversion, as the existing data in the table must be copied to a new table without the deleted field, and the old table must be deleted.
* D: Shortening the length of a domain used in a data element that is used in the table definition causes an indirect change to the database table, as the field length in the table is derived from the domain. This change requires a table conversion, as the existing data in the table must be checked for compatibility with the new field length, and any data that exceeds the new length must be truncated or rejected.
References: Converting Database Tables - ABAP Keyword Documentation, Adjustment of Database Structures - ABAP Keyword Documentation
質問 # 30
クラス zcl_demo_class は、言語バージョンが「標準 ABAP」に設定されたソフトウェア コンポーネント内にあります。 機能モジュール「ZF11」は、言語バージョンが「ABAP Cloud」に設定されたソフトウェア コンポーネント内にあります。 クラスと機能モジュールは両方とも顧客が作成したものです。 行番号 6 に関して、次のどれが有効な記述ですか?
- A. クラウド開発を呼び出すには、「ZF1」をリリースする必要があります。
- B. 'ZF1' は、クラウド開発用にリリースされていないラッパーを介して呼び出すことができます。
- C. 'ZF1' は、クラウド開発用にリリースされたラッパーを介して呼び出すことができます。
- D. クラウド開発用にリリースされているかどうかに関係なく、「ZF1」を呼び出すことができます。
正解:C
解説:
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":
* Create a wrapper class or interface for the function module and release it for cloud development. A wrapper is a class or interface that encapsulates the function module and exposes its functionality through public methods or attributes. The wrapper must be created in a software component with the language version set to "ABAP Cloud" and must be marked as released for cloud development using the annotation @EndUserText.label. The wrapper can then be called from a class with the language version set to "Standard ABAP" using the public methods or attributes2.
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
質問 # 31
以下のネストされた結合では、結合はどのような方法で評価されますか?
- A. 表の順序に従って左から右へ:
1.
aはbと結合される
2.
bはcと結合される - B. 表の順序に従って右から左へ:
1.
b は c と結合されます。
2.
b は a と結合されます。 - C. 条件の順に上から下へ
1.
bはcと結合される
2.
aはbと結合される - D. オン条件の順に下から上へ:
1.
aはbと結合される
2.
bはcと結合される
正解: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
質問 # 32
定義をアクティブ化しようとすると、どのような応答が返されますか?
- A. アクティベーション成功
- B. ユニオンのフィールド型が一致しないため、アクティベーション エラーが発生します
- C. ユニオンのキーフィールドが一致しないため、アクティベーションエラーが発生しました
- D. ユニオンのフィールド名が一致しないため、アクティベーション エラーが発生します
正解:D
解説:
The response will be an activation error because the field names of the union do not match. This is because the field names of the union must match in order for the definition to be activated. The union operator combines the result sets of two or more queries into a single result set. The queries that are joined by the union operator must have the same number and type of fields, and the fields must have the same names1. In the given code, the field names of the union do not match, because the first query has the fields carrname, connid, cityfrom, and cityto, while the second query has the fields carrname, carrier_id, cityfrom, and cityto. The field connid in the first query does not match the field carrier_id in the second query. Therefore, the definition cannot be activated.
References: 1: UNION - ABAP Keyword Documentation
質問 # 33
どのパターンで例外が発生しますか? 注: この質問には 3 つの正解があります。
- A. データ: gv_target TYPE p DECIMALS 2. 定数: go intl TYPE i VALUE 3. gv_target -U EXACT (2 gcojntl)。
- B. データ: gv_target 型 文字列。定数: gco_string 型 長さ 16 値
0123456789ABCDEF*. gv_target = EXACT # gco_string+5 (5) ). - C. データ: gv_target タイプ d. s/ 定数: gco_date タイプ d 値 '20331233*. gv_target EXACT ( geo_date).
- D. データ: Ev target TYPE p DECIMALS 3. 定数: gcojntl TYPE i VALUE 2. Ev_target -U EXACT #2 / gcojntl )。
- E. データ: gv_target 型 c 長さ 5. V 定数: ECO 文字列 型 文字列 値
0123456789ABCDEF"。gv_target - EXACT (gco_string + 5 (6) )。
正解:A、C、E
解説:
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
質問 # 34
サブクラス subl で、スーパークラス superl のコンポーネントを再定義したいとします。どうすればこれを実現できますか? 注:
この質問には正解が2つあります。
- A. 再定義されたコンポーネントを subl に実装します。
- B. 再定義されたコンポーネントを superl で 2 回目に実装します。
- C. subl 内のコンポーネントに REDEFINITION 句を追加します。
- D. superl 内のコンポーネントに REDEFINITION 句を追加します。
正解:A、C
解説:
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
質問 # 35
どのオブジェクトのフィールドを読み取り専用に設定すると、RESTful アプリケーション プログラミング モデルのすべてのアプリケーションでフィールドが読み取り専用になりますか?
- A. メタデータ拡張
- B. 投影ビュー
- C. サービス定義
- D. 動作定義
正解:D
解説:
The object that can be used to set a field to read-only in all applications of the RESTful Application Programming model (RAP) is the behaviour definition. The behaviour definition is a CDS artefact that defines the business logic and the UI behaviour of a business object. A business object is a CDS entity that represents a business entity or concept, such as a customer, an order, or a product. The behaviour definition can specify the properties of the fields of a business object, such as whether they are mandatory, read-only, or transient. These properties are valid for all applications that use the business object, such as transactional, analytical, or draft-enabled apps12. For example:
* The following code snippet defines a behaviour definition for a business object ZI_PB_APPLICATION.
It sets the field APPLICATION to read-only for all applications that use this business object:
define behavior for ZI_PB_APPLICATION { field ( read only ) APPLICATION; ... } You cannot do any of the following:
* 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, these properties are only valid for the specific service that uses the business object, not for all applications that use the business object12.
* C. Projection view: 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.
* D. 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, these properties are only valid for the specific UI or analytical application that uses the metadata extension, not for all applications that use the CDS entity12.
References: 1: ABAP CDS - Data Definitions - ABAP Keyword Documentation - SAP Online Help 2: ABAP CDS - Behavior Definitions - ABAP Keyword Documentation - SAP Online Help
質問 # 36
どの製品で ABAP クラウド開発モデルを使用する必要がありますか? 注: この質問には 2 つの正解があります。
- A. オンプレミスの SAP S/4HANA
- B. SAP S/4HANA Cloud、プライベートエディション
- C. SAP BTP、ABAP環境
- D. SAP S/4HANA Cloud、パブリックエディション
正解:B、C
解説:
The ABAP Cloud Development Model is the ABAP development model to build cloud-ready business apps, services, and extensions. It comes with SAP BTP and SAP S/4HANA. It works with public or private cloud, and even on-premise1. However, the complete ABAP Cloud Development Model, including the cloud-optimized ABAP language and public local SAP APIs and extension points, is available only in SAP BTP ABAP Environment and in the 2208/2022 versions of the SAP S/4HANA editions1. Therefore, you must use the ABAP Cloud Development Model in SAP BTP, ABAP environment and SAP S/4HANA Cloud, private edition. You can also use it in SAP S/4HANA on premise, but it is not mandatory. You cannot use it in SAP S/4HANA Cloud, public edition, because it does not allow custom ABAP code2. References: 1: ABAP Cloud | SAP Blogs 2: SAP S/4HANA Cloud Extensibility - Overview and Comparison | SAP Blogs
質問 # 37
展示する:
Icl_super は Icl_subl と Icl_sub2 のスーパークラスであり、メソッド subl_methl と sub2_methl はそれぞれ Id_subl または Icl_sub2 のサブクラス固有のメソッドです。これらのキャストを実行すると何が起こるでしょうか?
注記:
この質問には2つの正解があります
- A. go_subl->subl_meth !(...)* は動作します。
- B. go subl = CAST # go super) は動作しません
- C. go_sub2 = CAST # go super) は動作します。go_subl CAST #go_super) は動作します。
- D. go_sub2 = CAST #(go_super). は動作しません。] go sub2->sub2 meth 1(...). は動作します
正解:A、B
解説:
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
質問 # 38
テスト メソッドでは、メソッド cl_abap_unit_assert=>assert_equals( .. ) を次のように呼び出します。
クラス Itcl1 テストの定義 リスクレベル 無害 期間 短い。
プライベートセクション。
テスト方法 m1。
エンドクラス。
クラス Itcl1 実装。
方法m1.
データ: go_test_object 型は zcl_to_be_tested を参照します。
定数: Ico_exp 型 文字列 値 'test2'。
オブジェクト go_test_object を作成します。
cl_abap_unit_assert=>assert_equals(
輸出
行為 = go_class->mv_attribute
exp = lco_exp
msg = 'assert equals failed ' && go_test_object->mv_attribute && ' ' && lco_exp ENDMETHOD。
エンドクラス。
メソッドパラメータ act と exp が等しくない場合はどうなりますか?
- A. テストは中止されます。
- B. テストされたユニットは、デフォルトの ABAP テストコックピットバリアントに自動的に追加されます。
- C. テストされたユニットは輸送できません。
- D. テストログにメッセージが表示されます。
正解:D
質問 # 39
有効なステートメントは何ですか? 注: この質問には 2 つの正解があります。
- A. プラグマは構文チェッカーによってチェックされません。
- B. ##NEEDED は構文チェッカーによってチェックされます。
- C. 疑似コメントは構文チェッカーによってチェックされます
- D. #EC_NEEDED は構文チェッカーによってチェックされません。
正解:A、B
解説:
Both statements are valid in ABAP, but they have different effects on the program.
* ##NEEDED is a pragma that can be used to hide warnings from the ABAP compiler syntax check. It tells the check tools that a variable or a parameter is needed for further processing, even if it is not used in the current statement. For example, if you declare a variable without assigning any value to it, you can use ##NEEDED to suppress the warning about unused variables12.
* The pragma is not checked by the syntax checker means that you can use any pragma to hide any warning from the ABAP compiler syntax check, regardless of its effect on the program logic or performance. For example, if you use ##SHADOW to hide a warning about an obscured function, you can also use it to hide a warning about an invalid character in a string12.
You cannot do any of the following:
* #EC_NEEDED is not checked by the syntax checker: This is not a valid statement in ABAP. There is no pseudo-comment with #EC_NEEDED in ABAP3.
* The pseudo-comment is checked by the syntax checker: This is false. Pseudo-comments are obsolete and should no longer be used in ABAP. They were replaced by pragmas since SAP NW 7.0 EhP2 (Enhancement Package)4.
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
質問 # 40
ABAP SQL 算術式にはどのような制限がありますか? 注: この質問には 2 つの正解があります。
- A. 浮動小数点型と整数型を同じ式で使用することはできません。
- B. 演算子/は浮動小数点式でのみ使用できます。
- C. 演算子は浮動小数点式でのみ使用できます。
- D. 10 進数型と整数型を同じ式で使用することはできません。
正解:B、C
解説:
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
質問 # 41
割り当てでは、データ (gv_result) = 1/8 です。gv_result のデータ型は何でしょうか?
- A. OタイプI
- B. 型 DEFLOAT 16
- C. P小数点3を入力
- D. P 小数点 2 型
正解:B
解説:
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
質問 # 42
......
SAP C_ABAPD_2309日本語試験実践テスト問題:https://jp.fast2test.com/C_ABAPD_2309-JPN-premium-file.html