cancel
Showing results for 
Search instead for 
Did you mean: 

Error in Receiver FCC: Unknown structure ... found in document

Former Member
0 Kudos

Hi Experts,

I have a problem with the Receiver File Adapter. I want to use Content Conversion to generate a plain file.

Input to receiver file adapter:

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

<PlainFile>

<filename>filename.txt</filename>

<line>Line 1</line>

<line>Line 2</line>

...

</PlainFile>

Wanted result: a file filename.txt with this content:

Line 1

Line 2

...

FCC settings:

RecordSet Structure: line, filename

line.fieldSeparator:'nl'

filename.fieldFixedLengths:0

filename.fixedLengthTooShortHandling:Cut

Problem is: the adapter throws error "Message processing failed in XML parser: 'Conversion configuration error: Unknown structure 'PlainFile' found in document'"

If I use:

RecordSet Structure: PlainFile, line, filename

and add:

PlainFile.fieldSeparator:'nl'

... the lines are printed, but also the unwanted filename. The XML input results from an 1:n mapping, therefore I want to set different filenames by variable substitution from the payload.

Many thanks for your help,

Ralf

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Finally found it: an additional hierarchy in the xml file is needed for the sake of the FCC logic.

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

<PlainFile>

<settings>

<filename>filename.txt</filename>

</settings>

<content>

<line>Line 1</line>

<line>Line 2</line>

...

</content>

</PlainFile>

FCC settings:

RecordSet Structure: settings, content

content.fieldSeparator:'nl'

settings.fieldFixedLengths:0

settings.fixedLengthTooShortHandling:Cut

settings.endSeparator:'0'

Former Member
0 Kudos

Since you want to the filename to be sent in the payload, check out the below Variable Substitution Method. This information is available in help.sap.com.

Advanced Tab Page

Variable Substitution (Target Directory/File Name Scheme)

If you set the Enable indicator, you can enter variables for the Target Directory and File Name Scheme. Enter the names of the variables and references in the table.

&#9679; Enter each variable that you reference in the Target Directory and File Name Scheme fields without the surrounding percentage sign under Name of Variables in the table.

The variables can refer to attributes of the message header or elements of the message payload.

&#9675; If the variables are to refer to an attribute of the message header, add the prefix message: to the name of the variable under Reference. You can specify the following attributes of the message header:

sender_party, sender_service, receiver_party, receiver_service, interface_name, interface_namespace,

message_id (message ID with hyphens, for example 9fbe1ff1-9a0d-11d9-8665-cbf10a126331)

message_id_hex (message ID in hexadecimal format, for example 9fbe1ff19a0d11d98665cbf10a126331)

For example, if you want to specify the interface name from the message header in the target directory or in the file name scheme, enter message:interface_name as the reference.

Note

If one of the message attributes contains characters that are not permitted in a file name, for example \, /, :, *, ?, ", <, >, |, then these characters are replaced by an underscore ("_").

&#9675; If the variable refers to an element in XML schema, add the prefix payload: to the information under Reference. The reference then comprises a pseudo path description in the form of a comma-separated list with the schema namea,na,nameb,nb,....

namea,nameb,... corresponds to the element name and na,nb,... corresponds to the occurrence of the element name at the respective level in the document.

The description begins at the root of the document and ends at the respective element.

Example

To reference the element that is in bold in the example, the following expression is used: payload:root,1,e1,1,e2,2

The parser searches for the first occurrence of the root element at the first level. It then searches for the first occurrence of e1 at the second level and for the second occurrence of e2 at the third level. The content of the last element (“Example Value”) is set as the value for a specified variable.

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

<root>

<dummy>

<e1>

<e2>Data_1</e2>

<f/>

<g attr="abc">text</g>

<e2>Data_2</e2>

</e1>

</dummy>

<e1>

<e2>illegal/value</e2>

<f/>

<g attr="abc">text</g>

<e2 attr="fghij">Example Value</e2>

</e1>

</root>

Former Member
0 Kudos

Hi Praveen,

that's what I do. The problem is only that the filename occurs also in the file content.

Do you know if it's possible to take an attribute for the variable substitution ? (use <PlainFile filename="xyz.txt"> )

Best regards, Ralf

stefan_grube
Active Contributor
0 Kudos

Hi Ralf,

there is no wayto prevent the file name from the output, when you use variable substitution. Attributes do not work.

The better aproach is using the ASMA. Here you can store the filename during mapping and need not have it in the payload.

Regards

Stefan

Former Member
0 Kudos

Hi Ralf,

use:

RecordSet Structure: PlainFile, line, filename

and add:

PlainFile.fieldSeparator:'nl'

line.fieldSeparator:'nl'

filename.fieldFixedLengths:0

filename.fixedLengthTooShortHandling:Cut

This will solve your FCC issue.

Regards,

Rajeev Gupta

Former Member
0 Kudos

Hello Rajav,

Former Member
0 Kudos

Hi Rajeev,

thanks for the quick answer, but your suggestion is what I desribed at the bottom. Or did I miss the difference ? The lines are printed, but the filename is then also in the content of the file.

Best regards, Ralf.