Customised module for reading Excel files.

Hi Gurus,
I have to develop a customsed java module for reading Excel files from PI. I downloaded NWDS 7.31 from following location NWDS Download links - Java Development - SCN Wiki. I have installed it on my local laptop. For developing the module I need following Jar files.
com.sap.aii.af.ms.svc_api
com.sap.aii.proxy.svc_api.jar
com.sap.aii.sec.svc_api.jar
com.sap.aii.utilxi.server.jar
com.sap.aii.utilxi.core.jar
com.sap.xi.mapping.tool.lib_api.jar
sap.com~tc~bl~txmanagerimpl~plb~impl.jar
sap.com~tc~je~appcontect_api~API.jar
com.sap.aii.af.cpa.svc.api
com.sap.aii.af.lib.mod
com.sap.aii.af.ms.ifc_api
com.sap.aii.af.svc_api
com.sap.xpi.ib.mapping.lib
1. Where can i get these jar files. I checked these files in my downloaded NWDS 7.31  package, but cold not find them.
Thanks in advance

Hi.
Check this thread.
Where to get the libraries for XI development - Process Integration - SCN Wiki
Regards
Lucho

Similar Messages

  • Adapter module to read excel file -java code required for PI 7.1

    Hi PI experts,
    I am working on PI 7.1 SP 08.
    I am trying to develope an adapter module to read excel file
    http://wiki.sdn.sap.com/wiki/display/ABAP/AdapterModuleToReadExcelFilewithMultipleRowsandMultiple+Columns
    but here in this wiki , given java code is for pi 7.0 and it is using jar file from PI 7.0
    I tried with using corresponding PI 7.1 files
    com.sap.aii.af.lib.mod.jar:
    sap.comtcloggingjavaimpl.jar:
    com.sap.aii.af.svc_api.jar:
    com.sap.aii.af.cpa.svc_api.jar:
    com.sap.aii.af.ms.ifc_api.jar:
    jave program is not throwing any error in NWDS but After deploying file on server.
    i am getting this errot in communication channel
    2009-12-15 15:47:08 Information AO: Now calling the Convert Method to convert Excel to XML.
    2009-12-15 15:47:08 Error MP: exception caught with cause javax.ejb.TransactionRolledbackLocalException: nested exception is: java.lang.RuntimeException: java.lang.UnsupportedClassVersionError: Bad version number in .class file; nested exception is: javax.ejb.EJBException: nested exception is: java.lang.RuntimeException: java.lang.UnsupportedClassVersionError: Bad version number in .class file; nested exception is: javax.ejb.EJBTransactionRolledbackException: nested exception is: java.lang.RuntimeException: java.lang.UnsupportedClassVersionError: Bad version number in .class file; nested exception is: javax.ejb.EJBException: nested exception is: java.lang.RuntimeException: java.lang.UnsupportedClassVersionError: Bad version number in .class file
    since i am not a JAVA expert so i am unable to resolve this error
    if some one has already deployed this module for PI 7.1, then please provide me java code for PI 7.1
    Thanks
    sandeep sharma

    hi,
    please try this:
    obj = inputModuleData.getPrincipalData();
    msg = (Message) obj;
    amk = new MessageKey(msg.getMessageId(),msg.getMessageDirection());
    XMLPayload xpld = msg.getDocument();
    Workbook wb = Workbook.getWorkbook((InputStream) xpld.getInputStream());
    xmldata ="<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n"+ "<ns0:"msgType" ""xmlns:ns0=\""nameSpace+"\">";
    Cell[] cells ;
    Cell[] cellNames ;
    cellNames = wb.getSheet(0).getRow(0);
    for(int j=1;j<wb.getSheet(0).getRows();j++)
    xmldata = xmldata+"<Record>";
    cells = wb.getSheet(0).getRow(j);
    for(int i=0;i<wb.getSheet(0).getColumns();i++)
    xmldata = xmldata"<"cellNames<i>.getContents()">"cells<i>.getContents()"</"cellNames<i>.getContents()+">";
    xmldata = xmldata+"</Record>";
    xmldata = xmldata"</ns0:"msgType+">"; 
    wb.close();
    byte byt[] = xmldata.getBytes();
    xpld.setContent(byt);
    inputModuleData.setPrincipalData(msg);
    Thanks,
    Mayank

  • Open data set for reading excel file on application server in back ground

    open data set for reading excel file on application server in back ground

    hi Vijay,
    I am afraid you won't be able to read from Excel file on Appl. Server.
    ec

  • Java API for reading Excel Files.

    Hi,
    Can you please suggest me any api for reading excel files.
    Right now i am using jxl.jar for this purpose but i am searching for an open source java api better than this.
    Whether POI gives better than this ?
    Thanks,
    Amit Shah.

    Can you please suggest me any api for reading excel
    files.
    Right now i am using jxl.jar for this purpose
    but i am searching for an open source java api better
    than this.
    Whether POI gives better than this ?i don't know about jxl but poi has several features which an excel can contain and it has been vastly improved in the past few versions.

  • Jar files required to read excel file in SAP PI 7.3.1 sp09 dualstack

    Hi experts,
    I need to read excel file (.xls) using SAP PI and process it to target system. I have read blogs
    and found that there are 2 ways to read an excel file in PI using file adapter.
    1) Developing a custom adapter module
    2) Using XSLT code.
    So in order to develop a custom adapter module, i have followed the following blogs
    **************** - XI - Step-by-step guide to develop Adapter Module to read Excel file
    and
    Excel Files - How to handle them in SAP XI/PI (The Alternatives)
    and
    http://wiki.scn.sap.com/wiki/display/ABAP/Adapter+Module+To+Read+Excel+File+with+Multiple+Rows+and+Multiple+Columns
    I am unable to find the jar files in SAP PI at OS level as per the first blog(think they were obsolete).
    Please let me know
    1) What are the required jar files needed to read excel file and their location
    2) Even if i use the old jar files as mentioned in the first blog can i achieve my requirement
    3) Following this blog Convert incoming XML to Excel or Excel XML – Part 1 - XSLT Way if i apply the same logic at sender side, will it work? Because through case studies i came to know that we cannot read a .xls file using XSLT code. Correct me if i am wrong.
    Looking for your valuable suggestions.
    Regards
    Shilpa

    Hi Shilpa
    Welcome to SCN!
    The blog you refered to might be for previous versions of PI. You can refer to the following two wikis to find out what are the relevant JAR files for PI 7.3 and also how to get them.
    XI libraries for development - Process Integration - SCN Wiki
    Where to get the libraries for XI development - Process Integration - SCN Wiki
    It also looks like for newer versions, you might not need to manually get and add those JAR files into your NWDS project - please refer to the first comment on the blog below. I have not tried it personally as I'm not using the latest NWDS, but you can try that first, and if it does not work, then go get them manually.
    PI 7.4 - Adapter Module Creation using EJB 3.0
    Do note that you should be using the JAR files that is corresponding to your PI server version.
    As for your third question, that does not apply to you. XLS is the older non-XML format, and therefore cannot be read by XLST since it is in binary format.
    Rgds
    Eng Swee

  • Adapter Module (Reading Excel File)

    Hi Guys,
    I followed the Webblog : Read Excel instead of XML through FileAdapter
    For File Adapter Module Development , for reading Excel Sheet.
    Deployment all went fine and when i used in my configuration , file is getting picked up but the xml content is not getting displyed , it says not well formated.Below error is shown in the CC Monitor
    The XML page cannot be displayed
    Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.
    XML document must have a top level element. Error processing resource 'http://pxxxxx:50xxx/mdt/messagecontentservlet?att...
    My coding in nwds
              xmldata =   "<?xmlversion="1.0"encoding="UTF-8"?>
                             + "<ns:"+wb.getSheet(0).getCell(0, 0).getContents() +"xmlns:ns=""
                             + wb.getSheet(0).getCell(1, 0).getContents() + "">"
                             + "<Name>"+ wb.getSheet(0).getCell(1, 2).getContents()
                             + "</Name>" +"</ns:" wb.getSheet(0).getCell(0, 0).getContents()">";
    Kindly suggest if any
    srini
    Edited by: Venkateswarlu Srinivas on Jul 4, 2008 2:47 PM

    try removing the \n you have added in the string

  • Error reading excel file using POI.

    Hi ,
    I am having some problem when reading the excel file.
    While reading excel file I am getting error-java.io.IOException: Unable to read entire block; 4 bytes read; expected 512 bytes.
    part of my code:-
    InputStream stream = objFormFile.getInputStream();
    POIFSFileSystem fs = new POIFSFileSystem(stream);//getting above error here.
    HSSFWorkbook wb = new HSSFWorkbook(fs);
    Case 1:
    I download the file on the system ,save it ,and then directly upload it to the system ,I get the above error .
    Case 2:
    It works fine if I download the excel and manually open and save it and then upload it .
    I am using JDK1.4.1 and poi-2.5.1-final-20040804.jar.
    Can any one please help me out for the above problem?
    Edited by: hruday on Jul 31, 2008 3:20 AM

    Instead of using POIFSFileSystem, try to directly create the HSSFWorkbook
    InputStream stream = objFormFile.getInputStream();
    //POIFSFileSystem fs = new POIFSFileSystem( stream );//getting above error here.
    HSSFWorkbook wb = new HSSFWorkbook( stream );

  • How to read Excel file in java

    Respected sir/madam
    I want to read the values from Excel file in Java program. How can I do that. When I searched over the net I came to know that you can treat Excel file as a Database and write the code as u write for making DB connections .
    I did that but i am getting the following error ..can anybody please help..
    This is the code what i have written
    import java.io.*;
    import java.sql.*;
    public class ReadExcelFile {
    Connection c;
    Statement stmnt;
    public void checkABA_Number()
    try
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    c = DriverManager.getConnection("jdbc:odbc:ExcelTest","",""); // ExcelTest is the DSN name
    stmnt = c.createStatement();
    ResultSet rs = stmnt.executeQuery("select * from abadata"); // abadata is my Excel file name
    while(rs.next())
    System.out.println(rs.getString(1)+" "+rs.getString(2));
    }catch(Exception e)
    System.out.println(""+e.toString());
    finally
    try
    stmnt.close();
    c.close();
    catch( Exception e )
    System.err.println( e );
    public static void main(String[] args)
    new ReadExcelFile().checkABA_Number();
    My Excel file starts from the first row and first column and also the first row contains the names of the column.
    It give me the following error..
    java.sql.SQLException: [Microsoft][ODBC Excel Driver] The Microsoft Jet database engine could not find the object 'abadata'. Make sure the object exists and that you spell its name and the path name correctly.
    How can I deal with this.?I have properly selected the worksheet while giving the DSN . Is there any versionig problem with Excel or some drivers are in appropriate..and yes i chose Microsoft Excel Driver (.xsl) from ODBC .
    I created System DSN.
    Can anybody please help me with this ? I will be very gratefull for replies
    Thanks in advance

    here is the code to read excel file
    public void readexel(String filename)
    Connection c = null;
    Statement stmnt = null;
    try
    Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver" );
    c = DriverManager.getConnection("jdbc:odbc:Driver={Microsoft Excel Driver (*.xls)};DBQ=" + filename);
    stmnt = c.createStatement();
    String query = "Select * from [Sheet1$]" ;
    ResultSet rs = stmnt.executeQuery( query );
    while( rs.next() )
    System.out.println( rs.getString(1) );
    catch( Exception e )
    System.err.println( e );
    }

  • Error while reading excel file from application server into internal table.

    Hi experts,
    My requirement is to read an excel file from application server into internal table.
    Hence I have created an excel file fm_test_excel.xls in desktop and uploaded to app server using CG3Z tcode (as BIN file type).
    Now in my program I have used :
    OPEN DATASET v_filename FOR INPUT IN text mode encoding default.
    DO.
    READ DATASET v_filename INTO wa_tab.
    The statement OPEN DATASET works fine but I get a dump (conversion code page error) at READ DATASET statement.
    Error details:
    A character set conversion is not possible.
    At the conversion of a text from codepage '4110' to codepage '4103':
    - a character was found that cannot be displayed in one of the two
    codepages;
    - or it was detected that this conversion is not supported
    The running ABAP program 'Y_READ_FILE' had to be terminated as the conversion
    would have produced incorrect data.
    The number of characters that could not be displayed (and therefore not
    be converted), is 445. If this number is 0, the second error case, as
    mentioned above, has occurred.
    An exception occurred that is explained in detail below.
    The exception, which is assigned to class 'CX_SY_CONVERSION_CODEPAGE', was not
    caught and
    therefore caused a runtime error.
    The reason for the exception is:
    Characters are always displayed in only a certain codepage. Many
    codepages only define a limited set of characters. If a text from a
    codepage should be converted into another codepage, and if this text
    contains characters that are not defined in one of the two codepages, a
    conversion error occurs.
    Moreover, a conversion error can occur if one of the needed codepages
    '4110' or '4103' is not known to the system.
    If the conversion error occurred at read or write of  screen, the file
    name was '/usr/sap/read_files/fm_test_excel.xls'. (further information about
    the file: "X 549 16896rw-rw----201105170908082011051707480320110517074803")
    Also let me know whether this is the proper way of reading excel file from app server, if not please suggest an alternative .
    Regards,
    Karthik

    Hi,
    Try to use OPEN DATASET v_filename FOR INPUT IN BINARY mode encoding default. instead of OPEN DATASET v_filename FOR INPUT IN text mode encoding default.
    As I think you are uploading the file in BIN format to Application server and trying to open text file.
    Regards,
    Umang Mehta

  • Function module for transfering a file contents into another?

    Hi all,
       Is there a Function module for transfering a file contents into another?That is the whole content from a file to other??
    Regards,
    Shashank.

    Hi,
    I think there is no such FM. You need to read the data in internal table and then write it in another file.
    Regards,
    Atish

  • Java Module for changing the file's name

    Hi all
    I m developing a java module for altering a file's name. I m trying to append system date and time to the file name and send it back. I was successful in retrieving the file's name, appending date n time in it but now I want to send it back. How can I achieve this ? any pointers will be very helpful
    awaiting your reply
    Regards
    Kapil

    String SIGNATURE = "process(ModuleContext moduleContext, ModuleData inputModuleData)";
              TRACE.entering(SIGNATURE, new Object[] { moduleContext, inputModuleData });
    //          Access the XI message. I.e. this module must be placed in the module chain
               // behind a module that sets an XI message as principal data.
               Object obj = null;
               Message msg = null;
               try {
                         obj = inputModuleData.getPrincipalData();
                         msg = (Message) obj;
                        Message msgg = (Message)inputModuleData.getPrincipalData();     
                        AuditMessageKey amk = new AuditMessageKey(msgg.getMessageId(), AuditDirection.INBOUND);               
                        Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, "RenameFile: Module Called");
    //               Read the channel ID, channel and the module configuration
                         String cid  = null;
                         String mode = null;
                         String fileName = null;
                         try {
                              // CS_GETMODDAT START
                              mode = (String) moduleContext.getContextData("mode");
                              // CS_GETMODDAT END
                              // CS_GETCHADAT START
                              cid  = moduleContext.getChannelID();
                              Channel channel = new Channel(cid);
    //                          channel = (Channel) LookupManager.getInstance().getCPAObject(CPAObjectType.CHANNEL, cid);
                              // Example to access a channel configuration parameter in a module: String someParameter = channel.getValueAsString("YourAttributeName");
                              // CS_GETCHADAT END
    //                         Hashtable mp = (Hashtable) inputModuleData.getSupplementalData("module.parameters");
    //                           if(null != mp)
    //                                 fileName = (String)mp.get("FileName");
    //                                 fileName = fileName + todaysDate;
    //                                 mp.put("FileName",fileName);     
                             fileName = channel.getValueAsString("file.targetFileName");
                             Date todaysDate = new Date(System.currentTimeMillis());
                             fileName = fileName + todaysDate;
                             Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, "RenameFile: fileed" + fileName);
                              if (mode == null) {
                                   TRACE.debugT(SIGNATURE, "Mode parameter is not set. Switch to 'none' as default.");
                                   mode = "none";
                              TRACE.debugT(SIGNATURE, "Mode is set to {0}", new Object[] {mode});
                         } catch (Exception e) {
                              TRACE.catching(SIGNATURE, e);
                              TRACE.errorT(SIGNATURE, "Cannot read the module context and configuration data");
                              ModuleException me = new ModuleException(e);
                              TRACE.throwing(SIGNATURE, me);
                             Audit.addAuditLogEntry(amk, AuditLogStatus.ERROR, "Rerrrd" + me);
                              throw me;
    //               try{
    //                  Hashtable mp = (Hashtable) inputModuleData.getSupplementalData("module.parameters");
    //                  String fileName = null;
    //                  Date todaysDate = new Date(System.currentTimeMillis());
    //                  if(null != mp)
    //                       fileName = (String)mp.get("FileName");
    //                       fileName = fileName + todaysDate;
    //                       mp.put("FileName",fileName);     
    //                  inputModuleData.setSupplementalData("module.parameters", mp);
    //               }catch(Exception e){
               } catch (Exception e) {
                    TRACE.catching(SIGNATURE, e);
                    if (obj != null)
                         TRACE.errorT(SIGNATURE, "Input ModuleData does not contain an object that implements the XI message interface. The object class is: {0}", new Object[] {obj.getClass().getName()});
                    else
                         TRACE.errorT(SIGNATURE, "Input ModuleData contains only null as XI message");
                    ModuleException me = new ModuleException(e);
                    TRACE.throwing(SIGNATURE, me);
                    throw me;
              return inputModuleData;
    Please refer the above code, it might help you to understand what i m trying to do. I have also included some code that is in comments which I tried by referring the links given by other users but its nt working. Please tell me how to improve my code to set the filename into the <b>reciever file adapter</b>.
    Regards
    Kapil

  • How to download module for opening raw files from D80o. I have CS6

    How to download a module for opening raw files from Nikon D800? I just bought a CS6 not containing this possibility

    Adobe Camera RAW 6.7 and upwards support Nikon D800 RAW files.
    You can download Adobe Camera Raw (ACR) 7.1 from here:
    http://www.adobe.com/support/downloads/detail.jsp?ftpID=5390 - Mac
    http://www.adobe.com/support/downloads/detail.jsp?ftpID=5391 - Windows
    Download & Install it. You can open RAW from D800.

  • Reading excel files in real time

    Hello,
    I would like to have a labVIEW program which permits to read several excel files, and collect all data in a single excel file.
    I know that it is possible to write a program which can read multiple files.
    But I would like to know that if its possible to read files in a real time:
    for ex. each time there is a new excel file to read, the LabVIEW program read it automatically and add its data to the final file?
    Thank you and bests regards

    As Sam notes, it is certainly possible to merge Excel Files (I've done it, myself).  An oft-repeated Best Practice for Program Development, which I didn't understand nor start following until quite recently, is "Write the Documentation First".  In this case, you want to think carefully (and specify in a Document, which tends to "clarify your thinking") a number of issues:
    Where will you look for the Excel Files to be merged?  [Hint -- it's much easier if they are all in the same Folder).
    Where will you save the Merged File?  Will it be in the same Folder as the Source Files?
    How will the Merged File be named?  This can have an interaction effect with the previous points.
    What is the structure of the Source, and of the Merged, File?  Is it "obvious" how the Merge is to take place?
    Related to #4, are there Headers?  Multiple WorkSheets?
    How do you know when it is time to Merge?  Are you checking for new files periodically?  How often?
    In some ways, these "structure" questions are trickier to design and thornier to deal with than simply reading data from two Excel Files and writing the data to a third (which I'm calling a Merge).  Note that I'm assuming that you are really dealing with Excel files (.xls, .xlsx), for which I recommend using the Report Generation Toolkit.  If you are speaking about Comma-Separated Variable (.csv) files that LabVIEW calls "Spreadsheets", the above questions are still mostly relevant, but your approach will be a little different.
    Write yourself a Document, show it to us, and if you have ideas on how to do this, give it a try and show us your code -- we'll try to provide assistance if you "get stuck".
    Bob Schor

  • Read Excel file path in WD

    Hi,
    We want to read a excel file. For that we are using file upload UI element and HSSF POI to read excel file. The code to read the excel file is working fine in standalone. In standalone we are hardcoding the file path. But in WD application, we are not hard coding it.
    We are using following code to supply the file name to HSSF code through  file upload UI:
    try
             InputStream in = new FileInputStream(wdContext.currentContextElement  
                                               ().getFileResource());
             wdComponentAPI.getMessageManager().reportSuccess("IN "+in);
             HSSFWorkbook wb  = new HSSFWorkbook(in);
    catch (Exception e)
         wdComponentAPI.getMessageManager().reportSuccess("ERROR in HSSF");
    Where FileResource is a context variable binded with property "data" of FileUpload UI element.
    Now, the problem is that the excel file is not getting read. We are getting ERROR in HSSF message.
    Please help in reading the file path.
    Regards,
    Vaibhav

    Hi,
       Try this:
    InputStream in = wdContext.currentContextElement().getFileResource().read(false);
    Regards,
    Satyajit.

  • Open module for managing property file and environment variables

    Looking for an open module for managing property files and environment variables (like CLASSPATH) set in a shell script. For handeling properties (preserving comments, supporting includes, appending new entries, and more) I have looked at SuperProperties from openadaptor but find certain functionality lacking. As for interfacing with common shell scripts/files containing setting for CLASSPATH, JAVA_HOME, other system/application variables another type of object editor is needed. Maybe JFIG?
    Any ideas are greatly welcomed.

    You seem wright, you hit a brick wall here with Air to find the location
    of the command console on windows...
    So in fact I never build an exe tool, but this little problem was a nice
    case to test it and I tried it.:
    I downloaded monodevelop
    -GTK# for .NET 2.12.10*
    -MonoDevelop 2.4.2*
       from http://monodevelop.com/Download
    created a console project and had an exe in 5 minutes !
    You can download the findconsole tool and the projectfiles here:
       http://greencollective.nl/temp/dump/findconsole_monoproject.zip
    findconsole.exe will reveal the path/location of cmd.exe on a windows system.
    Cheers,
    Latcho

Maybe you are looking for