on 07-03-2015 11:16 AM
You can use the UDF (User Defined Function) XSLT mapping to convert any Excel (.xlsx) file into .csv format in SAP PI/XI.
The steps to use XSLT mapping for the conversion are as follows:
1. Create an Interface in SAP PI/XI with the file adapter.
2. Edit the interface and double-click on the Graphical mapping editor and select XSLT Mapping as the transformation mode.
3. Create the XSLT mapping program. The program should contain the logic to convert the Excel (.xlsx) file into the .csv format.
4. Once the XSLT mapping is complete, save and activate the mapping program.
5. Execute the interface to start the conversion process.
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.
Hi Sateesh,
Now Getting below error in sender comm channel
Time Stamp | Status | Description |
---|---|---|
2015-07-06 16:30:50 | Success | Send binary file "storeXL.xlsx" from FTP server "082.163.0033.13320:/homeUser/STORE_DATA/test_SENDER/", size 12004 bytes with QoS EO |
2015-07-06 16:30:50 | Error | Attempt to process file failed with com.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException: Object not found in lookup of ExceltoXML. |
2015-07-06 16:31:00 | Success | Send binary file "storeXL.xlsx" from FTP server "082.163.0033.13320:/homeUser/STORE_DATA/test_SENDER/", size 12004 bytes with QoS EO |
2015-07-06 16:31:00 | Error | Attempt to process file failed with com.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException: Object not found in lookup of ExceltoXML. |
Hi Sateesh,
I didnt get you " <jndi-name> name in ejb.j2ee-engine.xml". You mean in Excel_ModuleJavaCode.txt.zip
Below is myconfigurations:
Hi Sateesh,
Shoul we need to do all the steps mentioned in http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c0b39e65-981e-2b10-1c9c-fc3f8e674...
Looks totally complicated and involves basis kind of work.
Hi Sateesh,
So you mean to say the custom module should be created and implement all the steps mentioned in below link.
Am I right correct me If I'm wrong.
Hi Rajesh,
The above link is for your reference for how to create & deploy a custom module and code should be used from "A Simple approach in Reading Excel File".
Regards,
Sateesh.
Thanks alot Sateesh. Hope so it will work fine and data movements flow smoothly.
I have did all the steps except below link which involves basis support to do it.
Hi Rajesh,
I think its better to use XSLT mapping....
If u want to work with Excel in a file to file scenario XSLT is a best option.
Regards,
Srikanth Mavuri.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Srikanth,
Please check below code so that I can import archive in IR.
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="
htttp://EXCEL2CSV.com/xi/StoreConversion" xmlns:ns0="htttp://EXCEL2CSV.com/xi/StoreConversion">
<xsl:template match="/">
<ns0:mt_store_receiver>
<xsl:for-each select="ns0:mt_store/RECORD">
<RECORD>
<HEADER>
<xsl:element name="KEY" select ="KEY"/>
<xsl:value-of select="KEY" />
<xsl:element name="WEEK" select ="WEEK"/>
<xsl:value-of select="WEEK" />
<xsl:element name="STORE_CODE" select ="STORE_CODE"/>
<xsl:value-of select="STORE_CODE" />
.
.
.
.
</HEADER>
</RECORD>
</xsl:for-each>
</ns1:mt_store_receiver>
</xsl:template>
</xsl:stylesheet>
Hi Rajesh,
follow these links...
http://www.wikiguga.com/topic/b251c058f3de880f5a37c59df51587ed
http://www.wikiguga.com/topic/b251c058f3de880f5a37c59df51587ed
use above link how to read excel file at sender side.
Regards,
Srikanth Mavuri.
Hi Experts,
Please provide your inputs.
Many 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.
Hi Rajesh,
As per my understanding, CallSapAdapter module's position should be in the end. I tried a similar scenario where I used PayloadZipBean with CallSapAdapter and ran into issues.
Also, please note that PayloadZipBean do not work when you are uploading zip files in AL11 directories. There is some encoding issues.
Thanks,
Arkesh
Hi Rajesh,
CallSapAdapter is a default module and is part of File Adapter. If you remove it then it may cause problems.
If there is a proper excel file then you either use Java Mapping or XSLT mapping to achieve your requirement. In my case, we achieved Excel to XML conversion using Java Mapping.
There are lot of codes available on the internet which can help you achieve that. You just need to search for it and then put it in the right format acceptable by PI. Unfortunately, I do not have the code with me otherwise would have shared it with you. But we did it by searching and then fixing the bugs in NWDS. You can also use Eclipse for this purpose.
On the target side you can use the FCC and save it as CSV file. That would help you solve the problem on the target side.
Regards,
Arkesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rajesh,
In the first glance, I can see that it is a File adapter and so there should be a "CallSapAdapter" module used by default. I do not see in your snapshot so I am assuming that it has been removed.
Please include it in your list of modules.
Also, you need to maintain the order of the modules. After performing all conversions by the other modules, please use the CallSapAdapter module at the end.
Thanks,
Arkesh
Hi Arkesh,
Custom_AF_Modules/FormatConversionBean is throwing an error as mentioned abovee.
Now I have used only below modules in processing sequence and no parameter value mentioned at module configuration module.
AF_Modules/PayloadZipBean 1
CallSapAdapter 3
localejbs/CallSapAdapter 5
Getting below error at sender comm channel:
2015-07-06 15:45:13 | Success | Trying to put the message into the send queue. |
2015-07-06 15:45:13 | Success | Message successfully put into the queue. |
2015-07-06 15:45:13 | Success | The application sent the message asynchronously using connection File_http://sap.com/xi/XI/System. Returning to application. |
2015-07-06 15:45:13 | Error | Attempt to process file failed with java.lang.NullPointerException |
Hi Rajesh,
Kindly observe the error log closely.
As per the error log, you have to use "localejbs/Custom_AF_Modules/FormatConversionBean".
Instead you have used "Custom_AF_Modules/FormatConversionBean" in the processing sequence section. The part in the path "localejbs" is missing.
Kindly try that out if it works and let me know.
Kind Regards,
Souvik
Hi Souvik,
On Using "localejbs/Custom_AF_Modules/FormatConversionBean" module in Processing sequence and I didn't mention any parameter Name in Module configuration.
I'm Facing below error in comm channel:
Time Stamp | Status | Description |
---|---|---|
2015-07-07 11:32:10 | Success | Trying to put the message into the send queue. |
2015-07-07 11:32:10 | Success | Message successfully put into the queue. |
2015-07-07 11:32:10 | Success | The application sent the message asynchronously using connection File_http://sap.com/xi/XI/System. Returning to application. |
2015-07-07 11:32:10 | Error | Attempt to process file failed with com.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException: Path to object does not exist at Custom_AF_Modules, the whole lookup name is localejbs/Custom_AF_Modules/FormatConversionBean. |
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
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.