As we said in part I of this post, tools also does not allow you to create mappings through EIM for custom foreign keys.
For example, let’s say we need a product id in the S_SRV_REQ (service requests) table. This foreign key to the Internal Product entity (table S_PROD_INT) does not come from the box, so we only have to add a custom column of type X_PROD_ID to cover the requirement.
If we needed to load via EIM service requests from a legacy system, we would encounter the problem that EIM does not allow you to do so without the help of Expert Services, so the most common solution would be to load the X_PROD_ID directly through an additional process that made the corresponding UPDATE.
Following the same logic that we presented in part I of this post, we can get EIM mapping for custom FK columns and it will work like standard FKs.
The steps to follow are essentially the same as those described in Part I, putting in this case the focus on the following sections of the XML:
- COLUMN
- EIM_TABLE_MAPPING
- FOREIGN_KEY_MAPPING
- FOREIGN_KEY_MAPPING_COLUMN
- FOREIGN_KEY_MAPPING
- INDEX
- INDEX_COLUMN

In addition to editing the XML (.sif) conveniently, we must not forget that we need a temporary processing column that the EIM will use to resolve the destination table ID and finally dump it into the corresponding FK column (in our case, it could be the T_PROD__RID column)
Finally, you should add an index in the new column T_PROD__RID that will help EIM in terms of performance.

