Describing the ABAP RESTful Application Model Flashcards
How do you create a Database Table
File -> New -> Other
Type database table in the appearing dialog box filter
Doubleclick
How do you define columns in a table in the database definition? (built-in ABAP Dictionary types)
Use the notation field_name : data_type.
For built-in ABAP dictionary types, use the notation abap.data_type.
Provide the length in parentheses after the data type if it’s incomplete.
For example, abap.char(10) for character types.
For numeric types with fixed decimal places, use abap.dec(15,2) for example, defining 15 digits including two decimal places.
EXAMPLE:
carrier_id : /dmo/carrier_id;
Afterwards, ctrl + click on carrier_id (the right one)
What are data elements?
Data elements are ABAP Dictionary objects defining the type of a single field.
They encompass both technical type descriptions and semantic information like field labels.
How do you create a new data element in ABAP?
Navigate to File → New → Other, then select “data element.”
Provide the package name and name for the data element.
Select a transport request for version control.
Specify a data type for the data element, usually a domain.
Enter short, medium, and long field labels, along with a label for column headings.
How do you define table columns in ABAP, and what is the difference compared to using data elements?
In ABAP, table columns can be defined directly by specifying the field name and data type using the notation “field_name : data_type.”
Unlike using data elements, which provide semantic information and allow for automatic usage of field labels on generated user interfaces, directly defining table columns does not offer these benefits.
Directly defining table columns can be less structured and may require manual management of field labels and other metadata.
Why is a primary key necessary in a table definition, and what are the requirements for defining it?
A primary key is required to uniquely identify each entry in a table.
The primary key is defined as a sequence of fields at the beginning of the table description.
The first field in the key definition must be the client field with the data type abap.clnt, indicating the client-specific data partitioning.
It is recommended to use a UUID (Universally Unique Identifier) for the unique key, specified by the data element sysuuid_x16, to allow the runtime to automatically assign UUIDs when creating new records.
Example:
key client : abap.clnt not null;
key uuid : sysuuid_x16 not null;
What is the significance of the first field in the table definition?
The first field in the table definition must be the client field, with the data type abap.clnt.
What is recommended for generating a unique key in a table?
It is recommended to use a UUID (Universally Unique Identifier) for generating a unique key in a table. This can be achieved by using the data element sysuuid_x16.
Why is it important to store administrative information with data in a database table?
It is important for traceability reasons to store administrative information with data in a database table. This includes details such as the user who created or changed the data, as well as timestamps for creation and last change.
What purpose do timestamps serve in the ABAP RESTful application programming model?
timestamps are used for concurrency control. They serve as effective ETag fields, ensuring data consistency by changing their value whenever a data set is updated.
What is the purpose of publishing the service in the OData UI Service?
The service must be published before testing the app to ensure it is available for preview.
How can you publish the OData UI Service?
To publish the service, open the service binding and choose “Publish.”
How can you Preview the app?
After publishing the service, you can preview the app by selecting the entity (e.g., Connection) and choosing “Preview.”
What is the significance of the Preview option in the OData UI Service?
Choosing “Preview” allows you to test the SAP Fiori app generated from the OData UI Service in a browser window.
What is the object generator and its role in creating a Fiori app in the ABAP context?
The object generator is a tool used in ABAP development to automatically create repository objects needed for building a Fiori app. It generates CDS views, behavior definitions, implementation classes, and other artifacts based on input provided by the developer, streamlining the development process and ensuring adherence to naming conventions and best practices.
How do you start the object generator for creating ABAP repository objects?
Right-click the table name in the Project Explorer and choose “Generate ABAP Repository Objects.”
In the ABAP RESTful Programming Model, how do you access database tables?
Instead of accessing database tables directly, you use a CDS data definition, which is similar to an SQL view but contains important semantic information.
What is a behavior definition in the context of the ABAP RESTful Programming Model?
A behavior definition specifies which actions (create, update, delete) are allowed for a particular entity, along with other definitions like draft enabling, automatic numbering, validations, and determinations.
What is the purpose of a service projection in the ABAP RESTful Programming Model?
A service projection contains a view with the required fields for a specific app, a behavior definition specifying available behaviors, and metadata extensions defining the app’s UI.
What is the semantic key in the context of database tables?
a combination of fields in a database table that must be unique according to business logic, in addition to the technical key.
Where are validations declared in the ABAP RESTful Application Programming Model?
Validations are declared in the behavior definition of the CDS view entity, specifying conditions and checks to ensure data consistency and integrity.