on 03-25-2009 7:23 PM
Is there a way to insert custom code to change the FCC comma delimited (.csv) into an Excel file in the receiver communication channel file adapter? If so, how do I do this in XI? Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I created my mapping using the SAP XI GUI mapping and used the File adapter's FCC comma delimited in the Receiver comm channel.
Is there a way to plug in custom code in XI to convert the comma delimited file to Excel before the File adapter FTPs the file to the target? Would I use the module to do this?
If changing the content type wouldn't work, what do you suggest? Is XSLT mapping the only way to create an Excel file from XML?
I already did my mapping using the SAP XI GUI so I would prefer to reuse this mapping rather than the XSLT mapping. How can I create an Excel file using the SAP XI GUI mapping?
Kristine,
I agree completely with Shabz on this.
But what exactly is your requirement? Do you need exactly the .xls(x) file as your output? If you dont care about this, then try saving the file with extension .csv By default the comma separated value file can be rendered in MS-Excel in separate columns.
Regards
Jai
well there are many java apis available that can help you create an excel file. So in that case you will ahve to use these apis in a module and manipulate your payload to get the desired output.
one such api is this - http://www.java-tips.org/other-api-tips/jexcel/how-to-create-an-excel-file.html
>
> The target can only handle Excel 2003. It cannot accept the .csv file.
> How would I go about creating the adapter module? Do I assume its going to be from the csv file then transform that message to Excel? Or will it be from the XML file generated by my SAP XI GUI mapping?
it would be the XMl created by the GUI mapping that will be input to the module
to create a module - https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3bdc14e1-0901-0010-b5a9-a01e29d7...
>>Do I assume its going to be from the csv file then transform that message to Excel? Or will it be from the XML file generated by my SAP XI GUI mapping?
It is really your choice here. If you want to convert the xml file to excel, then all you need is an adapter module that makes use of one of the Java APIs to do the trick. But if you want to convert the xml file to csv and then finally to a excel file, you can achieve this using standard sap adapter module (forgot the exact name, I guess it is XMLtoplain bean) I believe this option would be easier.
>
> It is really your choice here. If you want to convert the xml file to excel, then all you need is an adapter module that makes use of one of the Java APIs to do the trick. But if you want to convert the xml file to csv and then finally to a excel file, you can achieve this using standard sap adapter module (forgot the exact name, I guess it is XMLtoplain bean) I believe this option would be easier.
Ideally, I just want to convert the XML to Excel. Which way would be the better route to do this without having to use XSLT mapping because I want to reuse the SAP XI GUI mapping I already created.
Kristine,
I did not mean you to use XSLT mapping. You can write your adapter module that will either process the XML file (direct from your GUI Mapping) or CSV file (using GUI mapping again but passed through another standard adapter module that converts your xml file to csv) This method is preferable coz in your adapter module it will be easier for you to parse and get the fields.
Regards
Jai
>
> Kristine,
>
> I did not mean you to use XSLT mapping. You can write your adapter module that will either process the XML file (direct from your GUI Mapping) or CSV file (using GUI mapping again but passed through another standard adapter module that converts your xml file to csv) This method is preferable coz in your adapter module it will be easier for you to parse and get the fields.
>
> Regards
> Jai
Thanks Jai. I will try your recommendation from GUI mapping to CSV to Excel.
Can you please confirm if I understand the process correctly...
GUI Mapping -> Adapter Module 1 that converts XML to CSV -> Adapter Module 2 that converts CSV to Excel -> File Adapter (FTP)
Questions:
1. Is there a standard SAP XI adapter module that can do Module 1?
2. Is there a standard SAP XI adapter module that can do Module 2?
Please give me more information about the modules because I haven't used them before. Thank you for all your help!
Kristine
> GUI Mapping -> Adapter Module 1 that converts XML to CSV -> Adapter Module 2 that converts CSV to Excel -> File Adapter (FTP)
>
> Questions:
> 1. Is there a standard SAP XI adapter module that can do Module 1?
> 2. Is there a standard SAP XI adapter module that can do Module 2?
>
> Please give me more information about the modules because I haven't used them before. Thank you for all your help!
>
> Kristine
You flow should ideally be
GUI Mapping (XML) -> Adapter Module -> File adapter
Note modules are extensions to file adapter.
Ref:
How to create modules -
XI JAVA User Module Development using NWDI -
/people/community.user/blog/2007/12/21/xi-java-user-module-development-using-nwdi
>>Can you please confirm if I understand the process correctly...
GUI Mapping -> Adapter Module 1 that converts XML to CSV -> Adapter Module 2 that converts CSV to Excel -> File Adapter (FTP)
Your understanding is perfectly correct.
>>1. Is there a standard SAP XI adapter module that can do Module 1?
Yes. Take a look at the strictXMLtoplain bean. Ref:
http://help.sap.com/saphelp_nw70/helpdata/EN/44/748d595dab6fb5e10000000a155369/content.htm
>>2. Is there a standard SAP XI adapter module that can do Module 2?
No. This has to be your own custom developed adapter module.
Regards
Jai
Thank you very much for all your help. I decided to go the XSLT route.
Here are the steps I took to create an XSLT transformation in XI 3.0:
1. I created my source and target XSDs using XMLSpy.
2. I created the XSLT mapping from source to target in XMLSpy (referencing the souce XSD schema).
3. I created another XSLT mapping to format the target into Excel XML.
4. Import the source and target XSDs in the IR's External Definitions
5. Zip each XSLT mapping (.xls) and import it into the IR's Imported Archives
6. Reference the XSL mappings in the Interface Mapping
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.