Start of Content Area

Storing Data as Clusters  Locate the document in its SAP Library structure

New variants of the IMPORT and EXPORT statements are available to support heterogeneous Unicode environments. They allow you to store data as a cluster in an XSTRING in a cross-platform format You can use the following variants:

Storage in the DATA BUFFER

EXPORT {pi = dobji | pi FROM dobji } TO DATA BUFFER dbuf.

EXPORT (itab) TO DATA BUFFER dbuf.

Stores the objects dobj1 ... dobjn (fields, flat structures, complex structures, or tables) as a cluster in the data buffer, dbuf, which must be of type XSTRING.

IMPORT {pi = dobji | pi FROM dobji } FROM DATA BUFFER dbuf.

IMPORT (itab) FROM DATA BUFFER dbuf.

Imports the data objects dobj1 ... dobjn (fields, flat structures, complex structures, or tables) from a data cluster in the data buffer entered, dbuf¸ which must be of type XSTRING. The system reads all the data that was previously stored in the data buffer dbuf using the EXPORT ... TO DATA BUFFER statement. Again, the system does not check that the structures in the EXPORT and IMPORT statements match.

Note

If the data objects are specified dynamically, the parameter list in the two-column index table, itab, is passed. The columns in this table must be of type C or STRING. The first column of itab contains the name of each parameter, while the second lists the data objects. If the first column of itab is empty, an exception that cannot be handled occurs, with the runtime error DYN_IMEX_OBJ_NAME_EMPTY.

Example

TYPES:
    BEGIN OF ITAB_TYPE,
      CONT TYPE C LENGTH 4,
    END OF ITAB_TYPE.

  DATA:
    XSTR TYPE XSTRING,
    F1 TYPE C LENGTH 4,
    F2 TYPE P,
    ITAB TYPE STANDARD TABLE OF ITAB_TYPE.

  EXPORT P1  = F1
         P2  = F2
         TAB = ITAB TO DATA BUFFER XSTR.

The New CODE PAGE HINT Addition

You use this addition in conjunction with ambiguous code pages in the EXPORT obj1 ... objn TO [ DATA BUFFER | DATABASE | DATASET ] statement. It specifies the code page, f1, which is to be used to interpret the import data.

 

 

End of Content Area