cancel
Showing results for 
Search instead for 
Did you mean: 

XML to FixedLength String?

Former Member
0 Kudos

Hi everybody,

I have to convert a XML Record to a String with fix field length.

The XML has multiple child elements and I have to Loop over this elements, pick up every single field, fill up the field with a given fieldlength (taken from a commaseperated fieldlength-list and append it to the targetstring.

Has anyone an idea how to realize this?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

the source is the following:

<?xml version="1.0" encoding="UTF-8" ?>

<MT_RecType>

<RecType>

<RecIdent1>01111</RecIdent1>

<RecIdent2>02222</RecIdent2>

<Name1>Miller</Name1>

<Name2>Schulz</Name2>

</RecType>

<RecType>

<RecIdent1>999</RecIdent1>

<RecIdent2>999</RecIdent2>

<Name1>Mik</Name1>

<Name2>Debbie</Name2>

</RecType>

<RecType>

<RecIdent1>888</RecIdent1>

<RecIdent2>22</RecIdent2>

<Name1>Joe</Name1>

<Name2>Doe</Name2>

</RecType>

</MT_RecType>

I want to loop over the RecType and create a string like:

01111 02222 Miller Schulz /nl999 999 Mik Debbie /nl888 22 Joe Doe /nl

with the following fieldlegth:

RecIdent1 = 10

RecIdent2 = 10

Name1 = 15

Name2 = 15

What I forgot.....

I have to send this string as an eMail attachment with the mail package. My problem is to fill this in the content field..... sorry!

Message was edited by:

Heiko Stach

Shabarish_Nair
Active Contributor
0 Kudos

in FCC on the file recv. adapter try;

RecType.fieldFixedLengths 10,10,15,15

RecType.endSeparator /nl

MichalKrawczyk
Active Contributor
0 Kudos

hi,

- I'd try to use standard content conversion adapter module to change it to your string

- then a simple adapter module to take this payload and put it in the attachment

this way you could you the standard adapter module

and put this content inside the attachment

BTW

I would't use the mail package for that

Regards,

michal

-


<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

Former Member
0 Kudos

You can easily achieve this using receiver file adapter.

Record set structure : RecType

Use content conversion as the message protocol. The content conversion parameters will be

RecType.fieldSeparator ,

RecType.endSeparator 'nl'

Regards,

Jai Shankar

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

I don't think he needs file adapter

you can use content conversion adapter module to do the same with

mail adapter

Regards,

michal

-


<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

Former Member
0 Kudos

Michal,

I dint see that he expects the result in a mial. Apologies for the confusion ands thanks for pointing that.

Regards,

Jai Shankar

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

I hope this can be possible with MAIL adapter with configurations,but no need to use file adapter ,

see below link

http://help.sap.com/saphelp_nw2004s/helpdata/en/23/c093409c663228e10000000a1550b0/content.htm

Regards

Chilla..

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

if you need to create file with FixedLengths all you need

to use is content conversion

BTW

you can also use content conversion with many other adapters

(JMS, SOAP etc.)

Regards,

michal

-


<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

Can you give an example?

Regards

Bhavesh