SAP IMPORT DIRECTORY ABAP Statements



Get Example source ABAP code based on a different SAP table
  


ID IMPORT-DATABASE
• IMPORT DIRECTORY ABAP Statement
• INTO IMPORT DIRECTORY
• FROM DATABASE IMPORT DIRECTORY
• TO IMPORT DIRECTORY
• CLIENT IMPORT DIRECTORY
• ID IMPORT DIRECTORY

IMPORT DIRECTORY
Short Reference

ABAP_SYNTAX
IMPORT DIRECTORY INTO itab
FROM DATABASE dbtab(ar) $[TO wa$] $[CLIENT cl$] ID id.

What does it do?
This statement passes a table of content<(>s<)> 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. ComponentTypeMeaning NAMECHAR(30)Name of the parameter under which a data object was stored. OTYPECHAR(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. FTYPECHAR(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. TFILLINT4Length 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. FLENGINT2Length of stored data object or stored table line in bytes. The value 8 is returned for strings.
System Fields sy-subrcMeaning 0The specified data cluster was found and a list of the exported data objects was passed to the internal table itab. 4The specified data cluster was not found.



Example ABAP Coding

Storing three data objects in a data cluster and reading the directory. Afterwards, the content of the table itab is as follows: NAMEOTYPE:FTYPE TFILLFLENG PAR1Fa08 PAR2TI104 PAR3RC0168
ABEXA 00322
ABAP_EXAMPLE_END



Runtime Exceptions


Non-catchable Exceptions
Reason for error:
Target table has an invalid structure.
Runtime error:
IMPORT_DIR_WRONG_TABLE_STRUC
ABAP_NONCAT_END

Return to menu