cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How can I map source field to target only when a condition field exits in that line items

vkomere
Explorer
0 Kudos
316

Hi Experts,

I have a requirement where, I need to create "EXCP" Node only when "Place" exists in source payload (I can get multiple line items) and map "TANUM" under "EXCP" to "Work" where ever 'Place" exists. Please advice how I can achieve this.
Below are the sample payloads:

Source payload:

<RootNode>
<Parent>
<Child>
<Work>1234</Work>
<Place>HYD</Place>
<Time>01:02:03</Time>
</Child>
<Child>
<Work>5678</Work>
<Time>01:04:03</Time>
</Child>
<Child>
<Work>9012</Work>
<Place>HYD</Place>
<Time>01:02:03</Time>
</Child>
</Parent>
</RootNode>

Target Structure:

<WMTCIDOC>
<IDOC>
<EDIDC>
<EX1>1</EX1>
<EX2>1</EX2>
</EDIDC>
<EXCP> ( I need to create this only when "Place" exists in source
<TANUM></TANUM> (Need to map Work from source where "Place exists")
<ANUM></ANUM>
</EXCP>
</IDOC>
<WMTCIDOC>

Expected Target payload:

<WMTCIDOC>
<IDOC>
<EDIDC>
<EX1>1</EX1>
<EX2>1</EX2>
</EDIDC>
<EXCP> 
<TANUM>1234</TANUM> 
<ANUM>01:02:03</ANUM>
</EXCP>

<EXCP> 
<TANUM>9012</TANUM> 
<ANUM>01:02:03</ANUM>
</EXCP>

</IDOC>
<WMTCIDOC>

I'm able to achieve creating the node if "Place" exists but not able to map right "Work" to "TANUM" (TANUM is mapped sequentially).

Thanks,
Venkat

Accepted Solutions (1)

Accepted Solutions (1)

vkomere
Explorer
0 Kudos

Achieved.

Answer : Used Removecontext at Node level, which help me resolve later on.

Thanks,

Venkat

Answers (0)