ABAPIMPORT_MEDIUM - IMPORT MEDIUM

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

IMPORT - medium

Short Reference



Syntax

... { DATA BUFFER xstr }
  | { INTERNAL TABLE itab }
  | { MEMORY ID id }
  | { DATABASE      dbtab(ar) [TO wa] [CLIENT cl] ID id }
  | { SHARED MEMORY dbtab(ar) [TO wa] [CLIENT cl] ID id }
  | { SHARED BUFFER dbtab(ar) [TO wa] [CLIENT cl] ID id } ... .

Alternatives:

1. ... DATA BUFFER xstr

2. ... INTERNAL TABLE itab

3. ... MEMORY ID id

4. ... DATABASE dbtab(ar) [TO wa] [CLIENT cl] ID id

5. ... SHARED MEMORY dbtab(ar) [TO wa] [CLIENT cl] ID id

6. ... SHARED BUFFER dbtab(ar) [TO wa] [CLIENT cl] ID id

Effect

The data cluster to be imported can be taken from an elementary data object xstr, an internal table itab, theABAPMemory, a database table dbtab, or a cross-program memory area (if SHARED MEMORY or BUFFERspecified).

Alternative 1

... DATA BUFFER xstr


Effect

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 contain a data cluster which was createdusing the DATA BUFFER addition of the EXPORT statement. Otherwise, aruntime error occurs. Note that the data object cannot be initial.

Alternative 2

... INTERNAL TABLE itab


Effect

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 sor i and the second column must have the type x. The only table type allowed for itab arestandard tables withoutsecondarytable keys. The internal table must contain a data cluster which was generated using the INTERNALTABLE addition of the EXPORT statement; otherwise, aruntime error occurs. Note that the internal table cannot be empty.

Alternative 3

... MEMORY ID id


Effect

If MEMORY is specified, the data cluster that was written to theABAPMemory under the ID specified in id by the statement EXPORT is imported. id expects aflatcharacter-likedata object. This object contains the ID of the data cluster, which is case-sensitive.

Note

Outside of classes, an obsoleteshort form exists, in which the addition ID can be omitted. This reads the data cluster savedby the statement EXPORT without an ID being specified.

Alternative 4

... DATABASE dbtab(ar) [TO wa] [CLIENT cl] ID id


Effect

If DATABASE is specified, the data cluster that was written to the database table dbtabin the area ar and under the ID specified in id using the statement EXPORTis imported. The database table dbtab must beset upin the same way as described for the EXPORT statement. id expects a flat, character-likedata object that contains the ID of the data cluster, which is case-sensitive. The two-character area ar must be specified directly.

After TO, a work area wa that has the same data type as the database table dbtabcan be specified. When imported, the values of the database fields that are between the fields SRTF2and CLUSTR are assigned to the components of wa with the same name. If the addition TO wais not specified within classes, then no data transport takes place in these components. If the additionTO wa is not specified outside of classes, but the statement TABLES is used to declare atablework area for the database table dbtab, then the values of these database fields are assigned, when imported, to the components of the table work area dbtab with the same names.

If the database table dbtab is client-specific, then a flat character-like field cl can be specified after the addition CLIENT. This field contains aclient ID. If the addition is not specified, the current client is used.

Notes

  • It is still possible to use a table work area implicitly outside of classes (instead of using TO waexplicitly). This should be considered anobsolete short form, however.
  • Since each client represents a self-contained unit, the addition CLIENT must not be used in application programs. This is checked by the ABAP runtime environment inMultitenancy systems.
  • In addition, outside of classes, the specification id can be replaced by the obsolete specificationobs_id.


Example

The table that is imported into the internal table itab is the table exported under the name tab and the ID "TABLE" into the area "XY" of the database tableINDX supplied by SAP (refer to the additionsmediumof 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.

Alternative 5

... SHARED MEMORY dbtab(ar) [TO wa] [CLIENT cl] ID id


Alternative 6

... SHARED BUFFER dbtab(ar) [TO wa] [CLIENT cl] ID id


Effect

If SHARED MEMORY or SHARED BUFFER is specified, the data cluster is imported that waswritten (by the statement EXPORT) to the relevant application buffer of thesharedmemory in the area ar and using the ID specified in id. The system accesses a memory table of the application buffer whose row structure is defined by a database table dbtab. Theset-up of this table is described in the statement EXPORT. id expects aflatcharacter-like data object that contains the ID of the data cluster. The two-character area ar must be specified directly.

For the optional work area wa and client cl, the same applies as for imports from a database table.

Note

Instead of using data clusters in the shared memory, we recommend that you usesharedobjects. Shared objects allow you to store objects with complex dependencies, can be processed like normal objects, and enable several users to access the shared memory without any copying effort.


SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up   Vendor Master (General Section)  
This documentation is copyright by SAP AG.


Length: 12297 Date: 20120522 Time: 065016     triton ( 339 ms )