Create An XML Schema in BODS - SAP Blogs
Create An XML Schema in BODS - SAP Blogs
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!
Former Member
April 8, 2013 | 2 minute read
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.
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
An approach to build Target file in Excel format in SAP BODS using XSL
By Titto Antony Sep 16, 2014
Related Questions
Error in Creating a XSD schema in BODS.
By Former Member Mar 20, 2012
18 Comments
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.
Like 0 | Share
Kumari Varsha
August 20, 2014 at 9:28 am
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
Like 0 | Share
Kumari Varsha
August 20, 2014 at 2:46 pm
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]
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)
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]
Like 0 | Share
Hi Varsha,
Your image looks like you are extracting the data from single nested xml
file and loading into the table.
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.
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
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.
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.
Ramana.
Like 0 | Share
Hi Neha,
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 .
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.
Ramana.
Like 0 | Share
Kumari Varsha
September 2, 2014 at 11:19 am
Like 0 | Share
Kumari Varsha
September 26, 2014 at 11:30 am
Hi, Venkata
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
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,'/');
Ramana.
Like 0 | Share
Kumari Varsha
September 29, 2014 at 4:56 am
Like 0 | Share
Paras Singh
April 8, 2020 at 2:45 pm
Hi Venkata,
I have a small doubt. When i am importing xsd in BODS, it is unable to parse and throws the following error-
Like 0 | Share
Find us on
Newsletter Support