Go to SPAD transaction and first press Full administration button.
You will then see Device Types tab. Navigate to Device Types tab and press Display next to Page Formats input.
This will give you list of all Page Formats defined in system, you can check this list to see if any of these matches your paper size. If it does then you won’t need any new Page Formats.
To create new Page Format first go to change mode and then press new button. Enter name of Page Format, Orientation and Dimension of page and save.
The page dimensions and orientation specified page format is just for smartform and sapscript and it do not affect any printer.
NOT: You may like to define both landscape and portrait definition here if you have that requirement. If you only define Portrait size and try and use landscape in smartform/sapscript you will get following messages.
Warning message SMARTFORMS291 in smartform – You have chosen ZCH1 landscape format as the page format. This page format is not available in the spool administration.
Error message TD108 – Page format ZCH1 L is not in the spool administration.
After you have defined page format you can start with your smartform/sapscript development. Page layout which you see in smartform/sapscript take page information from Page Format definition.
You will get warning message, (TD165) You have selected a page format ZCH1 for which there is no identical formatting type in the spool, in sapscript but it will let you work on sapscript. However you won’t be able to print just yet.
Go back to transaction SPAD Full administration mode and under Device type click on Display next to Format Types input.
On next screen click on new button and create new format type ZCH1, yes Format Type and Page Format should have same name. Make sure you choose ‘Format type for SAPscript’ then select Page Format, Select Portrait specify something meaningful in comment and save.
Modifying Device Type Setting
Page Format store page information for sapscript/smartforms. Format type is created just for documentary purpose and does not hold any additional information. Printer code which actually sets page size on printer is defined in Device type for each Format type it supports. If you do not already know, printers in SAP points to Device type which stores all printer specific data including printer codes for all Format Type it supports. For your printer to support this page size you need to add Format Type in its Device type. And more importantly you need to specify printer code after you have added Format type in Device type to set page length and height on printer.
Below flow chart explains this relationship. We have already defined Page Format and Format Type. It’s time now to modify Device type of printer to support Format type ZCH1.
To find out which device type you printer is using. Run SPAD transaction and click on Display next to Output Devices input.
This will give you list of all printers installed in your SAP system. Double click on printer which you want to support new Page Format. In DeviceAttributes tab first field is Device Type. Note down this device type.
Now run SPAD in Full adminstation and under Device Types tab click on Display next to Device Types input.
Double click on device type which you have found in previous step and you should see details of device type. Click on Formats button and it will take you to list of formats currently supported by Device type.
On this screen, where list of supported format is displayed, click on new button.
And specify Format Type which we just created.
Press OK to add Format type to Device type.
Now we need to write printer specific code to set page length on printer along with some other commands on Printer initialization. What we can do here is copy code from Print Initialization of DINA4 format and change that to match our Page Length.
In the list of format types supported by device type double click on DINA4 and then go to Printer initialization section.
Copy the code which is in there and paste it in Printer initialization of form ZCH1 and save.
Page length is defined in terms of lines in hexadecimal format. There is bit of calculation here which I will be explaining in steps.
Page height in ZCH1 is 102 mm.
102 mm in inch is 4 inches.
Since we have 6 lines per inch, 4 inches would be 24 lines.
And 24 in hexadecimal is 0x18
In below screen shot I have highlighted the line where I have made this change.
Once you save these setting you should be able to issue print from sapscript and smartform on this paper size to printer.
Print to a dot matrix printer using computer paper with 66 lines
- Define paper types
- Formatting process Z_60_135
- Page format DINA4
- Orientation tick both Portrait and Orientation
- Type in the comment and click save
- Device initialization
- Device type – OKI341
- Formatting process Z_60_135 then click Execute
- Double click Printer initilization
- You must key the 66 lines hexadecimals for your printer. ( line no 9)
# oki341 x_paper # reset # \e\0x40 # select codepage multilingual 850 \e\0x52\0x1a # disable skip perforation mode \e\0x4f # select 6 lpi \e\0x32 # select page length 66 lines (66=hex $42) \e\0x43\0x42 # select 10 cpi font \e\0x60
Printer model OKI ML1120 or OKI ML 3310/3320
For ABAP List format enter printer initialization as shown below
# printer must be set to IBM Proprinter III XL emulation mode # set print quality: Draft \e\0x49\0x00 # select IBM character set 2 \e\0x36 # CR = CR only \e\0x35\0x00 # cancel skip perforation mode (bottom margin clear) \e\0x4F # set 6 LPI = 12/72 inch and start this line spacing \e\0x41\0x0C\e\0x32 # set page length 72 (=$48 hex) lines and set TOF at current pos. \e\0x43\0x21 # set 9 LPI = 08/72 inch and start this line spacing \e\0x41\0x08\e\0x32 # cancel double-width print \e\0x57\0x00 # cancel bold print \e\0x46 # cancel double-strike print \e\0x48 # cancel super/subscript \e\0x54 # cancel underlining \e\0x2D\0x00 # cancel condensed print, select 12 CPI \0x12\e\0x3A