You are on page 1of 5

SAP PI XSD Creator Tool Using PHP

Author(s)

: Ramkumar Ganesh

Date

: 12-Dec-2013

Target Readers
SAP PI Developers, Integration Architect, PHP developers
Keywords

XSD Converter, Creator, Tool


XSD Tool
PI XSD Converter
PHP
WAMP

SAP PI XSD Creator Tool Using PHP

Table of Contents
Introduction.............................................................................................................3
Prerequisites............................................................................................................3
Scenario...................................................................................................................3
Tool Overview...........................................................................................................3
Artifacts...................................................................................................................3
WAMP.........................................................................................................................3
Installation Guide.........................................................................................................4
XSD Converter Installation............................................................................................4
File Format...............................................................................................................4
Process.....................................................................................................................5
References...............................................................................................................6

SAP PI XSD Creator Tool Using PHP

Introduction
This Document is about the PHP tool to convert the CSV file which contains information like node,
elements, data types etc in to XSD file. The generated file can be further used in middleware
integration tools like SAP PI.

Prerequisites

Basic knowledge of PHP.


Basic knowledge of XI/PI.

Scenario
This is used in EAI projects where we have a list of elements/Node in a CSV format which we need
to add manually into any EAI/middleware tool to create a XSD structure. To overcome this we have
developed the code in PHP for converting CSV to XSD format. This will ease half of our work,
instead of manually creating all the elements. Since the XSD can be imported into most of the EAI
middleware tools for creating the corresponding message structures.

Tool Overview
XSD Converter tool is mainly developed to reduce the effort of manually creating the data types in
SAP PI.
The Converter tool will take the input as a CSV file. The CSV file contains the list of nodes to be
created in SAP PI with element name, max, min occurrences, data type and length (optional). So
the CSV file should be in the attached template format. For more details refer the file format
section.
The Tool will generate the output as a XSD File. We can import the XSD file in to SAP PI.

Artifacts
WAMP
WAMP is a Windows web development environment. It allows you to create web applications with
Apache, PHP and the Mysql database

Installation Guide

WAMP_INSTALL.txt

CSV_XI_XSD_Install.
txt

SAP PI XSD Creator Tool Using PHP

XSD Converter Installation

CSV_XI_XSD.zip

File Format
The CSV file should follow the format mentioned in the below attached Template.PNG file.

Sample.csv

Template.PNG

Process
1

The code will read the entire CSV file and generate the XSD file which contains elements, data
types, Min & Max Occurrences and Length (optional).

After downloading the tool, extract the CSV_XI_XSD zip files to the root folder /www/

We can access the tools main page through


http://localhost/CSV_XI_XSD/upload_csv.php

Upload the CSV file using Browse option and provide the details like IR- data type name,
namespace and number of levels.

After submitting we can get a XSD file.

SAP PI XSD Creator Tool Using PHP


6

We can import the XSD file to the Data types using the import file option available in the XI
middleware tool.

Ideally created XSD file can be imported into SAP PI middleware tool.

After importing we can add / edit the elements manually if required.

The elements which contain attributes are omitted (we need to insert the attributes manually).

References
http://www.php.net/
http://sdn.sap/com/