Friday 13 April 2018

Smoketesting host-print (“L”) from NetWeaver laptop edition

We assume you are running an SAP NetWeaver AS Abap Developer Edition instance as a guest VM on your local machine.

Also we assume that the SAP instance is up and running, and that your host computer (the one running your hypervisor for the guest VM) is capable of sending stuff to a printer located on your local network.

First, check what network printer you are going to use… because usually you need to “best-guess” suitable drivers… so in our example, it is a Canon imageRunner Advance C255i … and in this “example corporate network” it is on a Windows host with NetBIOS=abcd , and the printer share is called someprinter01.

So we are going to use Samba, which is the way to get Linux machines to interact with printers on Windows servers, and we are going to use the “Yast2 GUI” tool from openSUSE Leap Gnome desktop, because, well, it is easier and less error-prone than following the online documentation for command-line stuff.

So click on Activities, and type “Yast” in the searchbox…

SAP ABAP Tutorials and Materials, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP NetWeaver, SAP ABAP Certifications

Open YaST. Enter the root password to continue, that is the normal requirement from Yast:

SAP ABAP Tutorials and Materials, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP NetWeaver, SAP ABAP Certifications

Select from the “Hardware” options the Printer-icon…

SAP ABAP Tutorials and Materials, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP NetWeaver, SAP ABAP Certifications

Click “Add” to add a new printer configuration …then use the “Connection Wizard”-button…. and then under the Samba Connection type you can enter the relevant data, e.g. I use my Windows domain username and password, and a “close enough” printer model:

SAP ABAP Tutorials and Materials, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP NetWeaver, SAP ABAP Certifications

Test Connection:

SAP ABAP Tutorials and Materials, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP NetWeaver, SAP ABAP Certifications

Being in Europe, we want A4 as default paper size… also since I am only setting up one print channel from this machine, we may as well set it as default, and we want to Accept Print Jobs and Enable Printing, for sure (but those last 2 options are probably automatically checked on when creating the connection, you can only edit them later I think).

When creating the new connection, you can also give it a name, under “Set Arbitrary Name” …mine gets the name “canonsuse1”, and we should keep that in mind for later when configuring SAP NetWeaver instance to print.

SAP ABAP Tutorials and Materials, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP NetWeaver, SAP ABAP Certifications

Once the new connection is saved (“OK”) you come back to the Printer Configurations view and under (checkbox on) Local you can find the new connection. From there, try and print a test page (or two):

SAP ABAP Tutorials and Materials, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP NetWeaver, SAP ABAP Certifications

… and you go to the printer… assuming everything went well, Samba and CUPS and your printer have done the work and you have a nice shiny printout…

SAP ABAP Tutorials and Materials, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP NetWeaver, SAP ABAP Certifications

So that is nice, well of course only if it all worked out, “which was nice”

Next step is to set up SAP output device… go to transaction SPAD…

SAP ABAP Tutorials and Materials, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP NetWeaver, SAP ABAP Certifications

Switch to “Full Administration” (if you want), then anyway you want to choose either or the white arrow on green circle, or menu-path Configuration->Output Devices.

SAP ABAP Tutorials and Materials, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP NetWeaver, SAP ABAP Certifications

… so we can see here I already set up SAP to use an Output Device called CANON1, but anyway we can create another one, let’s call it CANON2, to capture the screenshots for this document… so, click on the Create icon or menu-path Output Device->Create:

SAP ABAP Tutorials and Materials, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP NetWeaver, SAP ABAP Certifications

So the first time you go to the icon , which is like the ”Output Device Wizard”, you will find you need to go to the SAP Note 1036961 and download the relevant .zip file, which contains an XML file, and so on… because this xml file basically contains the list of manufacturers and their models that are supporting printing from SAP…

SAP ABAP Tutorials and Materials, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP NetWeaver, SAP ABAP Certifications

Not sure what you do if you do not have S-user for accessing the SAP Note – maybe contact a colleague or friend who does – I don’t know why SAP makes stuff like this a bit trickier to get hold of, and this blog is not the place to discuss that; but luckily I currently have an S-user so I can continue:

SAP ABAP Tutorials and Materials, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP NetWeaver, SAP ABAP Certifications

So download that “tspopi….zip” file to local computer, unzip it, then upload it into SAP using “Update Printer Information”…

SAP ABAP Tutorials and Materials, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP NetWeaver, SAP ABAP Certifications

Note that this doesn’t also upload all drivers you might want, it just basically says what supported manufacturer-printer combinations for SAP printing exist.

Then you select a Manufacturer, and choose a printer you think might be ok… in my case there was no exact match, either in the dropdown list of options, nor in the (see later) actual drivers-sets available for download, so a bit of experimentation was needed here… anyway I think PCL is going to be part of the right driver config… mmmm… what about…

SAP ABAP Tutorials and Materials, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP NetWeaver, SAP ABAP Certifications

So select the target line:

SAP ABAP Tutorials and Materials, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP NetWeaver, SAP ABAP Certifications

… and “Continue with Language Selection” and for example I select just “Western European” and move to “Show Available Device Types”…

SAP ABAP Tutorials and Materials, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP NetWeaver, SAP ABAP Certifications

So we need this config file from Canon, this “CNA22P”. To get that, we need to open the manufacturer specific note, in this case SAP Note 1135052, and then download the zip files, and search them until we find something suitable…

SAP ABAP Tutorials and Materials, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP NetWeaver, SAP ABAP Certifications

SAP ABAP Tutorials and Materials, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP NetWeaver, SAP ABAP Certifications

… then you can use the “Install Device Types”-wizard (button)…

SAP ABAP Tutorials and Materials, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP NetWeaver, SAP ABAP Certifications

After that is done, you can use “Assign Device Type to Output Device”. Set the spool server either using __AUTOSPOOLSERVER or the actual server name, either way from the selection box for the field. Other fields as default in DeviceAttributes:

SAP ABAP Tutorials and Materials, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP NetWeaver, SAP ABAP Certifications

Access Method is ”L”, and host printer is: whatever you called the connection in ”Set Arbitrary Name” earlier on when you were using Yast:

SAP ABAP Tutorials and Materials, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP NetWeaver, SAP ABAP Certifications

If you like, in OutputAttributes you can check the Color Printer checkbox, if your printer supports that. And then you Save the new Output Device.

Next thing is to test it. For example…

SAP ABAP Tutorials and Materials, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP NetWeaver, SAP ABAP Certifications

SAP ABAP Tutorials and Materials, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP NetWeaver, SAP ABAP Certifications

Go to menu-path List.. Print… choose an Output Device, say the new one CANON2..

SAP ABAP Tutorials and Materials, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP NetWeaver, SAP ABAP Certifications

SAP ABAP Tutorials and Materials, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP NetWeaver, SAP ABAP Certifications

Then we can go to tcode SP01, look at the Spool Requests; or from SPAD overview of our CANON2 Output Device click on the “Spool Requests”-icon:

SAP ABAP Tutorials and Materials, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP NetWeaver, SAP ABAP Certifications

… then from menu-path Spool Request -> Print -> Direct Processing, or from the icon for that, we can send the request to the actual print queue via the CANON2 Output Device…

SAP ABAP Tutorials and Materials, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP NetWeaver, SAP ABAP Certifications

and from the “Output Requests” icon we can see how that is progressing (use Refresh to, uhh, refresh status):

SAP ABAP Tutorials and Materials, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP NetWeaver, SAP ABAP Certifications

SAP ABAP Tutorials and Materials, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP NetWeaver, SAP ABAP Certifications

So go and see if our report has been printed…

SAP ABAP Tutorials and Materials, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP NetWeaver, SAP ABAP Certifications

… that is what success looks like

To test colour printing, can try e.g. using report RSTXICON, choose selection-screen radiobutton “as sapscript”, and the output device we want to test… then send it to actually print…

SAP ABAP Tutorials and Materials, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP NetWeaver, SAP ABAP Certifications

… report looks like this:

SAP ABAP Tutorials and Materials, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP NetWeaver, SAP ABAP Certifications

No comments:

Post a Comment