Skip to Content

Download pdf file from URL

Hi Community,

We need to retrieve a pdf file from URL that is stored as a link under the attachments of a material. The ultimate goal is to store this pdf as an attachment to a customer quote.

The URL is a regulare one that is publicly available w/o authentication. Meaning I can simply enter the URL (http://somehost.com/path/file.pdf) in webbrowser to get the file.

Is there any way to achieve this? We tried using the REST API but currently fail with an RABAX error whenever we call the REST service.

Any help appreciated,

Daniel

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Nov 08, 2017 at 10:37 AM

    Hi Daniel,

    In blog post Read and Write ByDesign Attachments using Web Services I described how to create and update attachments of ByD business objects using Soap services. Adding an external link as attachment to a business object in ByD works basically the same: just submit the external link instead of the file content (here: material attachment):

    ...
    <AttachmentFolder
    DocumentListCompleteTransmissionIndicator="false"
    ActionCode="06">
      <UUID>00163e0e-4644-1ed5-9aed-c438b0f1dcec</UUID>
      <Document PropertyListCompleteTransmissionIndicator="false" ActionCode="01">               
        <VisibleIndicator>true</VisibleIndicator>
        <CategoryCode>3</CategoryCode>               
        <TypeCode>10001</TypeCode>         
        <Name>www.sap.com</Name>
        <AlternativeName>My Web Page</AlternativeName>               
        <ExternalLinkWebURI>http://www.sap.com</ExternalLinkWebURI>
      </Document>
    </AttachmentFolder>
    

    Using OData you would basically need to provide the same data, but I did not use that yet.

    Best regards,
    Knut

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Knut,

      This is exactly what I am trying to do. But I could not find a way to download a PDF from an external source out of an ABSL script. I tryed to use a external service of type REST for this, but calling the REST simply dumps.

      Regards,

      Daniel