Skip to Content

With the 1808 release, there is a new web service available: ‘QueryDocumentOutputRequestIn’. Using this web service, it is now possible to retrieve the output forms from ByDesign in either PDF or XML format.

While understandably since this is a new web service, and the documentation is not yet available from SAP, there is already a bit of interest from some developers (me included), so here is some basic information, based on my recent experience.

Questions posted on the forum earlier:


Let us consider the following problem statement. You have a front end web shop and backend ByDesign. The sales order is first entered in the front-end web shop, and subsequently replicated to ByDesign. The requirement is to obtain ByDesign’s invoice PDF (or XML) document on the front end.


  1. front end already knows ByDesign sales order number.
  2. one sales order only maps to one invoice
  3. only preceding document type for invoice is ‘sales order’


Step 1: Get the invoice UUID

use web service ‘QueryCustomerInvoiceIn’ to get the invoice UUID.

example request, consider sales order ID is ‘123’:

Customer Invoice Query Request

<soapenv:Envelope xmlns:soapenv="" xmlns:glob="">


example response:

Customer Invoice Query Response

<soap-env:Envelope xmlns:soap-env="">
        <n0:CustomerInvoiceByElementsResponse_sync xmlns:n0="">

here, you see that the customer invoice ID is ‘456’.

make a note of the ‘UUID’: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

Important note: see ‘Assumptions’ above.

Step 2: get the Document UUID

Use web service ‘QueryDocumentOutputRequestIn’ to get the document UUID.

operation name: FindByElements

Continuing with the example, the customer invoice UUID is xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.

example request:

Document Output Request

<soapenv:Envelope xmlns:soapenv="" xmlns:glob="">


example response:

Document Output Response

<soap-env:Envelope xmlns:soap-env="">
        <n0:DocumentOutputRequestByElementsResponse_sync xmlns:n0="">

note down the document uuid: yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy


Step 3: Get the document in PDF

once you have the Document UUID, you can use the web service ‘QueryDocumentOutputRequestIn’ and operation ‘ReadOutputPDF’ to get the PDF file.

continuing with the example, our document UUID is yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy

example request:

PDF request

<soapenv:Envelope xmlns:soapenv="" xmlns:glob="">

the response will contain the PDF file content.


Step 4: Get the document in XML

Similar as step 3, but use the web service operation ‘ReadOutputXML’.


Thanks to SAP for closing this crucial gap. With this new web service, it is now possible to retrieve the output documents over a web service call. In my experience, the invoice PDF is of very high importance, but I can imagine several use cases which require the retrieval of other output forms too.


To report this post you need to login first.


You must be Logged on to comment or reply to a post.

  1. Otfried von Geisau

    Hi Rohan,

    I like your blog post promoting the new functionality we provide.

    When it comes to the documentation, I would like to point you to our new footprint in the SAP API Business Hub. This is only available as of two weeks ago.

    When you search for “output” you will find the web service documentation.

    Best regards

    1. Rohan Arthur Post author

      Dear Otfried,

      Thank you for your input. I wasn’t aware of the API hub, and it looks really nice!
      Currently, the link leads to a documentation page that has very basic data about this service (screenshot attached). Would it be a good idea to direct this link to the API hub page?

      Thanks and regards,

      1. Knut Heusermann

        Hi Rohan,

        the link in the ByD Service Explorer should show the same content as you can see in the API Business Hub. We plan to fix that as soon as possible.

        Thanks for pointing us to the issue and best regards,


Leave a Reply