cancel
Showing results for 
Search instead for 
Did you mean: 

File Adapter Question

Former Member
0 Kudos

Hi,

I've got a File Adapter receiver which should convert the following XML to a CSV file:

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

<ns0:_-BI0_-QI6AEST_S_ORGUNIT_XI_RFC xmlns:ns0="urn:sap-com:document:sap:rfc:functions">

<DATASOURCE>

</DATASOURCE>

<DATA>

<item>

<_-BIC_-S_ORGUNIT>10</_-BIC_-S_ORGUNIT>

<_-BIC_-S_ORG_LEV>2</_-BIC_-S_ORG_LEV>

<_-BIC_-S_CH_ON></_-BIC_-S_CH_ON>

<_-BIC_-S_CR_ON></_-BIC_-S_CR_ON>

<LANGU>DE</LANGU>

<TXTSH>Unit1</TXTSH>

<TXTLG>Unit1long</TXTLG>

</item>

<item>

<_-BIC_-S_ORGUNIT>11</_-BIC_-S_ORGUNIT>

<_-BIC_-S_ORG_LEV>3</_-BIC_-S_ORG_LEV>

<_-BIC_-S_CH_ON></_-BIC_-S_CH_ON>

<_-BIC_-S_CR_ON></_-BIC_-S_CR_ON>

<LANGU>DE</LANGU>

<TXTSH>Unit2</TXTSH>

<TXTLG>Unit2long</TXTLG></item>

</item>

</DATA>

</ns0:_-BI0_-QI6AEST_S_ORGUNIT_XI_RFC>

I have configured the file receiver adapter respectively. The record set structure is item. The parameters for content conversion are item.addHeaderLine 0, item.fieldSeparator ; and item.endSeparator 'nl'.

I would expect the follwing CSV file content:

10;2;;;DE;Unit1;Unit1long;

11;3;;;DE;Unit2;Unit2long;

Instead I get the follwing output:

10;11;

Does anybody know what might be the problem here?

Kind regards,

Heiko

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Heiko,

Your configuration seems to be fine.

I am not uble to understand what is <DATASOURCE></DATASOURCE> in your structure. Try giving this name also in record set structure and before item and give dummy fieldSeparator.

Hope it works,

Regards,

satish

Former Member
0 Kudos

Hi Satish,

I have done what you suggested. I have introduced DATASOURCE as first element in record set structure:

'DATASOURCE,item'. Now I get an empty file as result. When I write out the related XML file it contains all data.

Cheers,

Heiko

Former Member
0 Kudos

What is this 'DATASOURCE, for.

Can you write down your output XML structure. Maybe i can help more on this.

Your item configuration was seems to be fine.

Regards,

satish

Former Member
0 Kudos

Hello Satish,

schema for the interface results from an RFC import. The schema is quoted below.

Regards,

Heiko

===========

Schema:

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

<xsd:schema targetNamespace="urn:sap-com:document:sap:rfc:functions" xmlns="urn:sap-com:document:sap:rfc:functions" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<xsd:element name="_-BI0_-QI6AEST_S_ORGUNIT_XI_RFC">

<xsd:complexType>

<xsd:all>

<xsd:element name="DATASOURCE">

<xsd:simpleType><xsd:restriction base="xsd:string">

<xsd:maxLength value="30" />

</xsd:restriction>

</xsd:simpleType>

</xsd:element>

<xsd:element name="DATA" minOccurs="0">

<xsd:complexType>

<xsd:sequence>

<xsd:element name="item" type="ZOXBWD0088" minOccurs="0" maxOccurs="unbounded" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />

</xsd:sequence>

</xsd:complexType>

</xsd:element>

</xsd:all>

</xsd:complexType>

</xsd:element>

<xsd:complexType name="ZOXBWD0088">

<xsd:sequence>

<xsd:element name="_-BIC_-S_ORGUNIT" minOccurs="0">

<xsd:simpleType>

<xsd:restriction base="xsd:string">

<xsd:maxLength value="8" />

</xsd:restriction>

</xsd:simpleType>

</xsd:element>

<xsd:element name="_-BIC_-S_ORG_LEV" minOccurs="0">

<xsd:simpleType>

<xsd:restriction base="xsd:string">

<xsd:maxLength value="2" />

<xsd:pattern value="\d+" />

</xsd:restriction>

</xsd:simpleType>

</xsd:element>

<xsd:element name="_-BIC_-S_CH_ON" minOccurs="0">

<xsd:simpleType>

<xsd:restriction base="xsd:string">

<xsd:maxLength value="8" />

</xsd:restriction>

</xsd:simpleType>

</xsd:element>

<xsd:element name="_-BIC_-S_CR_ON" minOccurs="0">

<xsd:simpleType>

<xsd:restriction base="xsd:string"><xsd:maxLength value="8" />

</xsd:restriction>

</xsd:simpleType>

</xsd:element>

<xsd:element name="LANGU" minOccurs="0">

<xsd:simpleType>

<xsd:restriction base="xsd:string">

<xsd:maxLength value="1" />

</xsd:restriction>

</xsd:simpleType>

</xsd:element>

<xsd:element name="TXTSH" minOccurs="0">

<xsd:simpleType>

<xsd:restriction base="xsd:string">

<xsd:maxLength value="20" />

</xsd:restriction>

</xsd:simpleType>

</xsd:element>

<xsd:element name="TXTLG" minOccurs="0">

<xsd:simpleType><xsd:restriction base="xsd:string">

<xsd:maxLength value="60" />

</xsd:restriction>

</xsd:simpleType>

</xsd:element>

</xsd:sequence>

</xsd:complexType>

</xsd:schema>

Former Member
0 Kudos

Hi

I think it is difficult to write your output structure through field content conversion.

There are some limitations through reciever content conversion. The recordset structure should satisfy its condition.

reasons.

1. since you have datasource field which is not a strcuture but a field. Adapter content conversion doesnot handle these kind of situation.

answer: put this field under some node. lets say data1

2. If there are more than one recordset str in output message one content conversion logic is application to all other recordset.

Your problem can be solved if you keep data source in some node

e.g

<data1><datasource></datasource></data1><data><item> its fields<item></data>

than you can give data1,item in field content conversion.

item.fieldSeparator ;

item.endSeparator 'nl'

data1.fieldSeparator ;

data1.endSeparator 'nl'

and you will get the desired output.

If you dont want datasource field in your output, either dont map it or cut it in field content conversion.

e,g

data1.fieldFixedlengths 0

data1.fixedLengthTooShortHandling Cut

You will get items field with your desired output.

Since your structure is imported from RFC you have to create a structure for Output and than map it with source RFC structure.

Hope it makes some sense now.

Regards,

satish

Former Member
0 Kudos

Hi Satish,

thanks for your help. Unfortunately I can't influence the structure of my XML Output. It results from an imported RFC. So I will have to use the XML output for now.

Kind regards,

Heiko

Answers (0)