cancel
Showing results for 
Search instead for 
Did you mean: 

Splitbyvalue problem

Former Member
0 Kudos

Hi all,

I'm trying to create the following mapping. The goal is to create a number of idocs in one file to send out in a foreach block with bpm. The source contains one idoc with multiple similar nodes:

Source:

CREMDM04

-IDOC (1..1)

--BEGIN

--EDI_DC40 (1..1)

--E1LFA1M (1..9999)

The E1LFA1M node appears multiple times in the source idoc. I want to map this to a file containing multiple idocs which contain only one E1LFA1M.

So the target should be:

CREMDM04

-IDOC (0..unbounded)

--BEGIN

--EDI_DC40 (1..1)

--E1LFA1M (1..9999)

-IDOC

--BEGIN

--EDI_DC40 (1..1)

--E1LFA1M (1..9999)

-IDOC

--BEGIN

--EDI_DC40 (1..1)

--E1LFA1M (1..9999)

I have tried this with splitbyvalue from the E1LFA1M node onto the IDOC target node, but this result in:

CREMDM04

-IDOC (1..1)

--BEGIN

--EDI_DC40 (1..1)

--E1LFA1M (1..9999)

--E1LFA1M (1..9999)

--E1LFA1M (1..9999)

--E1LFA1M (1..9999)

I don't understand why.

Can anyone help?? Will award points.

Greetings

Message was edited by:

hans vremden

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi;

Then try out this

E1LFA1M (1..9999)---remove context --IDOC (1..1)

Mudit

Former Member
0 Kudos

ok, done.

Now it seems as if it is building a second idoc node.

getting there, however, it comes up with the following error.

cannot produce target element <b>/CREMDM04/IDOC[2]/BEGIN</b>. check xml instance ...

EDIT:I have put a constant on the target begin node. This works. Now it nags about the EDI_DC40 node. How do I make sure that this node is copied in each instance of the idoc node as of this node exists only one in the source.

why is it nagging about the begin node??

Greetings

Message was edited by:

hans vremden

Former Member
0 Kudos

Hi;

as Begin might have occurance 1..1 therefore.

map begin to constant 1

constant(1)--- copy value --- BEGIN

Mudit

award points if it helps

Former Member
0 Kudos

this works.

Is it normal to put constant on these values?

What if I need the source node which appears once in the source message to map to each idoc instance on the target message?

will provide points, don't worry

Former Member
0 Kudos

By the way. it now turns out like this:

cremdm

-idoc

--edi_dc40

--e1lfa1m

--e1lfa1m

--e1lfa1m

--e1lfa1m

-idoc

--edi_dc40

--e1lfa1m

-idoc

--edi_dc40

--e1lfa1m

-idoc

--edi_dc40

--e1lfa1m

And only the e1lfa1m's in the first idoc contain data....

strange?

Former Member
0 Kudos

Hi ;

so do you want the same data for e1lfa1m repeated for all IDoc occurances??

If so you will have to write a UDF for this

Mudit

Former Member
0 Kudos

No,

In the source structure there is one EDI_DC40 node and multiple E1FLA1M nodes under the IDOC node

I want the information of the E1FLA1M split into multiple IDOC nodes.And then I want the EDI_DC40 node to just copy the same values each time. Moreover, I don't care what's in the EDI_DC40 node. I just want the E1LFA1M nodes distibuted among multiple IDOC nodes...

EDIT: The EDI_DC40 can be achieved by useOneAsMany I believe.

Is this clear for you, please say if it isn't...

greetings

Message was edited by:

hans vremden

Message was edited by:

hans vremden

Former Member
0 Kudos

EDI_DC40-- copy value --EDI_DC40

E1FLA1M -- remove context -- split by value --- E1FLA1M

Mudit

Answers (3)

Answers (3)

Former Member
0 Kudos

You rock!

this works. Still need to figure out why..

here come the points

Former Member
0 Kudos

Hi;

Here IDoc in the target is specified as 1..1occurance but as you said "<b> I want to map this to a file containing multiple idocs which contain only one E1LFA1M</b>"

therefore the target IDoc should have 1...unbound occurances

Mudit

Former Member
0 Kudos

I'm terribly sorry. This is a typ-o.

The target IDOC has 0...unbounded as cardinality.

I have changed it in the xsd and imported it as an external definition.

Will edit message above.

Greetings.

Former Member
0 Kudos

It is probably due to the E1LFA1M <b>(1..9999)</b>

If you had 0..1 it may work!

Former Member
0 Kudos

> It is probably due to the E1LFA1M <b>(1..9999)</b>

>

> If you had 0..1 it may work!

Why's that? I put at least one in each time...

Former Member
0 Kudos

The way idocs work is they can have multiple segments.

hence the 1.9999

if there was 0.1 that would suggest maximum one segment.

Former Member
0 Kudos

OK, but I use the splitbyvalue as follows:

E1LFA1M ---> SPLITBYVALUE(EACHVALUE) --> IDOC

The rest is mapped as normal.

Then I would expect that in the target version I get a IDOC node for each 1LFA1M node in the source.

EDIT: Tried the 0..1 thing. It doesn't work for me.

Any other suggestions?

Not?

Message was edited by:

hans vremden