cancel
Showing results for 
Search instead for 
Did you mean: 

XML to IDOC : Hierarchy mapping help needed

Former Member
0 Kudos

Hi All,

I am trying to complete graphical mapping for an XML to IDOC structure. Both structures are EXACTLY same, but data is not populating in IDOC as desired.

My incoming XML structure and IDOC structure is

Header
Data_header  (1 -- 999)
  |_Data_item (1 -- 3)
Trailer

If I have only 1 header, then IDOC data is populated correctly.

But when I have multiple headers and theer items, the Headers are getting populated, but items do not get populated correctly.

*Example  My Input is:*

Header
Data_header
  |_Item_1
  |_item_2
Data_header
  |_item_3
Trailer

My output is (IDOC)

Header
Data_header
  |_Item_1
Data_header
  |_Item_2
Trailer

As seen above Item3 of Data_header2 has gone missing._

For Data Header, I am using REMOVE_CONTEXT function and for ITEM I am using SPLITBYVALUE. Thought this should have helped, but am struggling.

Any tips, help, greatly appreciated.

Many thanks

Shirin

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi....

Map Data_item--SplitbyValue--Data_header.

Regards,

Leela

Former Member
0 Kudos

Hi Leela, Srinivas,

I tried what you guess had mentioned, but its still doing the same.

Item from first header is going down to second header and item3 goes missing.

Regards

Shirin

Former Member
0 Kudos

Hello,

Have you done one to one mapping, as u mentiong they are exactly same..

if that's the case, then mapping test should be successful.

If there is any diffrence in occurences of target structure or any other difference and let me know.

If possible send me the target structure...

Regards,

Sreenivas.

Former Member
0 Kudos

Hi Sreenivas,

Thanks for the reply,

I have emailed you the structures at your official email ID.

Regards

Shirin

Former Member
0 Kudos

Hi,

Can you try my mapping one to one..instead of using remove by contexts..or..

just try with one to one with our any functions...

let me know

Regards,

Sreenivas.

Former Member
0 Kudos

Hi Sreenivas,

Infact if I do one-to-one mapping it throws an error about can not produce a target element /segment.

So If i remove the second header and its items in the incoming XML, it then works fine

Regards

Shirin

Former Member
0 Kudos

Hi,

For which element/segment ..its not generating target element..

Can you give error discription

Regards,

Sreeni

Former Member
0 Kudos

Hi Sreeni,

I have sent you the error message etc on ur email id of lntinfotech

Regards

Shirin

markangelo_dihiansan
Active Contributor
0 Kudos

Hi Shirin,

If the structures are the same, then one-to-one mapping with no node manipulations should work. If it would be possible, kindly send to me the structures too.

Regards,

Former Member
0 Kudos

Hi,

I have emailed the structure to your hotmail id.

Thanks

Shirin

markangelo_dihiansan
Active Contributor
0 Kudos

Hi Rajiv,

I was able to duplicate your problem. Kindly do one-to-one mapping with the two major nodes first GOODS_ISSUE_HEAD & GOODS_ISSUE_ITEM (replace the subnodes PSTNG_DATE & DOC_DATE with CONSTANTS first). The mapping of the two nodes is now corret. The problem is now that the subnodes PSTNG_DATE & DOC_DATE have to be manipulated for the change in contexts.

Regards,

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello,

Change your context of the noe Date_Header to root node.

You can do this by right click on the Data_Hearder node.

Regards,

Sreenivas.

Former Member
0 Kudos

Hi Sreenivas, I tried changing context to root node, buts its still the same.

Item_2 of Data_header(1) goes to Data_Header(2) and item_3 of Data_Header(2) has gone missing.

Regards

Shirin

Former Member
0 Kudos

Hi,

If both the structures are same...then do one to one mapping..

if not can send us the source and target structre.

to verfiry

Regards.

Sreenivas.