
- 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
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
SAP Scripts - Control Commands
In SAPscript, you can use control commands to control the output formatting handled by the SAPscript composer. The composer converts the text from the form displayed in the editor to the form used for printing.
Control commands are placed in the text editor in the same way as the normal line of text. Following structure is used for control commands −
Control commands are entered in paragraph format /:
You should enter only one control command in each line.
Control commands are entered in text.
You have to ensure that Control Command and its parameters doesn’t take more than one line.
When a control command contains an error, the line containing the control command is considered as the comment line and it is not printed.
Following are the common Control commands that can be used in SAPscript −
Explicit Page Break: NEW-PAGE
You can use this control command to force a page break in the text at any point.
Example
/: NEW-PAGE [page_name]

Note that there shouldn’t be any implicit page break occurrences within the blank lines, otherwise an unexpected blank page may be printed.
Preventing Page Breaks: PROTECT
With this page protect control command, you can print a complete paragraph on one page.
Main Window: NEW-WINDOW
This control command is used when one of the main window fills up. Then, the next main window on that page is taken.
Following are some other common Control commands that you can use in SAPscript for controlling the output −
SET DATE MASK − To format the Date Fields
DEFINE − To assign a Value to a Text Symbol
SET TIME MASK − To format Time Fields
SET COUNTRY − Country Dependent Formatting
SET SIGN − To position the Leading Sign
RESET − To initialize Numbered Paragraphs
TOP − To set a Header Text in the Main Window
BOTTOM − To set a Footer Text in the Main Window
IF − To add a conditional Text
STYLE − To change the Style
INCLUDE − To include other texts
Example
INCLUDE MYTEXT OBJECT TEXT ID ST
INCLUDE name OBJECT name ID name PARAGRAPH name LANGUAGE name
