Skip to Content
avatar image
Former Member

Require help for Scenario -How to download text (.txt file) from web url

Hi Experts

I require help in designing the following scenario.

How to download text file from web url using sap PI. our version of PI is PI 7.11 .

Please suggest any scenarios link or help.

Add comment
10|10000 characters needed characters exceeded

  • Former Member

    The .txt file needs to be downloaded from the url https://..................... by using PI and then the file needs to be sent to SAP for further logic. PI just needs to download the .txt file and send to SAP.

  • Get RSS Feed

2 Answers

  • Mar 29, 2017 at 05:53 AM

    Hi Iakshimi,

    You can try with the SOAP (Axis) adapter https://blogs.sap.com/2012/01/05/michals-pi-tips-exchange-rates-from-an-xml-file-on-a-web-page-rest-axis/ . However, i'm not sure if it works with non XML file. In the worse case you can do it with java development in a java mapping or own module bean.

    Regards.

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 29, 2017 at 07:29 AM

    Hi Lakshmi!

    URL website = new URL("http://source.server/source.file");
    ReadableByteChannel rbc = Channels.newChannel(website.openStream());
    FileOutputStream fos = new FileOutputStream("information.html");
    fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
    
    With this java code you can download file by given URL.

    Regards, Evgeniy.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Evgeniy

      The .txt file needs to be downloaded from the url https://..................... by using PI and then the file needs to be sent to SAP for further logic. PI just needs to download the .txt file and send to SAP.