cancel
Showing results for 
Search instead for 
Did you mean: 

File Adapter - Content conversion parameters at Receiver

Former Member
0 Kudos

Hi all,

I'm trying to translate a XML message to a text line file.

My XML message is this:

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

<ns1:Proveedor_100011 xmlns:ns1="http://sap.com/xi/webservices/buyordint">

<config>

<directory>c:/tmp</directory>

<filename>dynamicFile3.txt</filename>

</config>

<root><string>Header;423423</string>

<lines>

<value>LINE;</value>

</lines>

</root>

</ns1:Proveedor_100011>

I only want to write to text file the "root" TAG content.

I try different "Content conversion parameters" in the integration builder (configuration)

For example:

*************************************

RecordSet Structure: root

root.addHeaderLine 0

root.fieldSeparator ;

root.endSeparator ;

*************************************

but the better result is all XML content.

Can someone tell me how to skip "Config" TAG and only write the "ROOT" one?

I'll apreciate any help.

Thanks in advance,

Diego.

Accepted Solutions (0)

Answers (11)

Answers (11)

Former Member
0 Kudos

Not sure if this was ever answered, but in case someone is referencing this link and still having issues, please make sure the Content Conversion parameter is 'Cut' in this exact text.

Former Member
0 Kudos

Thanks Moorthy,

it keeps not working. If I do it work, i'll tell what was happening.

Regards,

Diego.

Former Member
0 Kudos

Hi Moorthy,

Thanks for your responde. I readed the note, it is for underscore problem solution. I finally removed the underscore from my message.

Could you please send me your message where the Cut parameter is working?

Best regards,

Diego.

moorthy
Active Contributor
0 Kudos

Hello,

Are not able to get the desired output as expected by CUT parameter?

Because currently I am in different project. So I don't have access to that.

Try to follow the blog mentioned in my earlier post.

Hope this helps,

Regards,

Moorthy

Former Member
0 Kudos

Hi Sravya,

I've tried again without better luck.

I change the root element of my message from

Proveedor_100011 to Proveedor100011. (removed underscore)

I created the next message as in your weblog:

<?xml version="1.0" encoding="ISO-8859-1"?>

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://sap.com/xi/webservices/buyordint" targetNamespace="http://sap.com/xi/webservices/buyordint">

<xsd:element name="Proveedor100011" type="Proveedor100011" />

<xsd:complexType name="Proveedor100011">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

54650790d48f11dab96c001438eb3b44

</xsd:appinfo>

</xsd:annotation>

<xsd:sequence>

<xsd:element name="root">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

45f01f20d48e11dab854d06ec0a8004a

</xsd:appinfo>

</xsd:annotation>

<xsd:complexType>

<xsd:sequence>

<xsd:element name="head" type="xsd:string">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

45f01f21d48e11da8f1dd06ec0a8004a

</xsd:appinfo>

</xsd:annotation>

</xsd:element>

<xsd:element name="rows" minOccurs="0" maxOccurs="unbounded">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

45f01f22d48e11da894ad06ec0a8004a

</xsd:appinfo>

</xsd:annotation>

<xsd:complexType>

<xsd:sequence>

<xsd:element name="value" type="xsd:string">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

45f01f23d48e11dab889d06ec0a8004a

</xsd:appinfo>

</xsd:annotation>

</xsd:element>

</xsd:sequence>

</xsd:complexType>

</xsd:element>

</xsd:sequence>

</xsd:complexType>

</xsd:element>

<xsd:element name="filenode">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

45f01f24d48e11daab91d06ec0a8004a

</xsd:appinfo>

</xsd:annotation>

<xsd:complexType>

<xsd:sequence>

<xsd:element name="filename" type="xsd:string">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

45f01f25d48e11da8becd06ec0a8004a

</xsd:appinfo>

</xsd:annotation>

</xsd:element>

<xsd:element name="filepath" type="xsd:string">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

45f01f26d48e11dac56cd06ec0a8004a

</xsd:appinfo>

</xsd:annotation>

</xsd:element>

</xsd:sequence>

</xsd:complexType>

</xsd:element>

</xsd:sequence>

</xsd:complexType>

</xsd:schema>

<Proveedor100011>

<root>

<rows>

<value></value>

</rows>

</root>

<filenode>

<filename></filename>

<filepath></filepath>

</filenode>

</Proveedor100011>

I've tried to set "Recordset Structure" in file adapter configuration to "root,filenode" and to "Proveedor110001, filenode" but no output is writed

We are using XI version: SAPKB64015, which version did you use in your weblog?

Thanks and regards,

Diego.

STALANKI
Active Contributor
0 Kudos

can you please rename the Proveedor_100011 to any name without underscore?That is the problem and then follow the blog written by me.Try giving the filename in the same way I have given..add filenode and filename inside it...it should definetly work.

Former Member
0 Kudos

Hello krishna,

Thanks for your response.

Every message in message monitor has state Success. No error appears.

Does any one have a Content Conversion document (pdf,...) that shows more complex escenarios than SAP help site?

Thanks in advance,

Diego.

moorthy
Active Contributor
0 Kudos

Hi,

Try to see this SAP Note- 850694

And it should work as I described earlier. Because similar has worked for me ...and th Cut Parameter is still working for me.

Regards,

Moorthy

Former Member
0 Kudos

Moorthy,

I tried your last solution and but it didn't work.

I have changed the document to this new structure:

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

<ns1:Proveedor_100011 xmlns:ns1="http://sap.com/xi/webservices/buyordint">

<dtroot>

<root>

<string>12312312</string>

</root>

<config>

<directory>c:/tmp</directory>

<filename>directory7.txt</filename>

</config>

</dtroot>

</ns1:Proveedor_100011>

In Recordset structure I set "dtroot,config,root"

And in parameters:

dtroot.fieldSeparator = 'nl'

dtroot.endSeparator= 'nl'

config.fieldFixedLengths = 0

config.fixedLengthTooShortHandling = CUT (or Cut)

root.addHeaderLine = 'nl'

root.fieldSeparator = 'nl'

It generates no output.

When I replace parameters for "config" TAG

config.fieldFixedLengths = 0

config.fixedLengthTooShortHandling = CUT (or Cut)

By

config.addHeaderLine = 0

config.fieldSeparator = 'nl'

It writes all content to file.

**********************************************

I don't know how to continue with this issue...

Any other suggestion?

Thanks for your time.

Regards,

Diego.

moorthy
Active Contributor
0 Kudos

Hi Diego,

As per my input, if you are not getting any input in your output file, (0 bytes), then try to see the error in the Message Dispaly Tool(Message Monitoring ->Audit Log).. It will show you some errors.

Just check it.

Regards,

krishna

Former Member
0 Kudos

Moorthy,

Thank you for your response. I tried it, exactly, but it didn't work for me.

When I set the two Recordset Structure (config and root) and set parameter values, no content is sent to file.

If I set only root as Recordset Structure, then everything goes to file, including filename and directory.

Do you know if I'm missing anything?

Best regards,

Diego.

moorthy
Active Contributor
0 Kudos

Hi Diego,

Just one try -

with wrapping up of one more node to the entire structure.

Now structure will be

<DT_Root>

<Config>

---

</Config>

<root>

</root>

</DT_Root>

Just check it

/people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion

Hope this helps,

Regards,

Moorthy

Former Member
0 Kudos

Moorthy

Thanks for your response but i've tried the blog solution and it doesn't work for me. When I specify all TAG names in recordset structure inbox field and set "fieldSeparator" for everyone of them it works, when I change for the TAG "config" fieldSeparator by (fieldFixedLengths and fixedLengthTooShortHandling) as the blog says, no output is writed.

Thanks,

Diego.

moorthy
Active Contributor
0 Kudos

Hi,

If your structure is like this

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

<ns1:Proveedor_100011 xmlns:ns1="http://sap.com/xi/webservices/buyordint">

<config>

<directory>c:/tmp</directory>

<filename>dynamicFile3.txt</filename>

</config>

<root>

<string>Header;423423</string>

<lines>

<value>LINE;</value>

</lines>

</root>

</ns1:Proveedor_100011>

Then your content conversion is -

RecordSet Structure: config,root

root.fieldSeparator = ;

root.endSeparator = 'nl'

config.fieldFixedLenghts = 0

config.fixedLenghtTooShortHandling = CUT

Try out this. And one more thing, do you want to get Header and Line details in the same line?

If so make the strucure like this

<root>

<String>Header...</String>

<Line Value>...</Line Value>

</root>

Try this out.

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

Hope this helps,

regards,

Moorthy

Former Member
0 Kudos

Diego

First of all you dont map them in Message Mapping and you create the text file of fixed lenghth and you give the content conversion parameters.

---Mohan

Former Member
0 Kudos

Mohan,

sorry but I don't understand what you mean. I did a message mapping before, in my BPM and there I fill the message fields, including one for the dynamic filename. The problem is that I cant't hide or cut this field when the file is writed.

I hope to was clear.

Thanks,

Diego.

moorthy
Active Contributor
0 Kudos

Hi,

You can use Cut Parameter in the Receiver File Adapter to cut the Config structure from the xml.

/people/sravya.talanki2/blog/2005/08/11/solution-to-the-problem-encountered-using-variable-substitution-with-xi-sp12

Hope this helps,

Regards,

Moorthy