new barcode printing in sap using smart forms

Upload: ekwikk

Post on 07-Apr-2018

248 views

Category:

Documents


1 download

TRANSCRIPT

  • 8/3/2019 New Barcode Printing in SAP Using Smart Forms

    1/11

    New Barcode Printing in SAP using

    Smartforms

    Attachments:14 Added byKris Donald, last edited byCraig Cmehilon Jun 19, 2008 (view change)

    Applies to:

    The new bar code conversion is included as standard as of SAP Web Application Server 6.40.

    You can also use the new bar code conversion as of SAP R/3 4.6C, as long as you have

    imported the relevant Basis Support Package and the corresponding Kernel Patch. For more

    information about this, see SAP Note 430887 in the SAP Service Marketplace.

    Summary

    Use any standard printer to print out barcodes using SAP Smartforms

    Author(s): Kris Donald & Siddharth Shah

    Company: Larsen & Toubro Infotech Ltd, Mumbai

    Created on:10 June 2008

    Authors Bio

    Kris Donald is a SAP technical consultant working with L&T Infotech, Mumbai, India. He

    has worked in SAP since September 2006 and his experience spans various technologies such

    as ABAP, XI, MDM and Web Dynpro for Java and ABAP Siddharth Shah is a SAP technical

    consultant working with L&T Infotech, Mumbai, India. He has worked in SAP since August

    2007 and his experience spans technologies such as ABAP and Web Dynpro for Java

    Table of Contents

    Applies to:

    Summary.

    Author Bio.

    Introduction.

    1. Maintaining the Font(s)

    http://wiki.sdn.sap.com/wiki/display/profile/New+Barcode+Printing+in+SAP+using+Smartformshttp://wiki.sdn.sap.com/wiki/display/profile/New+Barcode+Printing+in+SAP+using+Smartformshttp://wiki.sdn.sap.com/wiki/pages/viewpageattachments.action?pageId=27788128&metadataLink=truehttp://wiki.sdn.sap.com/wiki/pages/viewpageattachments.action?pageId=27788128&metadataLink=truehttp://wiki.sdn.sap.com/wiki/pages/viewpageattachments.action?pageId=27788128&metadataLink=truehttp://wiki.sdn.sap.com/wiki/display/~1004sw6axhttp://wiki.sdn.sap.com/wiki/display/~1004sw6axhttp://wiki.sdn.sap.com/wiki/display/~1004sw6axhttp://wiki.sdn.sap.com/wiki/display/~wm7mxeshttp://wiki.sdn.sap.com/wiki/display/~wm7mxeshttp://wiki.sdn.sap.com/wiki/display/~wm7mxeshttp://wiki.sdn.sap.com/wiki/pages/diffpages.action?pageId=27788128&originalId=27788315http://wiki.sdn.sap.com/wiki/pages/diffpages.action?pageId=27788128&originalId=27788315http://wiki.sdn.sap.com/wiki/pages/diffpages.action?pageId=27788128&originalId=27788315http://wiki.sdn.sap.com/wiki/pages/diffpages.action?pageId=27788128&originalId=27788315http://wiki.sdn.sap.com/wiki/display/~wm7mxeshttp://wiki.sdn.sap.com/wiki/display/~1004sw6axhttp://wiki.sdn.sap.com/wiki/pages/viewpageattachments.action?pageId=27788128&metadataLink=truehttp://wiki.sdn.sap.com/wiki/display/profile/New+Barcode+Printing+in+SAP+using+Smartformshttp://wiki.sdn.sap.com/wiki/display/profile/New+Barcode+Printing+in+SAP+using+Smartforms
  • 8/3/2019 New Barcode Printing in SAP Using Smart Forms

    2/11

    Creating a new font

    2. Creating the Style.

    3. Creating the Smartform

    4. ABAP Program to call the Smartform

    Sample program

    5. Sample Output

    6. Troubleshooting

    Consecutive bar-coded rows overlap

    Second field shows MATNR in English and not bar-coded

    Preview is proper but printing doesn't take place at all

    Preview is proper, text is printed properly but barcode (and pictures) are not proper

    Related Content

    Disclaimer and Liability Notice

    Introduction

    With traditional bar code printing, the bar codes are generated at the printer and not in the

    SAP system. Special hardware, such as SIMM modules, is required to do this. If the bar code

    is to be formatted or controlled with traditional bar code printing, print controls must be

    changed in the printer commands. In contrast to traditional bar code printing, the new bar

    code printing does not require any special software, since the bar code is sent to the printer as

    a graphic. However, the new bar code printing only works with Smart Forms.

    1. Maintaining the Font(s)

    Go to TCODE SE73 and display the system bar codes*,*

  • 8/3/2019 New Barcode Printing in SAP Using Smart Forms

    3/11

    A default font (such as C128A shown below) can be used or you can create your ownfont

    Creating a new font

    Make sure you are in change mode for System bar codes Click on the New button on the toolbar and then choose the 'New Bar Code

    Technology' and give it a name (eg: BC_NAME) and description

    Different barcode technologies are available. For this example we shall use 'Code 128'

    Keep the other settings as default and save the font in a transport request (clicking oncancel at the transport request popup will save it locally)

  • 8/3/2019 New Barcode Printing in SAP Using Smart Forms

    4/11

    2. Creating the Style

    Go to transaction SMARTSTYLES or use the 'Style' radio button of transactionSMARTFORMS

    Create a new Style (eg: ZBARCODE_STYLE) Create a default Paragraph Format by clicking on 'Create Node' from the Context

    Menu of 'Paragraph Formats' in the left navigation view

    Create a new Character Format by clicking on 'Create Node' from the Context Menuof 'Character Formats' in the left navigation view (I have given the Character Format

    the name 'CH' in this example)

  • 8/3/2019 New Barcode Printing in SAP Using Smart Forms

    5/11

    From the barcode name dropdown list, choose either a system default value such asC128A or the font that we just created (eg: BC_NAME)

    Save and activate the Style

    3. Creating the Smartform

    Here we will create a Smartform to display Material numbers from the MARA table as well

    as a barcode which contains that same Material number * Go to transaction SMARTFORMS

    and create a new Smartform (ZBARCODE_MARA in this example)

  • 8/3/2019 New Barcode Printing in SAP Using Smart Forms

    6/11

    Create the following entry in the Tables tab of the Form Interface of your Smartform

    Save the Smartform Create a new Table entry on the Main Window as shown below

    In the Table tab of %TABLE1,Split the Line type %LTYPE1 into two parts In the Data tab, LOOP AT Internal Table IT_MARA INTO IT_MARA Create a Table Line in the header as well as the Main Area of the table Assign Line type %LTYPE1 to both of them

  • 8/3/2019 New Barcode Printing in SAP Using Smart Forms

    7/11

    Create a Text value in each of these four cells (you can rename them to make it easierto understand) Your left side navigation display should now look something like this

    Put appropriate headers into the HEADER_MATNR and HEADER_MATNR_CODEtext fields

    Click on the Field list button to display the field list

  • 8/3/2019 New Barcode Printing in SAP Using Smart Forms

    8/11

    Drag and drop the MATNR field from the IT_MARA table interface into the GeneralAttributes tab of the DATA_MATNR as well as the DATA_MATNR_CODE cells

    In the Output Options tab of the DATA_MATNR_CODE cell, choose the style thatyou created earlier (ZBARCODE_STYLE in this example)

    Go back to the General Attributes tab, select the text &IT_MARA-MATNR& andthen change its character style to 'CH'

    Save and activate the Smartform

    4. ABAP Program to call the Smartform

    Go to transaction SE38 Create a simple program to call the Smartform Save, activate and run the program You can choose to preview or print the Smartform

    Sample program

    *&---------------------------------------------------------------------*

    *& Report ZBARCODE_CALLER

  • 8/3/2019 New Barcode Printing in SAP Using Smart Forms

    9/11

    *&

    *&---------------------------------------------------------------------*

    *& call smart form

    *&

    *&---------------------------------------------------------------------*

    REPORT ZBARCODE_CALLER.

    TABLES MARA.

    DATA FMNAME TYPE RS38L_FNAM.

    DATA ZITAB TYPE STANDARD TABLE OF MARA.

    SELECT MATNR FROM MARA INTO CORRESPONDING FIELDS OF TABLE ZITAB

    UP TO 15 ROWS.

    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'EXPORTING

    FORMNAME = 'ZBARCODE_MARA'

    IMPORTING

    FM_NAME = FMNAME.

    CALL FUNCTION FMNAME

    TABLES

    IT_MARA = ZITAB.

    5. Sample Output

  • 8/3/2019 New Barcode Printing in SAP Using Smart Forms

    10/11

  • 8/3/2019 New Barcode Printing in SAP Using Smart Forms

    11/11

    6. Troubleshooting

    Consecutive bar-coded rows overlap

    Create a new paragraph format and set the Line Spacing to 2 Lines

    Use this new format in the non bar-coded cells

    Second field shows MATNR in English and not bar-coded

    Make sure you select the text before changing the character format in the Smartform

    Preview is proper but printing doesn't take place at all

    Make sure your printer is configured properly in transaction SPAD. Try printing something

    else from SAP to verify the settings

    The device type used in our system is SAPWIN : Rel.4.x/SAPlpd 4.09+_Also check the

    _Print Immediately button, else go to transaction SP01 to immediately print all pending print

    jobs

    Preview is proper, text is printed properly but barcode (and pictures) are not

    proper

    Check that your printer is configured properly in Windows with the proper driver that

    matches your printer's model