# Import-/Export-Facility

## Creating a Structure Format

| For exporting structures three IEF definitions are required. One for the father element, one for the structure data itself and one for the son elements.
| Below an example of a format definition for an item structure: "HAN-ART-STR" is the format for the structure information. This format is of the type "STR". Formats of the type "STR" or "REF" require the entries "Entity 1", "Entity 2" and view. These are the same parameters as the ones found in the DataView programming manual for the function "iwf_lis_ref". It is in addition possible to determine a mask name when the format is to be generated automatically (create field definitions) or when several structure masks exist. The allocation of the formats for the father and son are carried out in the structure format definition via the column "format master entity"(father) and "assigned master entity" (son). Example of a format definition for an item structure:
| Field definition father elements In the format definition of the father element all EDB fields must be contained which determine the father item uniquely. These fields must be marked with a rhombus in the column S (Selection via the fields marked). When exporting additional fields and constants can be determined which are to be written from this mask into the file. When importing, only the key fields are to be interpreted.
| In the structure field definition all fields are described which are to be exported or imported. In addition the father key information is required. This can easily be selected in the field definition of the father element and be transferred to the mask with the "Cut and Paste" function of EDB. For this the key flag K must be removed. The EDB field names of the father key must be replaced by the special field names "@PART_ID", "@VERSION" and "@REVISION". These names have no special meaning, e.g. in documents "@PART_ID" can also be used as a document number. The line with "@INDEX" emerges from the line with "T_MASTER_STR.POS_NO". It can simply be copied and the EDB field can be replaced by "@INDEX". This line is then interpreted when importing and determines if the position does already exist in the item structure or not. If this line is left out, EDB-IEF then tries to recreate all lines during the import.
| Field definition son elements In the format for the son element those key fields are defined which are necessary for searching the position item when importing. For the export additional fields can be determined (only IEF-TYPE "REF").