Friday, October 14, 2011

VPN: How to access both internet and company network on XP

I used to connect to my company's network via a PPP VPN. As I have now left that company I thought I would document the way I connected to the VPN network and the internet (when connected to the VPN).

*now I must state that the company did have an VPN connections via Watchdog ssl connections and using this connection I was always able to connect to the compnay network and the internet. However this Watchdog VPN SSL connection proved unreliable for me and therefore I used the backup PPP connection as follows.

Change the VPN settings to disable the gateway on the remote network as shown below.



Then CONNECT to the VPN

The internet should be available however the company network is NOT!!!

So, using the windows command IPCONFIG command check the last number of the VPN connection. shown here


Then using a BAT file to setup the connections for the company network.

I called mine vpnroutes.bat


C:\Documents and Settings\robert.russell\Desktop>type vpnroutes.bat
route add X.X.X.0 MASK 255.255.255.0 10.175.2.%1%
route add X.X.0 MASK 255.255.255.0 10.175.2.%1%
route add X.X.X.0 MASK 255.255.255.0 10.175.2.%1%

*replace the X.X.X with the IP addresses of the company networked servers.

Then running the vpnroutes.bat file with the last number of the IP address,

vpnroutes 17
*using the example from the screen shot above.

Wednesday, October 12, 2011

Printing Barcodes for FREE with SAP

Now introducing the Barcode Writer in Pure Postscript (BWIPP) on the SAP server side
Version 3


Using the BWIPP script on the SAP Server Side

This version merges the BWIPP on the SAP server side. Therefore there is no need to configure PDF software or use scripts to introduce the BWIPP to generate barcodes.

By using standard SAP configuration the BWIPP can be merged into the SAP output stream on the server side. Therefore reducing any configuration on the client side.

Also as the solution is purely postscript based ANY postscript 2 compatible printer can be used for a barcode solution. See my earlier post in regards to printing postscript on HP printers

Steps involved.

ZBWIPP_M.PRI This is the SAP device type which contains the BWIPP configuration
Dbwipp This file is the Barcode Writer in Pure Postscript
ZBWIPP_PRINT.txt This is the ABAP code which produces 26 barcodes on one page

The test page looks like this.




2) SET the profile parameter 'rspo/devinit/datafile' to

rspo/devinit/datafile =
     /usr/sap/$(SAPSYSTEMNAME)/$(INSTANCE_NAME)/data/D++++++++

Note: Please pay attention to the number of "+" after the letter "D".
*Its important the the parameter is set exactly as above

3) Copy the Dbwipp file to the following directory on the SAP server
/usr/sap/$(SAPSYSTEMNAME)/$(INSTANCE_NAME)/data

*the parameter and Dbwipp file need to be set/copied to all application servers used for printing.

4) RESTART the application server

Import device type = ZBWIPP_M.PRI
Use ABAP code = ZBWIPP_PRINT.txt


*the output device qrcodes and cutepdf setup can be used as stated in the blog post. (They can be renamed as required)

Run the report ZBWIPP_PRINT for the demo ABAP code.

Here is a video covering barcodes in SAP Smart Forms with the BWIPP.








Previous Versions
Version 1

SAP: 26 different barcodes on a page with 1 ABAP report for FREE


This version relied on merging the the Barcode Writer in Pure Postscript (BWIPP) being with the SAP output on the desktop by using scripts.

Version 2
This version relied on merging the the Barcode Writer in Pure Postscript (BWIPP)  with the SAP output on the desktop by using PDF software configuration.

Tuesday, October 11, 2011

SAP: New version of the SAP QR code device type

In my original development of the SAP barcode device types based on the Barcode Writer in Pure Postscript (BWIPP) it was suggested to use the BWIPP ASCII85 encoded versions. The ASCII85 BWIPP versions can be found here. 

I do like the ASCII85 encoding method as it reduces the amount of code and therefore the size of the SAP device type.

The new device type also contains two extra print controls to cover some extra formatting options for smartforms. Read the SDN blog regarding the implementation and the comments section of the blog does contain some fixes for using the device type in smartforms.

Download link to the new QR code device type is here

The zip file contains file ZBWPQR2.PRI which is the ZBWPQR2 device type.
Follow the original QRcode blog but use the ZBWPQR2 device type

The main benefits are reducing the number of SAP Action pages required for the device type.
The actual reduction in size of the postscript sent to the frontend/printer.
The extra print controls covering Smart Form formatting.

The following extract is from the Barcode Writer in Pure Postscript page detailing all the supported barcodes. Using the same method any of these could be incorporated into an SAP device type. If you see any you would want to use in SAP then you could follow the SDN blog to create your own or let me know via the comments if you would want me to help out in creating any of the SAP device types.


"The project supports all major barcode formats including:
EAN-13EAN-8UPC-AUPC-EISBNISMNISSNEAN-5 & EAN-2 (EAN/UPC add-ons), GS1 DataBar OmnidirectionalGS1 DataBar StackedGS1 DataBar Stacked OmnidirectionalGS1 DataBar TruncatedGS1 DataBar LimitedGS1 DataBar Expanded,GS1 DataBar Expanded StackedCode 128GS1-128 (EAN-128), SSCC-18 (EAN-18, NVE), EAN-14 (DUN-14), GS1 Composite(EAN/UPC, GS1 DataBar and GS1-128), Code 39Code 39 ExtendedCode 93Code 93 ExtendedCode 32 (Italian Pharmacode),Pharmazentralnummer (PZN), Interleaved 2 of 5ITF-14 (UPC SCS), Code 2 of 5 (Industrial, IATA, Matrix, Datalogic & COOP), Code 11 (USD-8), Codablock FCode 16KCode 49Code OneBC412Codabar (NW-7), Pharmacode (including two-track), MSI modified PlesseyPlessey UKTelepen (including numeric), Channel CodePosiCodePDF417MicroPDF417Data MatrixGS1 DataMatrix,QR Code (including Micro QR Code), MaxiCodeAztec CodeUSPS Intelligent MailUSPS POSTNETUSPS PLANETRoyal Mail(RM4SCC), KIX (Dutch Postal), JapanPostAusPostDeutsche Post IdentcodeDeutsche Post LeitcodeUSPS FIM symbolsDAFT,RawFlattermarkenHIBC barcodes (Code 39, Code 128, Data Matrix, PDF417, MicroPDF417, QR Code, Codablock F)"

Monday, October 10, 2011

SAP: Printing(PDF) QRcodes with the SAP Japanese postscript device type

Following up on my previous blog How to Print(PDF) QR Codes in standard SAP 


As I did come across QR codes in Japan I thought I would blog on how to use the Japanese postscript device type driver with QR codes. It should be noted the QRcode in the Barcode Writer in Pure Postscript (BWIPP) does not support kanji (yet). See the BWIPP outstanding  features list for the to-do list for QR codes. Check with the BWIPP project if you want to request/support any new features in the actual barcode.

So the intention of the post is to show the way to use Japanese in the output including a QRcode.

If you used Japanaese in the original method then the cutepdf output would look like the following screenshot.


So to get Japanese to print properly then the SAP Postscript font file from this note is required.

Note 83502 - Printing Support for Native Languages

Download the Japanese font file "Japanese  |  JPSPOST    | Dfnsjis  (note 83502)"


Follow the note to set the required parameter and upload the font to the SAP server.
*Check the limitations of using these device types in the note and that the font file will be sent to the frontend with each print.


The end result when using the QRcode enabled device type.






Smartform Example. 




Steps involved.

1) Downloaded the font file and set the parameter from the SAP note. Restart the SAP server


2) Download here  the zip file which contains the following files.
ZQR_PRINT_JP.txt     = ABAP code to produce a QRcode using the ZJPSPTQR device type.
ZBWIPP_JAPAN        = Output Device linking the device type to cutepdf desktop printer
ZJPSPTQR.PRI           = QRcode enabled SPOST Device Type


3) Use the original post in relation to the QRcode but use the above files to enable Japanese.


4) Run report ZQR_PRINT_JP (and make sure the print immediately is active).





Thai Language Support
In the comments section there is a question about using QRcodes and Thai Language support. By modifying the Thai device type that you can download in the note 83502 I was able to print Thai and the QRcode as shown below. I did rely on Google for the translation so hopefully it is translated appropriately....:)


















Wednesday, October 5, 2011

SAP: Troubleshooting QR codes in Smart Forms (and BWIPP barcodes)

Printing QR codes (or many other types of barcodes) in smartforms is possible by using the Barcode Writer in Pure Postscript.

Check out these blogs for further information and background to printing QRcodes/barcodes in SAP.
SDN Blog Barcode in SAP with the Barcode in Pure Postscript
Overview of BWIPP in SAP 


Two general issues have come up in printing QRcodes in smartforms. Both relate to the text intended for the barcode being shown on the page and the QRcode/barcode generated but blank (and unreadable). So I will cover the fix for both issues below.


1) Smartform Print contol missing.


As covered in the comments section of the SDN blog 



Check the raw format of the spool request. (send the print to the spool and not print immediately)

In SP01 when viewing your output requests, select on the menu screen, 'Goto' --> 'Display Requests' --> 'Settings', and select RAW format. and search for ZBW01 and ZBW02  then print control ZBW01 may not show up. For testing purposes swap out the device type and print controls for SAP standard and see if they appear.

The work around/fix was as follows.
In the smartform the setup was as below and did not create a proper barcode.
LOOP
..
.CELL
..PRINT CONTROL ZBW01
..TEXT FOR BARCODE
..PRINT CONTROL ZBW02

Turns out the missing print control occurs even with SAP standard print controls so is a smartform issue/feature and not related to the device type.

So the fix

Change to
LOOP
..
.CELL
..TEXT - empty / or blank lines to make room for the barcode
..PRINT CONTROL ZBW01
..TEXT FOR BARCODE
..PRINT CONTROL ZBW02

The above issue is normally only related to text boxes in a loop as standalone text boxes work as standard.




2) Format used in the text box for the barcode


There is a section in the SDN blog about "Identify the Text for the Barcode" so if I print the relevant section below.

"Standard formatted text can appear with the "s" command however sometimes especially if small text formatting is used other postscript procedures such as "w1" and "w2" appear. So any new form or output that requires a barcode should be output to a flat file. This is to check the file for the postscript formatting and commands used by SAP. This can be useful to note where to insert postscript commands via print controls (also for any trouble shooting). A tip for smartforms and sapscript is to search for lines with "<~" and "~>" as this signals ASCII85 encoded text. "

As the smartform will be converted to postscript then the way the smartforms text format is converted is vital to allow the barcode to be printed.

a) So lets start by creating a Windows frontend printer that prints purely text.
This will be used to create a text file of the SAP generated postscript.

Follow this note but use the QRcode/barcode device type 
 Note 576973 - Creating a file printer on a Windows PC

b) send the smartform to the new frontend printer. 
You will be prompted for a file location so enter c:\smart.ps for example (the full path must be entered).

c) open smart.ps and search for /s {bct exch ctxt  which is the start of print control ZBW01.


In your smartform there is some formatting to do with the width/size of the text so the normal postscript s command is not used and therefore the qrcode is not displayed correctly.

*NOTE, in the following example I will use postscript w1 and w2 as an example, the exact formatting may be different in your smartform, leave a comment and I will get back to you.


Here is an extract of some formatting I tested with a copy of the SF_EXAMPLE_01 smartform.


Screenshot of Smartform Formats used in a Text Box




Screenshot of the Postscript code generated by SAP for the smartform
*Note I have added the ASCII85 decoded text myself to show in this example.

Note the only line not using the postscript s command is the "small key word" text which uses the w1 and w2 postscript commands

The postscript commands w1 and w2 are used instead of the S command. Therefore to keep the formatting in the smartform we can add two new print controls.

d) Modify the QRcode/barcode device type in transaction SPAD.
Add print controls 


ADD TWO new print CONTROLS
ZBW90 = /w1 {bct} def \n/w2 {ctxt /bct exch def} def\n
ZBW91 = /w1 {SW 0 8#040} def \n/w2 {widthshow} def \n



e) Change the smartform to include the new print controls



..TEXT - empty / or blank lines to make room for the barcode
..PRINT CONTROL ZBW90
..TEXT FOR BARCODE
..PRINT CONTROL ZBW02
..PRINT CONTROL ZBW91


Basically the ZBW90 changes the W1 and W2 commands to allow the concatenation of the text.
ZBW02 is the same command to generate the QR code.
ZBW91 resets the W1 and W2 to SAP standard postscript.


f) Print the smartform to the original QRcode(barcode) printer.


Any comments let me know happy to help.



Google +