cancel
Showing results for 
Search instead for 
Did you mean: 

Content conversion at receiver side

Former Member
0 Kudos

Hi

I need to convert XML to a flat file. I am using Content conversion. But i could not get the required output.

My XML is

<MASTER>

<SEGNAM>MASTER</SEGNAM>

<PERSONAL>

<SEGNAM>PERSONAL-1</SEGNAM>

<IDNKD>IDNKD1</IDNKD>

<CONTACTS>

<SEGNAM>CONTACTS-1</SEGNAM>

<EDATUV>EDATUV1</EDATUV>

<EDATUB>EDATUB1</EDATUB>

</CONTACTS>

<CONTACTS>

<SEGNAM>CONTACTS-2</SEGNAM>

<EDATUV>EDATUV2</EDATUV>

<EDATUB>EDATUB2</EDATUB>

</CONTACTS>

</PERSONAL>

<PERSONAL>

<SEGNAM>EIEDP10-2</SEGNAM>

<IDNKD>IDNKD1</IDNKD>

<CONTACTS>

<SEGNAM>CONTACTS-3</SEGNAM>

<EDATUV>EDATUV3</EDATUV>

<EDATUB>EDATUB3</EDATUB>

</CONTACTS>

<CONTACTS>

<SEGNAM>CONTACTS-4</SEGNAM>

<EDATUV>EDATUV4</EDATUV>

<EDATUB>EDATUB4</EDATUB>

</CONTACTS>

</PERSONAL>

<MASTER>

And i need the flat file as follows

MASTER

PERSONAL-1 : IDNKD1

CONTACTS-1 : EDATUV1 EDATUB1

CONTACTS-2 : EDATUV2 EDATUB2

PERSONAL-2 : IDNKD1

CONTACTS-3 : EDATUV3 EDATUB3

CONTACTS-4 : EDATUV4 EDATUB4

.....

But i am getting this as

PERSONAL-1 : IDNKD1 CONTACTS-1 : EDATUV1 EDATUB1

CONTACTS-2 : EDATUV2 EDATUB2

PERSONAL-2 : IDNKD1 CONTACTS-3 : EDATUV3 EDATUB3

CONTACTS-4 : EDATUV4 EDATUB4

Am getting problem in the file content conversion. Even if i specify end Separator as 'nl', it is not working.

Any idea why this happens ?

Regards

Andy

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Moorthy

I guess we have to use XSLT mappings for this scenario. But i am not familiar with XSLT mappings. Do you have any examples of this kiind which could help me in easily understanding the XSLT?

Regards

Andy

moorthy
Active Contributor
0 Kudos

Hi,

Here you go about XSLT mapping-

http://help.sap.com/saphelp_nw04/helpdata/en/73/f61eea1741453eb8f794e150067930/frameset.htm

https://www.sdn.sap.com/irj/sdn/developerareas/java?rid=/webcontent/uuid/110ff05d-0501-0010-a19d-958... [original link is broken]

/people/prasadbabu.nemalikanti3/blog/2006/03/30/xpath-functions-in-xslt-mapping

Very good site-

http://www.troobloo.com/tech/xslt.toc.shtml

http://www.w3schools.com/xsl/

http://www.w3.org/TR/xslt

Hope this helps,

Regards,

Moorthy

Mark all helpful answers

Former Member
0 Kudos

Hi Moorthy

I have tried the same parameters, it is still giving the same output. :-(..

I dont know whether the content conversion will handle nested deep structure or not.

Regards

Andy

moorthy
Active Contributor
0 Kudos

Check this SAP Help-

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/f02d12a7-0201-0010-5780-8bf...

But usually File Structure will be Flat Structure. Try to convert this nested into flat structure in the Mapping.. Probably that time you will get context problems. If so you may required to do XSLT/Java Mapping to maintain the context for each Person level..

Thanks,

Moorthy

moorthy
Active Contributor
0 Kudos

Hi,

Can you try this-

MASTER,PERSONAL,CONTACTS - Record Structure

MASTER.fieldNames = SEGNAM

MASTER.fieldSeparator = <as required

MASTER.endSeparator = 'nl'

PERSONAL.fieldNames =<.....>

PERSONAL.fieldSeparator=<.....>

PERSONAL.endSeparator = 'nl'

CONTACTS.fieldNames = ..

CONTACT.fieldSeparator = <..>

CONTACT.endSeparator = 'nl'

http://help.sap.com/saphelp_nw2004s/helpdata/en/d2/bab440c97f3716e10000000a155106/content.htm

Thanks,

Moorthy