cancel
Showing results for 
Search instead for 
Did you mean: 

How to join related records for IDOC when using RowGeneration?

Former Member
0 Kudos

I have a situation where I want to create IDOCS for customers (1 idoc / customer). Each customer may have multiple associated accounts. Each account results in an idoc segment. Each Account has a DOCUMENT-NUMBER which links it to the Customer.

  • Cust1
    • Account1
  • Cust2
    • Account1
    • Account2

I first created the job to create 1-idoc per customer by adding a RowGeneration transform and selecting from this. This works successfully as I create 1-idoc for every customer. The segments select only from the RowGen transform (not Customer). This is how my input schema looks for each segment:

http://i.imgur.com/7mzk1EH.png

However, I now want to add segments to each of these idocs (for the Accounts).

When I make the join criteria, I have to use Customer/Account as a join. This means I must select from Customer/Account, which is returning all Accounts for all customers and making each as an idoc (so in the above situation I would have 3 idocs all with 3 segments - not 1 with 1, and another with 2).

http://i.imgur.com/0L1ESU2.png

I am not sure how to modify these schema selections to properly make the segments work correctly. It seems like I need to avoid using Customer in selection criteria here, but if that is the case, I am unsure how to setup my join correctly so that each set of Accounts is linked to the proper customer.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

In case anyone else has a similar problem, the solution is:

  • Remove Account selection from the idoc input schema.
    • The input schema for the idoc needs to be your Customer table/Row Generation
  • Add the Account selection to the relevant segments.Do not select from Customer here
    • Do not use a join (this is where my problem was). If you use a join, you are required to select from both Customer/Account tables, which causes the problems I had
    • Use the where clause with something like Customer.ID=Account.CustomerID (or whatever your join condition would have been)

Answers (1)

Answers (1)

former_member187605
Active Contributor
0 Kudos

Always a bit tricky to get those settings right, that's for sure. Have you gone thru the DS wiki pages explaining the NRDM? Start reading from The Nested Relational Data Model NRDM - Enterprise Information Management - SCN Wiki. There' s definitely a case matching yours.

Former Member
0 Kudos

Yes, I have gone through those. They lack explanation for "why should this happen like this?" and give more just "if your exact use case is X, this works."