Monday, July 18, 2011

Bar Code for SmartForms

Symptom
This note contains information on using the new bar code technology for SmartForms (Note 430887):
Which parameters are associated with the individual bar code symbology and what do they mean?
Which special characters may or must be taken into account when you transfer text data to bar codes?

Other terms
SmartForms, SE73, bar code

Reason and Prerequisites
You require information.

In order to use the new bar code technology, you must ensure that the system requirements specified in Note 430887 are fulfilled.


Solution
Note on the procedure: The "new bar code technology" described here only requires definitions in the list of system bar codes in transaction SE73. Those bar code definitions are device-independent and therefore do not require any changes or enhancements of device types/print controls or any maintenance of printer bar codes, as was the case with the "old" printer-based bar code output (Note 5196).
After creating a new system bar code in SE73, you can print this bar code with SmartForms using any suitable SAP device type. The following device types are suitable:
- All PCL5 device types (for example, BRHL, CAN105, HPLJ8000, LEXT622, OKI6100)
- All PostScript device types (for example, POSTSCPT, POST2)
- All Kyocera PRESCRIBE device types (for example, KYOFS150, KYOFS170)
- All device types for Windows printing (for example, SAPWIN, SWIN, I2SWIN, JPSAPWIN, CNSAPWIN)

If you create a new system bar code for the "new bar code technology" in transaction SE73, you must specify the following parameters:


Bar code name (used in Smart Styles)

Short text for system bar code (documentation)

Bar code symbology:
Code39
Code128
Interleaved 2of5
PDF417
Code93

This selection determines the technical bar code type that is used to format the bar code data (also called bar code symbology). The symbology also determines which characters are allowed in the bar code data.

Bar code alignment:
Normal (that is, the scan direction is "from left to right")
Rotated (the scan direction is rotated by 90 degrees "from top to bottom")
Inverted (the scan direction is rotated by 180 degrees "from right to left")
Bottom-up (the scan direction is rotated by 270 degrees "from bottom to top")


The other parameters are determined by the selected bar code symbology.
******************** Code39 ******************

Code39 is an alphanumeric code that can represent the following characters in the bar code data:
Numbers: 1234567890
Capital letters: ABCDEFGHIJKLMNOPQRSTUVWXYZ
Special characters: - . $ / + %
Blank characters (space characters)

The start and stop character for the Code39 bar code is usually represented by an asterix (*) in the text view of the bar code data (also called "human-readable text" or "interpretation line").

Parameters for Code39:

Narrow module width
Value range: 1 to 10
This is the width for the narrowest module of a bar code, measured in pixels. It controls the width of the bar code. Value 1 generates the "narrowest", value 10 the widest bars or spaces.

Linear height
Value range: 1 to 9999
Controls the height of the bars of the bar code, measured in pixels. A value of 600 is equal to a height of one inch.

Mod-43 check digit
Value range: X equals YES, blank character equals No
With this indicator, you can determine whether a Modulo-43 check digit is to be generated.

Bar ratio
Value range: 20 to 30
This value controls the ratio between wide and narrow bars. This value controls the ratio between wide and narrow bars.Value 20 means a ratio of 2.0:1, value 30 means a ratio of 3.0 to 1 (that is, 3:1).
*************** Interleaved 2of5 *************

Interleaved 2of5 is a numeric code, which can only represent the numbers 0 to 9. Since the digits in a bar code are always mapped in pairs, the total number of the digits displayed must always be an even number. If the number of digits (including an optional check digit) is odd, the system automatically adds a leading zero to the bar code data.

Parameters for Interleaved 2of5:

Narrow module width
Value range: 1 to 10
This is the width for the narrowest module of a bar code, measured in pixels. It controls the width of the bar code. Value 1 generates the "narrowest", value 10 the widest bars or spaces.

Linear height
Value range: 1 to 9999
Controls the height of the bars of the bar code, measured in pixels. A value of 600 is equal to a height of one inch.

Mod-10 check digit
Value range: X equals YES, blank character equals No
With this indicator, you can determine whether a Modulo-10 check digit is to be generated.

Bar ratio
Value range: 20 to 30
This value controls the ratio between wide and narrow bars. This value controls the ratio between wide and narrow bars.Value 20 means a ratio of 2.0:1, value 30 means a ratio of 3.0 to 1 (that is, 3:1).
******************* Code 128 *****************
Code128 is an alphanumeric code that can encode three different character sets. Each of the three character sets can represent 106 different characters. Within a bar code, you can alternate between the character sets.
The three Code128 character sets are named as follows:

Subset A) (contains, for example, digits, capital letters and control characters)
Subset B) (contains, for example, digits, uppercase and lowercase letters)
Subset C) (digit pairs from 00 to 99)
.

The following shows a table of the three character sets and the encoded characters:
Value Code A CodeB Code C
0 space space 00
1 ! ! 01
2 " " 02
3 # # 03
4 $ $ 04
5 % % 05
6 & & 06
7 ' ' 07
8 ( ( 08
9 ) ) 09
10 * * 10
11 + + 11
12 , , 12
13 - - 13
14 . . 14
15 / / 15
16 0 0 16
17 1 1 17
18 2 2 18
19 3 3 19
20 4 4 20
21 5 5 21
22 6 6 22
23 7 7 23
24 8 8 24
25 9 9 25
26 : : 26
27 ; ; 27
28 < < 28
29 = = 29
30 > > 30
31 ? ? 31
32 @ @ 32
33 A A 33
34 B B 34
35 C C 35
36 D D 36
37 E E 37
38 F F 38
39 G G 39
40 H H 40
41 I I 41
42 J J 42
43 K K 43
44 L L 44
45 M M 45
46 N N 46
47 O O 47
48 P P 48
49 Q Q 49
50 R R 50
51 S S 51
52 T T 52
53 U U 53
54 V V 54
55 W W 55
56 X X 56
57 Y Y 57
58 Z Z 58
59 [ [ 59
60 \ \ 60
61 ] ] 61
62 ^ ^ 62
63 _ _ 63
64 NUL ` 64
65 SOH a 65
66 STX b 66
67 ETX c 67
68 EOT d 68
69 ENQ e 69
70 ACK f 70
71 BEL g 71
72 BS h 72
73 HT i 73
74 LF j 74
75 VT k 75
76 FF l 76
77 CR m 77
78 SO n 78
79 SI o 79
80 DLE p 80
81 DC1 q 81
82 DC2 r 82
83 DC3 s 83
84 DC4 t 84
85 NAK u 85
86 SYN v 86
87 ETB w 87
88 CAN x 88
89 EM y 89
90 SUB z 90
91 ESC { 91
92 FS | 92
93 GS } 93
94 RS ~ 94
95 US DEL 95
96 FNC3 FNC3 96
97 FNC2 FNC2 97
98 SHIFT SHIFT 98
99 Code C Code C 99
100 Code B FNC4 Code B
101 FNC4 Code A Code A
102 FNC1 FNC1 FNC1
103 START (Code A)
104 START (Code B)
105 START (Code C)

Parameters for Code128:

Narrow module width
Value range: 1 to 10
This is the width for the narrowest module of a bar code, measured in pixels. It controls the width of the bar code. Value 1 generates the "narrowest", value 10 the widest bars or spaces.

Linear height
Value range: 1 to 9999
Controls the height of the bars of the bar code, measured in pixels. A value of 600 is equal to a height of one inch.

Code128 mode
Value range: N (default value), A, U
In default mode N (None), the Code128 bar code works in subset B. If you want to switch to another subset, you must trigger the change explicitly with a control command ("invocation code") in the bar code data.
In mode A (automatic), the software analyzes the transferred bar code data and recognizes automatically which subset is the most adequate for the bar code data. Subsets are swapped automatically in the bar code data. A sequence of four or more digits initiates an automatic change in subset C.
In mode U (UCC case mode), you must transfer 19 digits in the bar code data. Subset C is set automatically and an FNC1 character is added as prefix.
Note: If fewer than 19 digits are transferred, the bar code is filled with zeros to the left until it contains 19 digits.

UCC check digit
Value range: X equals YES, blank character equals No
Note: This parameter has no effect becaues Code128 always generates a check digit, even in UCC mode. The parameter will be removed in the future.

Invocation codes for Code128 Mode N:
You can select subsets A, B and C in two ways:
1) A special invocation code is added to the bar code data as prefix.
2) At the beginning of the bar code data, a special start code ("start code A", "start code B", "start code C") is used.
To switch the subset within the bar code data, insert an invocation code at the relevant position in the bar code data. The new subset is valid until the subset is changed again with a new invocation code.
For example: In subset C, a ">7" in the bar code data initiates a change to subset A.
The following table shows the Code128 invocation and start codes for the three subsets:
Invocation Decimal Subset A Subset B Subset C
Code value Character Character Character
>< 62 ^ ^
>0 30 > >
>= 94 ~
>1 95 USQ DEL
>2 96 FNC3 FNC3
> 3 97 FNC2 FNC2
> 4 98 SHIFT SHIFT
>5 99 CODE C CODE C
> 6 100 CODE B FNC4 CODE B
> 7 101 FNC4 CODE A CODE A
> 8 102 FNC1 FNC1 FNC1
Start Characters:
> 9 103 Start Code A (Numeric Pairs giveAlpha/Numerics)
> : 104 Start Code B (Normal Alpha/Numeric)
> ; 105 Start Code C (All Numeric 00-99)

Code 128 - subset B
Since Code128 subset B is the subset used most frequently, Code128 starts in subset B by default when in mode "N" if a start character is not defined in the bar code data. The bar code data for Code128 is transferred directly as ASCII characters, with the exception of values over 94 (decimal) and some special characters':
^ > ~
These characters must be transferred with the invocation codes listed above (for example, ">0" to represent the greater-than sign (>) in subset B or "><" to represent the caret character (^)).

Code128 - subsets A and C
Both subsets A and C are represented as digit pairs from 00 to 99 in the bar code data (see above in the table with the three character sets).
In subset A, a digit pair represents an individual character within the bar code; in subset C, the digit pair represents exactly the two digits of which it consists.
Example for subset A:
The bar code data
>9515334513752003331
encodes the "SUBSET A?" string in subset A. Bear in mind that subset A is started with the start character ">9" and that each subset A character to be encoded is represented with its decimal code. Therefore, you can also represent non-printable characters and special characters that are "illegal" in SAP Smart Forms with the Code128 bar code.

Example for subset C:
The bar code data
>;1234567890
encodes the string "1234567890" in subset C. Bear in mind that subset C is started with the start character ">;".
Note: If you specify anything else but a digit as the first position of a digit pair in the bar code data of subset C, this "illegal" character is ignored. However, if you specify a "non-digit" character in the second position of a digit pair, the entire digit pair is ignored.

******************* Code 93 *****************

Code93 is an alphanumeric code that can represent the following characters directly in the bar code data:
Numbers: 1234567890
Capital letters: ABCDEFGHIJKLMNOPQRSTUVWXYZ
Special characters: - . $ / + %
Blank characters (space characters)

The start and stop characters in the Code93 bar code are represented as # sign in the text view of the bar code data (also called "human-readable text" or "interpretation line").

Representation of the full ASCII character set in Code93:
By combining one of the special characters
' & ( )
with another character, you can represent the complete ASCII character set (that is, all characters from 0 to 127 in decimal form) with Code93 as follows:
Val. ASCII char. Character in bar code
0 NUL 'U
1 SOH &A
2 STX &B
3 ETX &C
4 EOT &D
5 ENQ &E
6 ACK &F
7 BEL &G
8 BS &H
9 HT &I
10 LF &J
11 VT &K
12 FF &L
13 CR &M
14 SO &N
15 SI &O
16 DLE &P
17 DC1 &Q
18 DC2 &R
19 DC3 &S
20 DC4 &T
21 NAK &U
22 SYN &V
23 ETB &W
24 CAN &X
25 EM &Y
26 SUB &Z
27 ESC 'A
28 FS 'B
29 GS 'C
30 RS 'D
31 US 'E
32 space
33 ! (A
34 " (B
35 # (C
36 $ $
37 % %
38 & (F
39 ' (G
40 ( (H
41 ) (I
42 * (J
43 + +
44 , (L
45 - -
46 . .
47 / /

58 : (Z
59 ; 'F
60 < 'G
61 = 'H
62 > 'I
63 ? 'J
64 @ 'V

91 [ 'K
92 \ 'L
93 ] 'M
94 ^ 'N
95 _ 'O
96 ` 'W
97 a )A
98 b )B
99 c )C
100 d )D
101 e )E
102 f )F
103 g )G
104 h )H
105 i )I
106 j )J
107 k )K
108 l )L
109 m )M
110 n )N
111 o )O
112 p )P
113 q )Q
114 r )R
115 s )S
116 t )T
117 u )U
118 v )V
119 w )W
120 x )X
121 y )Y
122 z )Z
123 { 'P
124 | 'Q
125 } 'R
126 ~ 'S
127 DEL 'T

Parameters for Code93:

Narrow module width
Value range: 1 to 10
This is the width for the narrowest module of a bar code, measured in pixels. It controls the width of the bar code. Value 1 generates the "narrowest", value 10 the widest bars or spaces.

Linear height
Value range: 1 to 9999
Controls the height of the bars of the bar code, measured in pixels. A value of 600 is equal to a height of one inch.

Check digit
Value range: X equals YES, blank character equals No
With Code93 bar codes, a pair of check digits is always used and is always generated in the bar code. This parameter has no effect.

******************* PDF417 *******************

PDF417 is a two-dimensional bar code to represent datasets that are larger as the usual datasets in one-dimensional bar codes (for example, more than 1,000 characters). The entire 7-Bit ASCII character set is generally processed (binary values 1 - 127, the value 0 is not permitted).
A PDF417 bar code consists of 3 to 90 consecutive rows. Every row consists of a start/stop indicator and "code words". A code word consists of 4 bars and 4 spaces. The minimum number of code words per row is three.

Parameters for PDF417:

Narrow module width
Value range: 1 to 10
This is the width for the narrowest module of a bar code, measured in pixels. Value 1 generates the "narrowest", value 10 the widest bars or spaces.

Linear height
Value range: 1 to 9999
This parameter currently has no effect on PDF417. The height of a PDF417 symbol is controlled by parameter "Single Row Height" and the number of columns and rows, in conjunction with the length of text data to be encoded.

Single row height
Value range: 1 to 32000
This value, multiplied by the narrow module width, returns the height of the individual rows of a PDF417 symbol, measured in pixels. Caution: Do NOT use the value 1 for this parameter

Security level
Value range: 0, 1-8
This parameter controls the number of code words that are generated for error recognition and error correction. The default value 0, however, only permits error recognition but no automatic correction. If you increase the security level, the level of error correction increases with it (this increases the size of the bar code).

Number of columns
Here, you can define the number of the code word columns which you can use to check the width of the bar code.
Value range:
0 (default value) : A row/column ratio of 1:2 is used.
Permitted values: 1 to 30

Number of rows
Here, you can define the number of rows which can be used to check the height of the bar code.
Value range:
0 (default value) : A row/column ratio of 1:2 is used.
Permitted values: 3 to 90
For example: If you leave both parameters set to the default value 0, the system would convert 72 code words in a bar code symbol with 6 columns and 12 rows.

Truncation
Value range: X equals YES, blank character equals No
This indicator determines if the right row indicator and the stop pattern are to be truncated (this saves space).

The following character combinations in the transferred bar code data have the special function:
\& - This represents the end of a line (Carriage Return + Newline)
\\ - This represents a backslash (5C hexadecimal)
\0xYY - This represents a single byte with the value YY (hexadecimal)
For example: \0x1E is output as a single byte with the value 1E (hex)
or 30 (decimal).

Comments:
- If you specify values higher than zero for Number of columns and Number of rows, the result of both values must be less than 928.
- A bar code is not printed if the total of Columns and Rows is higher than 928.
- A bar code is not printed if the total number of code words is greater than Columns multiplied by Rows.
- You can use Truncation if it is unlikely that the bar code will be damaged.

No comments:

Post a Comment