--- title: "Loading internal IDoc structure" slug: "intro-sap-loading-templates-idoc-lobster" updated: 2026-07-29T13:29:56Z published: 2026-07-29T13:29:56Z canonical: "docs.lobstersoftware.com/intro-sap-loading-templates-idoc-lobster" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.lobstersoftware.com/llms.txt > Use this file to discover all available pages before exploring further. # Loading internal IDoc structure The following screenshot shows the dialogue for importing a supplied IDoc template (in this case for a source structure). *See also*: [Source structure menu](/v1/docs/en/phase-3-source-structure-menu) and [Target structure menu](/v1/docs/en/phase-3-target-structure-menu). ![images/download/attachments/201680154/874-version-2-modificationdate-1748329924440-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/874-version-2-modificationdate-1748329924440-api-v2.png) (1) **Refresh structure:** If this checkbox is set, the structure is refreshed. This only makes sense if the structure is not replaced, but is to be updated. For example, because the IDoc was extended with a new custom segment or new fields. Function chains and formats in the existing target structure will be kept where possible if the differences to the IDoc template are minimal. (2) **Use variables:** Only applies to target structure templates. See the following section. (3) **Matchcodes without version information:** Only applies to source structure templates. If this checkbox is not set, the [Match codes](/v1/docs/en/intro-profiles-phase-2-parsing-match-codes) of the source structure nodes are created with the version number of the respective segment and filled with whitespaces from the right up to 30 characters. If the checkbox is set, the version number and the whitespaces are not added. **NOTE:** This checkbox is also effective for the direct import from the SAP system. However, only the match codes are adjusted, not the names of the nodes. **Example:** With version (trailing whitespaces are represented with underscores): | Starts with: E2EDK01005____________________ | | --- | **Example:** Without version: | Starts with: E2EDK01 | | --- | (4) **Template:** List of IDoc templates. There are three template types. *IDOC_* (for SAP version 46C), *V7IDOC_* (for SAP NetWeaver 7x) und *V75IDOC_* (for SAP NetWeaver 75x). ## Variables for the IDoc segment header in target structure If option "**Use variables**" is set, the profile variables necessary for the generation of the segment headers of the IDOC (*SYS_DOCNUM*, *SYS_MANDT*, *SYS_SEGNUM*, *SYS_SEGNUM_1*, *SYS_SEGNUM_2*, *SYS_SEGNUM_3*, *SYS_SEGNUM_4*, *SYS_SEGNUM_5*, ...) are created automatically with the appropriate data type if they do not already exist. In addition, these variables are filled in the corresponding target structure fields with automatically placed functions, as you can see in the following screenshot. ![images/download/attachments/201680154/871-version-2-modificationdate-1748331457843-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/871-version-2-modificationdate-1748331457843-api-v2.png) **(1)** Field *MANDT* in control segment *EDI_DC40* in the target structure. **(2)** Field **(1)** and variable *SYS_MANDT* get the value of the linked (mapped) field **(3)**. **(3)** This setting means that the value assigned to the variable is taken from the linked (mapped) field. The Mapping itself has to be done by the user. Intermediate Document. SAP proprietary data format for the electronic exchange of business documents. IDocs transport structured data (e.g., orders, delivery notes) between SAP systems or between SAP and third-party systems, e.g., via ALE or EDI. A rule-based mechanism for automatically mapping data records to nodes in the source structure. Conditions such as *Is equal to*, *Starts with*, or *Regular expression* check attributes (e.g., header, ID). Multiple rules per node are always linked with an OR operator. The core task of Phase 3. Mapping transfers data from the source structure to the target structure according to defined rules. In the process, fields can be transformed, functions can be called, and values can be calculated.