Podcast
Questions and Answers
Which statement is used to change the contents of a row of data in an internal table?
Which statement is used to change the contents of a row of data in an internal table?
What happens when you use the 'Modify' statement on a standard table in ABAP?
What happens when you use the 'Modify' statement on a standard table in ABAP?
Which of the following operations will result in an error when applied to an internal table?
Which of the following operations will result in an error when applied to an internal table?
In what scenario would you NOT use the 'Modify' statement on an internal table?
In what scenario would you NOT use the 'Modify' statement on an internal table?
Signup and view all the answers
Which clause must be included to ensure the 'Modify' statement works correctly for a standard internal table?
Which clause must be included to ensure the 'Modify' statement works correctly for a standard internal table?
Signup and view all the answers
What is a consequence of using the 'Modify' statement without the 'WHERE' clause?
What is a consequence of using the 'Modify' statement without the 'WHERE' clause?
Signup and view all the answers
When using 'Modify' to update a row in an internal table, which of the following must be guaranteed?
When using 'Modify' to update a row in an internal table, which of the following must be guaranteed?
Signup and view all the answers
What is a typical use case for the 'Modify' statement in ABAP?
What is a typical use case for the 'Modify' statement in ABAP?
Signup and view all the answers
Which of the following statements is true when using the expression itab1 = corresponding #( itab2 )?
Which of the following statements is true when using the expression itab1 = corresponding #( itab2 )?
Signup and view all the answers
What is a requirement for the expression itab1 = corresponding #( itab2 ) to work correctly?
What is a requirement for the expression itab1 = corresponding #( itab2 ) to work correctly?
Signup and view all the answers
Which data declarations will allow for the assignment between gv_source and gv_target without truncation or rounding? (Select all that apply)
Which data declarations will allow for the assignment between gv_source and gv_target without truncation or rounding? (Select all that apply)
Signup and view all the answers
What can happen if fields with the same name but different types are present in itab2 when using itab1 = corresponding #( itab2 )?
What can happen if fields with the same name but different types are present in itab2 when using itab1 = corresponding #( itab2 )?
Signup and view all the answers
Which of the following must you consider regarding types when using internal tables?
Which of the following must you consider regarding types when using internal tables?
Signup and view all the answers
What will be the response when activating a Core Data Service View Entity Data Definition if the field types of the union do not match?
What will be the response when activating a Core Data Service View Entity Data Definition if the field types of the union do not match?
Signup and view all the answers
In which scenarios will the expression itab1 = corresponding #( itab2 ) lead to errors?
In which scenarios will the expression itab1 = corresponding #( itab2 ) lead to errors?
Signup and view all the answers
Which select statement would correctly extract the mat field from demo_sales_cds_material_view?
Which select statement would correctly extract the mat field from demo_sales_cds_material_view?
Signup and view all the answers
Which of the following is classified as a generic internal table type?
Which of the following is classified as a generic internal table type?
Signup and view all the answers
How does the SQL command 'itab1 = corresponding #( itab2 )' determine which fields to copy?
How does the SQL command 'itab1 = corresponding #( itab2 )' determine which fields to copy?
Signup and view all the answers
What is one of the outcomes when executing 'itab1 = corresponding #( itab2 )'?
What is one of the outcomes when executing 'itab1 = corresponding #( itab2 )'?
Signup and view all the answers
What is the variable type of connection_full when defined as DATA connection_full TYPE /DMD/I_Connection?
What is the variable type of connection_full when defined as DATA connection_full TYPE /DMD/I_Connection?
Signup and view all the answers
What should be the types of itab1 and itab2 when using the expression itab1 = corresponding #( itab2 )?
What should be the types of itab1 and itab2 when using the expression itab1 = corresponding #( itab2 )?
Signup and view all the answers
In the context of ABAP SQL code, which syntax correctly specifies case distinctions?
In the context of ABAP SQL code, which syntax correctly specifies case distinctions?
Signup and view all the answers
What is the primary reason for an activation error in a Core Data Service View?
What is the primary reason for an activation error in a Core Data Service View?
Signup and view all the answers
Which of the following describes the use of an internal table type effectively?
Which of the following describes the use of an internal table type effectively?
Signup and view all the answers
Study Notes
Core Data Services (CDS)
- CDS view entities support parameters.
- Parameters are defined using the
@
symbol followed by a variable or expression. - Some examples of valid parameters are:
-
$session.system_date
(system date) -
@ (cl_abap_context_info->get_system_date())
(system date) - A literal date value in the format YYYYMMDD ('20230101').
-
CDS Views - Joining
- CDS views can be joined based on their fields.
- You can use the
ON
clause in aJOIN
statement to define the join condition. - The JOIN clause should reference the fields from the views you want to join.
- You cannot use the
$projection
variable in theON
clause because it represents the view's projection, not individual fields.
ABAP Internal Tables
- You can utilize the
itab1 = corresponding #( itab2)
statement to copy data from one internal table (itab2) to another (itab1). - This statement will copy fields with the same name and data type.
- Both tables must have at least one field name in common.
ABAP String Manipulation
- You can use ABAP SQL to manipulate strings within a SELECT statement.
- The
substring
,upper
, andleft
functions can be used to extract specific characters from a string.-
substring(upper('mr joe doe'), 4, 3)
will extract the substring "JOE" from the string. -
upper(left( 'mr joe doe', 6))
will extract the substring "MR JOE" and convert it to uppercase.
-
ABAP Data Types
- When assigning a variable to another variable, the types must be compatible to avoid truncation or rounding issues.
- The
TYPE
keyword is used to declare a variable's data type. - Examples of data types:
-
p
- Packed number,c
- Character,string
- Character string
-
CDS View Activation Error
- A CDS view with a union must have matching field names (same names) and data types (compatible types) for successful activation.
- If the field names in the union do not match, the activation will fail. Similarly, if the field types are incompatible, the activation will fail.
ABAP SQL - Selecting From CDS Views
- You can select data from a CDS view using
SELECT
statements in ABAP SQL. - The
FROM
clause should reference the view name, for example:-
SELECT mat FROM demo_sales_cds_material_ve
(select the field named 'mat' from the viewdemo_sales_cds_material_ve
)
-
ABAP Internal Table Types
- There are different types of internal tables in ABAP:
-
Standard Table
- Default internal table type, no specific ordering. -
Sorted Table
- Table with entries ordered bySORT
statement. -
Hashed Table
- Table with entries accessed using a hash key for fast access. -
Index Table
- Table with entries accessed by a specific index number.
-
ABAP Variables
- Variables in ABAP can be declared with different data types:
-
Simple variable
- Stores a single value. -
Internal table
- Stores a collection of rows. -
Structure
- Groups data into logical units, similar to classes.
-
ABAP SQL - Case Distinctions
-
CASE
statements in ABAP SQL allow you to evaluate different conditions and return specific values. - You can use
CASE
statements to create conditional logic withinWHERE
clauses andSELECT
statements. - Valid case distinctions include
WHEN
clauses andELSE
clauses.
ABAP Internal Table Sorting
- Sorting is performed using the
SORT
statement. - You can define sorting conditions based on fields and their order (ascending or descending).
-
SORT itab BY field1 field2
will sort the internal tableitab
ascending byfield1
and thenfield2
.
ABAP Internal Table Modifications
- The
MODIFY
statement is used to modify the contents of an existing row in an internal table.
ABAP Security - Access Control Objects
- Access Control Objects (ACOs) define access rights to database tables.
- They use clauses like:
-
WHERE
to define specific conditions for access. -
GRANT
to define access rights. -
REVOKE
to remove access rights.
-
ABAP SQL Syntax
- Conventions for
SELECT
statements in ABAP Open SQL:- The
INTO TABLE @gt flights
clause should appear after theFIELDS
clause within theSELECT
statement.
- The
ABAP Predicate Conditions
-
CAST
can be used to convert data types in ABAP. - To ensure a valid
CAST
operation, the data type being converted should be aSUPPLIED
type (meaning it has a value).
ABAP Logical Expression Evaluation
- The logical operators in ABAP are evaluated in the following order:
-
NOT
- highest priority -
AND
- medium priority -
OR
- lowest priority
-
ABAP Database Table Definitions
- Key parts of defining a database table:
-
Field list
- Defines the fields and their data types. -
Semantic table attributes
- Defines the table's characteristics. -
Extension
- Allows you to add custom fields and logic.
-
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.
Related Documents
Description
Test your knowledge on Core Data Services (CDS), including the use of parameters and joining views. Additionally, explore the handling of internal tables in ABAP. This quiz covers essential concepts for SAP ABAP developers.