FAQ on ABAP Scripts


SAP Scripts



What is sap script and layout set?

Ans - SAPscript is the integrated text management system of the SAP R/3 System. SAPscript is tightly integrated into the SAP System. It is used for many different word-processing tasks all over the SAP System.


What is layout set?


A layout set in SAPscript is used for page layout. The layout set contains various elements, which are used for layout control of the individual pages and also contain layout information for texts which are to be output on the individual pages.


The layot of a document is defined in a layot set.

A layout set specified the appearance and structure of a document.


Layout sets contain predefined text modules with space reserved for variable data.  You can use these text modules for different application.


Every SAPscript document uses a layout set.


To make changes to your documents, such as moving a piece of text, or changing fonts, paragraph formats, and tabs, you only need to change the layout set.



There are two ways of formatting texts using layout sets:

The text is entered and output in standard text maintenance.  You can  assign any layout set.  Text can also be entered via the layout set  a  letter header, for example.

The text is formatted via an ABAP/4 program using a layout set.  The  program can either dynamically output individual predefined text modules, text elements or transfer entire texts, which are to be output in the layout set.


You can use Styles to define the formatting of the text in your documents.  A style

determines text formatting by setting the paragraph and character formats used in a

document.  You can, for example, use a style to highlight character strings or whole

paragraphs.  You can assign a style to any text.  Typically, however, you’ll use styles

primarily in the main windows of layout sets, where users type or enter text directly

in documents.


Header data is found  in both style and layout set maintenance.

In style maintenance, it is used primarily to present important information -  designed to make it easier for the end user to select a style.  The header data in layout set maintenance, on the other hand, is used for information and control purposes.


Windows are defined in layout set maintenance.  They represent areas

which are positioned on pages  as page windows and in which text is

later output.  At least one window must be defined for each layout set.  If

not, a text cannot be formatted by SAP script.


The following window types can be used:


MAIN – Main window in which continuous text is output.  This is the window used by dialog users of a print program and layout set.  For example the body text of a letter would be entered in MAIN.


VAR – Window with variable contents.  The text can vary on each page in which the window is positioned.  Variable windows are formatted for each page.


CONST – Window with constant contents which is only formatted once.


A layout set has the following elements:


Header data  - Data related to development (created by, development class, etc.)  and layout set information (which elements are used) are both stored in the header data.  A start page must be entered here.


Paragraph formats - Paragraph formats are required in layout sets -  as in styles - in order to format texts.  However, they are also used for word processing in layout sets, for example, to format  text elements.


Character formats - You can also use character formats to format texts or paragraphs. Unlike paragraph formats, however, they are used to format text within a paragraph.


Windows  - Windows are names and window types, which are not physically positioned until they are allocated to pages and units of measurement are specified.


Pages - Pages are defined to provide the system with a start and end point  in text formatting.


Page windows - Page windows are the combination of windows and pages, where the dimensions of a window and its position on a page are specified.


The purpose of SAP script control commands is to allow control of the

output formatting.  These commands are not interpreted by the SAPscript

editor, but are passed through to the SAPscript Composer for processing.  The

composer is the program that converts text from the form displayed in the editor to

the form used for printing.



What is SAPscript and explain its purpose?

SAP Script is the SAP system’s own text-proessing system.  You’ll find that it looks and feels a lot like other leading text-processing system that you may use on your personal computer.


Every company needs to output documents with a uniformly defined layout (eg. Invoices, delivery notes, etc..) all the time.


The basic layout of the document is pre-defined , but in many cases, other data has to be merged with it, such as address data or purchase order items.  This data might be entered manually by a employee, or retrieved from a database table.


Large quantities of these documents have to be produced.  From printing is usually a mattter of large print runs of documents such as payslips, checks, order confirmation, reminders etc.


SAPscript has been developed to meet the above requirements.  IT is an integrated tool for text entry and form printing in  R/3 applications.


These documents are normally provided by SAP but every organization have their unique waqys of these documents so to customize these and for creating newer ones if required; SAP script is used.



What are components of SAPscript?

Layout set, SAPscript Text, ABAP Print program , symbols, function modules like open_form, close_From, Read_text etc,.


What are the ABAP/4 Commands that link to a layout set?

Call function OPEN-form.

Call function WRITE-from.

Call function CLOSE-from



Importing Graphics (Logos) into SAPScript

The program RSTXLDMC can be used to upload graphics (file extension .tif on PC files) into individual standard text.


Other useful programs for SAPScript

RSTXFCON - Converts page format

RSTXSCRP - Upload/Download layout sets

RSTXDBUG - SAPScript debugger


Debug SAPScript

You can debug a SAPScript: Use Tools - Word Processing - Layout Set.

Enter name of layout set and then Utilities - Activate Debugger.

It is of no consequence which layout  set you enter when selecting the SAPscript debugger. (Menu path: Tools-Word-processing - Forms, Utilities - Activate Debugger) The next layoutset called will invoke the debugger. This is quite handy when verifying which layoutset is being called (Verifying customizing settings).

Another way to set the SAPScript debugger is to run program RSTXDBUG.


When a Form is copied from one client to another .And If U try to display or change the form in the copied client .The  possible error message cud be :

1.Form not found

Try coping again specifing the language .


2.IF IT dispalys an error message saying That the text file is inconsistent .

Then go to SE38 and Run “RSTXCHKO” .

It will ask for the form name ,then check all the checkboxes and then run the program.

Note : all Script related problems can be solved using Program ‘RSTX*’.



How to take a back up of script layout  into U’r hard disk and load it later

Use Program RSTXSCRP.

Use EXPORT mode, when downloading and IMPORT when uploading a script. Don’t forget to give the form  name in the object field. This will create a script with the same name as that of the original script . If a script with the same name exists in the same client ,then it will give an error ‘Object cannot be overwritten ’ .


I want to copy table across clients

Use Program RSCLTCOP


To transfer script files across systems (Not Clients)  - RSTXSCRP


To compare the contents of a table across clients: RSTBSERV


To change the development class of any object - RSWBO052


What type of variables normally used in sap script to output data?

&Tables name- fields&.


How do you number pages in sap script layout outputs?

& page &

&next Page &


What takes most time in SAP script programming?

Defining layout set up / sets.


How do you use tab sets in layout sets?

Define paragraph with defined tabs.


How do you backup sap script layout sets? Can you download and upload? How?

SAP script backup :- In transaction SE71 goto Utilities -> Copy from client -> Give source form name, source client (000 default), Target form name.

Download :- SE71, type form name -> Display -> Utilities -> form info -> List -> Save to PC file.

Upload :- Create form with page, window, pagewindow with the help of downloaded PC file. Text elements for Page windows to be copied from PC file.



What is Compare Tool in SAP Script ?

SAP Script offers  tools for comparing objects across clients. We can compare or copy the following kinds of objects.


Layout sets


With the Compare tool we can do the following :

Check whether an object exists in both clients

Display the differences between the versions of an object


Layout Sets  are used to control page layout and text formatting in documents .


SAP Standard styles and layout sets are always held in Client 000.


In what format does  SAP Script store text ?

SAPscript texts are stored in Interchange Text Format (ITF).  SAPscript offers conversion programs for the text file formats Rich Text Format (RTF) and ASCII as an interface to other word processors.


The various window types in SAP Script are

Main, Variable and Constant.



The New-Page command is used to force a Page break in the text at any point.


Protect ... Endprotect command pairs can be nested (True / False).



Delimiter &  must be used immediately before and after the symbol.



What does the composer do?


The final appearance of your documednt depends on interaction between the print program and the layout set.


The SAPscript print program initializes the printing process.  Every command entered using the SAPscript programming interfaces is transferred to the composer.


The composer received layout information from the layout set specified by the print program.  The documents are formatted according to this layout information.


If the documents contain variables, the compoer replaces these variables with data from the R/3 system, such as the current date, or with the userdata selected by the print program.


The print program controls the completion of thelayout set.  Once this is done, the composer places the completed document in the spool.



Where do we define Tab space for data in SAPScript?


When defining the paragraph for the text element we can define the TABS then.  There is parameter called TABS to be defined in paragraph definition.





what is difference between Window & a Page Window?


Window: An area that is predefined in the layout set.  Windows are text modules, which are positioned on a document page.


We define the window type, Default Paragraph, specify the text elements or a SAPscript text to be included etc in the Windcow Component.


PageWindow: we define the parameters of the earlier defined Window, appearance on the document like left or right margins, Width & Height.



What are symboles & state their different types with E.g.


A Symbol is a constant, which can be inserted in a document.  It saves the user unnecessary work when replacing sections of text, phrases, etc.  Each symbol has a name which is encloses by &.


Eg. &variable name &

System symbols eg &Date&, &time& etc.


Standard symbols :Standard symbols are user-defined.  They are maintained centrally in table TTDTG. Eg. &SGDH& for the opening salutation : “dear sir/madam”.

&MFG& for the closing saluta

Comments (14)

Said this on 8-4-2007 At 01:32 am
adding another topics, gives strenth to the site
hemendra patel
Said this on 10-23-2007 At 12:43 pm
Goodddddddddd Site
Said this on 10-26-2007 At 07:56 am
Said this on 10-29-2007 At 12:01 pm
thanks alot..
Said this on 12-6-2007 At 08:57 am
this site is very help full for who is complting the sap-abap course and also job trails people
Hemendra Patel
Said this on 1-4-2008 At 07:36 am
Said this on 1-10-2008 At 02:59 pm
no comment
Said this on 3-1-2008 At 06:36 pm
Its useful for jobseekers.Also,if we cover in more depth then it will be very efficient
Said this on 3-26-2008 At 03:39 pm
NIce to see all FAQ's at one place.And i really appreciate for the effort took in this Documentation.
Said this on 5-11-2008 At 04:27 pm
its very useful for learners.thank you very much for your effort.
Said this on 7-18-2008 At 03:57 pm
very good
Said this on 11-12-2008 At 01:49 pm
Said this on 6-11-2009 At 12:52 am
i think this is really a good site for guys in job trails ..it is a really very much helpful.....
in the same way can you give all the faq's for SAP HR
Said this on 11-9-2009 At 03:39 pm

This site is very help full and i really appreciate.

Post a Comment
* Your Name:
* Your Email:
(not publicly displayed)
Reply Notification:
Approval Notification:
* Security Image:
Security Image Generate new
Copy the numbers and letters from the security image:
* Message:

Email to Friend

Fill in the form below to send this article to a friend:

Email to Friend
* Your Name:
* Your Email:
* Friend's Name:
* Friend's Email:
* Security Image:
Security Image Generate new
Copy the numbers and letters from the security image
* Message: