cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping to an IDOC using an externally created XSL file

Former Member
0 Kudos

I want to map a message to an IDoc using an ABAP XSLT transform. I am creating the XSLT in an external tool.

I need to use an XSD definition of the IDOC as the target document of the mapping. I can get that in two ways:

1) Get the XSD definition of the IDOC from transaction WE60 and use the menu command 'Documentation -> XML Schema'

2) In the Integration Repository, export the XSD of the imported IDOC.

The problem is, there are significant syntax differences between these versions, and I don't know which is the correct version. For instance, the XSD exported from the Integration Repository has a mandatory attribute 'SEGMENT' for each segment that must be filled to create a valid XML message; this is not the case when the XSD definition is created in WE60.

Can somebody advise which is the correct version to use?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

If were your shoes I would use xsd from integration repository because that's the expected result. For each sement element you can assign constant 1. Actually you can also use xslt in integration repository, only create the zip archive.

best,

wojciech

Former Member
0 Kudos

Hi,

Do I assume then that placing a constant value of 1 in the SEGMENT attribute is just to satisfy the validation of the XML message against the XSD:

<xsd:attribute name="BEGIN" type="xsd:string" fixed="1" use="required" />

Can I assume that the IDoc adapter will fill the SEGMENT attribute with the correct value?

BR,

Tony.

Former Member
0 Kudos

Hi,

I'm not sure about this specific field but IDOC adapter is changing many fields. Prerequirement is only to fit this technical data with xsd.

best,

wojciech

Former Member
0 Kudos

Hi Anthony,

This is really strange...

In both case XSD should be same...can you please tell for which idoc you are generating xsd?

Eventhough if you generate XML Schema using WE60, mandatory attribute 'SEGMENT' for each segment has to be there....this validation would be done while posting idoc. It will check for all mandatory fields.

I have some different thoughts that what wojciech has suggested...

"If were your shoes I would use xsd from integration repository because that's the expected result...."

But final goal is not to achieve mapping but posting idoc with proper data in R/3 system successfully.

Your second question..

"Do I assume then that placing a constant value of 1 in the SEGMENT attribute is just to satisfy the validation of the XML message against the XSD:..?

ummm...I think if you assign constant "1" to segment it will generate that segment while creating idoc. Its mandatory to assign constant value to segment which you want to generate...

"Can I assume that the IDoc adapter will fill the SEGMENT attribute with the correct value?.."

I dont think so Idoc adapter will fill this attribute automatically...you need to assign constant to field segment.

Nilesh

Former Member
0 Kudos

Hi Nilesh,

Sorry I made a mistake: the SEGMENT attribute is there in both cases.

There isn't much difference in the XSD but the element names are quite different, e.g. for IDoc ORDERS05:

from the XSD of WE60:

<xsd:element name="E1EDK14" minOccurs="0" maxOccurs="12">

From the imported IDoc in XI:

<xsd:element name="E1EDK14" type="ORDERS05.E1EDK14" minOccurs="0" maxOccurs="12" xmlns:xsd="http://www.w3.org/2001/XMLSchema"/>

BR,

Tony.

Former Member
0 Kudos

Hi,

So there is no functional difference but only a difference in type definition. It doesn't have an impact on your mapping. Because it describes the same.

best,

wojciech

Answers (0)