SAVING ATTACHMENTS IS DONE BY DEFAULT IN SAP DATABASE

Many SAP users connect local PC files to SAP documents. Through the "Generic Object Services" or "Services for Object" button, available in virtually all standard SAP transactions, for example, PDF, Word or Excel files can be accessed through the underlying SAP document. For example, quotation files can be linked to orders or incoming orders associated with sales orders.

These attachments are stored by default in the underlying SAP database. Obviously, this type of binary files significantly take up more space than the flat data where the SAP database is primarily intended for.

Research with a number of our clients learns us that in some cases the table where attachments are stored (the SOFFCONT1 table) can cover up to 25% of the total database size. When looking to the cost of storage in a SAP HANA environment, a reduction in database size can significantly reduce costs. Even when traditional databases are used, the benefits can be significant as well. Think on backup procedures or system copies.

EXAMPLE SCENARIO

In transaction ME21N or ME22N (Create or Modify Order), attachments can be linked using the "Services for Objects" button.

 
Services+voor+object.png
 

When adding the attachment to the order, this document will be stored in the SAP database. The desire is to link PC documents such as Excel, PDF, etc. to an order without preserving these attachments on the SAP server. These documents must be stored on an external storage medium.

In order to analyze if it is useful to save attachments in an alternative way, we will first look at the database size of the SOFFCONT1 table. In the example below, we see that this table is approximately 1,074 GB. Compared to a total database of 5,661 GB this is about 20%!

We see that significant cost savings are possible here. In the next section we explain how.

STORAGE OF ATTACHMENTS ON EXTERNAL STORAGE

By customizing, attachments can be saved to an external data source, such as an SAP Content Server. The SAP Content Server is a stand-alone SAP component that can save external documents. Of course, the files can be retrieved directly through SAP.

The SAP Content server comes with the regular SAP license and is free to use. Documents are stored in a MaxDB database (part of the installation). SAP applications can access Content Server for uploading, downloading or viewing documents via the Archivelink protocol.

As shown in the figure below, KPro attachments will be in the content repository SOFFDB (maintained via transaction OAC0). This refers to database table SOFFCONT1.

 
 

To save documents to an external content repository, follow the following procedure:

1. Create a content repository linked to a SAP content server

In the Implementation Guide (IMG) (Transaction SPRO) choose SAP NetWeaver → Application Server → Basic Services → ArchiveLink → Basic Customizing → Define Content Repositories.

2. Then create a content repository for the storage category HTTP content server. This content repository contains the details of the connection to the SAP content server.

There are now 2 categories available: SOFFDB which is linked to the SAP Database, and SOFFHTTP which is linked to a SAP Content server.

 
 

3. Assigning SOFFPHIO class to content category SOFFHTTP

  • Choose transaction SKPR08
  • In the field previous category SOFFDB you have the class SOFFPHIO. Enter in the New Category field, the value SOFFHTTP
  • Choose "Save"

If SOFFPHIO value is not available, it must be made available through transaction SE16N. To do this, change the field value CAT MAINT to X in table SDOKPHCL, line SOFFPHIO.

From now on, all attachments are saved in the SAP Content server. This can be checked by viewing the size of SOFFCONT1 table before and after linking an attachment to, for example, a purchase order.

MIGRATION

After changing the default behavior when storing documents, it is also necessary to migrate the documents already in the SAP database to the external data storage. SAP has provided a number of tools for this. This allows the already attached attachments to be easily moved.


The most recent SAP program (RSGOS_RELOCATE_ATTA) for attachment migration is described in SAP Note 2293171.

In the above screenshots, all attachments stored in the SAP Database that are linked to purchase orders in a certain period are migrated to a SAP Content server. End users do not notice any difference, nothing changes for them. However, the SAP database size will decrease significantly. As previously reported in some cases by more than 20%!

For questions or additional information on this subject, please contact Wouter Van Peteghem.