cancel
Showing results for 
Search instead for 
Did you mean: 

Data Type - Complex type

Former Member
0 Kudos

Hi experts!

I wonder if it's possible when creating a data type that the highest treelevel doesn't get Category "Complex Type".

I want it to be an Element instead. Because the receiving system which is terradata can't read the message with start root Complex Type.

The Idocs which I import into PI have the highest treelevel as Element.

Any ideas?

Regards

Accepted Solutions (0)

Answers (4)

Answers (4)

baskar_gopalakrishnan2
Active Contributor
0 Kudos

You can customize your structure as you like by creating externally and import in ESR.

udo_martens
Active Contributor
0 Kudos

Hi,

just create a XML Schema (e.g. with XML Spy) and import it as "external definition" to PI. If you avoid Message Mapping (and use XSL, Java or ABAP instead), you can create a dummy data type which will not be checked during runtime.

Regards,

Udo

Former Member
0 Kudos

Hi!

Is it possible to create a datatype in PI and then modify it from complexType to Element in XML SPY? And then import it back to PI as external definition?

Regards

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

I wonder if it's possible when creating a data type that the highest treelevel doesn't get Category "Complex Type".

Once you added a sub-element to a data type it will become a complex type. You can settle for simple type though.

Hope this helps,

Mark

Former Member
0 Kudos

Hi,

How can I settle for a simple type?

Can I do it directly in PI when creating the data type?

Thanks!

Former Member
0 Kudos

Hi,

First you can create the DT as per your requirement then use "Export XSD to File" button to download the XSD on your desktop. Use any of the Data editor to edit the XSD and then use "Import Data Type Definition fron File" to import the schema back in DT.

Hope it helps.

Former Member
0 Kudos

Hi,

Yes I know the process of how to export and import the schema. But I don't know how to change the complex type into an element or simple type in the schema.

It complains all the time about some error when saving.

do you have an email I can send you the schema and get some help?

Would appreciate it!

Former Member
0 Kudos

Hi Sonny,

I think i dint understand your query earlier but now its clear and hence the solution.

Actually your requirement is not correct.

By definition, A simple element is an XML element that can contain only text. It cannot contain any other elements or attributes.

http://www.w3schools.com/schema/schema_simple.asp

Whereas a complex element is an XML element that contains other elements and/or attribute

http://www.w3schools.com/schema/schema_complex.asp

And the root node of a DT in PI contains other elements so it has to be a complex type. This is the basic concept of XSD so even if you change the XSD type manually outside PI and import; the PI will give you an error while activating the DT.

Let us know if you have any other doubts!!

Former Member
0 Kudos

Hi!

I appreciate the help! Now it's more clear to me.

something I wonder is that when I import an Idoc to PI and click on the XSD tab of it's structure then I notice that it begins with an element as startroot. How is that possible then? I want to do the same with my Datatype. It's a requirement from the receiving system in order to be able to read the messages. They can't open the message with a startroot of complexType.

Regards

Former Member
0 Kudos

Sonny,

Even if you will see the XSD of idoc, it will show you that the complex type (one which contains furhter nodes inside it ) node is under <xsd:complexType> only.

Please find below the extract of one of the idoc's (just to give you a pointer 😞

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<xsd:element name="COND_A01">

<xsd:complexType>

<xsd:sequence>

<xsd:element name="IDOC" type="ZCOND_A01.COND_A01" />

</xsd:sequence>

</xsd:complexType>

</xsd:element>

I hope it helps!!

Edited by: Puneet Singhal on Apr 21, 2011 2:31 PM

Former Member
0 Kudos

Hi, I have solved this issue.

the problem was that I gave the receiver system the DataType XSD schema. that's why it was complextype at the highest level. You must give the MessageType XSD schema...there it will automatically be created as an element at highest level.

thanks everyone for contributing!

Best regards

maciej_jarecki
Contributor
0 Kudos

Hi Sonny

Simple create XSD in some other tool and import it to ESR as Exteral Definition

Kind Regards

Maciej