Skip to Content
0
May 20, 2015 at 12:27 PM

Mapping multiple source field to one target

493 Views

Hi experts,

I have a SOAP to IDOC requirement where SourceStruc1 can occur multiple times in the source xml and have to create TargetStrucut1 in the target IDOC same number of time as SourceStruc1. Structure is provided as below.

Source XML Target IDOC

SourceStruc1(occurrence 1-999) TargetStrucut1(occurrence 1-999)
Source1 Target1
Source2
Source3
Source4
Source5
Source6

As per my requirement, value of Target1 have to determine based on values of Source1 to Source6 fields.

Value Source1 to Source6 fields Value of Target1

("A",4,"S","I",1,"N") N01

("A",4,"S","M",1,"N") N02

("A",5,"S","M",1,"N") N03

("A",5,"S","M",1,"W") N04

("A",5,"S","M",10,"N") N05

("A",5,"S","M",10,"W") N06

So I have implemented the logic in one UDF to determine the velue of Target1. But now the SourceStruc1 can occur multiple times in the source xml and TargetStrucut1 will also occur in the target IDOC same number of time as SourceStruc1. Could you please provide a solution to create the field Target1 in TargetStrucut1 each time TargetStrucut1 appears in the target structure.

Thanks & Regards,

Pratyus Ganguly