Skip to Content
avatar image
Former Member

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

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Apr 03, 2008 at 02:27 PM

    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>

    Add comment
    10|10000 characters needed characters exceeded

    • 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

  • avatar image
    Former Member
    Apr 03, 2008 at 02:21 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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.

  • avatar image
    Former Member
    Apr 11, 2008 at 02:25 PM

    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'

    Add comment
    10|10000 characters needed characters exceeded