2. Objective
• The participants will be able to :
– Define What SAPScript is
– Identify how SAPScript Works
– Create Report Vs. Form
– Identify components of SAPScript
Dec-2008 SAPScript Overview | 2
3. What is SAPScript ?
• SAPScript is used to print forms.
• SAPScript looks better than conventional
report.
• SAPScript form can have graphic elements and
it can be event-triggered.
Dec-2008 SAPScript Overview | 3
4. What is SAPScript ? (Contd.)
• SAPScript is used to print forms.
• SAPScript looks better than conventional
report.
• SAPScript form can have graphic elements and
it can be event-triggered.
Dec-2008 SAPScript Overview | 4
5. How SAPScript Works
Dec-2008 SAPScript Overview | 5
SAP
Document
Form
(Output)
Layout set
(Template)
Read Data Print
Define
SAP documents are printed using forms.
Forms are defined and formatted using layout sets.
SAPScript is a tool that SAP provides for creating layout sets.
SAP Script
Sales order,
Billing document,
Purchase Order, etc
Order confirmation,
Invoice,
Purchase order,etc
6. Creating Report Vs. Form
Dec-2008 SAPScript Overview | 6
Output
Program
(ABAP)
Report
Output
Program
(ABAP)
Layout set Form
Creating Reports
Creating Forms
SAP
Document
SAP
Document
7. Components of SAPScript
Dec-2008 SAPScript Overview | 7
Output
Program
Layout set Form
Output determination configuration
(Optional)
Printer / Font Configuration
Output program: Extracts data from SAP data dictionary
Layout set: Formats the extracted data
Printer / Font configuration: Configures impact / laser printer, bar code, logo
SAP
Document
8. Components of SAPScript (Contd.)
Dec-2008 SAPScript Overview | 8
Output
Program
Layout set Form
Output determination configuration
(Optional)
Printer / Font Configuration
SAP
Document
Output program: Extracts data from SAP data dictionary
Layout set: Formats the extracted data
Printer / Font configuration: Configures impact / laser printer, bar code, logo
9. Demonstration
• Displaying a SAPScript Form in the SAP R/3
system by running transaction SE71.
Dec-2008 SAPScript Overview | 9
10. Practice
• Displaying a SAPScript Form in the SAP R/3
system by running transaction SE71.
Dec-2008 SAPScript Overview | 10
11. Summary
• SAPScript is used to print forms. It looks better
than conventional reports and can have graphic
elements as required.
• SAPScript is a tool for creating layout sets using
transaction SE71 in the SAP R/3 system.
• The output program (written in ABAP ) extracts
data to be placed in forms while the layout set
formats the extracted data to be placed in the
form.
• SAPScripts can be referred to as the combination
of the output program and the layout set.
Dec-2008 SAPScript Overview | 11
12. Questions
• What is a layout set ?
• What is an output program in reference to
SAPScripts ?
• What are the different modes of
communication between the output program
and the layout sets ?
Dec-2008 SAPScript Overview | 12
Editor's Notes
SAPScript is used to print forms. It has many advantages over conventional reports.
In a report program , the programmer has less control over the formatting of the output . By using SAPScript , the programmer has more control to format the output so that the output form looks better. The programmer has more control mechanisms to format fonts, paragraphs, etc in SAPScript forms.
In addition to that, SAPScript forms can have graphic elements(e.g. company logo, bar code etc.) attached to it.
Forms can be event-triggered (e.g. Generating output as soon as the document is saved) using message control.
Example of standard SAPScript forms:
SD- Quotation
Order Confirmation
Delivery Note
Invoice
FI- Customer Statement
Checks
PP- Purchase Req.
Purchase Order
Contract
IM- Goods Issue
Goods Receipt
WM- Picking List
Packing List
Labels
SAP documents (e.g. sales order, billing document) are printed using forms.
Forms are defined and formatted using layout sets.
Layout set is a template that defines how the form will look when it actually gets printed.
SAPScript is a tool that SAP provides for creating layout sets.
At a very high level, the only difference between creating a report and a form is the one additional step of formatting the data using the layout set.
The output program(written in ABAP) will still extract the needed data.
The manual formatting logic is taken from the ABAP program.
The layout set defines the format in which the extracted data gets printed.
There has to be some mechanism for the output program and the layout set to communicate.
The communication is achieved through:
Function calls
Communication structures
Configuration
A SAPScript program is made up of two parts : The SAPScript form and the ABAP output program that calls the SAPScript form.
The easiest way to create a SAPScript program is to use a standard SAP form for the functionality that you want and then modify it so that it results in a customized output. To find out which form is to be modified it is required to find out the configuration in the system.
Most people commonly refer to SAPScript as the combination of the output program and the corresponding layout set. However, for SAPScript forms to work, all of its components (including the configuration elements) must be created and configured properly.
Output program is written in ABAP. It prepares the data to be displayed in the form. If message control technique is used then, it collects the key data in the document through communication structure and fetches other information from relevant tables based on this key values,otherwise all required data is selected from database based on business logic and feeds it to the layout set via function calls (OPEN_FORM, WRITE_FORM, CLOSE_FORM etc.).
Layout set formats the passed data.
Output determination configuration (optional) determines the appropriate output program / layout set combination. It defines which event triggers the printing of the forms, and also defines the timing (batch, on-line) and destination (which printer) of the output. This block is optional as it is used only with message control.
Printer configuration specifies the print control of the output device (e.g. impact, laser printer).
Font configuration can be used to specify logos and barcodes, paragraphs and character formats.
Note: The standard SAPScript forms are mainly triggered using the message control technique where Output determination configuration is required to find the appropriate output program / layout set combination, time, mode and device. This scenario is mainly used with transactional data. But in a custom scenario, if message control technique is not required then the output program ( also called print program or driver program) directly calls the specific layout set without the help of Output determination configuration. Also in that case information regarding the SAP document is not passed to the output program using communication structure. Whatever data is required to be displayed in the form is fetched from the relevant tables according to the business logic.