Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generate DDIC structure from XSD?

I have a number of XSDs that are part of the enterprise definitions for several services at the client.

I would like to be able to take a single XSD and generate a DDIC structure from it (without the use of PI!)

Seeing as you can generate proxies directly from a WSDL, and this also generates structures and data elements from the XSD definitions inside the WSDL, there is obviously already ABAP code that does this.

But do you know what classes/function modules to use to achieve this? Perhaps there is a convenient utility function or class method that takes the XSD as input and generates the relevant DDIC objects?

Some background on why I need this:

Some of the services include variable sections that include a piece of XML containing the data for one of the enterprise XSD entities; I am hoping to have a DDIC representation of these, which I can fill at runtime and then convert to XML to include in the message.

like image 439
mydoghasworms Avatar asked Jul 30 '13 07:07

mydoghasworms


People also ask

Can we generate XML from XSD?

To create an XML file from an XSD file: Right-click the XML Documents folder in your data development project, and select New > XML. The New XML File wizard opens.

What is structure in Ddic?

Introduction. To reduce the time required to create complex types and entity types in your data model, Service Builder provides you the Import DDIC Structure function with which you can import an existing ABAP (DDIC) structure and reuse this data to create new complex types and entity types with ease.

How do I create an XSD file in Visual Studio?

In Visual Studio, open the File menu and select New > File. Or, use the Ctrl+N keyboard shortcut. In the New File dialog box, select XML Schema and then select Open. A new file is created.


1 Answers

There is a program on the system called SPROX_XSD2PROXY with which you can upload one or more XSD files which will generate proxy objects for you.

You also end up with a service consumer with a corresponding class and what looks like a dummy operation.

The program is fairly short; it uploads the files(s) to an XSTRING, then converts the XSD(s) to WSDL(s) and finally the WSDL(s) to proxy objects using methods of a class called CL_PROXY_TEST_UTILS.

However, the result is satisfactory as it does give me a structure I can work with. And by examining the contents of those methods, it may be possible to build a more fine-tuned tool if I need one.

like image 139
mydoghasworms Avatar answered Oct 02 '22 01:10

mydoghasworms