cancel
Showing results for 
Search instead for 
Did you mean: 

Source Data type creation for XML file having Header and line item

Former Member
0 Kudos

HI friends.

I want to have better understanding on Souce Data type creation.

Suppose I have Sales Order data coming from 3rd party in *XML* format.

1 Header, Multiple Line items.

I have created Two element in Complex date type.

1 Header(Element)

Field1

Field2

2 LiineItem(Element)

Filed 3

Field 4

How System would understand that data coming in XML file ,which record to put in Header element fields and all his line item to LineItem Element fields.

Again next header record goes to header and line item to his Lineitem Elment....

Please help me in making uderstanding to make this setup. If possible send me some step by step document...

Accepted Solutions (1)

Accepted Solutions (1)

VijayKonam
Active Contributor
0 Kudos

If your input file coming from the source is an XML you need to exactly used the same names as in the XML in PI datatypes. Otherwise, if it is a flat file, you would define the names in the content conversion on the file adapter and create the data type according to it.

In both the ways, the system understands where to put what, based on the field names.

VJ

Former Member
0 Kudos

Hi friend,

Absolutely agree if its aflat file we need to do setting in File content conversion and do key field setting...

But My doubt if its XML file coming from 3rd party.

My doubts:

1: Will the XI will understand the xml file as it is..or we need to make any modifications to it.

2: I think we don't have to do File content Conversion in case of XML.means no key field setting.

then in that case how PI system will understand to (byname) first record is header .and rest 4 are its line items.

and again 5 is header and rest are its line items.

As I said..

1-Header

1-LineItem

these both element I had made in same level.May be sound silly but.

baskar_gopalakrishnan2
Active Contributor
0 Kudos

> 1: Will the XI will understand the xml file as it is..or we need to make any modifications to it.

PI will understand XML.

You have to create your source message based on the incoming source XML message structure from your client. Or you create data type structure and pass it to your client to send XML according to your requirement.

>I think we don't have to do File content Conversion in case of XML.means no key field setting.

then in that case how PI system will understand to (byname) first record is header .and rest 4 are its line items.

and again 5 is header and rest are its line items

Dont need to create File content conversion if the client send XML.

Create example as below

Root node Input ( 1 to unbounded)

---> Header 1 to 1 occurence

---> LineItem 1 to 4 occurence

since we declared Input root node is 1 to many .. this is going to repeat .. so input would show header (1) and Lineitem (4) each time and repeats.

Former Member
0 Kudos

Hi,

you need to agree with the 3rd party how the xml is going to send by them...

based on that the xml needs to be created in PI....

1. PI will understand xml only(integration engine) ...Adapters take care of converting the data to XML formats..

2. XML will have root tag and under that different substructures will be there which can occur in multiple times. so application sending the data need to phrase the xml as described in structure..same as to be defined in PI..

for e.g <SalesOrderNotification>

<SalesOrder> (occurence will be 0..unbounded)

<header> (occurence is 1)

<items> (occurence will be 0..unbounded)

</SalesOrder>

</SalesOrderNotification>

Hope this clears your query..

Regards

Rajesh

Former Member
0 Kudos

Thanks Rajesh , you have cleared my major problem.

But still I have a doubt which I wanna clear..

I have created my strucuture for source..

MT_Source

<Sales Order>

Header 0-1

F1

F2

Item 0-unbound

F1

F2

</Sales order >

Suppose my fiel structure is like

<ns0:MT_source xmlns:ns0="https://tcsfenesta">

<SalesOrder>

<Header>

<CustId>315143</CustId>

<CustName>Deepak</CustName>

<Address>Sector14</Address>

</Header>

<Item>

<MaterialNo>11</MaterialNo>

<MaterialDescriptio>Potassium</MaterialDescriptio>

</Item>

<Item>

<MaterialNo>45</MaterialNo>

<MaterialDescriptio>calcium</MaterialDescriptio>

</Item>

</SalesOrder>

<SalesOrder>

<Header>

<CustId>22222</CustId>

<CustName>Puneet</CustName>

<Address>Sector21</Address>

</Header>

<Item>

<MaterialNo>55</MaterialNo>

<MaterialDescriptio>Lithium</MaterialDescriptio>

</Item>

<Item>

<MaterialNo>45</MaterialNo>

<MaterialDescriptio>barium</MaterialDescriptio>

</Item>

</SalesOrder>

</ns0:MT_source>

is this ok

abhay_rajhans2
Contributor
0 Kudos

Hi Deepak,

If the sender is sending the data in XML format then you can ask them to provide you the WSDL file.

You can use this WSDL file into external definition and that will help you for the source data structure means you do not need to create the source data structure directly use the external definition in the message mapping and you can define target data structure as per your requirement.

Former Member
0 Kudos

Hi,

Please change the structure as,

MT_Source

<Sales Order>(0..unbounded)

Header 0-1

F1

F2

Item 0-unbound

F1

F2

</Sales order >

Babu

Answers (2)

Answers (2)

sugata_bagchi2
Active Contributor
0 Kudos

Hi Deepak,

hlbabau is right. in your incoming file as you are receiving multiple sales order you have to create another parent node e.g-

<sales_order>. it should be 0.unbounded.

Generally it is a very common scenario .. Business usually sends Sales Order , Purchases Order in a Batch mode.

Thanks

Sugata

Former Member
0 Kudos

Hi Deepak,

I have a requirement to create CSV from XML file and my input XML has complex structure. I could not even get to the point where I can use integration repository to create data types, message types etc...I am stuck in first step i.e., creating "product" and "software component version" in SLD. After creating product and software componet version, when I tried to import software componet version by going to TOOLS>Transfer From System Landscape Directory>Import software component version in IR I am getting the error below.

Unable to read software component versions from SLD <server>:<port> (still working with BASIS on this)

Were you able to finish the above step successfully? I think this is the first step before going to IR and creating data types. Please correct me if I am wrong. Your feedback would be greatly appreciated.

Thanks.

Mithun