Skip to Content
Technical Articles
Author's profile photo Markus Berg

Storing Output Documents in SAP S/4HANA

Storing and managing documents is an essential part of our customers business. When looking at SAP S/4HANA, mainly two main sources exist for documents. The SAP Document Management, handling attachments, and the output management, represented by the different output solutions.

From a customer/partner perspective these documents usually belong together (for example attachments of an invoice and the invoice document itself, created during the output process). Hence, they seek information on how to handle these documents properly, especially when using third party storage solutions.

With this blog I would like to provide more details on how output documents are handled by the output solutions NAST-based output control and SAP S/4HANA Output Control.

After reading this blog you should understand the common parts and the current differences on how output documents are handled by these two output solutions and how it’s impacting you.

Note: This blog only applies for the following editions: SAP S/4HANA and SAP S/4HANA Cloud, private edition.

 

Storing Documents with NAST Output Control

In my example for NAST-based output control (short: NAST) I assume the output documents shall finally be stored in an external system, for example using a third party solution. This is configured accordingly using the KPRO configuration and the possibility of assigning one or more storage categories via Archive Link. I further assume that all required setup in the NAST is made to use Archive Link to handle the output documents on SAP side. How these things can be setup is not part of this blog.

Based on this setup the overall process for storing output documents looks like this:

Storing%20Output%20Document%20with%20NAST

Storing Output Documents with NAST

It starts with the business application triggering the output via NAST. Based on the application type and the corresponding Archive Link configuration, the system will store the metadata of the output document and its object relations in the Archive Link tables (TOA*).

The content and some basic information (file name, mime type, document reference) are transferred by the KPRO runtime via HTTP to the external system. This means the external system does not get all the available information about the output document in the first place. So typically, the full access to the output document information is only possible via the SAP applications.

It also means, any additional information required by the external system would need to be retrieved in a second step. This is shown here:

Storing%20Output%20Document%20with%20NAST%202

Retrieving additional information (NAST)

Via a callback to the SAP S/4HANA system additional information can be retrieved, for example via a non-SAP web service call. As Archive Link is used in the example, the first query can retrieve the information from the corresponding TOA* tables. When using the object relations, a further navigation to the corresponding business document, e.g. a Purchase Order, is possible and a broad range of information can be retrieved.

 

Storing Documents with SAP S/4HANA Output Control

In my example for SAP S/4HANA Output Control (short: Output Control) I assume the output documents shall also finally be stored in an external system, for example a third party solution. This is configured accordingly using the KPRO configuration. By default, only one storage category can be used (SOMU).

For this setup the overall process to store output documents looks like this:

Storing%20Output%20Documents%20with%20Output%20Control

Storing Output Documents with Output Control

 

It starts with the business application triggering the output via the Output Control. The system will store the metadata of the output document and its object relations in the tables of Output Control (APOC).

The content and some basic information (file name, mime type, document reference) are transferred by the KPRO runtime via HTTP to the external system. This means the external system does not get all the available information about the output document in the first place. So typically, the full access to the output document information is only possible via the SAP applications.

It also means, any additional information required by the external system, would need to be retrieved in a second step. This is shown here:

Retrieving%20additional%20information%20%28Output%20Control%29

Retrieving additional information (Output Control)

Via a callback to the SAP S/4HANA system additional information can be retrieved, for example via a non-SAP web service call. As Output Control is used in the example, the first queries can retrieve the information from the corresponding APOC* tables. When using the object relations, also a further navigation to the corresponding business document, e.g. a Purchase Order, is possible and a broad range of information can be retrieved.

 

Comparing NAST and Output Control

Let’s put the information into a more compact form:

NAST SAP S/4HANA Output Control
Using multiple storage categories Yes No
Using Archive Link Yes No
Using KPRO Yes Yes
Providing basic information via KPRO to external system Yes Yes
Need Non-SAP callback to SAP S/4HANA system for additional information? Yes (Custom development) Yes (Custom development)
Starting point for external call Archive Link tables (TOA*) Output Control tables (APOC*)

 

Conclusion

When looking at this comparison you will notice that the differences are not that big. When using SAP S/4HANA Output Control you are currently limited to one storage category, and you need to look at different tables when you need to retrieve additional information.

 

Assigned Tags

      4 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Sergio Ferrari
      Sergio Ferrari

      Thanks for the interesting blog Markus !

      While reading I expected a mention to the SAP Document Management service of the SAP BTP. In case, could you spend a couple of words also on it?

      I believe that, implicitly, it is an option for what in the picture is named "External System" and that it is a kind of suggested/preferred solution for that.

      Author's profile photo Markus Berg
      Markus Berg
      Blog Post Author

      Hello Sergio,

      The SAP S/4HANA Output Control is currently not using the SAP Document Management on BTP. NAST anyway is in maintenance mode and also does not have any built-in integration.

      Hence whatever the external system technically is, will not change anything of the described status quo.

      Regards,

      Markus

      Author's profile photo Yuichi Suzuki
      Yuichi Suzuki

      Hi Markus,

      Very helpful documentation!

      We are in a phase of migrating our ERP system to S/4 HANA. If I change the Content Repository SOMU_DB from "SAP System Database" to "HTTP Content Server" and use our own specific Content Server, can I set up the landscape you have described here ?

      My second question is about retrieving the document stored in the External System (Content Server). Do the S/4 HANA Business applications allow me to do so or some custom development is required ?

      Best regards

      Yuichi

      Author's profile photo Markus Berg
      Markus Berg
      Blog Post Author

      Hello Yuichi,

      I am no expert with the details of setting up the external storage systems but using HTTP Content Server is  definitely required.

      For retrieving additional information, custom development is necessary. This is illustrated as "Non-SAP Web Service Call".

      Regards,

      Markus