0% found this document useful (0 votes)
144 views21 pages

Create An XML Schema in BODS - SAP Blogs

The document discusses steps for creating an XML schema in SAP BODS (Business Objects Data Services). It outlines 8 steps for importing an XML schema file and creating the schema in the local object library. These include browsing for an XML or XSD file, importing the schema, selecting the root element, and viewing the imported schema in the local object library. Comments discuss resolving errors that may occur during schema import.

Uploaded by

amitgupta1cc
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
144 views21 pages

Create An XML Schema in BODS - SAP Blogs

The document discusses steps for creating an XML schema in SAP BODS (Business Objects Data Services). It outlines 8 steps for importing an XML schema file and creating the schema in the local object library. These include browsing for an XML or XSD file, importing the schema, selecting the root element, and viewing the imported schema in the local object library. Comments discuss resolving errors that may occur during schema import.

Uploaded by

amitgupta1cc
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

Community

 A New Home in 
New Year for SAP
Community:
Exciting times
ahead for the SAP
Community! Read about the migration and join SAP Community Groups!

Not yet a member on


the new home? Join
today and start
participating in the
discussions!

Ask a Question Write a Blog Post Login

Former Member
April 8, 2013 | 2 minute read

Create an XML Schema in BODS


 18  5  19,075

Follow Steps:

1.Go to local object library in data services designer. Click Formats -> XML
 Like Schemas

 RSS Feed
2.Right click on XML schemas and click on new

3. A new window pops up. Give the desired format name under the tab Format
name
1. 4.We have to browse the xml schema file. Files in .XSD format have to be used. For this
we can use any tools available to convert a .xml file into .xsd file.

The content of xml file used in this example is

After converting to .XSD file the contents becomes as given below


5. Import the xml schema.

1. 6. If the file imported is not proper (format issue),then an error will be thrown
while importing.

For E.g.:
Rectify the error and import the proper xml schema.

7.After importing successfully give the corresponding Root element name from
the drop down.

1. 8.Click Ok.

The imported schema will be found under XML Schemas in local object library.

Alert Moderator

Assigned Tags

SAP Data Services

Similar Blog Posts 


Sending IDOC from Business Objects Data Services (BODS) to SAP
By ROSHAN CHHAJED Jul 17, 2012

An approach to build Target file in Excel format in SAP BODS using XSL
By Titto Antony Sep 16, 2014

Sending IDOC from BODS to SAP (Inbound to SAP)


By Ahalya Inturi May 07, 2013

Related Questions 
Error in Creating a XSD schema in BODS.
By Former Member Mar 20, 2012

Sending idocs from SAP ECC to Data Services


By Former Member Aug 01, 2013

is it possible to associate single Database to multiple local repositories


By Former Member Apr 08, 2015

18 Comments

You must be Logged on to comment or reply to a post.

Kumari Varsha
August 20, 2014 at 9:27 am

Hey Hi Sherin i followed all the steps which is mentioned above by u..but i getting error,if m m clicking on
OK button still able to create XML schema.

Below i hv write the error link..whr i got stuck..please helcp me out


http://scn.sap.com/servlet/JiveServlet/downloadImage/38-82845-202894/620-196/7.png

Like 0 | Share

Kumari Varsha
August 20, 2014 at 9:28 am

i m trying to import xml file.

Like 0 | Share

Balakrishna P
August 20, 2014 at 9:58 am

Convert your xml file to XSD(check online for converters/tools) and follow the steps
mentioned in the above document to create XML Schema in BODS.

Like 0 | Share

Balakrishna P
August 20, 2014 at 10:27 am

Check Line 44 in your XSD, see your error msg.

If possible, attach your XSD file to understand the problem.

Like 0 | Share

Kumari Varsha
August 20, 2014 at 2:46 pm

ya now done..successfully created XML SCHEMA

THANKS..

Like 0 | Share

Kumari Varsha
August 20, 2014 at 4:12 pm

Hey Bala, i took a sample example same as my client requirement..m getting error..i have
attached the screenshots plz help me out..problem with Mapping..
Like 0 | Share

Kumari Varsha
August 20, 2014 at 4:20 pm

[Query:Query]

Invalid mapping expression for column <Query.orderid>. Additional information: <Cannot


parse expression.

Table <Delivery1_no.XML_file_test> for column <orderid> does not occur in the FROM
clause. For a top-level query, all columns must belong to some table in the FROM clause..
(BODI-1112351)>. (BODI-1111081)

Plz anyone help me

Like 0 | Share

Balakrishna P
August 20, 2014 at 4:21 pm

Plz check Mapping tab, you have a join like condition with = symbol, so is the problem

Like 0 | Share

Kumari Varsha
August 20, 2014 at 4:40 pm
Order Id is equal and common for both.that's wy i used that Mapping
Expresssing,,,if m removing = ,symbol then below mentioned error.

[Query:Query]

Not all the tables are joined. (BODI-1110413)

Like 0 | Share

Venkata Ramana Paidi


August 31, 2014 at 7:22 am

Hi Varsha,

Your image looks like you are extracting the data from single nested xml
file and loading into the table.

I need few clarifications on your flow.

1. If it is single xml why you used two xml transfer transforms? You can
use single xml transfer transform and drag the required columns. The
extraction from xml is not that much difficult compare to loading data into
nested xml file from tables/files.

2. I will tell the reason for the above errors and scenario.

3. If you are going to load the data into nested xml file by using two(more)
source tables/files, we may get the error like doesn't occur in the from
clause and check from clause etc. Then you have to check in the from
clause like all tables are selected or not. If one of the table is not selected
but one/few field(s) from the unselected table mapped to target , you will
face this issue.
4. When you are loading into the nested target table we have to careful in
the joins . For example if you want to join header and line items tables
and load into target means , You have to give the join condition under line
item schema not under header schema . For give the join under line item
you have to make line item schema as current schema.

Thanks & Regards,

Ramana

Like 0 | Share

Kumari Varsha
September 1, 2014 at 10:47 am

hey Ramana,thanks alot for your response.. ,can u explain wid example
how to extract the data from xml as source file in target tbl ?

Like 0 | Share

Venkata Ramana Paidi


September 2, 2014 at 5:30 am

Hi Varsha,
I will explain through one scenario from table/file to nested xml and
nested xml to table/file.

I am taking simple source tables EMP & DEPT tables . my target is nested
xml looks like DEPTNO,DNAME,LOC. If you click on DEPTNAME or
DEPTNO we have to list out the employees in the corresponding
department.

So let's assume the query is nested like

Query

+- DEPT

DEPTNO

DNAME

LOC

+- EMP

EMPNO

ENAME

SAL

DEPTNO

For each schema you have to ask yourself "How many elements do I want
to have?"

and dept has the dept columns plus the emp schema, emp has the emp
columns.

This query has as inputs three sources, the EMP, DEPT table plus a
Row_Generation transform generating one row.

How many repeats of the XML root nodes do you want to have? One
obviously, an XML has to have one and only one root node. So we make
the Query the current and modify the FROM clause so that only the
Row_gen is listed.
How many times do we want to see the DEPT tag? Once per DEPT row. So
we make the DEPT schema the current and modify the FROM clause to be
DEPT only. Now all columns within the DEPT schema can be set to values
coming from the DEPT input table (plus the parent Row_Gen table but we
don't need that).
Same thing for the EMP schema. How many EMP tags do we want to see
inside each DEPT? As many EMPs as the department has. Hence we make
that schema the current, the FROM clause is set to EMP only and we need
a where clause for this schema: EMP.DEPTNO = DEPT.DEPTNO.
For QT_GET , from clause we have to select Row_Generation only .
Because we need QT_GET only once it is just output schema.

For DEPT schema( right click make as current) we need to select DEPT
table only . We need all the departments should be occur .
In the EMP schema ( right click make as current) from clause should be
from EMP only as we are taking fields from EMP table.

Below screenshot for nesting as my target schema.


Output is like this .

Because of Row_generation it occurred only once not many as no of


departments.

Departments occurred based of no of departments only not join with EMP


as we selected only DEPT in the from clause.
If we click on the EMP schema of department 10 we can see the above
result. This is because of join condition between DEPT & EMP and from
clause only EMP . If we select DEPT also it causes Cartesian product and
we will not get desired result.

I hope you understand the nesting from flat structures to nested


structures.

Thanks & Regards,

Ramana.

Like 0 | Share

Venkata Ramana Paidi


September 2, 2014 at 6:01 am

Hi Neha,

In my previous post I explained about nesting as i told told it is some how


expensive. In this I am replying for your question from loading data from
xml to flat structures like tables/files.

I am taking the output of the previous example as source here .


See the input data of the xml .

Here we can approach two ways to do un-nesting . one is xml pipe line is
straight forward and second one using query transform .

1. XML pipeline .
Drag the required columns to the output schema from input schema. It is
very striaght forward.

2. Query transform .

Drag the root schema(QT_GET_nt_1) as shown in the above picture to the


output schema.

Then right click on the root schema(QT_GET_nt_1) and select the option
Unnest with sub-schemas. Then you will see arrow symbol on that
schema and child schema also as shown in the screenshot.

You can see schema is un-nested , we can directly drag the required fields.

Here if we want to load different tables then use different query


transforms like DEPT & EMP as shown in the 1st screenshot and drag the
required fields for the table.
Here DEPT table is master table while dragging fields we have to use
distinct as it was combination of EMP & DEPT data .

I hope you will understand this .

Thanks & Regards,

Ramana.

Like 0 | Share

Kumari Varsha
September 2, 2014 at 11:19 am

Thanks Ramana,now understand

Like 0 | Share

Kumari Varsha
September 26, 2014 at 11:30 am

Hi, Venkata

Please help me out.


Input

Atlas_Id Sr_id
X/P01/ZOOMAR UK Zoomarine -One of it’s Kind%Ticket Only

Output
Field1 Field2 Filed3 Sr_id
X PO1 ZOOMAR UK Zoomarine One of its Kind Ticket
Only

Like 0 | Share

Venkata Ramana Paidi


September 27, 2014 at 10:03 am
Hi Varsha,

I am not clear about your question. You are asking related to XML or logic
for conversion from input to output.

In your input you have two fields and you are splitting first field into 3
fields based on delimiter "/". You can use word_ext function to splitting
the single column into multiple columns based on delimiter.

Field1= word_ext(Atls_Id,1,'/');

Field2= word_ext(Atls_Id,2,'/');

Field3= word_ext(Atls_Id,3,'/');

Thanks & Regards,

Ramana.

Like 0 | Share

Kumari Varsha
September 29, 2014 at 4:56 am

Hi..Good Morning,Venkata Thanks..

Like 0 | Share

Paras Singh
April 8, 2020 at 2:45 pm

Hi Venkata,

That was such a useful information by you. Thank you

I have a small doubt. When i am importing xsd in BODS, it is unable to parse and throws the following error-

XML Parser failed: Error:<namespace....namespace' is referenced without import declaration.


I searched it and find that the namespace schema file should be present in the same directory as the xsd
file.. I did that but still facing the same issue.

Can you please help?

Like 0 | Share

Find us on

Privacy Terms of Use

Legal Disclosure Copyright

Trademark Cookie Preferences

Newsletter Support

You might also like