cancel
Showing results for 
Search instead for 
Did you mean: 

A custom Data definition containing a standard IDOC

Former Member
0 Kudos

Hi

without wanting to extend an IDOC I would like to have a definition that contains a wrapper around multiple IDOCS that I can map to. I do not want a multi-mapping either as I want to control the name of the wrapper tags . This would be possible if I can define such a data type.

I am after a definition such as this... a couple of custom tag followed by the Standard IDOC(s).

<dt_asnfiles>

<ASN>0000002374</ASN>

<Company>mycompany</Company>

<ASNRecords>

<_-AFS_-DELVRY03>...</_-AFS_-DELVRY03>

<_-AFS_-DELVRY03>...</_-AFS_-DELVRY03>

<_-AFS_-DELVRY03>...</_-AFS_-DELVRY03>

<_-AFS_-DELVRY03>...</_-AFS_-DELVRY03>

</ASNRecords>

</dt_asnfiles>

I have tried exporting the IDOC as XSD - playing with the definition in order to import as a complex type

into a new Data Type but I cannot seem to do it.

There must be some way of doing this - do you know how ?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi

Making changes to XSD in notepad will be painful.

Make changes to IDoc xsd using xml editors like XMLSpy or Stylus studio and import it back to IR.

rgds,

Arun

Former Member
0 Kudos

So I assume that you have done this before ?.

I have been trying first to create a Data Type for the IDOC. If I can do that then I'll be able to use it as a complex type for the main ASN structure that I'm wanting.

The problem I have is with creating this Data Type for the IDOC. Now as you know the first element of a Data Type will be the name of the Data Type itself. eg dt_AFSDELVRY03 but if you export the IDOC as an XSD of course it's first element is the name of the IDOC. So of course I have been trying to adjust the IDOC XSD so that it will be ready to be imported into a Data Type but I'm having problems with it.

If you have done this before are you able to provide a small extract of your XSD of a Data Type for an IDOC.

Former Member
0 Kudos

hi

chk this

<xsd:element name="DT_MYVENDOR">

<xsd:attribute name="CSKNum"/>

<xsd:complexType>

<xsd:sequence>

<xsd:element name="WLSNum" type="xsd:string" minOccurs="0"/>

<xsd:element name="ElementaryInfo" type="xsd:string" minOccurs="1 maxOccurs="999"/>

<xsd:element ref="CREMAS03"/>

</xsd:sequence>

</xsd:complexType>

</xsd:element>

DT_MYVENDOR is the custom type. It is referring to "CREMAS03" Idoc structure.

So the entire Idoc struct will get embedded inside DT_MYVENDOR .

Export the Idoc and make changes in textpad/xleditor and import back to IR .

rgds,

Arun

Former Member
0 Kudos

Thanks - sounds like you are on the right track.

However I get an error Schema to be edited contains a element with a global reference to urn:mycompany.com.au:pi:SAP_ABA:IDOC_Interfaces:_-AFS_-DELVRY03

But this is exactly the thing I want inserted in my Data Type. So if it knows about it why won't it let me have it ?

here is my XSD - cut down slightly to making it easy to post in this SDN note

<?xml version="1.0" encoding="ISO-8859-1"?>

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:mycompany.com.au:pi:SAP_ABA:IDOC_Interfaces" 

targetNamespace="urn:mycompany.com.au:pi:SAP_ABA:IDOC_Interfaces">
	<xsd:complexType name="dt_WHSORDAFSDELIVERY03_for_3rdParty">
		<xsd:sequence>
			<xsd:element name="ASN" type="xsd:string"/>
			<xsd:element name="Company_Code" type="xsd:string"/>
			<xsd:element name="Division" type="xsd:string"/>
			<xsd:element name="Billto_AccountNo" type="xsd:string"/>
			<xsd:element name="ASNRecords" maxOccurs="unbounded">

				<xsd:complexType>
					<xsd:sequence>
						<xsd:element ref="_-AFS_-DELVRY03"/>
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>
		</xsd:sequence>
	</xsd:complexType>
</xsd:schema>

Former Member
0 Kudos

Hi

Arun - still have problems with this. I have import the IDOC CREMAS03 into the same namespace as the Data Type. I have create a new Data Type DT_MYVENDOR and imported the below xsd that you gave as an example - had to fix it up a little. Did not work and I have tried various combinations, importing xsd, converting xml to dtd, messing with the dtd and the xsd etc etc.... But no luck I cannot even import your simple example as get error Schema to be edited contains a element with a global reference to urn:Gazal.com.au:pi:SAP_ABA:IDOC_Interfaces:CREMAS03

The same error that I got when I tried my own example !.

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:myCompany.com.au:pi:SAP_ABA:IDOC_Interfaces" targetNamespace="urn:myCompany.com.au:pi:SAP_ABA:IDOC_Interfaces">
<xsd:complexType name="DT_MYVENDOR">
<xsd:sequence>
<xsd:element name="WLSNum" type="xsd:string" minOccurs="0"/>
<xsd:element name="ElementaryInfo" type="xsd:string" minOccurs="1" maxOccurs="999"/>
<xsd:element ref="CREMAS03"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>

Is somebody able to read my orginal request again and look at what I am trying to do. If you have done this before and it worked perhaps can you send me the xsd so I can import it to see if working first hand.

Thanks for any time you can spend helping me out.

Edited by: Paulie Seikmayt on Jun 5, 2008 12:00 PM

Former Member
0 Kudos

hi

You will have to change the Original Idoc xsd.

Export the Idoc xsd and do the changes that I have mentioned below using wordpad/xmleditor,

In the sample I have shown you, I have added the DT_MYVENDOR element on to the top of the CREMAS Idoc xsd

CREMAS xsd (Original)

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

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

<xsd:element name="CREMAS03">

<xsd:complexType>

<xsd:sequence>

<xsd:element name="IDOC" type="CREMAS.CREMAS03"/>

</xsd:sequence>

</xsd:complexType>

</xsd:element>

<xsd:complexType name="CREMAS03.E1LFA1M">

<xsd:annotation>

.........................

-


(I am not copying complete xsd...remaining part same as Idoc)

*CREMAS xsd (After Adding the DTMYVENDOR(In bold) element )*_

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

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

<xsd:element name="DT_MYVENDOR">

<xsd:complexType>

<xsd:sequence>

<xsd:element ref="CREMAS03"/>

<xsd:element name="ElementaryInfo" type="xsd:string" minOccurs="0"/>

</xsd:sequence>

<xsd:attribute name="CSKNum"/>

</xsd:complexType>

</xsd:element>

<xsd:element name="CREMAS03">

<xsd:complexType>

<xsd:sequence>

<xsd:element name="IDOC" type="CREMAS.CREMAS03"/>

</xsd:sequence>

</xsd:complexType>

</xsd:element>

<xsd:complexType name="CREMAS03.E1LFA1M">

<xsd:annotation>

.........................................

-


(I am not copying complete xsd...remaining part same as Idoc)

After doing this change, import the modified xsd back to the IR as an external definition.

rgds,

Arun

Answers (0)