
Hello everyone,
I hope everything is all right and well. Since I was a junior, we have been asked many times by our customers to perform services that change file formats. Even though they are similar services, I had to find alternative solutions because the methods I used sometimes did not work. In some services, I had to combine different methods or services. In this scenario, I will show you how to convert CSV file sent via SFTP to XML format. Unlike the previous examples, this time we will create ESR objects, but we will not write any code as in the previous examples.
There are some points I want to mention here :
For example, let's say we have a CSV file named Units with the file content as follows:
We use message transform beans to convert our CSV file to XML format. You can find detailed technical information about this on Mr. Engswee's blog :
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 Sender channel that can convert the CSV format to into XML structure.
After entering SFTP information, ASMA settings are made as follows:
Here, we go directly to the module tab, just like in the other examples we have done. By entering the following parameters, we will perform XML conversions:
Below you can find the modules and parameters we used:
localejbs/Custom_AF_Modules/MessageTransformBean Local Enterprise Bean Plain2XML
localejbs/CallSapAdapter Local Enterprise Bean entry
Plain2XML Transform.Class com.sap.aii.messaging.adapter.Conversion
Plain2XML Transform.ContentType text/xml;charset=utf-8
Plain2XML xml.conversionType SimplePlain2XML
Plain2XML xml.documentName MT_TEST
Plain2XML xml.documentNamespace http://namespace/TEMPTEST
Plain2XML xml.documentsSkipFirstRows 1
Plain2XML xml.endSeparator 'nl'
Plain2XML xml.fieldNames Necropolis,Inferno,Castle,Dungeon,Stronghold,Tower,Conflux,Fortress,Rampart,Neutral
Plain2XML xml.fieldSeparator ;
Plain2XML xml.processFieldNames fromConfiguration
Plain2XML xml.structureTitle Record
After the procedures here, our file will be converted to XML format. After these steps, Integrated Configuration is created.
There are some points I want to mention here :
Thus, we can easily convert CSV file format to XML data 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 |
---|---|
6 | |
3 | |
3 | |
2 | |
2 | |
2 | |
2 | |
1 | |
1 |