ArchiveLink: Uploading Employee Photos
I constantly receive customer inquiries regarding the upload of employee photos into the SAP system. That is why I decided to create this step-by-step guide on how you can easily upload the photos so they can be displayed in HR transactions like PA20 or PA30.
Find a place to store the photos
The first thing we need is a place to store the photos. You have two main options here: to store them in an external storage system, or to store them in the SAP database. I strongly recommend storing these photos in an external storage system, such as the SAP Content Server or any 3rd party SAP-certified storage system. Installing the SAP Content Server is a simple task, but in case you cannot perform this task at this moment, then you can use the SAP Database to store the photos. The disadvantage here is that the photos may use a lot of space in your database, so this is a decision you have to make in advance.
Create a content repository
Once you have decided where to store the photos you have to create a content repository, which is nothing more than a logical definition of the content server.
Some of the prerequisites to create a repository are necessary for both storing options:
Make sure that the HTTP plug-in is active
Transaction SMICM, “Display Services” function key (shift F1). The list of services must contain a port other than 0 for HTTP. If not, you must adjust the relevant profile parameter.
Typical entry (you may set your own port number):
icm/server_port_0 = PROT=HTTP, PORT=8045
Check the system PSE
Start Transaction STRUST. Expand the system PSE. The system PSE must be green for each application server.
Determine a suitable exchange directory
The archive system must be accessible from every application server. If all application servers are running on the same platform (for example, Windows), one network directory that is accessible on all application servers (for example,
server\share) is sufficient. You can generally use the global directory (profile parameter DIR_GLOBAL). You can use report RSPARAM or transaction AL11 to determine the path of DIR_GLOBAL.
Storing in the SAP Database
This procedure works if your system is on Basis release 620 or higher. For lower releases, you have to follow the Storing in a SAP Content Server section. The best guide on how to set up the storage in the SAP Database can be found in the SAP Note 595563 (https://service.sap.com/sap/support/notes/595563). Three of the steps from the note were already discussed, so let’s check the rest of the steps:
Make sure that the /sap/bc/contentserver service is active
Transaction SICF, select: default_host – sap – bc – contentserver. Select the function to display/change the service. Check that a user is defined. If a user is not defined, use Transaction SU01 to create a new user. Use the “System” user type. Assign the profiles SAP_ALL and SAP_NEW to the user. Using the relevant data from the user that has just been created, maintain the anonymous logon data for the service /default_host/sap/bc/ and then save the changes.
Create a table for storing the data
Use Transaction SE11 to create a copy of table SDOKCONT1. If you want to create the repository database, you can call the table ZCONT_DB, for example. Save the table as a local object. Activate the table. This is a very important step if you want to set up more than one SAP Database repository. You cannot use the same table for more than one repository.
Create the repository
Use Transaction OAC0 to create a new repository. Use the following parameters:
Note that the exchange directory ends with a \ (or a / on Unix). If you are using a variety of platforms, you must use Transaction FILE to define a suitable logical file name, and use this file name. Save the settings.
Test the repository
Use Transaction SE38 to start report RSCMSTH0. Specify your repository and start the test. The report must run without errors.
Storing in the SAP Content Server
If you are planning to use the SAP Content Server (CS) to store the photos, then you have additional requirements, like finding a suitable server to install this software. SAP customers can download the SAP CS for free. I will not go into details on how to install the SAP CS here, but you can get more information and download instructions at the SAP CS info page (http://service.sap.com/contentserver).
Once you have the SAP CS installed, you can create a content repository in transaction OAC0. In my example below, I am creating repository Y6. I have the SAP CS running on server sapcs.sap.corp and the SAP CS service listening on port 1090:
Once you created the definition of the content repository, you have to physically create it in the SAP Content Server. Do it as follows:
- Create the content repository as above and save the changes.
- Click on the “CS Admin” button, which will take you to the “Content Server Administration” transaction.
- You will probably be asked for an user and password. If so, enter the operating system user and password utilized for installing the SAP CS.
- Go to the “Create” tab and click the “Execute” button.
Now you can test your content repository by using the program RSCMSTH0. Specify your repository and start the test. The report must run withouterrors.
Configure the archivelink tables
Now that you have a repository, you can proceed to configure the archivelink tables so the photos are properly linked to the employees records.
You will first need an archivelink document type. HR provides an standard document type called HRICOLFOTO that can be freely used. Go to transaction OAC2 and make sure that this document type exists, and that it has the document class JPG assigned. If your photos are in a format different to JPG (e.g. TIF or GIF), this would be the right place to change this setting. You can also create a new document type if you prefer (e.g. ZPHOTO).
Then, you will have to link the business object and document type to the content repository that you just created. Go to transaction OAC3 and look for the entry with object type PREL and document type HRICOLFOTO (or your own document type). Assign the content repository you created; in my example above I have Y2 for the database repository and Y6 for the Content Server. Save the changes and you are done.
Upload the employee photos
You are now ready to upload the photos. Go to transaction OAAD and press the button Store and Assign. Enter the business object PREL and document type HRICOLFOTO (or your own document type). Then press the Create button. You will be requested for the employee number:
Then, the system will request the file from your PC. Select the file and continue. You should get a message saying Stored document created successfully. You will also get the technical details of the photo:
Finally, go to transaction PA30 to confirm that the photo was uploaded correctly. The screen should look like this one: