cancel
Showing results for 
Search instead for 
Did you mean: 

Read PDF form as binary data in S/4 HANA Public Cloud

aldimitrov14
Explorer
0 Kudos

Hello, I am faced with the following scenario: A custom Fiori/freestyle application should be developed which would then display as a print preview some standard form out of the SAP S/4HANA output management. Theoretically let's say that this form should be the Purchase Order PDF form. 

In S/4 Hana on-prem/private cloud you would use the NAST output and the spool id to get the document as a binary data so that it can be sent to the frontend using a OData service.

I fail to figure out how I am supposed to read the PDF document that was/will be generated when creating a new Purchase Order.

So the flow should be the following :

End user creates a Purchase Order -> the Purchase Order PDF is generated and stored in the system - > end user opens the custom Fiori/Freestyle application -> he is able to use a button to get the same document on his screen using the PDF Viewer control.

I would love to have some ideas if this is even possible, and if so how 🙂

Accepted Solutions (0)

Answers (2)

Answers (2)

thomas_mller13
Participant
0 Kudos

The PDF document is stored in an archive via archive link. You find the connection in the tables TOA01. The archive gives you an URL to display the document. Alternatively you can read the binary of the document by SMCS* function modules or you can read the binary of the pdf during generation and store it temporarily in the DB. 

aldimitrov14
Explorer
0 Kudos
Hello, I've stumbled upon this blog post by a SAP employee explaining the differences between the old NAST storage system which indeed is stored in the archive. However here the aim is not NAST but the S/4 Output Control which is related to the public cloud. According to this post https://community.sap.com/t5/technology-blogs-by-sap/storing-output-documents-in-sap-s-4hana/ba-p/13... the archive link won't be supported.
thomas_mller13
Participant
0 Kudos

You gave the answer by yourself:

image.png

The relation info is in the APOC* table. As soon you have the DOC ID you can use KPRO FM to get the LOIO ID. Check the FMs SDOK*. There must be one similar to

SDOK*LOIO*URI*

thomas_mller13
Participant
0 Kudos

The PDF document is stored in an archive via archive link. You find the connection in the tables TOA01/02/03. The archive gives you an URL to display the document. Alternatively you can read the binary of the document by SMCS* function modules or you can read the binary of the pdf during generation and store it temporarily in the DB.