Table of Contents

Search

  1. Preface
  2. Part 1: Getting Started with PowerExchange for SAP NetWeaver
  3. Part 2: Data Integration Using PowerExchange for SAP Dynamic ABAP Table Extractor
  4. Part 3: Data Integration Using ABAP
  5. Part 4: IDoc Integration Using ALE
  6. Part 5: Data Integration Using BAPI/RFC Functions
  7. Part 6: Data Migration
  8. Part 7: Business Content Integration
  9. Part 8: SAP BW Data Extraction
  10. Part 9: Loading Data to SAP BI
  11. Appendix A: Data Type Reference
  12. Appendix B: Code Pages and Unicode Support
  13. Appendix C: Glossary

PowerExchange for SAP NetWeaver User Guide for PowerCenter

PowerExchange for SAP NetWeaver User Guide for PowerCenter

DMI Primary and Foreign Keys

DMI Primary and Foreign Keys

A DMI message is organized hierarchically with one top-level parent segment and one or more second-level child segments. Second-level child segments may have one or more third-level child segments.
To maintain the structure of the DMI data, the SAP DMI Prepare transformation uses primary and foreign keys. The top-level parent segment has a primary key. Each child segment has a primary key and a foreign key. The foreign key of each child segment references the primary key of its parent segment. For example, the foreign key of a second-level child segment references the primary key of the top-level parent segment. Similarly, the foreign key of a third-level child segment references the primary key of the second-level child segment.
The SAP DMI Prepare transformation groups incoming data based on the values in the primary and foreign key fields. The Control Input group of the SAP DMI Prepare transformation represents the parent segment. All other groups of the SAP DMI Prepare transformation except the DMI_Prepare_Error_Output group represent second-level or third-level child segments.
The DMI_Prepare_Error_Output group is used for processing invalid DMI documents. You can process invalid DMI documents the same way as invalid IDocs.
The following table shows the groups of the SAP DMI Prepare transformation and the fields used for the primary and foreign keys:
Group(s)
Field
Description
Control Input Group
GPK_DOCNUM
Primary key of the parent segment.
Child Segment 1
GPK_<Child1_name>
Primary key of Child Segment 1.
Child Segment 1
GFK_DOCNUM_<Child1_name>
Foreign key of Child Segment 1 references the primary key of the parent segment.
Child Segment A of Child Segment 1
GPK_<Child1A_name>
Primary key of Child Segment A of Child Segment 1.
Child Segment A of Child Segment 1
GFK_<Child1_name>_<Child1A_name>
Foreign key of Child Segment A of Child Segment 1 references the primary key of Child Segment 1.
Child Segment 2
GPK_<Child2_name>
Primary key of the child segment.
Child Segment 2
GFK_DOCNUM_<Child2_name>
Foreign key of Child Segment 2 references the primary key of the parent segment.
Child Segment B of Child Segment 2
GPK_<Child2B_name>
Primary key of Child Segment B of Child Segment 2.
Child Segment B of Child Segment 2
GFK_<Child2_name>_<Child2B_name>
Foreign key of Child Segment B of Child Segment 2 references the primary key of Child Segment 2.
Each value for the GPK_<name> field must be unique. Each GFK_<parent_name>_<group_name> field must reference the primary key of its parent segment.
The following example shows the relationship of primary and foreign keys in a DMI document named ABSEN1 with four child segments:
Group
Field
Primary/Foreign Keys
CONTROL_INPUT_ABSEN1
GPK_DOCNUM
P1
E2ABSE1
GPK_E2ABSE1
C1
-
GFK_DOCNUM_E2ABSE1
P1
E2ABSE2
GPK_E2ABSE2
C2
-
GFK_DOCNUM_E2ABSE2
P1
E2ABSE2A
GPK_E2ABSE2A
C2A
-
GFK_E2ABSE2_E2ABSE2A
C2
E2ABSE3
GPK_E2ABSE3
C3
-
GFK_DOCNUM_E2ABSE3
P1
E2ABSE3B
GPK_E2ABSE3B
C3B
-
GFK_E2ABSE2_E2ABSE2A
C3
E2ABSE4
GPK_E2ABSE4
C4
-
GFK_DOCNUM_E2ABSE4
P1
The SAP DMI Prepare transformation uses these primary and foreign key relationships to maintain the structure of the DMI data. Any foreign key field that does not match the primary key of its parent segment results in an orphan row. Any primary key field that is not unique results in a duplicate row.
Verify that each DMI document has a unique primary key for the top-level parent segment, each child segment, and that each foreign key matches the primary key of its parent.

0 COMMENTS

We’d like to hear from you!