cancel
Showing results for 
Search instead for 
Did you mean: 

Is this possible!!!

Former Member
0 Kudos

Build a function to have a source IDOC structure element traverse the entire queue and find if a match exists with another segment's field, then another field within the found segment must look for another key field within an additional segment. if the key is found within all segments than creat the Target segment-field...

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hello Alex,

There are mapping patterns shipped with each XI installation resolvint typical mapping problems. To set up cross-references within independent xml branches (i.e. IDoc segments), please check the example Message Mapping <b>MapExampleTwoTablesToFlatStructureSoftware</b> of namespace <i>http://sap.com/xi/XI/System/Patterns</i> in Software Component SAP BASIS 6.40.

Best regards

Joachim

Former Member
0 Kudos

Sorry here is an example

IDOC

Seg1

f1 = xxx

seg2

f2 =xxx

f3 =yyy

seg3

f4 =yyy

f5 = Eureka

Target = Eureka

f1 finds f2 in a different segment and matches, then takes f3(known at design time) and traverses to another segment to match with f4. It finds the values matches again. Since it does match f5 is the desired result (create and populate Target-tf1 = Eureka)

fi f1 did not find a matching value in f2 (or f3 = f4) then do not create or populate the target element tf1

Now I think I can do this in the mapping tool itself by the following.

First have an Ifwithoutelse step proceeded by f1 equals f2 in the first input and f3 equals f4 in the second input. So it will only let f3 look for f4 if the first input is true.

The next step is to have the ifwithoutelse output go into another ifwithoutelse step which then maps f5 if the first argument is true….

That works right?

But if how to put that into a user defied function

Message was edited by:

Alex Ong

stefan_grube
Active Contributor
0 Kudos

An example would be useful to understand your request.

Regards

Stefan