IMPORT DIRECTORY INTO itab
FROM DATABASE dbtab(ar) [TO wa] [CLIENT cl] ID id.
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
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
id expects a
object that contains the ID of the data cluster and the two-character area
must be specified directly. The additions
have the same relevance as described in the statement
IMPORT for important data from the data cluster.
itab, index tables whose row type matches the structure CDIR
in ABAP Dictionary are allowed. The following table shows the components of the structure CDIR and their relevance.
|NAME||CHAR(30)||Name of the parameter under which a data object was saved.|
|OTYPE:||CHAR(1)||General type of the data object saved. The following values are permitted: "F" for elementary, flat data objects, "G" for strings, "R" forflat structures, "S" fordeep structures, "T" for internal tables with flat row type and "C" for tables with a deep row type.|
|FTYPE||CHAR(1)||More specific type of the data object saved. For elementary data objects and internal tables witha elementary row type, the data or row type is returned in accordance with the tables of return valuesfrom
|TFILL||INT4||Length filled of the saved 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 saved data object or saved table row in bytes. The value 8 is returned for strings.|
|0||The specified data cluster was found and a list of the exported data objects was passed to the internal table
|4||The specified data cluster was not found.|
Saving three data objects in a data cluster and reading the directory. Afterwards, the content of the table
itab is as follows:
DATA: f1 TYPE decfloat16, f2 TYPE TABLE OF i, f3 TYPE spfli. DATA itab TYPE STANDARD TABLE OF cdir. f2 = VALUE #( FOR j = 1 UNTIL j > 10 ( j ) ). EXPORT par1 = f1 par2 = f2 par3 = f3 TO DATABASE demo_indx_blob(hk) ID 'HK'. IMPORT DIRECTORY INTO itab FROM DATABASE demo_indx_blob(hk) ID 'HK'. cl_demo_output=>display( itab ).
Cause: Target table has an invalid structure.