最近一段时间一直在研究Zebra Printer,这是一个专门用于打印标签的打印机。而作为制造企业来说是有很多标签需要来打印的:Production Label, Production Pre-Labels, Production Hazard Label, Production Address label, GR Label.....。
这些标签使用我们传统的打印机是肯定不行的:标签的尺寸不统一;需要具有粘性,打印之后可以很方便的粘贴在货物上面;美观....。很多原因我也说不上来。但是不管怎么说,Zebra printer是标签打印的上上之选。

我们是在SAPscript 中使用Zebra script的,然后发送到Zebra printer来进行打印。需要注意的是,Zebra Form必须发送到Zebra printer,并且不能进行预览。相对来说也算是一个缺点。

下面是一个Pre-Label的SAPscript源代码:
 1SFORMZCSZ_PRE_LABEL
 2HFORMZCSZ_PRE_LABEL
 3 OLANE
 4 HEADFORM      ZCSZ_PRE_LABEL  SAP                                                   DEF EMA_DD_320_LCS, Pre Label                          ZCSZ_PRE_LABEL          00044CAREYCA2    46C 20030319133104DDIC        46C 2008041811415413200006 E0                                                                                                                           010
 5 LINE/:FORM CPI 10; LPI 6; TAB-STOP 1 CM; START-PAGE FIRST; PARAGRAPH L; RDI;
 6 LINE/:FORM RDIDEV;
 7 LINE/:PARAGRAPH L LINE-SPACE 1 LN;
 8 LINE/:WINDOW MAIN
 9 LINE/:PAGE FIRST NEXT FIRST;
10 LINE/:PAGE FIRST MAIN 0 0 MM 0 MM 148 MM 105 MM;
11 END
12 HEADFORM      ZCSZ_PRE_LABEL  SAP                                                   TXT 1MA_DD_320_LCS, Pre Label                          ZCSZ_PRE_LABEL          00040CAREYCA2    46C 20030319133104DDIC        46C 2008041811415413200596 E1                                                                                                                           010
13 LINE/:FORM TEXT 'MA_DD_320_LCS, Pre Label';
14 LINE/:PARAGRAPH L TEXT 'Left Justified';
15 LINE/:WINDOW MAIN TEXT 'Main window';
16 LINE/:PAGE FIRST TEXT 'First Page';
17 LINE/WMAIN
18 LINE/**----------------------------------------------------------------------*
19 LINE/*MA_DD_320_LCO - Print Pre Labels
20 LINE/*24-Mar-2003
21 LINE/**----------------------------------------------------------------------*
22 LINE*
23 LINE/EETIKETT
24 LINE/:IF &SY-SYSID(1)& = 'P'
25 LINE/:INCLUDE ZCSM_NOV_PRE_LABEL OBJECT TEXT ID ST LANGUAGE EN
26 LINE/:ENDIF
27 LINE/:PERFORM 'GET_MAT_TEXT' IN PROGRAM 'ZCSMI_GR_LABEL'
28 LINE/:USING &ZCSM_WM_LABEL-MATNR&
29 LINE/:CHANGING &GL_S_MAKTX_1&
30 LINE/:CHANGING &GL_S_MAKTX&
31 LINE/:ENDPERFORM
32 LINE/:NEW-PAGE
33 LINE* ^XA
34 LINE/ ~DGR:PreCN000.GRF,01792,028,
35 LINE/ ,
36 LINE/ :
37 LINE/ :
38 LINE/ :
中间为Zebra 将中文转变为图片的信息,此例中大概有五到六个这样的中文词组。
  1 LINE/ :
  2 LINE/ :
  3 LINE/ :
  4 LINE/ :
  5 LINE/ :
  6 LINE/ ^DFR:PreCN.ZPL^FS
  7 LINE* ^SEE:GB.DAT^FS
  8 LINE* ^CWJ,E:MSUNG24.FNT^FS
  9 LINE/ ~TA000~JSN^LT0^MMT^MNW^MTT^PON^PMN^LH0,0^JMA^PR2,2^MD10^LRN^CI26
 10 LINE/
 11 LINE*
 12 LINE*
 13 LINE/
 14 LINE/:IF &SY-SYSID(1)& = 'P'
 15 LINE/ ^FO1150,59^FR^XGLOGO000.GRF,1,1^FS
 16 LINE/:ENDIF
 17 LINE/
 18 LINE* ^LL1240
 19 LINE/ ^PW1748
 20 LINE/ ^LS0
 21 LINE/ ^FT704,152^A0N,83,81^FH\^FN2^FS
 22 LINE/ ^FT379,405^AJN,83,81^FH\^FN9^FS
 23 LINE/ ^FT379,286^A0N,83,81^FH\^FN3^FS
 24 LINE/ ^FT487,528^A0N,83,81^FH\^FN4^FS
 25 LINE/ ^FT484,662^A0N,83,81^FH\^FN5^FS
 26 LINE/ ^FT685,793^A0N,83,81^FH\^FN6^FS
 27 LINE/ ^FT727,923^A0N,83,81^FH\^FN7^FS
 28 LINE/*^BY7,3,205^FT413,1162^BCN,,Y,N^FN8^FS
 29 LINE/ ^BY4,3.0^FO413,980^A0N,56,55^BCN,170,Y,N,N,D^FR^FN8^FS
 30 LINE/
 31 LINE/ ^FT431,165^XGPreCN000.GRF,1,1^FS
 32 LINE/ ^FT30,428^XGPreCN001.GRF,1,1^FS
 33 LINE/ ^FT470,950^XGPreCN002.GRF,1,1^FS
 34 LINE/ ^FT390,820^XGPreCN003.GRF,1,1^FS
 35 LINE/ ^FT260,540^XGPreCN004.GRF,1,1^FS
 36 LINE/ ^FT260,682^XGPreCN005.GRF,1,1^FS
 37 LINE/ ^FT38,152^A0N,83,81^FH\^FDProduct No /^FS
 38 LINE/ ^FT38,286^A0N,83,81^FH\^FDProduct:^FS
 39 LINE/ ^FT38,528^A0N,83,81^FH\^FDBatch /^FS
 40 LINE/ ^FT38,662^A0N,83,81^FH\^FDDrum /^FS
 41 LINE/ ^FT44,793^A0N,83,81^FH\^FDSerial No /^FS
 42 LINE/ ^FT44,923^A0N,83,81^FH\^FDRevision No /^FS
 43 LINE/ ^XZ
 44 LINE/
 45 LINE/
 46 LINE/
 47 LINE/
 48 LINE/:NEW-PAGE
 49 LINE/ ^FX[Recall]^FS
 50 LINE/ ^XA
 51 LINE/ ^XFR:PreCN.ZPL
 52 LINE/ ^FN3^FD&GL_S_MAKTX&^FS
 53 LINE/ ^FN4^FD&ZCSM_WM_LABEL-CHARG&^FS
 54 LINE/ ^FN5^FD&ZCSM_WM_LABEL-UNIT&^FS
 55 LINE/ ^FN6^FD&ZCSM_WM_LABEL-SERNO&^FS
 56 LINE/ ^FN7^FD&ZCSM_WM_LABEL-REVNO&^FS
 57 LINE/ ^FN8^FD&GL_S_BARCODE1&^FS
 58 LINE/ ^FN9^FD&GL_S_MAKTX_1&^FS
 59 LINE/ ^FN2^FD&ZCSM_WM_LABEL-MATNR&^FS
 60 LINE/ ^PQ1,0,1,Y
 61 LINE/ ^XZ
 62 LINE/ ^FX End of job
 63 END
 64 HEADFORM      ZCSZ_PRE_LABEL  SAP                                                   TXT DMA_DD_320_LCS, Pre Label                          ZCSZ_PRE_LABEL          00035CAREYCA2    46C 20030319133104DDIC        46C 2008041811415413200051 E0                                                                                                                           010
 65 LINE/:FORM TEXT 'MA_DD_320_LCS, Pre Label';
 66 LINE/:PARAGRAPH L TEXT 'Left Justified';
 67 LINE/:WINDOW MAIN TEXT 'Main window';
 68 LINE/:PAGE FIRST TEXT 'First Page';
 69 LINE/WMAIN
 70 LINE/**----------------------------------------------------------------------*
 71 LINE/*MA_DD_320_LCO - Print Pre Labels
 72 LINE/*24-Mar-2003
 73 LINE/**----------------------------------------------------------------------*
 74 LINE/EETIKETT
 75 LINE/:IF &SY-SYSID(1)& = 'P'
 76 LINE/:INCLUDE ZCOM_NOV_PRE_LABEL OBJECT TEXT ID ST LANGUAGE EN
 77 LINE/:ENDIF
 78 LINE/:NEW-PAGE
 79 LINE/ ^XA
 80 LINE/ ^DFZCOM_N-2^FS
 81 LINE/ ^PRC
 82 LINE/ ^LH0,0^FS
 83 LINE/ ^LL1261
 84 LINE/ ^MD0
 85 LINE/ ^MNY
 86 LINE/ ^LH0,0^FS
 87 LINE/ ^BY4,3.0^FO176,800^A0N,54,48^BCN,240,Y,N,N,D^FR^FN999^FS
 88 LINE/ ^FO360,258^A0N,94,71^CI13^FR^FN998^FS
 89 LINE/ ^FO360,414^A0N,107,82^CI13^FR^FN997^FS
 90 LINE/:IF &SY-SYSID(1)& = 'P'
 91 LINE/ ^FO1025,59^FR^XG23EPCZco,1,1^FS
 92 LINE/:ENDIF
 93 LINE/ ^FO360,94^A0N,107,71^CI13^FR^FB623,2,0,L^FN996^FS
 94 LINE/ ^FO1039,731^A0N,59,46^CI13^FR^FN995^FS
 95 LINE/ ^FO240,732^A0N,59,46^CI13^FR^FN994^FS
 96 LINE/ ^FO360,573^A0N,107,82^CI13^FR^FN993^FS
 97 LINE/ ^FO40,96^A0N,81,59^CI13^FR^FDProdukt Nr:^FS
 98 LINE/ ^FO40,256^A0N,81,71^CI13^FR^FDProdukt:^FS
 99 LINE/ ^FO40,416^A0N,81,71^CI13^FR^FDBatch:^FS
100 LINE/ ^FO40,575^A0N,81,71^CI13^FR^FDGebinde:^FS
101 LINE/ ^FO40,731^A0N,59,46^CI13^FR^FDSerien Nr:^FS
102 LINE/ ^FO719,730^A0N,59,57^CI13^FR^FDRevisions Nr:^FS
103 LINE/ ^XZ
104 LINE/:NEW-PAGE
105 LINE/ ^XA
106 LINE/ ^XFZCOM_N-2.ZPL
107 LINE/ ^FN999^FH^FD&GL_S_BARCODE1&^FS
108 LINE/ ^FN998^FD&GL_S_MAKTX&^FS
109 LINE/ ^FN997^FD&ZCOM_WM_LABEL-CHARG&^FS
110 LINE/ ^FN996^FD&ZCOM_WM_LABEL-MATNR&^FS
111 LINE/ ^FN995^FD&ZCOM_WM_LABEL-REVNO&^FS
112 LINE/ ^FN994^FD&ZCOM_WM_LABEL-SERNO&^FS
113 LINE/ ^FN993^FD&ZCOM_WM_LABEL-UNIT&^FS
114 LINE/ ^XZ
115 LINE/ ^FX End of job
116 END
117 HEADFORM      ZCSZ_PRE_LABEL  SAP                                                   TXT EMA_DD_320_LCS, Pre Label                          ZCSZ_PRE_LABEL          00044CAREYCA2    46C 20030319133104DDIC        46C 2008041811415413200059 E0                                                                                                                           010
118 LINE/:FORM TEXT 'MA_DD_320_LCS, Pre Label';
119 LINE/:PARAGRAPH L TEXT 'Left Justified';
120 LINE/:WINDOW MAIN TEXT 'Main window';
121 LINE/:PAGE FIRST TEXT 'First Page';
122 LINE/WMAIN
123 LINE/**----------------------------------------------------------------------*
124 LINE/*MA_DD_320_LCO - Print Pre Labels
125 LINE/*24-Mar-2003
126 LINE/**----------------------------------------------------------------------*
127 LINE*
128 LINE/EETIKETT
129 LINE/:IF &SY-SYSID(1)& = 'P'
130 LINE/:INCLUDE ZCSM_NOV_PRE_LABEL OBJECT TEXT ID ST LANGUAGE EN
131 LINE/:ENDIF
132 LINE/:NEW-PAGE
133 LINE*
134 LINE/ ^XA
135 LINE/ ^DFR:PreLabel.ZPL^FS
136 LINE/ ~TA000~JSN^LT0^MMT^MNW^MTT^PON^PMN^LH0,0^JMA^PR2,2^MD10^LRN^CI0
137 LINE/
138 LINE/:IF &SY-SYSID(1)& = 'P'
139 LINE/ ^FO1150,59^FR^XGLOGO000.GRF,1,1^FS
140 LINE/:ENDIF
141 LINE/
142 LINE* ^LL1240
143 LINE/ ^PW1748
144 LINE/ ^LS0
145 LINE/ ^FT496,177^A0N,92,91^FH\^FN2^FS
146 LINE/ ^FT378,344^A0N,83,81^FH\^FN3^FS
147 LINE/ ^FT307,509^A0N,83,81^FH\^FN4^FS
148 LINE/ ^FT307,675^A0N,83,81^FH\^FN5^FS
149 LINE/ ^FT390,832^A0N,75,74^FH\^FN6^FS
150 LINE/ ^FT1547,832^A0N,75,74^FH\^FN7^FS
151 LINE/ ^BY4,3.0^FO390,900^A0N,56,55^BCN,170,Y,N,N,D^FR^FN8^FS
152 LINE/ ^FT71,179^A0N,83,84^FH\^FDProduct No:^FS
153 LINE/ ^FT71,344^A0N,83,81^FH\^FDProduct:^FS
154 LINE/ ^FT71,509^A0N,83,81^FH\^FDBatch:^FS
155 LINE/ ^FT71,675^A0N,83,81^FH\^FDDrum:^FS
156 LINE/ ^FT71,832^A0N,75,74^FH\^FDSerial No:^FS
157 LINE/ ^FT1134,832^A0N,75,74^FH\^FDRevision No:^FS
158 LINE/
159 LINE/ ^XZ
160 LINE/
161 LINE/
162 LINE/
163 LINE/:NEW-PAGE
164 LINE/ ^FX[Recall]^FS
165 LINE/ ^XA
166 LINE/ ^XFR:PreLabel.ZPL
167 LINE/ ^FN3^FD&GL_S_MAKTX&^FS
168 LINE/ ^FN4^FD&ZCSM_WM_LABEL-CHARG&^FS
169 LINE/ ^FN5^FD&ZCSM_WM_LABEL-UNIT&^FS
170 LINE/ ^FN6^FD&ZCSM_WM_LABEL-SERNO&^FS
171 LINE/ ^FN7^FD&ZCSM_WM_LABEL-REVNO&^FS
172 LINE/ ^FN8^FH^FD&GL_S_BARCODE1&^FS
173 LINE/ ^FN2^FD&ZCSM_WM_LABEL-MATNR&^FS
174 LINE/ ^PQ1,0,1,Y
175 LINE/ ^XZ
176 LINE/ ^FX End of job
177 END
178 ACTVSAP
179E
180
posted on 2008-04-25 13:52  沧海-重庆  阅读(3378)  评论(0编辑  收藏  举报