8 Replies Latest reply: Feb 3, 2011 11:13 PM by Mithun Dha RSS

Steps in creating CSV file from XML file using PI 7.0

Mithun Dha
Currently Being Moderated

Hi Experts,

     I have a scenario in which I need to use PI7.0 to pick up XML file from source (ECC6.0) convert it to CSV and send it to CLM system. I already found information on SDN and got some help from experts here on what the adapter configuration should be for sender and receiver. I will be using file adapter and I am new to PI/XI and trying to understand the steps.

 

1) I created new "product" and "software component version" in SLD. When I tried to import it in IR9Integration Repository) using TOOLS>Transfer From System Landscape Directory>Import software component version, I am getting the error below:

     Unable to read software component versions from SLD <server>:<port>

I found lot of articles on this on SDN and I had BASIS try everything but still having same problem. I am still working with BASIS on this but if anyone has any more ideas, please share with me.

 

2) I have a program in R3 that creates input XML file in a specific directory and this XML has very complex structure. I converted complex XML to simpler XML that I need for CSV output using MAPFORCE which generaes XSLT on the background.

 

I read quiet a bit on PI/XI but still trying to understand how I can acheive the result.

 

a) Can I mention somewhere in PI to automatically pick up the file created from SAP from a specific directory at certain intervals? Should I always have PI running for this to happen?

b) I created XSLT file to convert complex XML to simpler XML so that I can use "File Content Conversion" on the recceiver side to create output CSV file. Where would my XSLT file come into the picture i.e. where can I tell PI to convert one XML to another XML using XSLT that I created? I want to then use this converted simpler XML as input.

c) Can I mention somewhere in PI to ftp the converted CSV file so that CLM system can receive it?

 

I might be asking dumb questions but for this whole file conversion to happen, should I always run something in PI or is there any service that could be run in the background?

 

I would really appreciate any of your feedback.

 

Thanks.

  • Re: Steps in creating CSV file from XML file using PI 7.0
    Mithun Dha
    Currently Being Moderated

    Hi Experts,

               If you have any ideas, please let me know.

     

    Thanks.

    Mithun

  • Re: Steps in creating CSV file from XML file using PI 7.0
    Rajesh pasupula
    Currently Being Moderated

    Hi Mithun,

     

    your requirement can be achieved using PI.

     

    1. File sender adapter of PI needs to be used to pick file from SAP File server. in this adapter polling interval will be set... which will look for the file specified in the specified directory of SAP for file..if file is available it will be picked and processed in PI.

     

    2. To convert the xml using XSLT this can be achieved in PI ..for this you need to use XSLT mapping instead of Message Mapping in PI..once you have XSLT mapping code.the file needs to be imported into the import archive of PI then need to refer the same in Operation Mapping.

     

    3. FTP receiver adapter will take care of generating the file in the specified server and directory..

       Here use FCC as message protocol for conversion of XML to CSV..

     

    search in sdn for a file to file scenario to know more..

     

    HTH

    Rajesh

  • Re: Steps in creating CSV file from XML file using PI 7.0
    Baskar Gopalakrishnan
    Currently Being Moderated

    >> a) Can I mention somewhere in PI to automatically pick up the file created from SAP from a specific directory at certain intervals? Should I always have PI running for this to happen?

     

    Yes. Use File adapter as sender. you can set polling interval using availability time planning . You can specify the directory in the communication channel and Polling interval can be set in the availability time planning of communication channel.

     

    Go to component monitoring-> communication channel -> file adapter.

    Check this link for availability time planning

    http://www.dataxstream.com/2010/11/configuring-availability-time-planning-in-sap-pi/

     

    For File sender adapter

     

    http://help.sap.com/saphelp_nw04/helpdata/en/e3/94007075cae04f930cc4c034e411e1/content.htm

     

     

    >>b) I created XSLT file to convert complex XML to simpler XML so that I can use "File Content Conversion" on the recceiver side to create output CSV file. Where would my XSLT file come into the picture i.e. where can I tell PI to convert one XML to another XML using XSLT that I created? I want to then use this converted simpler XML as input.

     

    Yes Pi supports XSLT mapping. You can import the XSLT mapping code as jar and use it for mapping.

     

    > > c) Can I mention somewhere in PI to ftp the converted CSV file so that CLM system can receive it?

     

    Yes. You can use File adapter as receiver. It does ftp. To do CSV output from xml. You have to pick file content conversion message protocol in the file communication channel.

     

    see this link for fcc in the reciever side

    http://help.sap.com/saphelp_NW04/helpdata/en/d2/bab440c97f3716e10000000a155106/content.htm

  • Re: Steps in creating CSV file from XML file using PI 7.0
    Mithun Dha
    Currently Being Moderated

    Thanks everyone for the reply. I started doing file to file adapter configuration and got to the point where I have to create sata type, message type etc. After doing research here I found out that I can import my xsds into "external definition" in integration repository which I did but not sure how to reference to it when I am creating message type. I read somewhere I can use these xsds directly in message interface creation but I have no clue how! I am stuck at this point and any help would be appreciated. Here is again what I am look for

     

    I have xml file one with complex structure for example test1.xml. This one is created by using call transformation in SAP. I created xsd from this xml and want to use this a outbound data type.

     

    I created xslt with the help of mapforce and created simpler test2.xml. Now I want to convert this test2.xml to CSV. I created xsd for this xml and want to use this as inbound data type. Finally i want to use converted xml (test2.xml) to CSV.

     

    I did lot of research here but was not able to proceed further.

     

    **Also, when I create xsds from SAP xml it creates multiple xsds in xml spy. So for test1.xml it creates 2 xsds test.xml and test11.xml. test.xml has reference to test11.xml. Would this work in PI?

     

    Thanks.

    Mithun

    • Re: Steps in creating CSV file from XML file using PI 7.0
      Vivek Balaji
      Currently Being Moderated

      Hi Mithun,

       

        I hope you could use the same 'complex xml' rather than converting it to a simple one and then using it.

       

      Edited by: Vivek91188 on Feb 3, 2011 7:38 AM

    • Re: Steps in creating CSV file from XML file using PI 7.0
      Vivek Balaji
      Currently Being Moderated

      Hi Mithun,

                  

                   

      "After doing research here I found out that I can import my xsds into "external definition" in integration repository which I did but not sure how to reference to it when I am creating message type"

       

         In the case of external definitions, you need not create a message type exclusively. In the message mapping, directly specify the external definition. This can be achieved by just dragging and dropping the external definition into the source message side of the mapping or you can use the search help to get the external definition.

       

       

      "I read somewhere I can use these xsds directly in message interface creation but I have no clue how!"

       

        You can directly specify your external definition in the message interface (service interface), by specifying the type as 'External Message' and using the input help in the next column, you can select the external definition which you have imported.

       

         Hope this would help.

       

      Cheers,

      Vivek.

  • Re: Steps in creating CSV file from XML file using PI 7.0
    Mithun Dha
    Currently Being Moderated

    Thanks everyoone for the help

Actions