Ansicht
Dokumentation
ABAPIMPORT_DIRECTORY - IMPORT DIRECTORY
General Material Data BAL Application Log DocumentationThis documentation is copyright by SAP AG.
IMPORT DIRECTORY
IMPORT DIRECTORY INTO itab
FROM DATABASE dbtab(ar) $[TO wa$] $[CLIENT cl$] ID id.
Effect
This statement passes a table of contents of all data objects of a data cluster that was written to the database table dbtab in the area ar and under the ID specified in id using the statement EXPORT to the internal table itab. The database table dbtab must be structured in the same way as described for the EXPORT statement as an export/import table. id expects a flat character-like data object that contains the ID of the data cluster and the two-character area ar must be specified directly. The additions TO and CLIENT have the same meaning as described in the statement IMPORT for important data from the data cluster.
For itab, index tables whose line type matches the structure CDIR in the ABAP Dictionary are allowed. The following table shows the components of the structure CDIR and their meaning.
Component | Type | Meaning |
NAME | CHAR(30) | Name of the parameter under which a data object was stored. |
OTYPE | CHAR(1) | General type of the stored data object. The following values are allowed: "F" for elementary flat data objects, "G" for strings, "R" for flat structures, "S" for deep structures, "T" for internal tables with flat line type and "C" for tables with a deep line type. |
FTYPE | CHAR(1) | More specific type of the stored data object. For elementary data objects and internal tables with a elementary line type, the data type or line type is returned in accordance with the tables of the return values from DESCRIBE FIELD ... TYPE. In the case of flat structures and internal tables with flat structured line types, "C" is returned. In the case of deep structures and internal tables with deep structured line types, "v" is returned. In the case of a table that has an internal table as a line type, "h" is returned. |
TFILL | INT4 | Length filled of the stored data object. For strings the length of the content in bytes is returned and for internal tables the number of rows is returned. The value 0 is returned for other data objects. |
FLENG | INT2 | Length of stored data object or stored table line in bytes. The value 8 is returned for strings. |
System Fields
sy-subrc | Meaning |
0 | The specified data cluster was found and a list of the exported data objects was passed to the internal table itab. |
4 | The specified data cluster was not found. |
Example
Storing three data objects in a data cluster and reading the directory. Afterwards, the content of the table itab is as follows:
NAME | OTYPE: | FTYPE | TFILL | FLENG |
"PAR1" | "F" | "a" | 0 | 8 |
"PAR2" | "T" | "I" | 10 | 4 |
"PAR3" | "R" | "C" | 0 | 168 |
Exceptions
Non-Catchable Exceptions
- Cause: Target table has an invalid structure.
Runtime Error: IMPORT_DIR_WRONG_TABLE_STRUC
PERFORM Short Reference Fill RESBD Structure from EBP Component Structure
This documentation is copyright by SAP AG.
Length: 7621 Date: 20240424 Time: 160246 sap01-206 ( 95 ms )