cancel
Showing results for 
Search instead for 
Did you mean: 

Barcode width problem using smartform

Former Member
0 Kudos

Dear experts,

No matter what is the no of characters in the barcode value is, the total width of the barcode never change, it always stay at 50mm, example:


IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII   TESTING
IIIIIIIIIIIIIIIIIIIII                TEST
IIIIIIIIIIII                         TE
<----50mm-------------------------->

Symbology: 128A

Allignment: Normal

What I want is the barcode width should follow the no of characters, like below:

IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII TESTING

IIIIIIIIIIIIIIIIIIIII TEST

IIIIIIIIIIII TE

How to accomplish this?

**I already tried adjust the "Narrow Module Width" to different values, but the total width remain at 50mm, the only thing change is the barcode dimension.

Edited by: Yean Nean Yong on Nov 13, 2009 5:40 PM

Edited by: Yean Nean Yong on Nov 13, 2009 5:47 PM

Accepted Solutions (0)

Answers (2)

Answers (2)

Sandra_Rossi
Active Contributor
0 Kudos

I think this is not possible with standard: as you seem to use the new bar code technology (cf Note 645158 - New bar code technology for Smart Forms), here is how it works: SAP converts the barcode to an image, and sends it to the printer. There is no standard way to know what is the length of the generated barcode.

Maybe you can determine the formula to calculate length of generated barcode (I think it is not so complex) and then position the text using POSITION print control.

Former Member
0 Kudos

Hi Sandra,

How to use POSITION print control? can you give a simple example? thanks.

Sandra_Rossi
Active Contributor
0 Kudos

my mistake: it's POSITION control command (not "print control"). For more info, see [sap library - sapscript - control commands - box, position, size|http://help.sap.com/saphelp_nw2004s/helpdata/en/d1/803293454211d189710000e8322d00/frameset.htm]

Sandra_Rossi
Active Contributor
0 Kudos

Another solution you can try, if the printer language allows to generate directly the barcodes (especially true with Zebra printers/ZPL language): try to print the text right after the barcode command without any intermediate "cursor" relocation

Former Member
0 Kudos

Sandra,

I know POSITION can be used in sap script, but I'm using smart forms. In smart forms, we can insert command node but there is no place to put in POSITION command.

As for the other solution you suggested, I'm not using any Zebra printer, I'm using HP laserjet (Device Type: HPLJ4).

Sandra_Rossi
Active Contributor
0 Kudos

my fault again: POSITION can only position a BOX, not a text. Note that (almost all) commands may be used in both sapscript and in smart forms (I could create a box at a given position inside a smart form with POSITION and BOX commands).

So I think the easiest solution is to position by repeating spaces before the text you want to display. For example, you determine that one space width is 10 points; if the calculated barcode width is 500 points then you must repeat 50 spaces. You define barcode in its window, and text in another window...

Former Member
0 Kudos

I solved the problem by using 2 windows: 1st window for barcode & 2nd window for text, then I position the 2nd window right after the barcode (actual width of the barcode is 20mm, so I position 2nd window at 25mm), the windows position like below:


-------------------------------------------
|     main window                          |            
|                   ---------------        |                 
|    &Barcode&      | 2nd window  |        |
|                   ---------------        |
|                                          |                                                                    
|                                          |
|                                          |
|                                          |
|                                          |
|------------------------------------------|

I'm not sure whether this is the correct way to do it, but I got what I want. I already post this issue to SAP, they are investigating, maybe in the future they will enhance the barcode printing to follow actual width (Hope so).

Sandra_Rossi
Active Contributor
0 Kudos

I thought you had many possible lengths. If you have one or a limited number of barcode widths, you found the best solution! I don't think that SAP will change how it currently works. If you get more information, keep us informed

Former Member
0 Kudos

Anyone care to help? I'm stuck with this problem