![SAP Scripts Tutorial](/sap_scripts/images/sap-scripts-mini-logo.jpg)
- SAP Scripts Tutorial
- SAP Scripts - Home
- SAP Scripts - Overview
- SAP Scripts - Smart Forms
- SAP Scripts - Form Painter
- SAP Scripts - Layout Set
- SAP Scripts - Print Program
- SAP Scripts - Creating a Window
- SAP Scripts - Output Area
- SAP Scripts - Text Module
- SAP Scripts - Grouping Text
- SAP Scripts - Format Options
- SAP Scripts - Output Types
- SAP Scripts - Control Print Output
- SAP Scripts - Data Formats
- SAP Scripts - Export
- SAP Scripts - Import
- SAP Scripts - Control Tables
- SAP Scripts - Text & Graphics
- SAP Scripts - Control Commands
- SAP Scripts - Copy Scripts
- SAP Scripts - Standard Text
- SAP Scripts - Word Processing
- SAP Scripts - Create a Document
- SAP Scripts - Update a Document
- SAP Scripts - Find a Document
- SAP Scripts - Save a Document
- SAP Scripts - Delete a Document
- Print Preview of a Document
- SAP Scripts - Format Conversion
- SAP Scripts - Raw Data Interface
- SAP Scripts - Output Mode Spool
- SAP Scripts - Output Mode IDOC
- Create a Script in the System
- SAP Scripts Useful Resources
- SAP Scripts - Quick Guide
- SAP Scripts - Useful Resources
- SAP Scripts - Discussion
SAP Scripts - Create a Script in the System
To start a script, you have to run Transaction SE71 and this will open the Form Painter.
In the Form Painter, request screen, enter a name and language for a SAPscript form in the Form and Language fields, respectively. Let’s enter 'RVINVOICE01' and 'EN' respectively in these fields.
![RVINVOICE01](/sap_scripts/images/rvinvoice01.jpg)
Paragraph provides all the information required to format a paragraph of text and fonts. To create a Paragraph, click the Paragraph Formats tab as shown in the following screenshot.
Enter the left margin, right margin, alignment and line spacing to define the Paragraph format.
![Paragraph Format](/sap_scripts/images/paragraph_format.jpg)
Click the Character Formats tab to enter character format and meaning as shown in the following screenshot.
![Format Tab](/sap_scripts/images/format_tab.jpg)
Enter the following settings for format option −
- Format
- Meaning
- Size
![Format Option](/sap_scripts/images/format_option.jpg)
Then, you have to define Layout of the document. Click the Layout tab to design the window.
![Layout Document](/sap_scripts/images/layout_document.jpg)
Using Layout, gives a GUI editor where you can drag the window position and it is easy to use.
By default, you can see the Main Window in the Layout. To create a new window, you can right-click on Layout → Create Window as seen in the following screenshot.
![GUI Editor](/sap_scripts/images/gui_editor.jpg)
You can also add graph/logo to the layout part. Go to the Graph button next to Window tab and enter the details.
![Logo](/sap_scripts/images/window_logo.jpg)
To make an element on the respective window, click the Edit text button.
You can define a driver program under Transaction SE38 to call this script. Use function modules to define the calling program −
- START_FORM
- WRITE_FORM
- END_FORM
- CLOSE_FORM
This is how you can develop a script and add multiple windows and define the paragraph and layout of the form.
Form OPEN_FORM CALL FUNCTION 'OPEN_FORM' EXPORTING Form = 'FormName' Endform “OPEN_FORM
Form START_FORM CALL FUNCTION 'START_FORM' EXPORTING Form = 'FormName'. Endform “START_FORM
CALL FUNCTION 'WRITE_FORM' EXPORTING Window = 'GRAPHNAME’
CALL FUNCTION 'WRITE_FORM' EXPORTING Element = 'ELEMENTNAME' FUNCTION = 'SET' TYPE = 'BODY' Window = 'MAIN’ endform. " WRITE_FORM
CALL FUNCTION 'END_FORM' IMPORTING RESULT = EXCEPTIONS UNOPENED = 1 OTHERS = 5 endform. " END_FORM
CALL FUNCTION 'CLOSE_FORM' IMPORTING RESULT = EXCEPTIONS UNOPENED = 1 OTHERS = 5 endform. "CLOSE-FORM
To Continue Learning Please Login