cancel
Showing results for 
Search instead for 
Did you mean: 

two source fields in one target idoc structure

Former Member
0 Kudos

Hi Experts!

I have a problem.

I have a flat file with two fields desc1 and desc2. They have to be put into the field MAKTX of the table structure E1MAKTM. But not via concat or useOneAsMandy!

I need a new E1MAKTM structure for each desc1 and desc2 . So that i get following target structure:


<recordset>
.
.
.
-E1MAKTM
  - MAKTX = "content of desc1"
-E1MAKTM
  - MAKTX = "content of desc2"
.
.
.
</recordset>

I hope you understand what I am trying to do.

How can i solve this problem?

Thanks for your answers in advance.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

right click on MAKTX and select duplicate subtree then you can map your two source values.

Regards

Patrick

Answers (4)

Answers (4)

SudhirT
Active Contributor
0 Kudos

Hi Udo,

For dynamic creation of the node you can write one Udf taking desc1 and desc2 as the input and repeating the target segment E1MAKTM as many times these value repeats also chk the occurence of E1MAKTM.

Thanks!

Sudhir

Edited by: sudhir tiwari on Sep 8, 2008 8:34 AM

Former Member
0 Kudos

Hi Thanks so far for your answers.

Is there a possibility to dynamically duplicate the structures?

So that i get automatically a duplicated target structure for each content filled source field?

regards,

Udo

Former Member
0 Kudos

Hi,

>>Is there a possibility to dynamically duplicate the structures?

So that i get automatically a duplicated target structure for each content filled source field?

Yes, it is possible you can use createif function. which creates a new node for every occurance of the source field.

Regards,

Yuga

santhosh_kumarv
Active Contributor
0 Kudos

Hi,

>>Is there a possibility to dynamically duplicate the structures?

>>So that i get automatically a duplicated target structure for each content filled source field?

The solution that has give above would only do this.

Even though you are duplicating the segement in the design time, you are mapping the desc1 and desc2 to the E1MAKTM root node(for MAKTX).

During the runtime the node E1MAKTM will only be generated based on the number of occurance of the desc1 and desc2 in the source message.

For example if there are 2 desc1 and 1 desc2 field then 3 E1MAKTM node will be generated.

But make sure that the occurance of E1MAKTM is 0 to unbounded to achieve this.

Thanks

SaNv...

Former Member
0 Kudos

Hi,

Even though the occurrences are 1:1. Once u press duplicate subtree, it automatically becames 0:1.

Interesting one, try it!

santhosh_kumarv
Active Contributor
0 Kudos

Hi,

1. Check if the occurance of E1MAKTM is unbounded. If not change the occurance.

2. Right click on the field and dupicate it.

3. Map the field desc1 and desc2 to both E1MAKTM and MAKTX.

Thanks

SaNv..