Printing Labels in Landscape Format Using Smart Forms
Printing Labels in Landscape Format Using Smart Forms
Printing Labels in Landscape Format Using Smart Forms
Applies to:
This Article is intended for all those ABAPers who are interested in Printing Landscape Labels using SMARTFORMS and use them in ABAP. For more information, visit the ABAP homepage.
Summary:
This article will show how to print Labels in Landscape format and use them in sap ABAP. Author: Deepak Nagar
Author Bio:
Deepak Nagar works for Infosys Technologies Limited on ABAP module of SAP. Creation of Sets in SAPABAP, How to Read them INI SAP-ABAP Reports SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 2010 SAP AG 2.
Table of Contents
Overview: ............................................................................................................................................................ 3 Steps of Creation: ............................................................................................................................................... 3 Creating the Style: ........................................................................................................................................... 3 Creating the SMARTFORM: ........................................................................................................................... 6 Output Label: ...................................................................................................................................................... 9 Related Content ................................................................................................................................................ 10 Disclaimer and Liability Notice: ......................................................................................................................... 11
Overview:
In this article I am trying to explain the process by which we can print Labels in landscape format. To print Labels in Landscape format we will rotate the texts in SMARTFORM output by 90 degrees. Thus, getting output in Landscape format. We need to have a Rotated Barcode in this case as the Barcodes are not rotated using the Commands used in Smartforms.
Steps of Creation:
Creating the Style: Go to transaction SMARTSTYLES.
Name the Paragraph format, give a brief description and assign the required characteristics.
Name the Character format and give a brief description. Now as shown in the below screen-shot, select the required Bar Code (Rotated) from the dropdown menu. The description of the Barcode is also displayed alongside.
In the Header data of the Style, specify the Standard Paragraph format from the drop-down menu.
Mention the SMARTFORM name and press CREATE. Use the SmartStyle created above in the Output Options- Style field as shown below.
In the Main Window create a command field and write the command as shown below: Attribute Name: S_LZPL_SETUP Attribute Value: '^FWR'
This command is responsible for rotation of the text on the Label. When we will print the text on the label Horizontally, this command will rotate the text by 90 degrees on its axis clockwise. NOTE: Barcodes are not rotated by this command. For this reason we will use Rotated Barcodes. An important thing to notice is that when Label is rotated, the Left Margin and the Top Margin changes Top Margin and Left Margin of the output respectively. The position of text after rotation should be estimated beforehand (exact layout can be achieved after a few attempts). Check out the figure given below. The Actual Top Margin becomes outputs Left Margin and the Actual Left Margin becomes outputs inverse Top Margin (more the left margin, lesser is the top margin in the output and vice-versa).
Moving a window UP in portrait = moves LEFT landscape. Moving RIGHT portrait = moves UP landscape Moving DOWN portrait = moves RIGHT landscape Moving LEFT portrait = moves DOWN landscape
We cannot have two texts in the same window with different left margins to be positioned correctly in separate rows in the output after rotation. Thus, to achieve this we will have to create multiple windows overlapping each other. These overlapping windows will have text in the same row but with different left margins, which on rotation will result in different top margins. Hence creating different rows in the output.
After creating the required layout and placing the texts at the correct positions, we can use the Rotated Bar Code. The field for which we need the Bar Code in the Label should be printed using the Character format C1 as shown below:
Output Label:
Getting the fields at the required positions will result in the output as shown below:
Related Content
For more information, visit the ABAP homepage