✅ 1. How to delete duplicates from an internal table?
-
Use
DELETE ADJACENT DUPLICATES FROM i_tab
after sorting. -
Use
COMPARING
to restrict which fields determine duplicates.
πΉ Example:
✅ 2. What are the types of internal tables?
-
Standard Tables – Linear index, slower for large data.
-
Sorted Tables – Maintains order, binary search, fast read by key.
-
Hashed Tables – No index, uses hash algorithm, fastest for key-based access.
✅ 3. What is the size of an internal table?
-
Controlled using
OCCURS n
(commonlyOCCURS 0
). -
Memory is allocated dynamically as entries increase.
-
Affects performance, not actual size.
✅ 4. What is the effective way of using internal table records?
-
Define internal table without header line.
-
Use a work area to perform operations.
-
Always
CLEAR
the work area after use.
✅ 5. Explain Sorted Tables.
-
Entries inserted in sorted order using
INSERT
. -
Uses binary search.
-
Duplicate keys not allowed.
-
Best for partially sequential processing.
✅ 6. What is the difference between internal table and structure?
-
Internal Table holds multiple records.
-
Structure holds a single record during runtime.
✅ 7. What are field groups and internal tables?
-
Field Group: Logical group of similar fields.
-
Internal Table: Temporary memory used to store records at runtime.
✅ 8. What is SAP internal table key?
-
Identifies rows; can be:
-
Standard Key
-
User-defined Key
-
-
Keys can be
UNIQUE
orNON-UNIQUE
. -
Sequence of key fields matters for sorting and performance.
✅ 9. Explain Hashed Tables.
-
Best for key-based access.
-
Constant response time regardless of size.
-
Cannot access by index.
-
Must have a unique key.
✅ 10. What do you mean by table types?
-
Defines how data is accessed (index/key/hashed).
-
Types: Standard, Sorted, and Hashed.
-
Selection depends on performance and access needs.
✅ 11. What are control levels in internal tables?
Used in LOOPs:
-
AT FIRST
-
AT NEW
-
AT END OF
-
AT LAST
-
ON CHANGE OF
✅ 12. How can you specify internal tables as data objects?
-
Defined by line type, key, and access method.
-
Dynamic in size.
-
Memory limit ≈ 2 GB (500 MB realistic).
-
Hashed tables: Max ~2 million entries.
✅ 13. What is a generic internal table?
-
Key or line type can be unspecified.
-
Used for field symbols or interface parameters.
-
Cannot declare regular data objects this way.
✅ 14. Explain Standard Internal Tables.
-
Ideal for index-based operations.
-
Use
APPEND
,READ INDEX
,MODIFY INDEX
, etc. -
Linear access time, can use binary search if sorted.
✅ 15. Explain:
-
Internal Table: Runtime-only table in memory.
-
Value Table: Domain-level validation.
-
Check Table: Field-level validation (foreign key).
-
Transparent Table: Same structure in DB and ABAP Dictionary.
✅ 16. How to choose a table type?
-
Depends on access pattern:
-
Frequent index access → Standard Table
-
Sorted inserts → Sorted Table
-
Key-only access → Hashed Table
-
✅ 17. What is row type and line type?
-
Line Type: Structure of each row (data type).
-
Row Type: Actual content (data instance).
-
Helps in reuse and DDIC-defined tables.
✅ 18. Difference between internal table and work area?
Feature | Internal Table | Work Area |
---|---|---|
Purpose | Holds multiple records | Single data row holder |
Use | Store/loop/modify/delete data | Move data to/from table rows |
✅ 19. Difference between database tables and internal tables?
Aspect | Database Table | Internal Table |
---|---|---|
Storage | Stored in DB Server | Runtime memory (App server) |
Lifetime | Permanent | Temporary (during program run) |
Access | Persistent SQL operations | SAP program operations |
✅ 20. Difference between COLLECT
and APPEND
?
-
APPEND
: Adds row unconditionally. -
COLLECT
: If duplicate key exists, sums numeric fields instead of appending.
No comments:
Post a Comment