EXCEL XML into XML - using MessageMapping

Hi
I have an XSLT that I use to convert an Excel XML into another XML format.
But I wonder if there a way to do this via the XI Message Mapping instead?. I have tried but I am stuck at the moment trying to identify particular rows. For instance I need to fill the <desc> tag from the 3rd Cell.
[code]
Original Excel data
       Cell1 Cell2   Cell3            Cell4   Cell5
Row1 | AY02  403KITA Concentrator Kit $91.00  22-01-2005
Row2 | AY02  401KITC Oxygen Reg/Flow  $65.00  08-09-2006
[/code]
Input Source file (a cut down version...)
[code]
<Workbook>
<Worksheet>
  <Table>
   <Row>
     <Cell>
        <Data>AY02</Data>
     </Cell>
     <Cell>
        <Data>403KITA</Data>
     </Cell>
     <Cell>
        <Data>Concentrator Kit</Data>
     </Cell>
     <Cell>
        <Data>$91.00</Data>
     </Cell>
     <Cell>
        <Data>22-01-2005</Data>
     </Cell>
   </Row>
   <Row>
     <Cell>
         <Data>AY02</Data>
     </Cell>
     <Cell>
         <Data>401KITC</Data>
     </Cell>
     <Cell>
         <Data>Oxygen Reg/Flow Portable</Data>
     </Cell>
     <Cell>
         <Data>$65.00</Data>
     </Cell>
     <Cell>
         <Data>08-09-2006</Data>
     </Cell>
   </Row>
   </Table>
</Worksheet>
</Workbook>
[/code]
Target XML
[code]
<Batch>
  <items>
    <item>
      <catlgItemNum>403KITA</catlgItemNum>
      <desc>Concentrator Kit</desc>
      <unitPrice>$91.00</unitPrice>
    </item>
    <item>
      <catlgItemNum>401KITC</catlgItemNum>
      <desc>Oxygen Reg/Flow Portable</desc>
      <unitPrice>$65.00</unitPrice>
  </item>
</items>
</Batch>
[/code]

Hi Peter,
Please create the following user-defined function (cache: context):
public static void getIndexedValue(
     String[] a,
     String[] b,
     ResultList result,
     Container container) {
     //write your code here          
     Integer iB = new Integer(b[0]);
     result.addValue(a[iB.intValue()]);
You can then set up the following mappings:
Row - item
Data (context Row) 
                      getIndexedValue - ...
Constant [1, 2, 3]  /
Best regards
Joachim

Similar Messages

  • Import Excel file into SQL, using bulk copy - date issues

    Hello. I have a VB project where I need to import multiple excel files with lots of rows and columns into SQL 2012. Currently the import is set up, using OleDbConnection and insert commands and it takes up to 10 minutes to process all the spreadsheets.
    I'm trying to switch the code to use SQLBulkCopy, but experienced issues with dates columns. Some rows have Null dates and those are interpreted as strings and won't import into SQL tables. Is there a way to format the column prior to import programmatically?
    Any advice is appreciated.
    Note -
    If I add column mapping and exclude all dates columns - import works fine. All excel files have date fields, excel files are reports from other vendor and change on weekly bases, manual formatting of the excel files prior to import are out of the question...
    The code is just basic:
    Public Sub ImportFormExcelSample()
    Dim ExcelConnection As New System.Data.OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\MyExcelSpreadsheet.xlsx;Extended Properties=""Excel 12.0 Xml;HDR=Yes""")
    ExcelConnection.Open()
    Dim expr As String = "SELECT * FROM [Sheet1$]"
    Dim objCmdSelect As OleDbCommand = New OleDbCommand(expr, ExcelConnection)
    Dim objDR As OleDbDataReader
    Dim SQLconn As New SqlConnection()
    Dim ConnString As String = "Data Source=MMSQL1;Initial Catalog=DbName; User Id=UserName; Password=password;"
    SQLconn.ConnectionString = ConnString
    SQLconn.Open()
    Using bulkCopy As SqlBulkCopy = New SqlBulkCopy(SQLconn)
    bulkCopy.DestinationTableName = "TableToWriteToInSQLSERVER"
    Try
    objDR = objCmdSelect.ExecuteReader
    bulkCopy.WriteToServer(objDR)
    objDR.Close()
    SQLconn.Close()
    Catch ex As Exception
    MsgBox(ex.ToString)
    End Try
    End Using
    End Sub
    The error I get is System.InvalidOperatiomException: The given value of type String from the data source cannot be converted to type date of the specified target column. System.FormatException: Failed to convert parameter value from String to a DateTime...
    Thank you!
    Alla Sanders

    Hi Alla,
    This issue might be caused because the field contains a NULL value, but the date/time columns in your table does not allow NULL values. Furthermore, please aslo take a look at "Data Type Issues" session in the article below:
    http://odetocode.com/blogs/scott/archive/2013/02/08/working-with-sqlbulkcopy.aspx
    Here is a similar thread about this topic for your reference, please see:
    http://social.technet.microsoft.com/Forums/sqlserver/en-US/2d99181c-fc2b-4caf-9530-3bd6ae1745f1/sqlbulkcopy-column-validation-not-working?forum=sqldataaccess
    If you have any feedback on our support, please click
    here.
    Regards,
    Elvis Long
    TechNet Community Support

  • Upload multiple excel files into tables using APEX

    Hi folks,
    I'm wondering if anyone has ever uploaded multiple .csv files simultaniously and store the data into the database using APEX XE before.
    I can browse for a single file, and execute that okay and a good example of doing that can be found at http://advait.wordpress.com/2008/05/21/uploading-excel-sheet-using-oracle-application-express-apex/
    This works fine when the user browses to a specific file on their network and then uploads the data from that one file.
    However I need the ability to 'grab' every file in a specific directory one after the other to process rather than having to specify which one to load everytime, and wondered if anyone has come across this before.
    Many thanks
    Graham.

    Just for completeness ...
    Got this to work, but it's a pl/sql issue as opposed to an APEX issue.
    Anyway, if anyone needs to have the ability to read multiple files then a quick easy way to do it (as lomg as they know the file names that will be read), is to create a directory on the database which points to the actual harddrive on your PC, then create a table (called an external table) and read from that external table as if it was an actual database table ...
    1 - Log on as sys and grant CREATE ANY DIRECTORY to whatever user you are logging in as (assuming you are not using sys to create apps)
    2 - Create a directory e.g....CREATE OR REPLACE DIRECTORY GB_TEST AS 'c:\gbtest';
    3 - Create an external table as ...
    CREATE TABLE gb_test
    (file_name varchar2(10),
    rec_date date
    rec_name VARCHAR2(20),
    rec_age number,
    ORGANIZATION EXTERNAL
    TYPE ORACLE_LOADER
    DEFAULT DIRECTORY GB_TEST
    ACCESS PARAMETERS
    RECORDS DELIMITED BY NEWLINE
    FIELDS TERMINATED BY ','
    LOCATION ('data1.csv','data2.csv','data3.csv','data4.csv')
    PARALLEL 5
    REJECT LIMIT 20000;
    That's it then ...
    select * from gb_test
    where file_name = 'xxx'
    will return all the data where the file_name = 'xxx'
    very easy to use.

  • Office 2013 x64 - Inserting Excel spreadsheet into OneNote

    Hi - I'm inserting an Excel Spreadsheet into OneNote, using the following commands (in OneNote):
    Insert > Spreadsheet > existing > (locate it) > insert Spreadsheet
    The Spreadsheet is inserted, but the "preview" below displays only upto the first 95 rows by 29 columns
    I only noticed this when I was exporting my TechNet Keys to XML, then into Excel, then Excel into OneNote, and noticed that the Spreadsheet preview only went down as far as "Visio Professional" i.e. it didn't show the rows with
    "Windows ... keys"
    Worse still, is that there seems to be no indication (eg. scrollbars), that Spreadsheet preview isn't showing all the data
    Is there any way to change this 95x29 cell preview? - I would like to see more rows (29 columns is way enough for me)  
    I've tried dragging the border, but that just resizes (zooms) the view
    I know I can click on the Excel icon, and open the Spreadsheet in Excel, and see all of it,
    but I like using the Spreadsheet preview (as it syncs to OneNote on my mobile, and is viewable without actually opening/editing the whole Spreadsheet)   
    - any ideas ?

    I realize this is an old post, but I came across it trying to solve the same problem and came up with a solution that might help others.  Hope it helps.
    If you define a Table in the spreadsheet, you can choose to display it in the OneNote and it will show the whole thing.  You can also define multiple Tables and choose to display them also.
    To create a Table in a spreadsheet:
    Highlight the area you want to show
    On the menu bar choose: Insert > Table
    Fill in a name (for example: TechNetKeys)
    Hit OK
    Save the spreadsheet and return to OneNote
    Right-click on the preview of the spreadsheet
    Choose "Select What to Display..."
    Uncheck "Display Everything"
    Uncheck "Sheet1" (assuming your Table is on Sheet1)
    Check "Sheet1 TechNetKeys"

  • Code to translate xml data into html using jaxp ?

    Hi all !!
    Could you please send me code to translate xml data into html using jaxp
    i am sending my xml file and xsl file
    its urgent
    my xml file is :
    <?xml version="1.0" encoding="UTF-8"?>
    <?xml-stylesheet type="text/xsl" href="scenario.xsl"?>
    <scenarioReport>
    <node name="node1">
    <netObjId>124 </netObjId>
    <result>undefined</result>
    <report>The cell is 124.</report>
    <action>qsdsqdqsd </action>
    </node>
    <node name="node 3">
    <netObjId>124 </netObjId>
    <result>undefined</result>
    <report>Result is unresolved because ...</report>
    <action>No action</action>
    </node>
    <node name="node 2">
    <netObjId>124 </netObjId>
    <result>undefined</result>
    <report>qsdqsdqs </report>
    <action>qsdsqd</action>
    </node>
    <node name="node 5">
    <netObjId>124 </netObjId>
    <result></result>
    <report> </report>
    <action> </action>
    </node>
    <node name="node 4">
    <netObjId>124 </netObjId>
    <result></result>
    <report> </report>
    <action></action>
    </node>
    </scenarioReport>
    my xsl file is::
    <?xml version="1.0" encoding="UTF-8" ?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="html"/>
    <xsl:template match="/">
    <html>
    <body>
    <h2> Scenario Report</h2>
    <table border="1">
    <tr bgcolor="#9acd32">
    <th align="left">Nodename</th>
    <th align="left">netObjId</th>
    <th align="left">Result</th>
    <th align="left">Report</th>
    <th align="left">Action</th>
    </tr>
    <xsl:for-each select="scenarioReport/node">
    <tr>
    <td><xsl:value-of select="@name"/></td>
    <td><xsl:value-of select="netObjId"/></td>
    <td bgcolor="#ffffff "><xsl:value-of select="result"/></td>
    <td><xsl:value-of select="report"/></td>
    <td><xsl:value-of select="action"/></td>
    </tr>
    </xsl:for-each>
    </table>
    </body>
    </html>
    </xsl:template>
    </xsl:stylesheet>

    Must be something wrong with your XSL.
    However apparently it was so urgent that you didn't have the time to look at what you posted. They just "fixed" the forum software and apparently it doesn't escape HTML that you type in any more. Or stuff that looks like HTML, either. So your post was unreadable.
    If your deadline hasn't passed, try reposting that code surrounded by [pre] and [/pre].

  • Can't place XML into defaultTable using WinExplorier

    Hi,
    Oracle 9.2.0.1
    My sequence of operations:
    1. Register schema - successfully - can see it using WinExplorier; defaultTable and types were created;
    2. Using SQLPLUS can place any XML corresponding registered schema into repository and can see it into
    defaultTable.
    3. BUT CANT PLACE THE SAME XML USING WinExplorier (WEBDAV) !! Using drag-and-drop operation xml just
    can be inserted into repository, but doesn't appear
    inti defaultTable.
    It looks like XMLDB can't see xml schema in registered path.
    Has anybody run into the same problem ?
    Thanks in advance
    Viacheslav

    Hi,
    Upgrade to 9.2.0.3, until I upgrade I could not get the web-dav upload to work at all.
    The only problems I've had with this is if I logged on to web-dav as a different user from that which I registered the schema with. One thing I have noticed, is that the file size is shown as being 0 when the xml has been shredded successfully.
    And the previous answer is right, if you use FTP you might see better error messages.
    Hope it helps,
    John

  • BPEL process to Insert XML into DB using pl/sql stored proc

    Hi,
    We have created a BPEL process in which we are taking input request and store it into Oracle Database using PL/SQL proc.
    We have been unsuccessful in doing so because the data stored in table has root element missing.
    Has any body done this (insert xml into DB using pl/sql stored proc) successfully ?
    We can so this successfully if we do not use stored procedure and store data directly in table.
    Regards

    I have done this, stored it as a CLOB.
    Also I received the payload as an opaque schema, so I had to convert the message from binary into string.
    This way the root element doesn't get removed.
    cheers
    James

  • How can remove child into file xml using J2ME

    i want to delete child from file xml using midlet but nothing is changed into file
    please help me
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package ajou;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.io.OutputStream;
    import java.util.Vector;
    import javax.microedition.io.Connector;
    import javax.microedition.io.HttpConnection;
    import javax.microedition.midlet.MIDlet;
    import org.kxml2.io.KXmlParser;
    import org.kxml2.kdom.Document;
    import org.kxml2.kdom.Element;
    import org.kxml2.kdom.Node;
    * @author -Manel-
    public class manelGO extends MIDlet {
    public void startApp() {
    try {
              //Open http connection
              HttpConnection httpConnection = (HttpConnection) Connector.open("http://localhost:8080/examples/users.xml");
                   //Initilialize XML parser
                   KXmlParser parser = new KXmlParser();
                   parser.setInput(new InputStreamReader(httpConnection.openInputStream()));
                   Document theDoc = new Document();
                   theDoc.parse(parser);
                   Element rootElement = theDoc.getRootElement();
    rootElement.removeChild(1);
              catch (Exception e) {
                   e.printStackTrace ();
    public void pauseApp() {
    public void destroyApp(boolean unconditional) {
    }

    To achieve this you can use the bpelx:remove function: http://download.oracle.com/docs/cd/E12483_01/integrate.1013/b28981/manipdoc.htm#CIHJBJFD
    your assign will look like:
    <bpel:assign>
    <bpelx:remove>
    <target variable="person" query="/person/@per" />
    </bpelx:remove>
    </bpel:assign>
    Regards,
    Melvin

  • Convert xml into SAP using dataset

    Hi All,
    How to convert XML into itab using dataset, in this conversion have any function module available? please give me a sample program (having any). and material also.
    Thanks,
    Suresh maniarasu

    Hi,
    First you need to get the XML file Data into SAP using the  Function Module and can populate the data into an inernal table.
    TEXT_CONVERT_XML_TO_SAP
    DMC_CONVERT_XML_TO_TABLE
    or you can use the following classes
    CL_RSRD_CONVERTER_XML
    CL_WDR_XML_CONVERT_UTIL
    CL_EXM_IM_ISHCM_CONV_XML_SAP
    Thank U,
    Jay....

  • Import of excel-xml into Numbers '09 vers 2.3

    How can I import excel-xml into Numbers?
    or
    How can I import a CSV-fil into Numbers as a spreadsheet?

    In addition to File/Open you can
    Right click on the file. Open With. Numbers.
    CSV files can also be drag & dropped onto a table and the table will be populated by the contents of the file.

  • Convert XML file into DTD using Java

    Hi All,
    I want to do convert the xml file into DTD using Java.
    I read the DOM package but didnt get clear idea.
    Anyone of you have an idea please share the coding with me.
    Any suggestions greatly appreciated.
    Thanks
    Veera

    Hi All,
    I want to do convert the xml file into DTD using Java.
    I read the DOM package but didnt get clear idea.
    Anyone of you have an idea please share the coding with me.
    Any suggestions greatly appreciated.
    Thanks
    Veera

  • How to retrieve data from catsdb table and convert into xml using BAPI

    How to retrieve data from catsdb table and convert into xml using BAPI
    Points will be rewarded,
    Thank you,
    Regards,
    Jagrut BharatKumar Shukla

    Hi,
    This is not your requirment but u can try this :
    CREATE OR REPLACE DIRECTORY text_file AS 'D:\TEXT_FILE\';
    GRANT READ ON DIRECTORY text_file TO fah;
    GRANT WRITE ON DIRECTORY text_file TO fah;
    DROP TABLE load_a;
    CREATE TABLE load_a
    (a1 varchar2(20),
    a2 varchar2(200))
    ORGANIZATION EXTERNAL
    (TYPE ORACLE_LOADER
    DEFAULT DIRECTORY text_file
    ACCESS PARAMETERS
    (FIELDS TERMINATED BY ','
    LOCATION ('data.txt')
    select * from load_a;
    CREATE TABLE A AS select * from load_a;
    SELECT * FROM A
    Regards
    Faheem Latif

  • How to convert XML into XSD Using Altova XML Spy

    Hi,
    How to convert XML file into XSD Using Altova XML Spy.
    I want to use that XSD as an External Def in my IR
    Regards
    Suman

    hi
    Following is the path where you could get the PDF's and zip file.
    https://www.sdn.sap.com/irj/sdn/howtoguides?rid=/webcontent/uuid/5024a59a-4276-2910-7580-f52eb789194b [original link is broken]
    please check out the following Heading, and at the bottom corner you will find the download option where you will get the zip file:
    How to Generate XSD Schemas from Existing MDM 5.5 Repositories
    You can download xomlite45.jar from sdn
    copy the jar file to your java installation location like c:>java in
    Java –jar xomLite45.jar MyFile.xml
    then you get correspondig MyFile.xsd
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/bf0e8a97-0d01-0010-f0a2-af3b18b7f4eb

  • Rounding of decimal values into XML using DOM

    I want to roundoff 10.456 to 10.4(while generating the xml) using DOM.
    Please let me know how to handle this?
    Thanks in advance

    read the java.lang.Math API
    there are rounding functions there
    and next time please just use a search engine

  • Upload data from multiple worksheets of excel file into SAP by using MIME?

    Hi all,
    I'm trying to getting the data from a multiple worksheet excel file by usin the MIME Repository.
    First of all i realizied it like [here|http://abap-explorer.blogspot.com/2008/12/upload-data-from-multiple-worksheets-of.html] in a normal ABAP Report.
    By trying to transfer the code to a WebDynpro Component, i get problems.
    With this part of code, because ActiveX is not allowed in our Webbrowser. So i have to find another solution to get the data from the excel file.
    CALL METHOD c_oi_container_control_creator=>get_container_control
    IMPORTING
    control = iref_control
    error   = iref_error
    I tried to rebuild this solution in webdynpro. But it dont works.
    So my next step was trying to Read the Excel sheet directly from MIME by getting the Content (XString).
    But there is no useful information Just a mix out of '######' and other symbols.
    By converting it into String the same problem.
    Maybe someone has an idea how to rebuild [this code|http://abap-explorer.blogspot.com/2008/12/upload-data-from-multiple-worksheets-of.html] in Webdynpro that it works correctly.
    Currently Im Using the Fileupload UI Element. All Works fine. I can Upload the Excel file to MIME Repository and i can open it from there.
    But i cant get the same clear informationen from the file, to write it later in a Database, like before without webdynpro.
    i hope someone can help me.
    Edited by: Sascha Baumann on Apr 20, 2009 4:28 PM

    You can't read the native binary Excel Format in server side ABAP.  The functions and classes that did this in Classic Dynpro used OLE Automation via the SAPGUI Control Framework to remotely control Excel to read the data.  Because in the browser you have no connection to the SAPGUI or are sandboxed inside the browser; the same functionality is not possible. 
    I would suggest that you look into saving the Excel file as a open, text format.  You might be able to use XML (although the Excel XML format can be complex) to support multiple sheets. You would have to build the logic yourself (using XSLT or the iXML parser) to process the XML format back into ABAP data.

Maybe you are looking for

  • Info Package in Process Chain taking long time

    Dear All, Info Package in Process Chain having 0 records is taking 1 hr 5 mins to complete. Time out time is set to 10 mins. Does any one of you know the reason why it is happening like this? Regards.

  • MDB transaction getting silently rolled back?

              I have an MDB that is doing a delete of a database record in the onMessage method.           It seems to work fine. I see no errors in the log, in fact I have some debug           statements that indicate everything was completed normally.

  • Firefox crashes when downloading a file

    Firefox crashes whenever I try to download ANY file. If I right click + Save File as, if I'm downloading from Rapidshare, as soon as the file window opens, Firefox crashes. I've already tried deleting downloads.sqlite, and that didn't work. This happ

  • Modify the ACS database via CSUtil

    First, is there a document that will show me the entire CSUtil syntax? I have seen bits and piece, but not everything. Also, can you modify a user account in such a manner that you can actually change it's Group? In other words, can I move jdoe from

  • Sony/Accuweather App not working on z3

    hii, yesterday i got the xperia z3 and i noticed that the accuweather app does not work, and when i try to add my location it says location not found i forced stop and cleared data but still the widget isn't working.