Configure Repeating Fields in the Query CoNNector

Question

In the Query CoNNector, is there a way to link to the same table from two different fields?

For example, in the RESB table you might want to bring back MATNR (the material number being reserved) and BAUGR (the material number of an assembly). To include the material description, you could link to the MAKT table. But if you want the material description for both the materials, you cannot link to the MAKT table twice with two different criteria at the same time because the field names will not be unique.

There are several options for workarounds.

The simplest alternative is to find another source for the desired result field. Then you can configure Extensions into both the additional tables all on the same Query Level. (See Example 1)

Another fairly simple way to set up the Query is to put all the repeated results on a different Query Level. The drawback here is that you will have to find the matching records in the Level 2 Workset Table in your subsequent coniguration. (See Example 3)

If neither of these options are viable, you can set up a more complicated two-level Query, essentially duplicating the entire query structure at each level except for the repeating field. (See Example 2)

Examples

Example 1: Different Sources on the Same Level 

The View BIW_MAKT contains the same data as the Table MAKT.

If you create two Extensions on the RESB Level, you could link MATNR to MAKT (see 1 in the screenshot below) and BAUGR to BIW_MAKT (2).

Now you have unique Result Fields MAKT-MAKTX and BIW_MAKT-TXTMD. Don't forget to rename the Descriptions (3) so you know which one is which later on.

In this example it makes sense to use the RSNUM and RSPOS as the Key Fields of the RESB Result table.

If you configure a Return Variable on the Send Message, you will see how many records NLINK found.

In the NDM you can see the material numbers and their corresponding descriptions.

Example 2: Same Source on Different Levels

If you add a second Query Level and link it one-to-one to the results of the first Query Level, then you could put MATNR and its extension into MAKT in one Level (see 1 in the screenshot below), and BAUGR and its extension into MAKT in another Level (2).

Again, this keeps the field names unique within the Levels.

The default from the Wizard would be to create a new Level 2 Result table. But if you map both Results to the same Workset Table, then, assuming you bring back the proper Key Fields in both Levels, NLINK will combine the result records to look like what you would get from Example 1.

If you configure a Return Variable on the Send Message, you will see how many records NLINK found. If you don't get the same number of records in both Levels then you should revisit your Query configuration.

The results from Example 2 should be the same as from Example 1.

Example 3: All Repeat Results on a Different Level

Although the Query structure numbers the Levels 1, 2, 3, etc. the Result Workset Tables do not have to be set up with a Parent-Child relationship in the NLINK Workset.

If you move the repeated results to a separate Level in the Query, you can use an OR connection to provide the link(s) to the primary table (see 1 in the screenshot below).

Be sure to pull back the identifying data you will need to look up the proper results in the subsequent Level (2).

In this case, the Level 2 Result table can have a Key Field of just the material number. It will contain the MATNR and MAKTX for all possibilites of MATNR and BAUGR from the found reservation.

If you configure a Return Variable on the Send Message, you will see how many records NLINK found at each level.

In the NDM you can see the material numbers and their corresponding descriptions, now split across two Workset Tables.