cancel
Showing results for 
Search instead for 
Did you mean: 

Map the second occurrence of IDOC

Former Member
0 Kudos

Hi All,

i have been facing problem to map the second occurences of IDOC to target field.Ex:IDOC[02]-field1.

In the mapping for source i have specifed IDOC and generated advanced used defined function and mapped to target field. But i have entered the value in field1 ex: field1. the values not came in IDOC.i have checked in DISPLAY Queue also.if i map field1 i have received these values. But field1 contains occurences of 0..1. so i am getting error in used defined funtion.

Please guide me.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Noorul.

There is not enough information in your posting,

If i got you situation right, make sure you map the root

of the source element (that occurs X times) to the element you need to multiply.

Check,maybe your target IDoc's segment can't have occurance.

Please tell me which IDoc you use and example of the source structure.

Best regards

Nimrod Gisis

Former Member
0 Kudos

Hi Nimrod,

Thanks for your reply.

Source element of my idoc occurs n times. target is 0..1

i need to pass only second occurences.

Example:

IDOC E1MARAEXTRT-FIELD1 HAVE 2 OCCURENCES.

E1MARAEXTRT[01]-FIELD1- vALUE

E1MARAEXTRT[02]-FIELD1- DESCRIPTION.

I NEED TO PASS ONLY SECOND OCCURENCES FROM SOURCE TO TARGET.

SO SOURCE I HAVE TAKEN E1MARAEXTRT.TARGET IS 0..1. i think i have to write 1 user defined function and return a second occurences to target.

but if i map E1MARAEXTRT FOR SOURCE, I HAVE ENTERED THE VALUE 2 TIMES IN FIELD1(Duplicate subtree in message mapping).but the value not came to E1MARAEXTRT.MY USER FUNTION RETURNS NULL. IF I MAP fIELD1 AS SOURCE TWO VALUES ARE COMING.

please suggest me.

Former Member
0 Kudos

Ok, This is a bit clearer.

you want to send <u>only the Description item</u> from the source message.

question:

1)Is it possible to have more then 2 items like and would and will you need them as well?:

E1MARAEXTRT[01]-FIELD1- vALUE

E1MARAEXTRT[02]-FIELD1- DESCRIPTION.

<b>E1MARAEXTRT[03]-FIELD1- BLABLABLA</b>

2)Is the <b>DESCRIPTION</b> you wrote is a name of a segment ?is it a visible value that can be used for the mapping?

You can try to use the graphical\own java function mapping to one of the following actions:

- concatenate the two fields into one and map them to the target field (decide what you wanna do with the value prefix..)

-write a java mapping program or XSLT to map the desired node with condition on the number of nodes.

Don't give up.

Nimrod

Former Member
0 Kudos

Hi,

E1MARAEXTRT[01]-FIELD1 contains Value information.

IDOC segment name is E1MARAEXTRT.

FIELD name is FIELD1.

i SHOULD send the second occurences of E1MARAEXTRT[02]-FIELD1.

idoc segment have 2 occuences.E1MARAEXTRT.In message mapping- TEST Tab - i have created duplicate sub tree.

so E1MARAEXTRT came twice. i have entered values in field FIELD1 in both E1MARAEXTRT.but in display queue if i map the IDOC(E1MARAEXTRT) is showing NULL.IF I map field FIELD1 AS SOURCE i got 2 occurence values.but IDOC E1MARAEXTRT have X OCCURENCES.field FIELD1 have only 0..1. so in my user defined function am getting only 1 value.but display queue shows 2 values.

Please clarify.