cancel
Showing results for 
Search instead for 
Did you mean: 

Incoming XML file field issue at the Sender side

Former Member
0 Kudos

Hi Experts,

I have created a File-to-RFC scenario where we need to pick the incoming XML File from 3rd party POS system , Transform it in SAP PI and then Pass it to a RFC in SAP CAR system.

Sender    : POS System > Sends XML File  - File Adapter Used

Receiver : SAP CAR (DT&A) System - RFC - RFC Adapter Used

Issue : The file provided to us contains XML fields with additional data mentioned at every Node level. Sample Example Below :


SAMPLE :

                    <IsNotice dt:dt="ui1">1</IsNotice>       

                    <Op dt:dt="i4">2</Op>

                    <WkStn dt:dt="i4">1</WkStn>

                    <Tran dt:dt="i4">40</Tran>

                     Marked in Bold are the additional data coming in the incoming XML (dt:dt="ui1") .

My questions are :

1.) Can a file, with this format, be extracted by SAP PI from a source folder and converted to SAP PI understandable Soap-xml format so that we can get the incoming xml data to apply the transformation logic further ?

Note : On sender side, I am using File Adapter

If Yes, then

2.) how can we test it successfully, since I don't have OS level authorization/ Shared Folder Access or FTP tool to do the testing.

If No, then

3.) Is there a way to transform the incoming XML file into a simple XML file ?
e.g.

                   

                    <IsNotice>1</IsNotice>       

                    <Op>2</Op>

                    <WkStn>1</WkStn>

                    <Tran>40</Tran>    

Expectation : I want to check if the incoming XML file with additional data can be converted successfully at the Sender Adapter level(File Adapter) or do we need to follow a different approach here.

Please help.

Accepted Solutions (0)

Answers (3)

Answers (3)

xavisanse
Active Participant
0 Kudos

The field in question is called attribute. If you have developed the xml structure with a Data Type you can add this as attribute in the same data type.

Another way is use a tool to generate a XSD from XML as for example http://freeformatter.com/xsd-generator.html I usually used this to add an XSD for my XML files. (Keep in mind that if you have a node N times maybe you should change the cardinality of the XSD generated, or use some tricks as replicate the same node so online app detects that has a multiple cardinality)

Cheers

manoj_khavatkopp
Active Contributor
0 Kudos

Hi nitin,

Have you provided xsd file for the sender application which Is generating xml file or have they provided u an xsd, I would suggest take xsd from them and Create your mapping with that in that case even if they have these tags it works in mapping.

Can you Please provide the complete xml file to check further.

Br,

Manoj

Former Member
0 Kudos

Hi Manoj,

The client provided us with the XML Schema. The file is attached with this reply.

We tried creating xsd out of it using Altova tool and even by manual editing but the structure is incompatible with the one which we use in SAP PI xsd. As we can see, the additional xml tags in the field makes it difficult to import.

So we further decided to make a Data Type using the same xml schema.

Now the Data Type is in place along with the mapping.

But the problem which still remains is , whether the file can be processed successfully or not.

From Client side, XML schema is the only thing which we can get and it will be used as it is during runtime.

NOTE : XML Schema provided to us contains the structure as well as the Data in it.

My doubt is , if we can change it at Adapter level or do we need to deploy some other technique ?

Regards,

Nitin Balodhi

xavisanse
Active Participant
0 Kudos

Ok,

I think the problem is in a namespace prefix in each attribute. I suggest you use an anonymizer bean

SAPTechnical.COM - XML Anonymizer Bean in Communication Channel to remove namespace prefix in XML Pa...

Try with it

manoj_khavatkopp
Active Contributor
0 Kudos

Hi Nitin,

if third party is able to generate the XML then should have XSd you can ask the XSD and use the same no need of DT/MT.

Alternative  using XML   you can generate XSD and use it in mapping but you need to be careful about the fields which are not present in the current XML and also the occurrence of the nodes.

I gave a try using XML anonymizer bean but still the attribute remains after applying this module.

like : <OP dt="i4">2</Op>

Br,

Manoj

former_member186851
Active Contributor
0 Kudos

Hello Nitin,

why these additional Details are added in the XML tags?

Usually XML tags wont be like this.

Former Member
0 Kudos

Hi Raghuraman,

Its a default format in which client will be providing the data.

I asked the functional specialist the same question and the response was this that its the default format in which client will be providing the XML file to SAP PI and we need to process the file.

Now I don't know if this format can be translated by File Adapter to a Soap-Xml structure, which SAP PI understands.

Regards,

Nitin Balodhi

former_member186851
Active Contributor
0 Kudos

Hello Nitin,

Get the XSD from client, import the same and try using.