SAP Printing – SAP username in document name
Jobs submitted to Windows queues by the SAPSprint.exe service are normally assigned the job owner username SYSTEM. The username specified as the job owner will match the username under which the SAPSprint service is running.
When the PDAgent captures the print job, it will authenticate the job as SYSTEM, which means it won’t be assigned to the end user. To assign SAP jobs to the correct user, we need to configure the following:
- Change the LPD port the PDAgent listens on to avoid a conflict with SAPSprint.exe
- Check the user’s Login name and Secondary login name in Resource Manager. One of these fields must contain their SAP username.
- Configure the PDAgent on the print server to extract the SAP username from the document name of the print job and use it to override the job owner.
- Configure the SAP system to include the SAP username in the document name of print jobs.
Avoid a port conflict with SAPSprint.exe
By default, the SAPSprint service will use TCP port 515. This will conflict with the PDAgent LPD port. It is possible to change the port that SAPSprint.exe uses, but if the expertise to change this isn’t available, we can change the PDAgent LPD port.
Open the print server PDAgent and go to the Print services tab. Change the LPD port to 58515 as shown below:
On Windows, it is not possible to manually create a print queue with a custom LPR port. However, the PDAgent is able to create LPR print queues using the custom port. This can be done using the Alter port setting on print queues or by creating and applying Queue deployments.
Ensure the SAP username is contained in the Login name or Secondary login name field of user records
In most cases, when printing from client PCs (Windows/Mac/Chromebook) to a Windows print server, the job is authenticated with a username that is different from the SAP username. This is because the identity management of these operating systems and networks are independent from the SAP identity management.
It is possible that the SAP usernames have specifically been configured to match the user’s network/PC account names. In this rare case, we don’t need to configure the user’s Secondary login name because jobs printed from their PCs or SAP will be authenticated with the same username.
The example below shows the more common case where the user’s PC account name is different from their SAP username. Their domain account name is JohnDoe so that appears in the Login name field:
However, their SAP username is john_doe. This needs to be entered into their Secondary login name field on the Auth & Importing tab:
Now, whether they print from an app on their PC or from SAP, they will be able to release their job using their PIN (or card swipe).
Override the job owner with SAP username in the document name
We will create a username override that will look for the SAP username in the document name of the print job.
Open the print server PDAgent, click the Print services tab, then click the Extract job owner username from job button.
There will be some pre-defined overrides that are available. Tick the item with the Description: Username in document name before forward slash.
This item will use the text before a forward slash in the print job document name to try match a user. It will only check jobs that arrive with the job owner SYSTEM. This reduces unnecessary load on the server by ignoring all other jobs. If you double click the item, the settings can be customized. For example, if the SAPSprint.exe service doesn’t run under the SYSTEM account and uses a service account (e.g. svc_sapsprint) then the job owner limitation must be changed to svc_sapsprint.
Configure the SAP system to include the SAP username in the print job document name
The following steps will need to be executed by the SAP system administrator.
- Log in to your SAP system with appropriate authorization (e.g. authorization for transaction code SPAD).
- Enter transaction code SPAD in the command field and press Enter to open the Spool Administration screen.
- On the Spool Administration screen, click the “Full Administration” button.
- Navigate to the “Device Types” tab.
- Find the output device you want to modify and select it. Then click the “Display” button.
- In the output device configuration, click the “Change” button to edit the settings.
- In the “Host Spool Access Method” section, look for the “Job Name Format” field. This field controls how the document name is formatted for the print job.
- Modify the “Job Name Format” field to include the SAP username in the desired format. To include the SAP username followed by a forward slash and the original document name, enter the following format: &SAP_USER/&F
- The &SAP_USER variable will be replaced by the actual SAP username, and the &F variable will be replaced by the original document name when the print job is generated. Save your changes.
After making these changes, the SAP system will include the SAP username in the document name of the print job when printing with the modified output device. For example, if the user’s SAP username is “john_doe” and the original document name is “invoice2053”, the print job will arrive at the print server with the document name john_doe/invoice2053. Note that these instructions apply to the SAP GUI and may vary slightly depending on the specific SAP system and version.
Now, test sending a SAP print job and ensure it is assigned to the correct user based on the SAP username.
Document revision date: 2023/05/10
Software version:2.4.2.0