Skip to Content
0
Former Member
Dec 18, 2015 at 11:51 AM

Datahub: One TartgetItem type can have only one CanonicalItem source type?

74 Views

Hello,

I have an issue that I want to solve. I have an OrderDetail object with to fields.

SAP expect a list of these fields with a different qualifier for each field. I give an example:

My OderItem has one skuNumber and one eanNumber

The SAP target expect this {[qualifier='001', skuNumber], [qualifier='002', eanNumber]}

I have created two Canonical types like this (SKU_Canonical and EAN_Canonical):

        <item>
             <type>SKU_Canonical</type>
             <description>OrderDetail ean</description>
             <status>ACTIVE</status>
             <attributes>
                 <attribute>
                     <name>skuNumber</name>
                     <model>
                         <localizable>false</localizable>
                         <collection>false</collection>
                         <type>String</type>
                         <primaryKey>true</primaryKey>
                         <secured>false</secured>
                     </model>
                     <transformations>
                         <transformation override="false" disabled="false">
                             <rawSource>OrderDetail</rawSource>
                             <expression spel="false">skuNumber</expression>
                         </transformation>
                     </transformations>
                 </attribute>
                 <attribute>
                     <name>itemNumber</name>
                     <model>
                         <localizable>false</localizable>
                         <collection>false</collection>
                         <type>String</type>
                         <primaryKey>true</primaryKey>
                         <secured>false</secured>
                     </model>
                     <transformations>
                         <transformation override="false" disabled="false">
                             <rawSource>OrderDetail</rawSource>
                             <expression spel="false">itemNumber</expression>
                         </transformation>
                     </transformations>
                 </attribute>
                 <attribute>
                     <name>uniqueId</name>
                     <model>
                         <localizable>false</localizable>
                         <collection>false</collection>
                         <type>String</type>
                         <primaryKey>true</primaryKey>
                         <secured>false</secured>
                     </model>
                     <transformations>
                         <transformation override="false" disabled="false">
                             <rawSource>OrderDetail</rawSource>
                             <expression spel="false">uniqueId</expression>
                         </transformation>
                     </transformations>
                 </attribute>
             </attributes>
         </item>
 
 
         <item>
             <type>EAN_Canonical</type>
             <description>OrderDetail ean</description>
             <status>ACTIVE</status>
             <attributes>
                 <attribute>
                     <name>eanNumber</name>
                     <model>
                         <localizable>false</localizable>
                         <collection>false</collection>
                         <type>String</type>
                         <primaryKey>true</primaryKey>
                         <secured>false</secured>
                     </model>
                     <transformations>
                         <transformation override="false" disabled="false">
                             <rawSource>OrderDetail</rawSource>
                             <expression spel="false">skuNumber</expression>
                         </transformation>
                     </transformations>
                 </attribute>
                 <attribute>
                     <name>itemNumber</name>
                     <model>
                         <localizable>false</localizable>
                         <collection>false</collection>
                         <type>String</type>
                         <primaryKey>true</primaryKey>
                         <secured>false</secured>
                     </model>
                     <transformations>
                         <transformation override="false" disabled="false">
                             <rawSource>OrderDetail</rawSource>
                             <expression spel="false">itemNumber</expression>
                         </transformation>
                     </transformations>
                 </attribute>
                 <attribute>
                     <name>uniqueId</name>
                     <model>
                         <localizable>false</localizable>
                         <collection>false</collection>
                         <type>String</type>
                         <primaryKey>true</primaryKey>
                         <secured>false</secured>
                     </model>
                     <transformations>
                         <transformation override="false" disabled="false">
                             <rawSource>OrderDetail</rawSource>
                             <expression spel="false">uniqueId</expression>
                         </transformation>
                     </transformations>
                 </attribute>
             </attributes>
         </item>


Here is the issue: target xml

 <item>
                      <!-- Orderdetails sku-->
                      <type>ORDERS05$E1EDP01$E1EDP19</type>
                      <exportCode>idockeyfield=BELNR</exportCode>
                      <description>Order detail</description>
                      <updatable>true</updatable>
                      <canonicalItemSource>SKU_Canonical</canonicalItemSource>
                      <status>ACTIVE</status>
                      <attributes>
                          <attribute>
                              <name>QUALF</name>
                              <localizable>false</localizable>
                              <collection>false</collection>
                              <transformationExpression>'002'</transformationExpression>
                              <exportCode>keyfield=true</exportCode>
                              <mandatoryInHeader>true</mandatoryInHeader>
                          </attribute>
                          <attribute>
                              <name>IDTNR</name>
                              <localizable>false</localizable>
                              <collection>false</collection>
                              <transformationExpression>skuNumber</transformationExpression>
                              <exportCode>keyfield=true</exportCode>
                              <mandatoryInHeader>true</mandatoryInHeader>
                          </attribute>
                          <attribute>
                              <name>POSEX</name>
                              <localizable>false</localizable>
                              <collection>false</collection>
                              <transformationExpression>itemNumber</transformationExpression>
                              <exportCode></exportCode>
                              <mandatoryInHeader>true</mandatoryInHeader>
                          </attribute>
                          <attribute>
                              <name>BELNR</name>
                              <localizable>false</localizable>
                              <collection>false</collection>
                              <transformationExpression>uniqueId</transformationExpression>
                              <exportCode></exportCode>
                              <mandatoryInHeader>true</mandatoryInHeader>
                          </attribute>
                      </attributes>
                  </item>


I used as canonicalItemSource SKU_Canonical SKU_Canonical

But I also need the EAN_Canonical types in the same list ORDERS05$E1EDP01$E1EDP19

So I tried to create 2 target items with the same ORDERS05$E1EDP01$E1EDP19 and 2 different cananicalItemSources but that does not work.

How can I handle this?