Académique Documents
Professionnel Documents
Culture Documents
SAP script is the SAP System's own text-processing system.It looks and feels a lot
like other leading text-processing systems.
It is used to print preformatted text in pre-formatted forms.
1.
2.
Layout Set
To output documents using the programming interface, R/3 application programs need
so-called layout sets (a kind of form).In SAP script a layout set describes the layout of
the individual print pages and uses text elements to supply definable output blocks,
which a print program can call.A layout set can be defined as a page design for a
document
Layout set on its own doesn't contain any data. The selection of data for the document
is done through the print program. The print program selects the data from database
table and feeds it to the layout set. When the print program is executed the document
is printed on the screen, printer.
Usually a SAPScript Layout consists of following components
1.
2.
3.
4.
5.
Header Data: Header data is used for information and control of SAP printing.
The header data comprises of 2 parts - Device Independent - Stores information
like Start page , Default paragraph ,Language Attributes etc. And Device
Dependent stores information like Page format ,Orientation Lines per inch etc
Paragraph and Character Formats: Paragraphs are formatted using various
attributes. For instance Standard paragraph attributes specify Left or Right margin,
Alignment ,Line spacing etc. Font attributes specify Font family ,Font size etc.
Character formats allow to format entire blocks of text within a paragraph
Windows and Text Elements: Windows are individual text areas (header
address, date, footer) in a page . It helps combine the information contained in a
document into certain groups and make each group appear on the printed page in an
individual area.You can define text elements (window texts) for each window. The
print program accesses text elements by name, formats them and prints them in the
respective window. The paragraph and the character formats used must be defined
in the form.
Pages: They are individual pages of a document and must have a unique name.
You will often find different layouts for individual pages: The first page of an
invoice differs from the subsequent pages, on which you need not repeat general
information, such as address or customer data.
Page Windows: While defining windows and pages, you do not yet determine
the position and spacing of the texts to be output.A page window defines the
rectangular output area in the output medium by specifying the left upper edge of
the output area and its width and height
Control Commands
The purpose of "control commands" is to allow control of the output formatting.These
commands are not interpreted by the SAP script editor, but are passed through to the
SAP script Composer for processing. This includes, for example, line and page
formatting, the formatting of text according to the paragraph and character formats
specified.
Syntax
1
Examples
Print Program
The execution of script is done through an ABAP program, which is referred as Print
Program. Each print program should have an ENTRY form , which will be called
from customization.
For a standard configuration we can see the form name (script name), print program
name and output type in the table TNAPR.The print program uses the Form control
functions to call the script.
The print program call either all or some of the form control functions to execute the
script
Output Types
The output type can specify, a printed form that you need for internal use or a form
that you want to send to a customer or vendor . The output type can also be an internal
electronic mail message that you want to send to staff in another department.
For example "Print out" can be classified as one output type of a billing document, i.e.
when this output type is executed the billing document is printed. Similarly "Fax" can
be an output type, i.e. when this output type is executed a fax of the billing document
is sent
All the output types for any document (e.g. billing document) will be stored in the
table NAST.Output types are executed through the program RSNAST00 .
Example : Output type in a billing document1.
2.
3.
4.
Go to VF03
Enter billing document number and press enter again
Chose Output under the menu Goto -> Header
Here Z101 is an output type of a print output
SAP script does not maintain any versions. So when modifying the SAP script ,
ensure that the changes are well documented in script. This applies to the standard
texts too.
2.
The output of the form will differ when viewed on the screen and on the
printer. So always test the output of the script on the printer.
Smart Forms
SAP Smart Forms is used to create and maintain forms for mass printing in SAP
Systems.As output medium SAP Smart Forms support a printer, a fax, e-mail, or
the Internet (by using the generated XML output).
SAP introduced SmartForms in 1998 to overcome the limitations in SAP Scripts.
SmartForms are easier to develop, maintain and transport than SAP Script.
Multiple page formats are possible in SmartForms which is not the case in
SAPScripts
It is possible to have a SmartForm without a main window.
Routines can be written in SmartForms tool.
SmartForms generates a function module when activated.
Labels cannot be created in SmartForms.
They help adapting forms without any programming knowledge due to entirely
graphical user interface
When activating the smart form the system automatically generates the
function module and at the runtime .
To make any changes we have to use the Drag & Drop, Cut & Paste. These
actions do not include writing of coding lines or using a script language.
We can insert static and dynamic tables. These include the line feeds in the
individual table cells, triggering events for table headings and subtotals and sorting
data before output.
The smart forms allow the user to include graphics, which can be displayed as
a part of the form or as background graphics. During printout the user can suppress
the background graphic as and when necessary.
Web Publishing is possible using the generated XML output
Smartforms Guide
Lets go through it in SAP system1.
2.
Navigation window consist of nodes and sub nodes. They contain all the elements
(text, window etc) that belong to sap forms
Right-Clicking on the Pages will allow creation of New Page, Window, Graphic or
Address.
For background picture and graphics you can pick up either black and white or color
bitmap images and are stored in the form of standard texts. You may take a detour
from the smartform screen and open Form Graphics screen. Transaction code: Se78
Main
Secondary
You cannot have more than 1 main window in a page. You can have multiple
secondary windows
Whatever you print in secondary window...it has to be static. (If u have 20 lines
in a PO and there is page constraint the lines get carried forward to next page in the
main window. i.e. In a predecessor and successor type of content, they will be
printed in sequence in main window. This is not allowed in Secondary windows.
Inside the main window we can add text as introduction to customize the form output.
The Output options on each window determine the Line size, Width, Colors and
background to be put.
Smartforms gives the option of giving the address number which is maintained in the
central address management. The address will be directly taken from ADRC table and
will be populated in the form.
The two different editors are available in Smartforms viz. Normal Editor
The Table shows the different line types which will be used in the table. The Line
types define the size of each cell and the number of cells in each line.
This will return the Function module name of the smartform which is referenced.
Templates
Template can be used when you know the exact size of the output or the output is in a
fixed format.
E.g. Tax form/ cheques /airline form/railway ticket: all these use templates.
The big between table and template is that in a Table the height changes
dynamically.We call a row a 'line' in template.
SMART Styles
A Smart Style contains:
Paragraph formats including indents and spacing, font attributes, tabs, and
outline and numbering