SAP® Documentation

Single view

ABAPIMPORT_DIRECTORY - IMPORT DIRECTORY

Addresses (Business Address Services)   CL_GUI_FRONTEND_SERVICES - Frontend Services  
This documentation is copyright by SAP AG.
SAP E-Book

IMPORT DIRECTORY

Short Reference



Syntax

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 flatcharacter-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 relevance as described in the statement IMPORT for important data from the data cluster.

For 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.

ComponentTypeMeaning
NAMECHAR(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" for flat structures, "S" for deep structures, "T" for internal tables with flat row type and "C" for tables with a deep row type.
FTYPECHAR(1)More specific type of the data object saved. For elementary data objects and internal tables with a elementary row type, the data or row type is returned in accordance with the tables of return values from DESCRIBE FIELD ... TYPE. In the case of flat structures and internal tables with flat structured row types, "C" is returned. In the case of deep structures and internal tables with deep structured row types, "v" is returned. In the case of a table that has an internal table as a row type, "h" is returned.
TFILLINT4Length 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.
FLENGINT2Length of saved data object or saved table row 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

Saving three data objects in a data cluster and reading the directory. Afterwards, the content of the table itab is as follows:

NAMEOTYPE:FTYPETFILLFLENG
"PAR1""F""a"08
"PAR2""T""I"104
"PAR3""R""C"0168

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 ).

Exceptions

Non-Catchable Exceptions

  • Cause: Target table has an invalid structure.
    Runtime Error:IMPORT_DIR_WRONG_TABLE_STRUC







CPI1466 during Backup   Vendor Master (General Section)  
This documentation is copyright by SAP AG.

Length: 8587 Date: 20200127 Time: 225717     sap01-206 ( 54 ms )

Our Service

Looking for Support? Questions?

The

Consolut

Callback-Service

Leave us your contact details and we will call you back. Panels marked with * are mandatory.