cancel
Showing results for 
Search instead for 
Did you mean: 

Creating Reusable Data types in SAP PI

Former Member
0 Kudos

Hi,

I want to create a reusable data type, for example

Person (with following elements)

     Gender

     Age

     DOB

and reuse it across the data types for example Employee, Student, Manager etc.

I have tried creating the person data type, exporting it to an external xsd and then importing it as an external definition but, I am not able to chose the external definition while creating the new data type.

For info, I am a newbie to SAP PI, hence the question may sound stupid.

Please help.

Regards

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Upendra,

While you create data type you cannot choose external definition as external definition is different segment and and for different purpose  .

As per your requirements create data type as below for employee .

And save it by clicking  export "xsd to file" .

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

   <xsd:complexType name="Employee">

      <xsd:sequence>

         <xsd:element name="DOB" type="xsd:string" />

         <xsd:element name="AGE" type="xsd:string" />

         <xsd:element name="Gender" type="xsd:string" />

      </xsd:sequence>

   </xsd:complexType>

</xsd:schema>

If you already have saved xsd file and you have deleted from your ESR .then for reusing  create new data data for eg . Person

Make a little change on  <xsd:complexType name="Person"> .

And  import it and do your further changes .

thanks and regards,

Anup Banerjee

Answers (1)

Answers (1)

anand_shankar10
Active Participant
0 Kudos

Hi,

If you want to use a data type for multiple scenarios, You can still use the data type across, no need to get it converted to external definition file.

Also make sure that the different namespaces you are trying to use this object lies within same SWCV or else you need to make dependency of SWCV to use the object in a namespace which lies under different SWCV.

Thanks

Anand