Difficulty: Easy
Correct Answer: Standard table, sorted table, and hashed table
Explanation:
Introduction / Context:
Internal tables are one of the most important data structures in ABAP programming. They hold data in memory during program execution and are heavily used in reporting, interfaces, and business logic. SAP supports several standard types of internal tables, each optimised for different access patterns. Understanding these types is a favourite topic in ABAP interviews because it shows whether a candidate can choose appropriate data structures for performance and clarity.
Given Data / Assumptions:
Concept / Approach:
A standard table is the default internal table type and behaves similarly to an array or dynamic list. Entries are stored without a defined order, and index based access is efficient, while key searches are linear unless secondary keys are defined. A sorted table always keeps its entries sorted according to a key, which enables faster key searches using binary search. A hashed table organises entries by a hash key, providing very fast access by key but not supporting index access. Choosing between these types depends on whether you need fast random key access, sorted data, or simple list behaviour.
Step-by-Step Solution:
Step 1: Recall that in ABAP, you define internal tables with the addition STANDARD TABLE, SORTED TABLE, or HASHED TABLE.
Step 2: Standard tables are best when you mostly use index access or when the table is relatively small.
Step 3: Sorted tables maintain sorted order by key and support efficient key based access through binary search, which is useful for range operations.
Step 4: Hashed tables are optimised for unique key based lookups and use hashing techniques to provide constant time access in many cases.
Step 5: Option a lists exactly these three types and correctly identifies them as the standard internal table types.
Step 6: Options b and c use generic labels that are not ABAP syntax, and option d refers to database table categories, not internal table types.
Verification / Alternative check:
Examining ABAP type definitions or using the ABAP Dictionary shows that internal tables are declared with STANDARD, SORTED, or HASHED. Developer documentation explains the characteristics of each type and gives usage recommendations. On the other hand, there is no ABAP keyword for primary internal tables or tertiary internal tables, which confirms that options b and c are not valid descriptions of ABAP internal table types.
Why Other Options Are Wrong:
Option b is wrong because primary, secondary, and tertiary tables are not terms used for ABAP internal table types. Option c is incorrect because while internal tables can behave in dynamic ways, the key words static, dynamic, and global do not define internal table types. Option d describes pool, cluster, and transparent tables, which are physical database table types in the dictionary, not in memory structures inside ABAP programs.
Common Pitfalls:
A common pitfall is to use standard tables everywhere without considering performance, which can lead to slow linear searches on large datasets. Another mistake is to select hashed tables where index based processing is required, leading to runtime errors because hashed tables do not have a defined index. Understanding the three main internal table types and their strengths helps ABAP developers structure programs efficiently and answer interview questions with confidence.
Final Answer:
Standard table, sorted table, and hashed table.
Discussion & Comments