cancel
Showing results for 
Search instead for 
Did you mean: 

Message Mapping Problem

Former Member
0 Kudos

Hi

My File Structure is: I have Datatype with header fields and within it an Item level fields and within it a SubItem level fields.

I am getting an IDoc and want to map with the above file structure.

In message mapping I have mapped <b>Subitems>Removecontext>Datatype</b>

Also for items I have used <b>UseOneAsMany(with idoc, subitems, subitems)>SplitByValue(EachValue)>Items</b>.

Also for Subitems I have mapped <b>Subitems>SplitByValue(EachValue)>SubItems</b>.

Then I am getting my output as:

Current Output structure what we are getting from message mapping:

HEADER1,LINEITEM1,SUBITEM1

HEADER1,LINEITEM2,SUBITEM2

HEADER1,LINEITEM3,SUBITEM3

HEADER1,<blank> ,SUBITEM1

HEADER1,<blank>,SUBITEM2

HEADER1,<blank>,SUBITEM1

HEADER1,<blank>,SUBITEM2

In LineItem1 there are 3substructures and LineItem2 there are 2 substructures and 2 in third line item. I am getting fine for Subitems. But i am not getting Lineitems what i was expecting. I am gettng lineitems displayed but no values because it is already displaying. So I have to keep lineitem1 for the first 3subitems and lineitem2 for the second 2 subitems and lineitem3 for the third subitem.

Expected Output structure:

HEADER1,LINEITEM1,SUBITEM1

HEADER1,LINEITEM1,SUBITEM2

HEADER1,LINEITEM1,SUBITEM3

HEADER1,LINEITEM2,SUBITEM1

HEADER1,LINEITEM2,SUBITEM2

HEADER1,LINEITEM3,SUBITEM1

HEADER1,LINEITEM3,SUBITEM2

Any help would be greatly appreciated and regarded...

Regards,

---Satish

Accepted Solutions (1)

Accepted Solutions (1)

claus_wallacher
Active Participant
0 Kudos

Hi Satish,

your exact problem is described in this <a href="/people/claus.wallacher/blog/2006/04/17/replication-of-nodes-using-the-graphical-mapping-tool">weblog</a>.

Please have a look at it, it should solve your problem. If you still have issues, I can guide you through the process.

Regards,

Claus

Former Member
0 Kudos

Claus

First of all let me thank you for the weblog. I will try to solve my issue by looking at this. I will get back to you If I have any issues further.

Regards,

---Satsih

Former Member
0 Kudos

Claus

I will explain to you what is my scenario:

I have my file datatype as:

A Datatype with Details(having 10 Header fields) and within it the 11th field is my Items(having 5 fields)and within it I have 10Subfields. So it has Same Header, Multiple Items and Multiple Subitems.

I am using BOMMAT03 Idoc.

Also I have seen your weblog and with solution 2 i tried to resolve. After implementing that solution I have got the output as;

H1L1S1S2S3

H1L2S1S2

H1L3S1S2

But my requirement is:

H1L1S1

H1L1S2

H1L1S3

H1L2S1

H1L2S2

H1L3S1

H1L3S2

Could you pl. give me your mail id so that I can send you some screenshots(to let you know my datatype and idoc structure, mappings done etc)

Regards,

---Satish

Answers (2)

Answers (2)

claus_wallacher
Active Participant
0 Kudos

Hi Satish,

you find my email in my business card (I just opened it).

Regards,

Claus

Former Member
0 Kudos

Claus

I have send you a mail with some snapshots.

Regards,

---Satish

Former Member
0 Kudos

Claus

Its working now. Thanks and I really appreciate your patience and time.

Regards,

---Satish

moorthy
Active Contributor
0 Kudos

Hi Satish,

First of all your target structure is a File Structure right ? Then make your Target Structure as a flat structure.

Then use XSLT mapping to handle this context.

More on XSLT mapping- http://www.w3schools.com/xsl

Thanks,

Moorthy

Former Member
0 Kudos

Krishna

Yes my target structure is a file structure. Since I was not very much comfortable with XSLT it would be highly appreciated if you help me so?

Also as far as my knowledge goes krishna I think it is possible with Graphical Mapping only?

Regards,

---Satish

Former Member
0 Kudos

Hi Satish,

One Simple Solution is using User-Defined Solution in Graphical mapping.

for taht You give LineItem then give Remove Context as the first input,Subitem(set its context to LineItem) as the second input.You define userdefined function as Queue type.Name first parameter as a,second parameter as b and then write this following code in the function..

int j=0;

for(int i=0;i<b.length;i++)

{

if(b<i>.equalsIgnoreCase(ResultList.CC))

{

result.addValue(ResultList.CC);

j=j+1;

}

else

result.addValue(a[j]);

)

}

now give the output of the userdefined function directly to the target..you will get expected output..

Regards,

Sundararamaprasad.

Message was edited by: Sundararamaprasad

Message was edited by: Sundararamaprasad