You are on page 1of 7

05/12/13 My Experiments with ABAP: Creating custom page format for sapscript/smartform

sample-code-abap.blogspot.com.ar/2009/05/creating-custom-page-format-for.html 1/7
My Experiments with ABAP
Home Index Links SAP SD SAP MM Tutorial
Wednesday, 13 May 2009
You can print any size of output from SAP, it all depends on what page format is defined and configured in your SAP system. Most
of the standard page format are already defined in SAP but often you come across the situation where the required output doesnt
even come close to any of these predefined page format. Printing cheques and receipts are some common example. Defining
and configuring Page format is multi-step process and often is printer specific. In short its very easy to get your setting wrong and
situation is worse when printer is physically away from you.
Its very important to understand how this page format works in SAP. The process starts with defining the Page Format, but you
need few more setting to actually print this page size on printer. Page format just define the size of page for sapscript (this size
info defined in page format is not passed to printer), next step is to define Format type which defines 'Type of format' and what
orientation are allowed with this page format. It is important to note that Page Format and Format type should have same name.
Well, you can argue why do we need to define Format Type. To find out that, which you may find bit confusing refer sap note
2374. Still you can not print with this page size on printer. To allow printer to use this new page format you need to add this page
format to device type of printer. This step will enable you to print the output but correct page size information will not be passed
to printer. You need to actually put printer specific code to set desire page size on printer.
Before we start it worth checking where do we specify page format in sapscript.
Now let us go through each step with screen shot. You need to have access to transaction SPAD and changes to the repository and
cross-client customizing should be permitted in the client where you will create/change page format.
Execute transaction SPAD. By default transaction will not show all the tabs, you need to click on 'Full administration' to get the
desire tab.
Creating custom page format for sapscript/smartform
9
Processing xml with XSLT
transformation in ABAP
Displaying Two ALV Grid on
Screen
Simple Code to consume Web
service using SAP ABAP
SAP ABAP Dynamic Internal table
and Processing 02
Enhancement - Sales Order
transactions VA01/VA02/VA03
ALV Grid OO - Tips
Defining Range Type in ABAP
Display ALV Grid (OOP)
Fullscreen
Table Maintenance with
Create/Modified Information
Automatically Filled in
Creating custom page format for
sapscript/smartform
Popular Posts
Join this site
with Google Friend Connect
Members (62) More
Already a member? Sign in
Followers
Very Useful information. Thank
you. - 11/9/2013 - Vinay
Very Useful information.
Thanks. - 11/9/2013 - Vinay
thanks very much for posting
material
tables... - 4/9/2013 - Harish
Kumar
Thanks Buddy..!! Very
Helpful..:) - 26/8/2013 - Santho
sh kumar
Great Buddy, Very Helpful
...:) - 26/8/2013 - Santhosh
kumar
Recent Comments
Read this on Mobile Device
Ms

Siguiente blog Crear un blog

Acceder
05/12/13 My Experiments with ABAP: Creating custom page format for sapscript/smartform
sample-code-abap.blogspot.com.ar/2009/05/creating-custom-page-format-for.html 2/7
Go to 'Device Types' tabs and hit 'Display' button next to Page Formats.
On next screen hit 'change' button then you will button to create new Page format, now press New button.
Fill in the required input, below is an example.
Follow by Email
Email address... Submit
05/12/13 My Experiments with ABAP: Creating custom page format for sapscript/smartform
sample-code-abap.blogspot.com.ar/2009/05/creating-custom-page-format-for.html 3/7
Congrats you just created a new page format.
At this stage you can use this page format in sapscript, however you can not print that sapscript. This information of page
dimension is just for sapscript. You will get warning message while adding page format to sapscript 'There is no form for page
format XYZ' and error message while printing 'Device type ABC does not support page format XYZ'.
Next step is to create Format Type. Remember Format Type should have same name as your Page Format name. Start from
transaction SPAD, on 'Device Type tab press display button next to 'Format Type'. Click on change then new button and create
Format Type as shown in screen-shot below.
To allow printer to use this new Format Type you need to add this format to device type of printer. You can find the device type of
printer from table TSP03D, it is stored in field PATYPE.
On 'Device Types' table enter Device name and press Display button next to it.
05/12/13 My Experiments with ABAP: Creating custom page format for sapscript/smartform
sample-code-abap.blogspot.com.ar/2009/05/creating-custom-page-format-for.html 4/7
Go in change mode and press 'Formats'
On next screen press New button and enter 'Format Type'.
Once the format type added to device type, double click on the line (on first column). On next screen as shown below double click
on 'Printer initialization'
05/12/13 My Experiments with ABAP: Creating custom page format for sapscript/smartform
sample-code-abap.blogspot.com.ar/2009/05/creating-custom-page-format-for.html 5/7
19 comments
Top comments

manisha jain 5 months ago
hi friend ,, its nice to see your blog.. i am sap bwbi consultant. i just looking funcunality in sap abap , their
i found your blog interesting. Thanks for sharing such a valuable information on sap-abap
Seemachandan Pallegar 1 year ago
Add a comment as Mariano Acevedo
Input following code, this code will actually set the page length on printer. Page length is defined under the code '# set page
length 72 lines'. Its defined in hex and is defined in lines. You might have to do some math to convert your page length from
CM/MM to line considering lines per inch value set.
For example in this particular case the page length define Page format is 102 mm which is 4 inches. Using setting 6 lines per inch
4 inches comes out to be 24 lines. (ok, the comment is wrong, it should be '# set page length 24 lines'). And in hex 24 is
represented as 18.
You might need to add this format and put this code for each device type of each printer on which you are planning to print the
output.
With all these setting in place you can, hopefully, print the output on printer with correct page format.
Posted by Pawan Kesari
Labels: Formatting, SAP ABAP, Sapscript
+1 Recomendar esto en Google
05/12/13 My Experiments with ABAP: Creating custom page format for sapscript/smartform
sample-code-abap.blogspot.com.ar/2009/05/creating-custom-page-format-for.html 6/7
Seemachandan Pallegar 1 year ago
nice
Anonymous 1 year ago
Works perfectly and very useful! thank you for your hard work!
alex linh 1 year ago
How to create a sapscript in abap, you could check this link
http://saptechnicals.blogspot.com/2012/04/how-to-create-sapscript-in-abap.html
Anonymous 1 year ago
\o/ very good!
ambrish 1 year ago
very good
Anonymous 2 years ago
good work thanks!!!
Anonymous 2 years ago
Thanks
Anonymous 2 years ago
I am working with a zebra label printer and it is not working...I wonder why?
Anonymous 2 years ago
Very Helpfull documents, Thanks
Bhavesh Panchal (ABAP) 3 years ago
very good
Anonymous 3 years ago
thanks..
matheus_tux 3 years ago
Thanks
Anonymous 3 years ago
Thanks Lot .......... It helps Lot
Anonymous 3 years ago
Thanks a lot, it was really helpfull and well explained.
05/12/13 My Experiments with ABAP: Creating custom page format for sapscript/smartform
sample-code-abap.blogspot.com.ar/2009/05/creating-custom-page-format-for.html 7/7
Newer Post Older Post Home
Subscribe to: Post Comments (Atom)
Anonymous 3 years ago
Thanks a MIL for this! Helped me solve my print pblm! :) B
Anonymous 4 years ago
Very Nice explanation. It help me resolve a critical issue.
Dion 4 years ago
Good Work! Tks Dion Mar - Brazil
Anonymous 4 years ago
nice explanation..
2013 (24)
2012 (6)
2011 (16)
2010 (11)
2009 (23)
December (3)
September (5)
August (3)
July (3)
May (5)
Processing xml with XSLT transformation in ABAP
Use of Application Log FMs to display Message
List...
Reset ALV Export Option for User
Simple Code to consume Web service using SAP
ABAP
Creating custom page format for
sapscript/smartfor...
April (1)
March (1)
February (1)
January (1)
2008 (39)
Blog Archive
Search
Search This Blog
Abap Objects (13) ALV List (10) Config
(11) Dynamic (6) EDI (8)
Module Pool (6)
Quick Reference (50) Report
(12) Sample Code (61) SAP
ABAP (80) SAP
MM (15) SAP SD (12)
Sapscript (9) Selection-Screen (6)
Smartforms (7) Tutorial
(25) Web Dynpro
(7)
Labels
Component Usage (1)
Customer-exit (1) Date (3)
Enhacement (2) Excel (2) Formatting (2) HR A BA P (2) MD04
(1) OLE Automation (1) Open Dialog Box (1)
Performance (2)
Rounding Issue (1)
SA P Basis (4) SA P FI (3) SA P Mail (2)
SA P Notes (3) SA P QM (2) SAP WM
(1) Screen-exit (1) SFTP (1)
Standard Text (2) Translation (1)
Upload Download (2) Utility (5) VAT (1)
Web service (2) xml to ABAP (1) XSLT (1)
You are most welcome to use any information available in this blog. Any usage of the information or sample code is at your own risk. I do take care of accuracy and relevance of blog before publishing. However, I do not guarantee that
information and code are accurate and bug free, their can be alternate and better way of doing same thing so please use information as reference only. Relevance of code and instructions can possibly change with time, check the blog post
date before using this information. This is my personal blog, recommendation and opinions expressed in this blog are mine and not of any company of any of my employer. I do moderate comments and publish as soon as I check them. You
can post questions as well, which I will try best to solve. I will anyway publish your questions in case others readers might have answer. Thanks for coming here and reading the blogs :)
Small print

You might also like