
Hello everyone,
I hope everything is all right and well. In my previous articles, I shared with you how to create some scenarios on PI/PO without using ESR objects. I will show you how to convert the XML structure sent via SOAP or Proxy to CSV format this time. Unlike the previous examples, we will create ESR objects this time, but we will not write any code as in the previous examples.
While doing these operations, we will use Message Transform Bean again. You can find a few blogs about this on the internet, but Mr. Engswee's blogs are the more understandable ones I have read so far. You can access his blog about Message Transform Bean below:
We have no problem sending data in XML structure as Soap or Proxy. That's why we won't use any special methods when creating ESR objects.
There are some points I want to mention here :
Below you can find the example data in XML structure:
<Record>
<Necropolis>Power Lich</Necropolis>
<Inferno>Efreet Sultan</Inferno>
<Castle>Crusader</Castle>
<Dungeon>Minotaur King</Dungeon>
<Stronghold>Ancient Behemoth</Stronghold>
<Tower>Titan</Tower>
<Conflux>Magma Elemental</Conflux>
<Fortress>Greater Basilisk</Fortress>
<Rampart>Gold Dragon</Rampart>
<Neutral>Azure Dragon</Neutral>
</Record>
First of all, what we need to do is to create ESR objects. The first important part is to create a Data Type :
The second important part is that while service interfaces are defined, they must be asynchronous:
After the ESR objects are created, we need an SFTP Receiver channel that can convert the XML structure into CSV format.
We chose Units as the file name :
From here, we go directly to the Module tab without making any changes (We did not use ASMA in this service). Then, by entering the following module and parameters in the module tab, we perform format conversion on the SFTP receiver channel:
Below you can find the modules and parameters we used:
1 localejbs/AF_Modules/MessageTransformBean Local Enterprise Bean <XML2Plain>
2 localejbs/ModuleProcessorExitBean Local Enterprise Bean exit
<XML2Plain> Transform.Class com.sap.aii.af.sdk.xi.adapter.Conversion
<XML2Plain> Transform.ContentType text/xml;charset=utf-8
<XML2Plain> xml.addHeaderLine 1
<XML2Plain> xml.conversionType SimpleXML2Plain
<XML2Plain> xml.fieldNames Necropolis,Inferno,Castle,Dungeon,Stronghold,Tower,Conflux,Fortress,Rampart,Neutral
<XML2Plain> xml.fieldSeparator ;
<XML2Plain> xml.processFieldNames fromConfiguration
exit JNDIName deployedAdapters/com.sap.aii.adapter.sftp.ra/shareable/com.sap.aii.adapter.sftp.ra
After the procedures here, our file will be converted to CSV format. After these steps, an Integrated Configuration is created.
There are some points I want to mention here :
After these steps, our CSV file will be created without any problems.
Below you can see our file converted to CSV format:
Thus, we can easily convert XML data to CSV format without using any code.
Thank you, have a great day!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
4 | |
3 | |
2 | |
2 | |
2 | |
2 | |
1 | |
1 | |
1 |