cancel
Showing results for 
Search instead for 
Did you mean: 

Structure Mapping Question Selected node copying

Former Member
0 Kudos

Dear experts,

I would like to know the following. I have an Idoc to xml-file scenario. The xml is provided. There are for each row in the idoc a number of similar segments (1..unbounded). I want to copy only those segments if they have a particular value, this is always one segment from this header, can never be more with the same value in VAL. Like this:

Source:


<HEADER>
  <SEGMENT>
    <XAL>555</XAL>
    <VAL>name one</VAL>
  </SEGMENT>
  <SEGMENT>
    <XAL>666</XAL>
  </SEGMENT>
  <SEGMENT>
    <XAL>777</XAL>
    <VAL>name three</VAL>
  </SEGMENT>  
</HEADER>

As a result I want to map only the value from VAL where in that same segment XAL=777

So:


<TARGETHEADER>
   <VAL>name three</VAL>
</TARGETHEADER>

How do I accomplish this?

Kind regards.

Accepted Solutions (0)

Answers (3)

Answers (3)

justin_santhanam
Active Contributor
0 Kudos

Auke,

As said by patrick use IF Without ELSE.

Do the logic,

XAL & Constant(777) -


>equals----->IF Without else -


>Target

Choose equals function under Text category.

raj.

Former Member
0 Kudos

Dear all,

Thanks for your suggestions guys. Already was using the IfWithoutElse. I found the answer.

Because the values are at a lower level and I split them at target side I needed a removeContext and SplitbyValue to complete this.

Thanks.

Will rewards points for effort.

Former Member
0 Kudos

Hi,

In you mapping, you can do like this.

Source Segment (if XAL is not initial) --- > Target Segment. (doing this will allow only those segments which are having a value in XAL)

Now inside this segment check if XAL Equals "777" then map VAL to Target node.

Regards,

Sarvesh

Former Member
0 Kudos

Hello,

you can use the standard function 'if-without-else'.

if 'XAL = 777' then ...

Regards

Patrick