Convert csv in XML?

Hi,
I'm new in XI.
Is it possible in XI to convert a csv-file in a xml-file?
Thanks for your help.
Regards
Stefan

hi Stefan,
have you seen my friends weblog?:
/people/sap.user72/blog/2005/01/06/how-to-process-csv-data-with-xi-file-adapter
Regards,
michal

Similar Messages

  • Converting string to XML

    Dear All,
    I am using PI 7.1
    I am trying to invoke a third party SOAP API which accepts request in the form of a string which has embedded xml and also return a string which has xml embedded in it.
    To send the xml as string, I used the feature "Retun as XML" in mapping and it worked fine.
    But the response which has xml embedded, needs to be converted back to XML message.
    I understand that we can write parsers in java, ABAP and also do XSLT mapping.
    Just wanted to know that is there any "out of the box" feature to do the same.
    Please refrain from providing links to java mappings or xslt as I have gone through them already.
    regards,
    Piyush

    Hi Piyush,
                      All parsers will fail to parse the XML message you are getting. Since you are getting the following tag twice within the XMl
    "<?xml version="1.0"?>"
    This tag can be present in an document only once in begining of the document. First you need to remove this tag from appearing in source.
    Suppose you are able to do that then your XML structure will become something like this
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    <ns1:AuthenticateResponse xmlns:ns1="urn:Login" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">
    <return xsi:type="xsd:string"><MessageResponse sessionid=";jsessionid=FxZLTxtJnXJttpW6gMhJ06kyn00tfSgjt9ZwbzJ55CXGn92S8L6f!-444760742!1311845684753" status="SUCCESS" topicprefix="ND-DSK-117.CXL_HMEL_DB"><Entity name="REF_PERSON"><Property name="last_access_dt" value="20110728145937" type="DATE"/><Property name="modify_person_num" value="21" type="INTEGER"/><Property name="persontopic" value="350523952" type="STRING"/><Property name="login_result_ind" value="0" type="INTEGER"/><Property name="login_result_reason" value="" type="STRING"/><Property name="bypass_drafts" value="0" type="STRING"/><Property name="stl_check_swap_option_pricing_end" value="1" type="BOOLEAN"/><Property name="stl_update_provisional_cashflows" value="0" type="BOOLEAN"/><Property name="stl_autoinvoice_costs" value="1" type="BOOLEAN"/><Property name="stl_allow_payments_from_agents" value="0" type="BOOLEAN"/><Property name="stl_payment_allocation_at_invoice_detail_level" value="1" type="BOOLEAN"/><Property name="last_db_reloaded_on" value="" type="DATE"/><Property name="xl_mode_ind" value="0" type="INTEGER"/><Property name="Xchange_enabled" value="1" type="INTEGER"/><Property name="Xchange_server" value="XCHANGE" type="STRING"/><Property name="ipaddress" value="10.60.4.80" type="STRING"/><Property name="appname" value="CommodityXL" type="STRING"/><Property name="version" value="7.XL7.08.17E" type="STRING"/><Property name="econfirm.server.enabled" value="0" type="BOOLEAN"/></Entity></MessageResponse></return>
    </ns1:AuthenticateResponse>
    Then you can use the following java mapping code to remove the SOAP envelop.
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.util.Map;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.dom.DOMSource;
    import javax.xml.transform.stream.StreamResult;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    import com.sap.aii.mapping.api.StreamTransformation;
    import com.sap.aii.mapping.api.StreamTransformationException;
    public class RemoveSoapEnvelopSDN implements StreamTransformation{
    public void execute(InputStream in, OutputStream out)
    throws StreamTransformationException {
    try
         DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance();
         DocumentBuilder builderel=factory.newDocumentBuilder();
         /*input document in form of XML*/
         Document docIn=builderel.parse(in);
         /*document after parsing*/
         Document docOut=builderel.newDocument();
         TransformerFactory tf=TransformerFactory.newInstance();
         Transformer transform=tf.newTransformer();
         Element root;
         Node p;
         NodeList l;
         int mm,n1;
         //if you need to include namespace use next two lines
         //root=docOut.createElement("ns0:MessageResponse");
         //root.setAttribute("xmlns:ns0","http://connectsystems.be/MAINFR/AccDocument");
         root=docOut.createElement("MessageResponse");
         p=docIn.getElementsByTagName("MessageResponse").item(0);
         l=p.getChildNodes();
         n1=l.getLength();
         for(mm=0;mm<n1;++mm)
              Node temp=docOut.importNode(l.item(mm),true);
              root.appendChild(temp);
         docOut.appendChild(root);
         transform.transform(new DOMSource(docOut), new StreamResult(out));
    catch(Exception e)
         e.printStackTrace();
    public void setParameter(Map arg0) {
    public static void main(String[] args) {
    try{
         RemoveSoapEnvelopSDN genFormat=new RemoveSoapEnvelopSDN();
         FileInputStream in=new FileInputStream("C:\\Apps\\my folder\\sdn\\sdn6.xml");
         FileOutputStream out=new FileOutputStream("C:\\Apps\\my folder\\sdn\\removedEnvelopSdn6.xml");
         genFormat.execute(in,out);
    catch(Exception e)
    e.printStackTrace();
    You can add attributes to the tags as per your requirement. I have commnented those lines in the java code.
    The output will look like this
    http://postimage.org/image/2b2czww90/
    Hope this helps.
    Regards
    Anupam

  • Converting String To XML Format and send as attachment

    Hi
    My requirement is to convert String into XML Format and that XML File i have to send as an attachment
    can any one one give solution for this Problem.
    Thank you
    Venkatesh.K

    hi,
    i m filling the itab first and converting to xml
    itab contaning these data
    GS_PERSON-CUST_ID   = '3'.
    GS_PERSON-FIRSTNAME = 'Bill'.
    GS_PERSON-LASTNAME  = 'Gates'.
    APPEND GS_PERSON TO GT_PERSON.
    GS_PERSON-CUST_ID   = '4'.
    GS_PERSON-FIRSTNAME = 'Frodo'.
    GS_PERSON-LASTNAME  = 'Baggins'.
    APPEND GS_PERSON TO GT_PERSON.
    after conversion data is coming like that
    #<?xml version="1.0" encoding="utf-16"?>
    <CUSTOMERS>
      <item>
        <customer_id>0003</customer_id>
        <first_name>Bill</first_name>
        <last_name>Gates</last_name>
      </item>
      <item>
        <customer_id>0004</customer_id>
        <first_name>Frodo</first_name>
        <last_name>Baggins</last_name>
      </item>
    </CUSTOMERS>
    but errors are  1) # is coming at the first
                            2)for 'encoding="utf-16"?>', it is not coming perfectly, some other data (iso-8859-1) should come here
    can anybody plz solve it.
    regards,
    viki

  • Converting string to XML format

    Hi All,
    I have a requirement to convert string to xml format and download it. Atpresent, I have a string which is a collection of xml tags. I want to convert this string to xml format like <VALUE004>20387899.437</VALUE004>
    <VALUE005>20387899.437</VALUE005>
    <VALUE006>20387899.437</VALUE006>
    Is there any function module for this.

    Chk this thread.
    Re: Regd: File Conversion to XML format

  • Converting string to xml in xslt

    Hi we are trying to convert string to xml in xslt but it is getting errored out.
    We have followed the procedure mentioned at http://download.oracle.com/docs/cd/A91202_01/901_doc/appdev.901/a88894/adx04xsl.htm under the section "How Do I Convert A String to a Nodeset in XSL?".
    Standard procedure mentioned by oracle is not working. Is it a known bug?

    Chk this thread.
    Re: Regd: File Conversion to XML format

  • Methods in bapi used to convert data into XML

    Methods in bapi used to convert data into XML,
    how to implement those also,
    points will be rewarded
    Thank you,
    Regards,
    Jagrut BharatKumar Shukla

    Hi
    Check this
    http://www.sap-img.com/abap/sample-xml-source-code-for-sap.htm
    https://forums.sdn.sap.com/click.jspa?searchID=2889167&messageID=3406594
    Reward points for useful Answers
    Regards
    Anji

  • CSV to XML problem in message mapping

    Hi,
        I am trying for a CSV to XML scenario. But i am confused with the message mapping.
    Can anybody please help me by giving demo example of this???
        Thank you.
    Regards,
    Atul

    Hi
    Kindly have a look at this SDN TVdemo VALUE MAPPING REPLCIATION for all answers,
    https://www.sdn.sap.com/irj/sdn/developerareas/xi?rid=/webcontent/uuid/a680445e-0501-0010-1c94-a8c4a60619f8 [original link is broken]
    http://help.sap.com/saphelp_nw04/helpdata/en/49/1ebc6111ea2f45a9946c702b685299/frameset.htm
    IR: Message Mapping
    http://help.sap.com/saphelp_nw04/helpdata/en/43/c4cdfc334824478090739c04c4a249/frameset.htm
    hope this helps!
    best regards,
    Thangesh

  • Convert Excel to XML file

    Hi Guys,
    I need to generate the XML from Excel file. The XML file will have the definition like this:
    <people_list>
    <name>Fred Bloggs</name>
    <birthdate>27/11/2008</birthdate>
    <gender>Male</gender>
    </people_list>
    The Excel file will look like this:
    A B C
    1 Fred Bloggs 10/21/2008 Male
    2 ABC 12/23/2008 Female
    3 XYZ 07/16/2008 Male
    All the values in name,birthdaye,gender will come from the Excel file. I am having 100 rows in the Excel file with the data and I want to parse this excel file and create the XML file with the above template.
    Any ideas how to do this?
    Thanks,
    Mahesh

    Hi Mahesh,
    there are tons of ways to do what you need. It all depends on how your workflow is organized and how complicated it may become.
    Alternative 1:
    Export your Excel file as a cvs and convert cvs to XML (which shouldn't be so hard).
    Pro: Relative easy transformation.
    Con: Every time you want to convert the Excel file to XML you first needs to export it out of Excel by a manual step.
    Alternative 2:
    Save you Excel file as XML (e. g. the new *.xslx documents) and transform it as you like.
    Pro: Very clean way to do this. You can access the single source Excel file directly from Java. No further steps needed.
    Con: It's very very hard to program because the Excel xml structure is ridiculously complex.
    Alternative 3:
    You can create a little Excel VBA Script which generates the XML File.
    Pro: Easy programing.
    Con: Needs some experience in Visual Basic 6 programming.
    Alternative 4:
    Use http://jexcelapi.sourceforge.net/ or any other Excel-API to Access the Excel application out of Java.
    Pro: Clean way to do it. You need no further manual actions to prepare something. (maybe the most flexible and at the same time easyest way)
    Con: Additional license.
    Best Wishes
    esprimo

  • Convert FMB to XML File on Unix

    Hello,
    I want to convert a FMB-File to XML in my HP-UX-Middletier-Environment.The Script frm2xml.sh is only shipped with IDS.
    Can someone upload the frmf2xml.sh from a linux or Solaris IDS-Enviroment?
    Robert

    So if we were to keep text-based source files, the process would have to be:
    - check-out to local working copy
      - convert XML to FMB
        - make changes using Forms Developer
      - convert FMB to XML
    - commit to svn
    I'm concerned about the side-effects of the conversion process (edge-cases, incompatibilities), and I also expect that even with some automation, the above will be a pretty slow process that will slow the team down. I guess we'll probably stick with fmb.
    I guess as a compromise, it may be worthwhile generating the xml or fmt alongside the fmb and committing both. At least we'd then have a text-based file to compare revisions with. So the process then becomes:
    - check-out to local working copy
      - make changes using Forms Developer
      - generate XML from FMB
    - commit both to svn
    I'm still baffled as to why Oracle has chosen a binary source format, even 15 years ago. This basically precludes a vast number of tools and techniques that are essential to the software craft :(

  • How to force BI Publisher to output header without any record in CSV or XML format?

    When the output format is CSV or XML, it seems that Oracle BI publisher does not use the template. When there is no record returned, it only display "ROWSET" in the report. No column names are displayed in the report. If the output format is one of the following: PDF, Excel, HTML, RTF, Excel200, and MHTML, it generates correct header/column names even there is no record.
    How could I force BI publisher to do the same when the output format is CSV or XML (data)?
    Thanks,
    GT

    Alex,
    I did not say that bip must use template for xml output. What I have said was that bip ignore the template even you have set up a template when the output is in XML or CSV. The reason that I set up a template for XML or CSV output is to test whether I can make it output column names when the SQL query returns no records. It apparently that it did not return any column name. It just returns "ROWSET" text.  This is a problem for down-stream process or any other receiving system since the down-stream systems do not know what are the column names in the report.
    Did you get what is the issue here and have an answer for it?
    GT

  • Step by step bapi to convert SAP to XML please its urgent

    step by step bapi to convert SAP to XML please its urgent
    full points if with full example and coding in ABAP,
    Thank you,
    Regards,
    Jagrut Shukla

    yes i want to convert Catsdb table into xml format and safely in server, i.e secured  place

  • Import and Export CSV Through XML File in Oracle

    Hi Gurus,
    I am sorry , I had deleted this post.
    Thanks
    Edited by: user10679113 on Feb 5, 2009 6:13 AM

    What does it mean to do something with comma separated values through XML. That is a new concept for me.
    Either something is CSV or XML but what is it you are trying to describe? Please provide an example.
    Then come the obvious questions like what version and edition of Oracle on what platform? What does any of this have to do with email? How large a file? etc.
    No one else has responded so I can only assume they are thinking what I am ... "what is this person trying to do?"

  • Convert XMLList to XML in AS3?

    Hello,
    I am trying to figure out how to convert an XMLList that I
    retreived from an XML instance back into well-formed XML in Flash
    CS3. Here is what I am doing.
    - I have an XML document loaded and I am displaying the
    contents in a datagrid component (which is working well).
    - I am then filtering the XML to obtain a subset of data by
    first obtaining an XMLList representing all elements of my XML
    instance and then filtering the list on a particular element (this
    is working well).
    - Now I want to display my filtered results in the datagrid
    and here lies the problem because the datagrid can't use an XMLList
    as a dataprovider. How do I convert this XMLList back into well
    formed XML so I can use it as my grid's dataprovider? I need to
    somehow get a root tag back on.
    Could I somehow use toXMLString() and then convert that to
    XML?
    Thank you in advance for any advice.
    TH

    I solved this so I thought I would post how I did it in case
    anyone would find this useful.
    1. First, convert your XMLList to an xml string:
    var yourXMLString:String = yourXMLList.toXMLString();
    2. Next, add a root tag to the beginning and end of your xml
    string.
    yourXMLString=
    "<your_root_tag>"+yourXMLString+"</your_root_tag>";
    3. Convert the string to xml.
    var yourNewXML:XML=new XML(yourXMLString);
    yourNewXML is now well-formed xml and will work as a
    dataprovider.
    TH

  • Converting IDOC to XML

    Hi,
    I have an application where i have to convert an IDOC to XML format so that it can be handled by webmethods.
    I want to know how to convert IDOC to XML. I have seen that in SAP there are two port types, XML and XML HTTP. Are they used for posting an IDOC in XML format at defined port.
    When i tried to generated a test IDOC with port type as XML, it has created an xxx.XML file in application server but i an unable to display it.
    1). Can any one pls. tell me how to convert IDOC to
    XML??? What are the different methods ( if available)
    2). DO i need to have any extra component for this??
    3). what are XML and XML http ports are for.
    Pls. help me as this is very urgent.
    Thanks in advance.
    Pratik

    Hi,
    Does xxx.XML contain no data? Or you are just not able to display it (try opening it in notepad).
    1 - You are doing it right. Using XML port should be enough.
    2 - You don't need anything additional.
    3 - XML port gives you an option like a file port (you get the idoc in an XML file) for batch type interface. XML http will let you post the XML data realtime to an web server that accepts XML messages.
    If your partner system can take http messages, you can use http port to send the IDOC directly to that system, else you can create the XML file and send it in batch mode.
    hope this helps,
    cheers,
    Ajay

  • Converting audio to xml form

    hi
    i need to know how to convert audio to xml form.. can any one help me on this...

    take a look at this article:
    http://www.javaworld.com/javaworld/javatips/jw-javatip117.html?tip

Maybe you are looking for

  • What are the Corresponding fields in CRM for sales order in ECC

    HI! Experts, While creating a standard sales order in CRM I want to poulate these fields in ECC Sales order, these fields are VBKD-BSARK - Purchase order type VBAK-BNAME - Name: user ordered VBKD-IHREZ - Web Confirmation Number VBAK-TELF1 - Telephone

  • Can´t open files directly in Camera Raw from Bridge.

    I get this message: "Camera Raw editing requires that a qualifying product has been launched at least once to enable this feature." It has been working before without problems. Bridge 6.0.1.6   OS X  10.10

  • OSB Service Deployment

    I am trying to expose web services from EJB as OSB proxy services. Basically, what I have done so far is, import WSDL of web services from URL, create business service and proxy service, and export the project as sbconfig.jar. But when I deploy the s

  • An error has occurred

    For the past two days, when accessing Updates in Mac App Store, I get the following error: "An error has occurred.  The operation couldn't be completed. (NSURLErrorDonain error -1100." This is only happening on a 2007 iMac running 10.8.2 on a network

  • Automatic page start for LW 16/600 PS

    I am running G3 with OS9.2 I have a LW 16/600 PS that when turned on, automatically sends a page with a solid black of ~4x8 inches. How can I turn this off? I don't have the software that came with the printer... where can I get it?