cancel
Showing results for 
Search instead for 
Did you mean: 

Interface Determination for source file without namespace definition

Former Member
0 Kudos

Hi,

I have the following problem:

I am developing a file to IDoc scenario in AEX 7.31. All design objects in ESR and configuration objects in ID are created and the sender communication channel is running. Now I got a test file. It starts directly with the data elements but does not contain the root element as defined in my data type. To make it clear:

Data Type in ESR:

DT_DatatypeA

-- Record [1..unbounded]

---- Field1

---- Field2

The File looks as follows (it lacks the root element 'DT_Datatype_A'):

<Record>

  <Field1>...</Field1>

  <Field2>...</Field2>

</Record>

<Record>

  <Field1>...</Field1>

  <Field2>...</Field2>

</Record>

...

When I try to send it via PI I get the following error:

When I add the XML root element <ns0:DT_DatatypeA ns="..."> manually to the file (and the corresponding end tag), the message is processed correctly.

How can I solve this issue? The file is created by a legacy system which does not know anything about my PI namespaces.

Thanks in advance!

Accepted Solutions (1)

Accepted Solutions (1)

Muniyappan
Active Contributor
0 Kudos

Hi Stefan,

if you are not using FCC and picking the xml file which does not contain the namespace and root tag, then you can use xslt/java mapping.

this one easy to achieve add Namespace in message mapping | SCN

Regards,

Muni

Answers (6)

Answers (6)

Former Member
0 Kudos

What we found out now:

The xml root element is mandatory (it seems that the PI finds the SI with the help of the message type name). But it works fine when the namespace attribute is missing.

At first, you have to remove the namespace in the message type. Just set the field empty:

To make this work, it is important to set the properties of the sender file adapter in the ID in tab "Processing" like this (we had set "binary" before, this did not work):

Now the message is processed right.

0 Kudos

Hi Stefan,

If you are not using FCC and your file starts with tag 'Record'. Then try creating Message type name as 'Record'. Am not sure whether it is write approach but i hope it solves your issue.

Regards,

Sudha

Former Member
0 Kudos

I don't think that this will work because the root element (named equal to the datatype) always occurs exactly one time. The "Record" in my example can occur n times.

Muniyappan
Active Contributor
0 Kudos

i am bit confused here.

how does your input look like? i.e when sender generates the files..

is that like below xml?

<Record>

  <Field1>...</Field1>

  <Field2>...</Field2>

</Record>

<Record>

  <Field1>...</Field1>

  <Field2>...</Field2>

</Record>

or

is it a flat file? and you use FCC in the sender adapter to convert it into xml?

Field1,Field2

Field1,Field2

Former Member
0 Kudos

It's like the XML you posted NOT a flat file.

Muniyappan
Active Contributor
0 Kudos

in that case you don't have to use FCC in the sender channel.

check my above reply. that should help you.

markangelo_dihiansan
Active Contributor
0 Kudos

Hi Stefan,


The File looks as follows (it lacks the root element 'DT_Datatype_A'):

<Record>

  <Field1>...</Field1>

  <Field2>...</Field2>

</Record>

<Record>

  <Field1>...</Field1>

  <Field2>...</Field2>

</Record>

An xml document must always have a root node (namespaces are optional though). In this case, your file is not a valid xml at all. Please ask the sender to correct it.

Regards,

Mark

iaki_vila
Active Contributor
0 Kudos

Hi Stefan,

If you are reading a flat file and you are using the standard module adapter MessageTransformBean you should use the parameter xml.documentNamespace and to set your required namespace like the SAP.HELP documentation shows SAP Library - SAP Exchange Infrastructure

Regards

former_member190624
Active Contributor
0 Kudos

Hi Stefan,

Try to configure your FCC in channel as below,

And let us know , if this not works.

Thanks

Hari.

Former Member
0 Kudos

This does not seem to work. It seems that the fieldNames and fieldSeparator have to be specified:

("Vaue1" is the same as "Field1" above).

iaki_vila
Active Contributor
0 Kudos

Hi Stefan,

Are you using file content conversion? have you tried to set the Document Namespace field?

Regards.