In the last week I've got a HP Color LaserJet Multi Functional Printer
M477fdw. While doing the setup of all the functionality like Cloud Print, Scan-to-Mail I've stumbled upon the HP Support page on
HP Printers - Device Types For SAP Printing. So I though why not get my
SAP NetWeaver AS ABAP Developer Edition to print?
So I've started out installing the SAP Device Type as described in the
HP Documentation. I've used the SPAD method. That was the easy part. Getting the SAP actually to print was a bit more tricky. Check out my steps to the solution:
I've started out using the
Host Spool Access Method named
L: Print Locally Using LP/LPR:
That failed with the error message
sh: 1: /usr/bin/lpr: not found. As I'm using
Ubuntu Server 16.04.2 LTS to run my ABAP Developer Edition I installed So as the next step I've installed lpr using:
sudo apt-get install lpr
The next try caused the error
lpr: M477fdw: unknown printer. As I've hadn't setup a printer in lpr that wasn't really surprising. I've researched on how to print with linux and found that nowadays CUPS is the default solution. So another software installation:
sudo apt-get install cups cups-client
As I'm connecting to the Virtual Machine running the ABAP Dev Edition from my Mac using SSH and the Webserver to configure CUPS was not bound to the network interface I've redirected the local port 8631 to the servers CUPS port 631 while establishing the SSH connection:
ssh u1604snw75.fritz.box -L 8631:localhost:631
With that I was able to setup my printer using the
Add printer wizard. But unfortunately my model M477fdw was not in the list of drivers. So another Google search to discover that
HP Linux Imaging and Printing is the place to go. Ubuntu provides it's drivers in the hplip package that can be installed using:
sudo apt-get install hplip
I've restarted cups using:
sudo service cups restart
to make sure the new drivers where loaded. After that the setup was a breeze and a test page was successfully printed.
But how to get now SAP talking to CUPS? The solution is cups-lpd as SAP supports the
Host Spool Access Method named U
: Print Using Berkeley Protocol. The first step is another install. We need xinetd to have a deamon listen on port 9100:
sudo apt-get install xinetd
Then make sure to add:
jetdirect 9100/tcp laserjet hplj
to your
/etc/services file. When this is done you can create
/etc/xinetd.d/jetdirect with the following content:
# Allow applications using the AppSocket / JetDirect protocol
# to communicate with CUPS.
service jetdirect {
socket_type = stream
protocol = tcp
wait = no
user = lp
group = sys
passenv =
server = /usr/lib/cups/daemon/cups-lpd
server_args = -o job-sheets=none,none -o document-format=application/octet-stream
}
The part
-o job-sheets=none,none I had to add as with every print a cover page was printed. It seems that cups-lpd does not respect the settings in the CUPS web based administration.
With xinetd running I was able to make this setup in SPAD:
After that I was able to print from SAP.