cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with creating number of target JDBC records depending on occurence of two IDOC segemnts

Former Member
0 Kudos

We have a requirement for IDOC to JDBC scenario wherein the number of records that are inserted into JDBC table depends on occurence of two independent segments. Below are the two segments on whose occurence the number of target records should generate.

1st it depends on occurence of /ZDEFINV2/IDOC/E1EDK01/Z1DEK04

next it check for occurence of /ZDEFINV2/IDOC/E1EDP01E1EDP04

Also in target there is a field DETAIL_LINE_NUMBER which is like a counter (Sequence number) for the records

So consider an example where Z1DEK04 occurs 2 times  and  E1EDP04 occurs 3 times then the target should be:

Record               DETAIL_LINE_NUMBER

Record 1                    1    

Record 2                    2

Record 3                    3

Record 4                    4

Record 5                    5

Please let me know if this is possible in PI with graphical mapping and how or we have to use any other mapping to implement this.Currently this logic is working in TIBCO but we want it to implement in PI.

Thanks in advance

Accepted Solutions (1)

Accepted Solutions (1)

former_member184681
Active Contributor
0 Kudos

Hi,

In the graphical mapping definition, simply duplicate (right-click and choose Duplicate Node) the node that you would like to provide with two sources. Then, you will have two identical copies of the target node, so you can provide independent mappings from both of your source segments.

Regards,

Greg

Former Member
0 Kudos

Yes I have done that but then for the target field DETAIL_LINE_NUMBER should start from where the first condition ends and continue the number of times the second occurence of segment. I have provided an example.

former_member184681
Active Contributor
0 Kudos

This should be simple again. Probably you are using the index function (from the Static functions group) to assign the numbers. Here is how you could do it then:

Z1DEK04 -> index -> DETAIL_LINE_NUMBER[1]

E1EDP04 -> index -> add(count(Z1DEK04)) -> DETAIL_LINE_NUMBER[2]

Regards,

Greg

Former Member
0 Kudos

Thanks for the solution

Answers (0)