... { DATA BUFFER xstr }
| { INTERNAL TABLE itab }
| { MEMORY ID id }
| { DATABASE dbtab(ar) [TO wa] [CLIENT cl] {ID id}|obs_id }
| { SHARED MEMORY dbtab(ar) [TO wa] [CLIENT cl] ID id }
| { SHARED BUFFER dbtab(ar) [TO wa] [CLIENT cl] ID id } ... .
1. ... DATA BUFFER xstr
2. ... INTERNAL TABLE itab
3. ... MEMORY ID id
4. ... DATABASE dbtab(ar) [TO wa] [CLIENT cl] {ID id}|obs_id
5. ... SHARED MEMORY dbtab(ar) [TO wa] [CLIENT cl] ID id
6. ... SHARED BUFFER dbtab(ar) [TO wa] [CLIENT cl] ID id
The data cluster to be imported can
be taken from an elementary data object xstr, an internal table itab, the
ABAP Memory, a database table
dbtab, or a cross-program storage area (specification of SHARED MEMORY or BUFFER).
... DATA BUFFER xstr
If DATA BUFFER is specified, the data cluster is taken
from the elementary data object xstr, which must be of
the type xstring. The data object must be filled with
the same addition of the statement EXPORT.
... INTERNAL TABLE itab
If INTERNAL TABLE is specified, the data cluster is taken
from the internal table itab. The first column of itab must have the data type
s> and the second column must have the type x. As table type, only
standard tables are allowed for
itab. The internal table must have been filled with the same addition of the statement EXPORT.
... MEMORY ID id
If MEMORY is specified, the data cluster that was written to the
ABAP Memory under the identification
specified in id with the statement
EXPORT is imported. For id, a
flat
, character-type data object is expected. This object contains the identification of the data cluster.
Obsolete Abbreviation
Outside of classes, the identification id can be omitted
for storage in the ABAP Memory. Then the data cluster that was stored without specification of the ID
with the statement EXPORT is read.
... DATABASE dbtab(ar) [TO wa] [CLIENT cl] {ID id}|obs_id
If DATABASE is specified, the data cluster that was written to the database table dbtab in the area ar and under the identification specified in id using the statement EXPORT is imported. The database table dbtab must be set up in the same way as described for the EXPORT statement . For id, a flat, character-type data object is expected that contains the identification of the data cluster, and the two-digit area ar must be specified directly.
After TO, a work area wa that has the same data type as the database table dbtab can be specified. During import, the values of the database fields that are between the fields SRTF2 and CLUSTR are assigned to the components of wa with the same name.
If the database table dbtab is client-dependent, a flat, character-type field cl can be specified after the addition CLIENT. This field contains a client identification. If the addition is not specified, the current client is used.
Outside of classes, the addition TO wa can be omitted. Instead, a
table work area for the database
table dbtab can be declared using the statement
TABLES. Then, during the import, the values of the database fields that are between the
fields SRTF2 and CLUSTR are assigned to the component with the same name in the table work area
dbtab. In addition, outside of classes, the specification id
can be replaced by the obsolete specification obs_id.
The table that is imported into the internal table itab is the table exported under the name tab and the identification " TABLE" into the area "XY" of the database table INDX supplied by SAP (see the additions medium of the statement EXPORT). However, the components - which can be selected as required - are assigned to the structure wa_indx.
TYPES:
BEGIN OF tab,
col1 TYPE i,
col2 TYPE i,
END OF tab.
DATA:
wa_indx TYPE indx,
wa_itab TYPE tab,
cl TYPE mandt VALUE '100',
itab TYPE STANDARD TABLE OF tab.
IMPORT tab = itab
FROM DATABASE indx(xy)
TO wa_indx
CLIENT cl
ID 'TABLE'.
WRITE: wa_indx-aedat, wa_indx-usera, wa_indx-pgmid.
ULINE.
LOOP AT itab INTO wa_itab.
WRITE: / wa_itab-col1, wa_itab-col2.
ENDLOOP.
... SHARED MEMORY dbtab(ar) [TO wa] [CLIENT cl] ID id
... SHARED BUFFER dbtab(ar) [TO wa] [CLIENT cl] ID id
If SHARED MEMORY or SHARED BUFFER is specified, the data cluster that is specified in the area ar, given under the identification in id using the statement EXPORT, and also written to the appropriate application buffer of the Shared Memories, is imported. The system accesses a storage table of the application buffer whose row structure is defined by a database table dbtab. The set-up of this table is described in the statement EXPORT. For id, a flat, character-type data object is expected that contains the identification of the data cluster. The two-digit area ar must be specified directly.
For the optional specifications of the work area wa and
the client cl, the same applies as for import from a database table.