cancel
Showing results for 
Search instead for 
Did you mean: 

how do I change order of the output records?

Former Member
0 Kudos

Hello,

IDOC - File

The receiver structure:

+MT_CR_AT

++RECV

+++Header

++++field1

++++field2

++++field3

++++field4

+++Orderitm

++++field1

++++field2

++++field3

++++field4

+++Orderchild

++++field1

++++field2

++++field3

++++field4

header is 1....1 which occurs only once

Orderitm and Orderchild are 1.. unbounded which can occur 'n' no of times

As you can see Header, Orderitm, Orderchild are al placed at the same heirarchy

now in the receiver file, I am getting like this:

header data

Orderitm1

Orderitm2

Orderitm3

Orderchild1

Orderchild2

Orderchild3

I want the output to be in the following way:

header_data

Orderitm1

Orderchild1

Orderitm2

Orderchild2

Orderitm3

Orderchild3

If I include Orderitm and Orderchild inside Header node,all the existing mapping will be deleted.

Can I get the required output without changing the Mapping and without changing the heirarchy?

Nikhil.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi nikhil,

Make ur strucutre like

+MT_CR_AT

++RECV

+++Header

++++ HeaderFields

+++ORDERS(Add New Node) 0..Unbounded

++++Orderitm 0..1

+++++OrderFields

++++Orderchild 0..1

+++++OrderChild fields

Mapping to the node ORDERS is same as how you have mapped for Orderitm earlier.The content converison parameters are remain same.You will get the desired output as you wish.

I have tested the same at my end.

Cheers

Veera

Answers (5)

Answers (5)

Former Member
0 Kudos

hi nikhil,

Have you made that ur Orderitem and Orderchild nodes are as subsegments of which was inserted a new node at Header level.Occurence of newly created node is like 0..Unbounded and Occurences for Orderitem and Orderchild is like 0..1.After doing this u r mapping of new node is as similar as you have done for Orderitem. And mapping for Orderitem and Orderchild just map with constants.

It should work and u will get the desired structure. Can you post the strucure how you have tried this?

Cheers

Veera

Former Member
0 Kudos

Veera,

Thanks again for your continous efforts to help me out.

I havent tested with 0...unbounded.

Just now tested with 0....unbounded.

now the same problem

like, the child is appended to the item

Is there a way to split the output record?

Former Member
0 Kudos

Hi Veera,

The latest update is its working with the strucuture you told me

thanks

Former Member
0 Kudos

HI nikhil,

Yes, you will get the desired output, i have done the same at my end.YOu need to add one more node and ur oderitem and OrderChild nodes are to be subsegments of new node.

To ensuring this create that strucutre just with one field of all segments and test the mapping.In your test u can view the desired output. Mapping to the new node as similar as how you did for Orderitem node currently and Mapping for Orderitem and Orderchild nodes are just map with Constant.If you confirm the desired output is coming then go for full structure.

While creating the data type see the strucure once in my previous post.

Cheers

Veera

Former Member
0 Kudos

Hi Veera,

The same problem

I did changes in the original structure only (with the thing in mind not to activate if something goes wrong)

I exactly placed how you want me to put a new node abov item and child nodes at the level of Header

its generating

Header

item

item2

child

child2

Former Member
0 Kudos

Hi nikhil,

You can do like this by making the OrderChild as subsegment for Orderitem segment.

+MT_CR_AT

++RECV

+++Header

++++ HeaderFields

+++Orderitm

++++OrderFields

++++Orderchild

+++++OrderChild fields

Or you can create another DT,MT&MI for above strucuture and do another mapping. In this mapping source message is target message of first mapping and Target message is newly created one. In this way the mapping would be just one to one. Test the MM, if it is giving required strucutre you can go furhterly.

In interface mapping take target MI is as newly created MI.And specify the two mappings. Accordingly change u r Configuration sceanrio. i guess it wouldnot take that much time to do this.

Try this one and let me know your proceedings

Cheers

Veera

Former Member
0 Kudos

Veera,

it may work

but the Orderchild will be appended to the Orderitm

it will not come in a seperate line

eg:

header

Orderitmfields1|orderchildfields1

Orderitmfields2|orderchildfields2

Orderitmfields3|orderchildfields3

Former Member
0 Kudos

Now, I changed the sequence

its working but its displaying in the following way

header

Orderitmfields1|orderchildfields1

Orderitmfields2|orderchildfields2

Orderitmfields3|orderchildfields3

I need it to be

header

Orderitmfields1

orderchildfields1

Orderitmfields2

orderchildfields2

Orderitmfields3

orderchildfields3

Former Member
0 Kudos

Veera,

Now the DT is created in the following way as per your first suggestion:

+MT_CR_AT

++RECV

+++Header

++++ HeaderFields

+++Orderitm

++++OrderFields

++++Orderchild

+++++OrderChild fields

now its displaying one after the other

Header

itm | child

itm2 |child2

itm3 |child3

I did a dummy mapping n the MM is getting disturbed if I add a new node on the top of Orderitm

so, can I do anything that will allow me to put

itm

child

itm2

child2

itm3

child3

in the above manner

thanks

Nikhil

Former Member
0 Kudos

hi nikhil,

as your requirment is you can try as follows.

make one data type of :

+++Orderitm

++++field1

++++field2

++++field3

++++field4

+++Orderchild

++++field1

++++field2

++++field3

++++field4

<b>and add this data type after header in one other data type which is your MT_CR_AT so you will have a bunch of this two Orderitm and Orderchild.</b>

then you can easily copy thuis structure into message mapping and it will be in a proper sequence as your requirment.

hope this will help

regards

HONEY

Former Member
0 Kudos

Hello Honey,

Let me gist you what I understood

create DT at the heirarchy above Header (at the RECV level)

hmm.... i guess in that the order wont be maintained and there is a chance that MM delete as the heirarchy changes

I have a plan in mind that...

make Orderitm and Orderchild subnodes to Header

it will work but I hav to re map (around 200+ fields:( ), also Orderitm and Orderchild records will be concatnated on a single line they wont come in seperate lines in this case.

But I am trying without making changes to heirarchies... Cant it be achieved?

former_member214364
Active Contributor
0 Kudos

Hi Nikhil,

you cant do this without heirarchy change.

former_member214364
Active Contributor
0 Kudos

> I have a plan in mind that...

> make Orderitm and Orderchild subnodes to Header

> it will work but I hav to re map (around 200+

> fields:( ), also Orderitm and Orderchild records

> will be concatnated on a single line they wont come

> in seperate lines in this case.

Hi Nikhil, you can save mapping to local system,open it in XMLSpy and can make changes easily and reimport mapping after changing the target structure.

if you want to know how to do this let me know.

Thanks,

Jag

Former Member
0 Kudos

Yes Jag,

you are correct I will do the same way

But i was talking about the context changes I made to each node while mapping

I need to change them as the context will be changed again.

thanks anyways,

nikhil

former_member214364
Active Contributor
0 Kudos

Yes Nikhil,

As you said,have to make changes in Context.its not avoidable to achieve your required output.

Thanks,

Jag

Former Member
0 Kudos

hi nikhil,

i was tellin like this

<b>make a data type suppose Test in which your Orderitm and orderchild will be there</b>.

then make a other data type like your MT_*** then use header after this add one node in that <b>your data type Test</b> will be there, <b>right click on data type it will send to the list of user data types in last option.</b>

so this will give you the proper sequence in mapping when you copy the whole structure test.

hope this willl help

regards

HONEY

Message was edited by:

Honey Gyanani

former_member214364
Active Contributor
0 Kudos

Hi Nikhil,

Could you please give target message structure?

Thanks,

Jag

Former Member
0 Kudos

Hi Jag,

MT_CT_AT

->RECV

--->Header

-


><fields of Header>

--->Orderitm

-


><fields of Orderitm>

--->Orderchild

-


><fields of Orderchild>

The MT has around 100 fields for Header and Orderitm and orderchild

The sender side, there is an IDOC

IDOC - File