CDS View Entity Annotation
24 Questions
0 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What is the correct way to define a parameter in a CDS view?

  • Using a component of an ABAP Dictionary structure
  • Using a numeric value
  • Using a data element (correct)
  • Using a built-in ABAP type (correct)
  • What is the purpose of a unique secondary key?

  • To improve data integrity
  • To provide an alternative access path (correct)
  • To optimize data retrieval (correct)
  • To enforce data consistency
  • What is the best way to achieve faster access to internal tables?

  • Using a hashed internal table with a partial primary key from the left
  • Using a standard internal table with a complete primary key (correct)
  • Using a hashed internal table with a complete primary key (correct)
  • Using a sorted internal table with a partial primary key from the left (correct)
  • What is the correct sequence of execution in an ABAP program?

    <p>Numeric functions, addition and subtraction, multiplication and division</p> Signup and view all the answers

    How do you redefine a component of a superclass in a subclass?

    <p>By adding the clause REDEFINITION to the component in the subclass</p> Signup and view all the answers

    What is the purpose of a projection view in ABAP?

    <p>To transform data</p> Signup and view all the answers

    What is the benefit of using a hashed internal table?

    <p>Faster data retrieval</p> Signup and view all the answers

    What is the purpose of a unique key in ABAP?

    <p>To improve data integrity</p> Signup and view all the answers

    What is the effect of attaching a system field to an input parameter of a CDS view entity?

    <p>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).</p> Signup and view all the answers

    What is the data type of gv_result in the assignment data(gv_result) = 1 / 8?

    <p>TYPE I</p> Signup and view all the answers

    Which of the following statements is true about the given code?

    <p>In class CL1, the interface method is named if-m1.</p> Signup and view all the answers

    What will happen when executing the cast go_sub1 = CAST #(go_super)?

    <p>It will work.</p> Signup and view all the answers

    What is the purpose of setting a field to read-only in a service definition?

    <p>To make the field read-only in all applications of the RESTful API.</p> Signup and view all the answers

    What is the effect of using the annotation @Default.aggregation.Column on a CDS view?

    <p>It sets the default aggregation type of the column to SUM.</p> Signup and view all the answers

    What is the purpose of using the ABAP statement DATA gv_result TYPE i?

    <p>To declare a variable of type integer.</p> Signup and view all the answers

    What is the effect of using the CDS view annotation @ObjectModel.createEnabled: true?

    <p>It enables the creation of new objects in the CDS view.</p> Signup and view all the answers

    What is the data type of gv_target in the statement DATA gv_target TYPE string?

    <p>String</p> Signup and view all the answers

    What is the correct syntax for a SELECT statement in ABAP SQL?

    <p>SELECT mat FROM demo_sales_cds_so_i_ve...</p> Signup and view all the answers

    What is the purpose of a CDS view?

    <p>To define a data model</p> Signup and view all the answers

    What is the data type of connection_full based on the statement DATA connection_full TYPE /DMD/I_Connection?

    <p>Structure</p> Signup and view all the answers

    What is the correct syntax for a CASE statement in ABAP SQL?

    <p>CASE WHEN F2 = '1' THEN 'Value 1' WHEN F2 = '2' THEN 'Value 2' ELSE 'Value for the rest' END</p> Signup and view all the answers

    What is the data type of gv_source in the statement DATA gv_source TYPE c?

    <p>Character</p> Signup and view all the answers

    What is the purpose of a unique key in a CDS view?

    <p>To improve data integrity</p> Signup and view all the answers

    What is the effect of using the CDS view annotation @ObjectModel.createEnabled: true?

    <p>It allows creation of new records</p> Signup and view all the answers

    Study Notes

    CDS View Entity

    • Attaching a system field to an input parameter of a CDS view entity means that the value of sy-langu will be passed to the CDS view automatically when used in ABAP or in another CDS view entity.
    • It is still possible to override the default value with a value of your own.

    Data Type

    • In the assignment data(gv_result) = 1 / 8, the data type of gv_result is TYPE I.

    Interface Methods

    • In class CL2, the interface method is not named if1-m1.
    • Class CL2 uses the interface.
    • In class CL1, the interface method is named if-m1.
    • Class CL1 uses the interface.
    • Class CL1 implements the interface.

    Casting

    • go_sub1-&gt;sub1_meth1(...). will work.
    • go_sub2-&gt;sub2_meth1(...). will work.
    • go_sub1 = CAST #(go_super) will work.
    • go_sub2 = CAST #(go_super) will not work.

    Read-only Field

    • Setting a field to read-only in the metadata extension makes the field read-only in all applications of the RESTful Application Programming model.
    • Setting a field to read-only in the service definition does not make the field read-only in all applications of the RESTful Application Programming model.

    Core Data Service View Entity

    • When attempting to activate the definition, the response will be an activation error because the key fields of the union do not match.

    ABAP SQL

    • The select statement that selects the mat field on line #17 is SELECT mat FROM demo_sales_cds_so_i_ve....
    • INDEX TABLE is a generic internal table type.

    CDS View Variable

    • The variable type of connection_full based on the code DATA connection_full TYPE /DMD/I_Connection is a structure.

    ABAP SQL Case Distinctions

    • Valid case distinctions in ABAP SQL are CASE with WHEN and ELSE clauses, and CASE with WHEN and OTHERS clauses.

    Unique Secondary Key

    • A unique secondary key is created with the first read access of a table.
    • A unique secondary key is updated when the table is modified.

    Faster Access to Internal Tables

    • Specifying the primary key partially from the left without gaps in a sorted internal table results in faster access.
    • Specifying the primary key completely in a hashed internal table results in faster access.
    • Specifying the primary key completely in a sorted internal table results in faster access.

    CDS View Entity Input Parameter

    • A built-in ABAP Dictionary type can be used to replace "????" in the definition of a CDS view entity with an input parameter.
    • A data element can be used to replace "????" in the definition of a CDS view entity with an input parameter.

    Sequence of Execution

    • The sequence of execution in the dropdown list is:
      • Numeric functions (highest priority)
      • Multiplication (") and Division (/) (middle priority)
      • Addition (+) and Subtraction (-) (lowest priority)

    Redefining a Component

    • To redefine a component of a superclass in a subclass, you add the clause REDEFINITION to the component in the subclass.
    • You implement the redefined component in the subclass.

    Studying That Suits You

    Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

    Quiz Team

    Related Documents

    Description

    Understanding the effects of attaching a system field to an input parameter of a CDS view entity in ABAP.

    More Like This

    ABAP CDS and SAP List Viewer Quiz
    5 questions
    ABAP Programming Concepts
    6 questions
    ABAP Dialog Transaction Management
    10 questions
    Use Quizgecko on...
    Browser
    Browser