Professional Documents
Culture Documents
Report is for Internal Purpose , i,e to analyze the current status and also helps for
decession Making.
SAP Script is Printing the Data on the Pre Printed Documets such as Experience
letters,Offer Letters or Printed with pre defined Layout.
SAP Script is for External Purpose to Print and transfer the Business Documents.
SAP SCRIPTS is SAP'S word processing tool for Printing the business
documents.
No. We can't have layout without Main window, as it is the default window in
the layout.
4.How Many times a MAIN Window Can be Placed on the Same Page in a
Layout ?
The main window can be placed on the page upto 99 times. The names of the main
window starts from 00 to 98 ie MAIN00,. MAIN01, MAIN02 etc.
Note : The Text on MAIN Window always starts prinitng from MAIN00.
Main window is default window in a page, which we can Placed upto 99 times on the
Same Page.
The main window names range can be from 00 to 98 i.e MAIN00, MAIN01 etc.
And the text on MAIN Window always starts prinitng from MAIN00.
Note : We can not have more than one variable window with same name on same page.
Note : If the Text SIZE is More than the Window Size, the extra text will be truncated In
Variable Windows and it will be Scrolled to Next MAIN Page Window for MAIN
Window.
MAIN is the Default Window. We Cannot Create SAP SCRIPTS without MAIN
Window.
Note : We Can Upload Only the image types .TIFF and .BMP but not Directly.
So that Only the GRAPHIC and TEXT Objects Can be Included Directly.
Note : Only the .TIFF Files Can be Converted into Object TEXT .
• The SAP system suggests a name for the file ( like ZHEX-MARCO-). The *
indicates the type of file.
• The ID should be ‘ST’ and give the logon language
• Running the program will convert this .TIFF file into a TEXT Object.
• Incorporate this converted logo in the appropriate window under the
appropriate text element by giving
OR
Insert -> Object -> TEXT
Note : The logo should be EXACTLY TIFF 6.0, Otherwise the same will not be printed.
Note : Both .TIFF and .BMP Files Can be Converted into GRAPHIC Object.
8.What is the table name that will contain all the script form names
and print program names?
TNAPR.
It is Used to write the Subroutines to Fetch additional Data to print it on the the Layout
when the additional data has to be printed without changing the Standard Driver
Program.
i.e Write the Subroutines here and Call the PERFORM From the Page Windows of the
Layout.
/: USING &INVAR1&
/: USING &INVAR2&
……..
……..
/: CHANGING &OUTPUT1&
/: CHANGING &OUTPUT2&
……..
……..
/: ENDPERFORM
INVAR1 and INVAR2 are variable symbols and may be of any of the four SAPscript
symbol types.
OUTVAR1 and OUTVAR2 are local text symbols and must therefore be character
strings.
The ABAP subroutine called via the command line stated above must be defined in the
ABAP report prog (Subroutine Pool) as follows:
...
ENDFORM.
The values of the SAPscript symbols passed with /: USING... are now stored in the
internal table IN_TAB . Note that the system passes the values as character string to the
subroutine, since the field Feld VALUE in structure ITCSY has the domain
TDSYMVALUE (CHAR 80). See the example below on how to access the variables.
PROTECT-ENDPROTECT :
When the Text that is be printed on one without any break inbetween then we use
PROTECT AND ENDPROTECT.
The text given between the PROTECT AND ENDPROTECT will tries to print on current
page if thespace is availble. If the current MAIN Window do not have sufficient space
then it will print entire text on next page if the NEXT Window is enough.
If next page also not sufficient print entire some lines will be printed the current page and
remaing lines on next page Because we Cannot avoid the Paragraph Break..
MAIN 00
MAIN 01
MAIN 02
Note : The Width of the all the MAIN Windows on the Same Page should be always
same and the Height Can differ.
Case 1 :
/: PROTECT
--
--
-- 7 Lines to be Printed.
/: ENDPROTECT
Note : The Text on MAIN Window always starts printing On MAIN 00 and the
MAIN00 is not enough to print the 7 lines within the PROTECT –ENDPROTECT
So that it prints all the 7 Lines on the MAIN01 which is enough to Print all the 7 Lines.
Case 2 :
Page 9 of 35 Prepared By : Ganapati Adimulam
eMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
SAP Scripts
We Never Compromise in Quality. Would You ?
_______________________________________________________________________
_
/: PROTECT
--
--
-- 10 Lines to be Printed.
/: ENDPROTECT
Note : The Text on MAIN Window always starts printing On MAIN 00 and the
MAIN00 is not enough to print the 10 lines within the PROTECT –ENDPROTECT
So that it Checks MAIN01 which is not enough to Print all the 10 Lines.
Since it always prints all the text either on the Current Window or On NEXT Window
Only, When both Windows are not enough Paragraph break is necessary.
i.e it Prints First 5 lines On MAIN00 and rest of the 5 lines On MAIN01.
TOP - ENDTOP :
It is used to print text on top of all the MAIN Windows on the Same Page.
BOTTOM -ENDBOTTOM :
It is used to print the same text at the bottom of of all the MAIN Windows on the Same
Page.
11.Explain All the Funtion Modules used in SAP SCRIPTs and the
Importance Of START_FORM and END_FORM ?
OPEN_FORM,
START_FORM,
WRITE_FORM,
END_FORM,
CLOSE_FORM.
Function call:
LANGUAGE = SY-LANGU
DEVICE = 'PRINTER'
OPTIONS = SPACE
Export parameters:
Possible values:
Structure: ITCPO
To switch forms, use the function module START_FORM. If another form is still open,
you must close it first using END_FORM.
Note : This is used to call More than One layout in the Same Driver Program or To Call
the same layout Multiple times i.e by repeatedly calling the START_FORM and
END_FORM Combination each time we call the layout(Same/Different Layout).
Page 12 of 35 Prepared By : Ganapati Adimulam
eMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
SAP Scripts
We Never Compromise in Quality. Would You ?
_______________________________________________________________________
_
Function call:
WINDOW = 'MAIN'
FUNCTION = 'SET'
TYPE = 'BODY'
IMPORTING PENDING_LINES =
EXCEPTIONS ELEMENT =
FUNCTION =
TYPE =
UNOPENED =
UNSTARTED =
WINDOW =
Export parameters:
ELEMENT Specify the name of the text element you want to output
into the form window specified in the parameter
WINDOW. The element must be defined in that form
window. If you specify no element, the system uses the
default element, if one is defined in the form.
'DELETE' no effect
or area
Possible values:
SMART_FORMS
In-between the function modules OPEN_FORM and CLOSE_FORM, you can use
different forms. This allows you to combine several different forms into one print output.
However, you can combine only those forms that have the same page format.
To switch forms, use the function moduleSTART_FORM. If another form is still open,
you must close it first using END_FORM.
If you specify no form name when callingSTART_FORM, the system restarts the last
open form. If after OPEN_FORM no form was activated yet, the system leaves the
function module with the exception UNUSED.
Function call:
LANGUAGE = SPACE
STARTPAGE = SPACE
PROGRAM = SPACE
IMPORTING LANGUAGE =
EXCEPTIONS FORM =
FORMAT =
UNENDED =
UNOPENED =
UNUSED =
Export parameters:
FORM The parameter contains the name of the form you want to
use for printing. If you specify no form here, the system
restarts the last active form.
Export parameters:
ELEMENT Specify the name of the text element you want to output
into the form window specified in the parameter
WINDOW. The element must be defined in that form
window. If you specify no element, the system uses the
default element, if one is defined in the form.
'DELETE' no effect
or area
Possible values:
END_FORM : It ends the currently started form and execute the require terminiation
process to enable to start new form. The current START_FORM must be closed by using
END_FORM.
Note : A Form Should be Opened and Closed Only Once and it Can be Started and
Ended any no of times with START_FORM and END_FORM Combination.
III. PAGE WINDOWS : The page which contains windows are called page windows
Page Windows are the Windows On Page.
IV. Note: We Can always print the Data on Page Windows Only BUT not on
Windows and Pages.
VI. Character formats : A line can printed in defferent format by using a character
format with in the same Paragraph.
13.Explain How to Print the Signature Only in the Last page and Address
and Logo Only in First Page ?
/: IF &NEXTPAGE& = 0.
“Current Page is Last Page when there is no NEXT Page.
INSERT the Scanned Signature Object.
/: ENDIF.
Note : Printing Data on Layout is always through Symbols and each symbol
Starts and Ends with &.
Types Of Symbols :
1. System symbols
2. Standard symbols
3. Program symbols
4. Text symbols
Program symbols : Program symbols are variables from the driver program.
EX : &WA_KNA1-KUNNR&
Text symbols : Text symbols are symbols defined in the Layout itself.
EX : DEFINE &V_AMOUNT& = ' '
Note : The Difference between the above symbols is the Source of Data.
a) Since SAP Script is Client dependent , We Need to Copy the standard Layout and
Convert the Original Language from DE to EN as We Can always change the Layout in
Original Language Only.
b ) Modify the Layout according to the Client’s Requirement and Change the Script
Configuration i.e Attach the Modified Layout with the Original(Standard) Driver
Program.
Note : This Configuration or Linking is done through transaction NACE and is by the
Functional Consultants.
Page 21 of 35 Prepared By : Ganapati Adimulam
eMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
SAP Scripts
We Never Compromise in Quality. Would You ?
_______________________________________________________________________
_
The text elements are used to identify the block of statement from the page window. So
that instead of executing all the statemnet all the time we can specify when to execute
particular set of statements in page window by passing element name along with
window name in WRITE_FORM of driver program.
Note : Text Element is Simply the name given to group of statements in the Page
Window.
All text elements start with /E tag
Syntax:
Refer Q7.
25.Is is Possible to print the text with Different font on the same line?
/: IF &NEXTPAGE& EQ 0
/: ENDIF
Page 24 of 35 Prepared By : Ganapati Adimulam
eMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
SAP Scripts
We Never Compromise in Quality. Would You ?
_______________________________________________________________________
_
Note : When there is No Next Page (NEXTPAGE = 0) for the current Page then
Current Page itself the last Page.
27.Can we have have 2 different Orientations for 2 pages from the Same Layout ?
No. All the Pages from the Same Layout should always have the same Orientation.
In SE63, click Translation -> Long Texts -> Sapscripts -> Forms
Those language you can convert to have already been pre-installed in the system.
29.The Width Of all the Page Windows of type MAIN on the Same Page
should be Same. TRUE / FALSE?
TRUE.
We can track the Standard Layout and Standard print program used for all standard
Business Documents and also the Place to Configure or Link the New layout(Copied) to
the Driver Progam if the Standard Layout is Copied and Changed.
33 .What is Standard TEXT and how to create and INCLUDE it in the Layout ?
You can create standard texts using the transaction SO10. Then to insert these standard
texts in the SAPScript choose the menu, Insert->Text->Standard and choose the standard
text that you want to choose.
Alternatively, you can display standard texts in your SAP Scripts using the command:
INCLUDE ZSTEXT OBJECT TEXT ID ST LANGUAGE EN
Execute the Program RSTXTRAN and Provide the Transport Request Task.
Many of these options are abbreviated to a single letter, which has to be given as a
capital letter. You can combine two or more options on a single symbol, as long as
the result still makes sense.
Certain symbol values are printed with leading zeros. If you want to suppress these, use
the Z option.
Syntax &symbol(Z)&
Page 26 of 35 Prepared By : Ganapati Adimulam
eMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
SAP Scripts
We Never Compromise in Quality. Would You ?
_______________________________________________________________________
_
&DAY& -> 01
&DAY(Z)& -> 1
Space Compression:
The C option has the effect of replacing each string of space characters with a single
space and shifting the ‘words’ to the left as necessary to close up the gaps.
Syntax: &symbol(C)&
Syntax &symbol(K)&
In addition to using initial values for symbols, you can specify additional texts that are
printed only when the value of the symbol is no longer the initial value.
If the symbol contains its initial value, these texts are suppressed.
Syntax: &'pre-text'symbol'post-text'&
&'P.O. Box 'KNA1-PFACH& -> If a P.O. Box has been specified, then this
will be displayed together with the appropriate text in the normal way.
Summarized List :
Note : For More Formatting Options, Go through SAP Scripts in Volume2 of eMAX
Materials.
You can create Boxes in the SAPScript using the BOX command specifying the x,y co-
ordinates and the width and the height
BOX XPOS '0' CM YPOS '0.5' CM WIDTH '9.2' CM HEIGHT '3.5' CM FRAME
8 TW
In the transaction SE71, enter the Form name and choose the menu, Utilities->Copy from
client to copy SAPScripts from one client to another.
(OR)
Use the addition INTENSITY in the BOX command to apply gray shading to the boxes.
Eg:
BOX XPOS '0' CM YPOS '0.5' CM FRAME 8 TW INTENSITY 10
40.What is the difference between the SAP Script texts, 'Customer &KNA1-
KUNNR&' and '&Customer KNA1-KUNNR&'?
• IF..ELSE...ENDIF
• CASE...ENDCASE
42.How to print a text which in English, in different languages what are the steps to be
taken?
Create the Text as Standard Text through SO10 , for which we can maintain the
Language translation and also can be Included Simply in the Layout. For More
Information about Standard Text , Refer Q 34.
43.How to change the Development Class / Package of a SAP Script and other than
SAP Scripts ?
Observe the
Development
Class($TMP)
Execute Transaction Code SE03 -> choose option Change object Directory
Entries->Execute
OR
Execute
It is Changed
From &TMP
to ZKIRAN.
Open the Corresponding Object through it’s trabsaction i.e Program through SE38
and Goto -> Object Directory Entry -> Change the Development Class ->SAVE.
EXERCISE:-
1) Develop a Custom layout to Issues the Offer Letter for Any no Of Employees at a
time ?
4) Modify the Standard Layout RVINVOICE01 and Create the Standard Texts For
All the Hard Coded Texts ?
5) Modify the Standard Layout DELNOTE and Create the Standard Texts for all
the hard Coded text And maintain the Same in More than One Language ?