Você está na página 1de 35

SAP Scripts

We Never Compromise in Quality. Would You ?


_______________________________________________________________________
_

1.Differences Between Reports and Scripts ?

Report is Printing Data as per the Customer requirements.

Report is for Internal Purpose , i,e to analyze the current status and also helps for
decession Making.

Sap script is text processing System. It is used to print the business


documents such as sales order purchase order, offer letter etc.

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.

2.What is SAP Script, How to Create it and the Importance ?

SAP SCRIPTS is SAP'S word processing tool for Printing the business
documents.

SAPSCRIPTS can be created by using Transaction code SE71.

These are frequently used in the manufacuturing sector, service sector


and trading sector.

SAP SCRIPT generate documents which cantain logos, barcodes, tables


and other objects.

3.Can we Create a Layout without MAIN Window?

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.

Page 1 of 35 Prepared By : Ganapati Adimulam


eMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
SAP Scripts
We Never Compromise in Quality. Would You ?
_______________________________________________________________________
_

5.Explain the Types Of Windows, More about MAIN Window ?

There are Three types of windows


Main window
Variable
Constant

Both Variable and Constant Windows Works in the Same Way.

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.

6.Explain the Different Ways Of Uploading Logos into Scripts ?

Note : We Can Upload Only the image types .TIFF and .BMP but not Directly.

The Above image types should be Converted into


1. GRAPHIC as Stored on document server
2. TEXT

So that Only the GRAPHIC and TEXT Objects Can be Included Directly.

Page 2 of 35 Prepared By : Ganapati Adimulam


eMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
SAP Scripts
We Never Compromise in Quality. Would You ?
_______________________________________________________________________
_

Note : Only the .TIFF Files Can be Converted into Object TEXT .

Procedure to Conver .TIFF Files to TEXT.

• Execute the program RSTXLDMC from the ABAP /4 editor.

• Enter the location of the .TIFF file on the PC

• Specify BMON or BCOL(Color) as the raster image type

• 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

Page 3 of 35 Prepared By : Ganapati Adimulam


eMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
SAP Scripts
We Never Compromise in Quality. Would You ?
_______________________________________________________________________
_

Note : /: INCLUDE ZHEX-MACRO-LOGO OBJECT TEXT ID ST LANGUAGE


'E'.

OR
Insert -> Object -> TEXT
Note : The logo should be EXACTLY TIFF 6.0, Otherwise the same will not be printed.

Converting and Inserting Graphics:

Note : Both .TIFF and .BMP Files Can be Converted into GRAPHIC Object.

Procedure to Convert the image into GRAPHICs Object :

a) Execute the transaction SE78

Page 4 of 35 Prepared By : Ganapati Adimulam


eMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
SAP Scripts
We Never Compromise in Quality. Would You ?
_______________________________________________________________________
_

Select the GRAPHICS and


Double Click on BMAP.

Provide the Name of the Graphic Element and Click on IMPORT.

Provide the File path and ENTER.

Page 5 of 35 Prepared By : Ganapati Adimulam


eMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
SAP Scripts
We Never Compromise in Quality. Would You ?
_______________________________________________________________________
_

Make sure that the Graphic is imported Correclty.

Page 6 of 35 Prepared By : Ganapati Adimulam


eMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
SAP Scripts
We Never Compromise in Quality. Would You ?
_______________________________________________________________________
_

From the Layout Editor for the Page Window,


Insert -> Object -> Graphics and choose name of graphic object.

And Provide the relevent details of the GRAPHIC Object.

7.SAP SCRIPTS are Client Independent .(TRUE/FALSE)

False . SAP Scripts are client Dependent.

8.What is the table name that will contain all the script form names
and print program names?

TNAPR.

9.What is sub routine pool in sap script? when it is used?


It is One of the Program Types . Which Contains Only the Definations of the
Subroutines , So that it is sub routine pool Program.

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.

Syntax in a FORM window:


Page 7 of 35 Prepared By : Ganapati Adimulam
eMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
SAP Scripts
We Never Compromise in Quality. Would You ?
_______________________________________________________________________
_
/: PEROFORM <FORM> IN PROGRAM <Prog>

/: 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:

FORM <form> TABLES IN_TAB STRUCTURE ITCSY


OUT_TAB STRUCTURE ITCSY.

...
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.

Page 8 of 35 Prepared By : Ganapati Adimulam


eMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
SAP Scripts
We Never Compromise in Quality. Would You ?
_______________________________________________________________________
_
The internal table OUT_TAB contains names and values of the CHANGING parameters
in the PERFORM statement. These parameters are local text symbols, that is, character
fields.

10.Explain the Control Commands ?

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..

Ex : Height Height Height


5 Lines 8 Lines 10 Lines

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.

SET DATE MASK :

It is used to provide the required format for Date.

/: SET DATE MASK = 'DDD:MMM:YYYY'.


&DATE&

SET TIME MASK :

It is used to specify TIME format using tag '/:'.

:/ SET TIME MASK = 'HH-MM-SS'.


&TIME&

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.

Note : TOP-ENDTOP AND BOTTOM-ENDBOTTOM are not events so they appear


at the beginning of the MAIN Window so that the required Space Will be Reserved Else
the Same thing will be printed Only when space available when control reaches to these
statements.

Page 10 of 35 Prepared By : Ganapati Adimulam


eMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
SAP Scripts
We Never Compromise in Quality. Would You ?
_______________________________________________________________________
_
NEW-PAGE <Page>.
To Jump to the required page Directly with out processing the
Current Page Completely.

11.Explain All the Funtion Modules used in SAP SCRIPTs and the
Importance Of START_FORM and END_FORM ?

The folling function modules used in sapscripts.

OPEN_FORM,
START_FORM,
WRITE_FORM,
END_FORM,
CLOSE_FORM.

OPEN_FORM : It opens form for printing. OPEN_FORM must be called


before all other forms. It must be closed by using CLOSE_FORM.

Function call:

CALL FUNCTION 'OPEN_FORM'

EXPORTING FORM = SPACE

LANGUAGE = SY-LANGU

DEVICE = 'PRINTER'

OPTIONS = SPACE

Export parameters:

FORM Name of the Layout Name(FORM).

If you leave the parameter blank, you must call


START_FORM with a valid form name before starting any
output functions.

Default value: SPACE


LANGUAGE Forms are language-dependent. Enter the desired language.

Page 11 of 35 Prepared By : Ganapati Adimulam


eMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
SAP Scripts
We Never Compromise in Quality. Would You ?
_______________________________________________________________________
_
If a form does not exist in this language, the system tries to
call the form in its original language.

Default value: SY-LANGU

DIALOG Use parameter DIALOG to determine whether to display a


dialog box before printing, in which the user can set several
spool parameters for print formatting.

Possible values:

' ' display no print parameter screen

'X' display print parameter screen

Default value: 'X'


OPTIONS Use parameter OPTIONS to set several options for print
formatting. The parameter has the structure ITCPO. The
user can change some of the defined settings on the print
control screen.

Structure: ITCPO

START_FORM : 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 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:

CALL FUNCTION 'WRITE_FORM'

EXPORTING ELEMENT = SPACE

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.

Default value: SPACE


WINDOW Specify the name of the window into which you want to
output the form element specified in the parameter

Page 13 of 35 Prepared By : Ganapati Adimulam


eMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
SAP Scripts
We Never Compromise in Quality. Would You ?
_______________________________________________________________________
_
ELEMENT.

Default value: 'MAIN'


FUNCTION The parameter determines how to output the text element
into the respective window. The output type depends on the
window type and area:

Window type MAIN, area BODY:

'SET' append to previous output

'APPEND' same as SET

'DELETE' no effect

Window type MAIN, areas TOP and BOTTOM;

all other windows:

'SET' delete old window or area contents and

output the element

'APPEND' append the element to the existing elements


'DELETE' delete the specified element from the window

or area

DELETE in the TOP area (headings) takes


effect only on the next page. You can no
longer delete any heading from the TOP
area after outputting text to the BODY area.

Default value: 'SET'


TYPE The system interprets this parameter only for output to the
main window.

Page 14 of 35 Prepared By : Ganapati Adimulam


eMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
SAP Scripts
We Never Compromise in Quality. Would You ?
_______________________________________________________________________
_

The parameter determines the area of the main window into


which you want to output the element.

Possible values:

'TOP' header area

'BODY' main area

'BOTTOM' footer area

Default value: 'BODY'

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:

CALL FUNCTION 'START_FORM'

EXPORTING FORM = SPACE

LANGUAGE = SPACE

STARTPAGE = SPACE

PROGRAM = SPACE

Page 15 of 35 Prepared By : Ganapati Adimulam


eMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
SAP Scripts
We Never Compromise in Quality. Would You ?
_______________________________________________________________________
_
ARCHIVE_INDEX = 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.

Default value: SPACE


LANGUAGE Forms are language-dependent. Enter the desired language
here. If the form does not exist in this language, the system
tries to call the form in its original language. If the
parameter LANGUAGE is empty, the system uses the
language of the last active form.

Reference field: THEAD-TDSPRAS

Default value: SY-LANGU


STARTPAGE Usually, SAPscript starts with the page specified as start
page in the form definition. If you want to start output with
another form page, enter the name of the desired form page
here. If the desired page is not defined, the system uses the

Page 16 of 35 Prepared By : Ganapati Adimulam


eMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
SAP Scripts
We Never Compromise in Quality. Would You ?
_______________________________________________________________________
_
start page defined in the form.

Default value: SPACE


UNENDED The last form opened is still open. It must first be closed
using END_FORM or the form output must be closed
using CLOSE_FORM.
UNOPENED The current form function could not be executed, since the
form output was no yet initialized using OPEN_FORM.
UNUSED One of the parameters FORM or LANGUAGE contains
only blanks and no form has been opened yet whose name
or language could be used as defaults.

CALL FUNCTION 'OPEN_FORM'

CALL FUNCTION 'START_FORM'

CALL FUNCTION 'END_FORM'

CALL FUNCTION 'START_FORM'

: Should be repeated for each Layout.

CALL FUNCTION 'END_FORM'

CALL FUNCTION CLOSE_FORM

WRITE_FORM : The system outputs the form element specified in parameter


Page 17 of 35 Prepared By : Ganapati Adimulam
eMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
SAP Scripts
We Never Compromise in Quality. Would You ?
_______________________________________________________________________
_
element into the currently opened form and into the specified window.

call function ‘WRITE_FORM'


Exporing
ELEMENT = <Element Name>
WINDOW = 'MAIN'
FUNCTION = 'SET'
TYPE = 'BODY'

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.

Default value: SPACE


WINDOW Specify the name of the window into which you want to
output the form element specified in the parameter
ELEMENT.

Default value: 'MAIN'


FUNCTION The parameter determines how to output the text element
into the respective window. The output type depends on the
window type and area:

Window type MAIN, area BODY:

'SET' append to previous output

'APPEND' same as SET

'DELETE' no effect

Window type MAIN, areas TOP and BOTTOM;

all other windows:

Page 18 of 35 Prepared By : Ganapati Adimulam


eMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
SAP Scripts
We Never Compromise in Quality. Would You ?
_______________________________________________________________________
_

'SET' delete old window or area contents and

output the element

'APPEND' append the element to the existing elements


'DELETE' delete the specified element from the window

or area

DELETE in the TOP area (headings) takes


effect only on the next page. You can no
longer delete any heading from the TOP
area after outputting text to the BODY area.

Default value: 'SET'


TYPE The system interprets this parameter only for output to the
main window.

The parameter determines the area of the main window into


which you want to output the element.

Possible values:

'TOP' header area

'BODY' main area

'BOTTOM' footer area

Default value: 'BODY'

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.

Page 19 of 35 Prepared By : Ganapati Adimulam


eMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
SAP Scripts
We Never Compromise in Quality. Would You ?
_______________________________________________________________________
_
CLOSE_FORM : It closes the form opened using OPEN_FORM It terminate the
process which is started by OPEN_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.

12.Explain the SAP Script Components ?

I. PAGES : Page is container for windows. Where we place windows


II. WINDOWS : Windows can be placed on the pages. Output Areas On the PAGE.

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.

V. PARAGRAPH formats : it to provide the format of the data to be printed, such


as spacing ,alignment,Fort,Size etc

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 ?

Check for the Page No and Print it.

i.e /: IF &PAGE& = 1. “First Page


INERT the LOGO.
And repeat the Same Procedure to Print the address
In the corresponding PAGE Window.
/: ENDIF.

To Print the Signature on the Last Page

/: IF &NEXTPAGE& = 0.
“Current Page is Last Page when there is no NEXT Page.
INSERT the Scanned Signature Object.
/: ENDIF.

14.Explain What is Symbol and Types Of Symbols ?


Page 20 of 35 Prepared By : Ganapati Adimulam
eMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
SAP Scripts
We Never Compromise in Quality. Would You ?
_______________________________________________________________________
_

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

System symbols : SAPSCRIPT provides values for the system symbols.


Ex &DATE& -> Current Date,
& YEAR& -> Current Year,
& DAY& -> Current Day,
& PAGE& -> Current Page etc.

Standard symbols : Standard symbols and their values are defined in


the Table TTDTG

EX : &DSM& "Dear Sir or Madam

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.

15.Explain the Procedure to Modify the Standard SCRIPT Layout ?

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 ?
_______________________________________________________________________
_

16.How to DEBUG the SAP Scripts ?

SAP SCRIPTS program can be debugged by executing the program RSTXDBUG.


OR
The SCRIPT Debugger can be activated by selecting the menu option
UTILITIES->ACTIVATEDEBUG From the Initial Screen of SE71.

17.Explain the TEXT Element in SAP SCRIPT ?

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

CALL FUNCTION 'WRITE_FROM'


EXPORTING
ELEMENT = 'PRINT_ADDRES'
WINDOW = 'ADDRESS'

18.The Importance of the Structure SAPSRIPT?

SAPSCRIPT: General SAPscript Fields

We can print the following fields of structure SAPSCRIPT as program symbols in


SAPscript forms:

• &SAPSCRIPT-SUBRC&: Receives a value after executing an INCLUDE


statement. The value shows whether the INCLUDE was found (that is, the
INCLUDE text exists) or not. You can query this value in an IF statement.
INCLUDE was found: &SAPSCRIPT-SUBRC& = 0 INCLUDE was not found:
&SAPSCRIPT-SUBRC& = 4

• &SAPSCRIPT-FORMPAGES&: This field contains a number representing the


total number of pages of the currently formatted form (any output between
START_FORM and END_FORM). The page counter mode (START, INC,
HOLD) of the individual pages is ignored. You can use this symbol to formulate
information like ‘Page x of y’ for your output.

Page 22 of 35 Prepared By : Ganapati Adimulam


eMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
SAP Scripts
We Never Compromise in Quality. Would You ?
_______________________________________________________________________
_
• &SAPSCRIPT-JOBPAGES&: This field contains a number representing the
total number of pages of all forms contained in the currently formatted print
request, in other words, of all forms created using the OPEN_FORM,
START_FORM.. ENDFORM, START_FORM.. END_FORM,...,
CLOSE_FORM function modules.

• &SAPSCRIPT-COUNTER_x& (x = 0.. 9): These fields represent ten counter


variables that you can use in your text and forms for any counting purposes. You
can use the ‘+’ and ‘-’ formatting options to increment or decrement a counter
before its value is printed.

19.Explain ADDRESS - ENDADDRESS Control Command?


The ADDRESS - ENDADDRESS control command formats an address according to the
postal convention of the recipient country defined in the COUNTRY parameter. The
reference fields are described in the structures ADRS1, ADRS2, or ADRS3, depending
on the type of address. Either direct values or symbols may be assigned to the parameters.

Syntax:

/: ADDRESS [DELIVERY] [TYPE t] [PARAGRAPH a] [PRIORITY p]


[LINES l]
/: TITLE title
/: NAME name1[,name2[,name3[,name4]]]
/: PERSON name of natural person [TITLE form of address]
/: PERSONNUMBER number of the personen
/: DEPARTMENT department
/: STREET street name HOUSE house number
/: LOCATION additional location information
/: POBOX po box [CODE post code / zip code] [CITY city]
/: POSTCODE post code / zip_code
/: CITY city1[,city2]
/: REGION county / state
/: COUNTRY recipient country [LANGUAGE language code]
/: LANG_FOR_COUNTRY language key
/: FROMCOUNTRY sender country
/: ENDADDRESS

20.How to Read the data Maintained in Standard TEXT In ABAP Program?

CALL FM: READ_TEXT


Page 23 of 35 Prepared By : Ganapati Adimulam
eMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
SAP Scripts
We Never Compromise in Quality. Would You ?
_______________________________________________________________________
_

21.How to Add Additional Processing Logic to the Standard Driver Program


without Changing Driver Program ?

Refer Q7.

22.Upload/Download SAP Scripts To/From PC ?


Execute RSTXSCRP - SAP Scripts Export/Import .

23.Frequently Used SAP SCRIPTs Transactions ?

SE71 - Form painter

SE72 - Style maintainance

SE78 - SapScript Graphics Management

SO10 - Create standard text module


SE63 – Language Transalations in Layout.

24.Frequently Used SAP Script Programs ?

RSTXDBUG - Activate/Deactivate Form Debugger


RSTXFCPY - Copy Forms Between Clients
RSTXFCOM - Comparison of Two Forms
RSTXR3TR - Transport Program For SAPscript Transport Objects

25.Is is Possible to print the text with Different font on the same line?

Yes, it is Possible through Character Format.


In the SAPScript apply like this :

<U>Underline Text</> <B>Bold Text</> .

Where Character Formats : B for bold text and U for Underline.

26.How to Print the Footer note Only on the Last Page ?

/: IF &NEXTPAGE& EQ 0

The Required footer you want.

/: 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.

28.How to Develop SAPScripts in different languages ?

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.

30.How to convert Sapscript spools request to PDF?


RSTXPDFT4 .
Please note that it is not restricted to sapsciprts spool only. Any reports in the spool can
be converted using the program 'RSTXPDFT4'.

31.What is the use of transaction code NACE in sap scripts?

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.

Note : Generally this Configuration is done by the Functional People.

32.How to print the Page Nos in Forms ?

Every page I want to print 1 of 10 , 2 of 10 etc.

PAGE &PAGE& OF &SAPSCRIPT-FORMPAGES& .

33 .What is Standard TEXT and how to create and INCLUDE it in the Layout ?

Page 25 of 35 Prepared By : Ganapati Adimulam


eMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
SAP Scripts
We Never Compromise in Quality. Would You ?
_______________________________________________________________________
_
Purpose : Instead of Maintaining the Long text as Fixed text such as Terms and
Conditions, if We Maintain the Same as Standard TEXT,
. It Can be Re-used
i.e Can be reused in any no of Layouts.
. Language Translations Can be Maintained.
i.e It Can be Used for all the Countries to Print it in their regional Languages.

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

 where ZSTEXT refers to the Standard Text name.

34.How to convert a sapscript to smart form?


Transaction SMARTFORMS.

Utilities->Migrate Scripts to Smartforms.

35.How can we transport the standard text?

Execute the Program RSTXTRAN and Provide the Transport Request Task.

36.Formatting Options for Symbols ?

The value of a symbol is normally printed using its full length.


You can adapt the standard formatting to your own requirements by using one of
the additional formatting options available.

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.

Omitting Leading Zeros:

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)&

Assuming ' Albert Einstein ' is the symbol value,

&symbol& -> Albert Einstein

&symbol(C)& -> Albert Einstein

Page 27 of 35 Prepared By : Ganapati Adimulam


eMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
SAP Scripts
We Never Compromise in Quality. Would You ?
_______________________________________________________________________
_

Ignoring Conversion Routines :

SAPscript conversion routines specified in the Dictionary are automatically recognized


and used when program symbols are formatted. To suppress conversion, use the K
option.

Syntax &symbol(K)&

Preceding and Subsequent Texts (Pre-Text / Post-Text) :

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.

&'P.O. Box 'KNA1-PFACH& -> P.O. Box 123456

Summarized List :

&symbol(Z)& Omit Leading Zeros

&symbol(S)& Omit Leading Sign

&symbol(<)& Display Leading Sign to the Left

&symbol(>)& Display Leading Sign to the Right

&symbol(C)& Compress Spaces

&symbol(.N)& Display upto N decimal places

&symbol(T)& Omit thousands separator

&symbol(R)& Right justified

Page 28 of 35 Prepared By : Ganapati Adimulam


eMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
SAP Scripts
We Never Compromise in Quality. Would You ?
_______________________________________________________________________
_
&symbol(I)& Suppress output of the initial value

Note : For More Formatting Options, Go through SAP Scripts in Volume2 of eMAX
Materials.

37.How do I create Boxes in SAPScript?

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

38.How can I copy SAPScripts from one client to another?

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 RSTXSCRP to import/export SAPScripts.

39.How can I apply shading for the BOXes in SAP Script?

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&'?

In the first case of 'Customer : &KNA1-KUNNR&',


the text 'Customer : ' is displayed regardless of the variable KNA1-KUNNR even if it is
having Initial value.

In the second case of '&Customer : KNA1-KUNNR&',


The text 'Customer :' and KNA1-KUNNR is displayed only when the variable KNA1-
KUNNR has non-initial values.

Page 29 of 35 Prepared By : Ganapati Adimulam


eMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
SAP Scripts
We Never Compromise in Quality. Would You ?
_______________________________________________________________________
_

41.What the conditional statements used in SAP Scripts?

The following conditional statements are used in SAP Scripts:

• 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 ?

Page 30 of 35 Prepared By : Ganapati Adimulam


eMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
SAP Scripts
We Never Compromise in Quality. Would You ?
_______________________________________________________________________
_
For SAP Scripts :

Observe the
Development
Class($TMP)

Execute Transaction Code SE03 -> choose option Change object Directory
Entries->Execute

OR

Run the Program RSWBO052.

Page 31 of 35 Prepared By : Ganapati Adimulam


eMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
SAP Scripts
We Never Compromise in Quality. Would You ?
_______________________________________________________________________
_

Provide the Object as FORM and


It’s Name then Execute

Execute

Select the Layout(Object) and Click On Change Object Directory entry

And provide the New Development Class.

Page 32 of 35 Prepared By : Ganapati Adimulam


eMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
SAP Scripts
We Never Compromise in Quality. Would You ?
_______________________________________________________________________
_

Provide the New


Development Class
ZKIRAN

Note : Observe the Layout after Changing the Development Class/Package

Page 33 of 35 Prepared By : Ganapati Adimulam


eMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
SAP Scripts
We Never Compromise in Quality. Would You ?
_______________________________________________________________________
_

It is Changed
From &TMP
to ZKIRAN.

Changing the Development Class/Package for other than Scripts :

Go to Transaction SE80 ->


Select Package(Development Class)
 Enter &TMP -> Hit Enter -> Place the cursor On the object ->
Right click -> Other functions -> Object Directory Entry ->
Change -> Change the package -> Save.
OR

Open the Corresponding Object through it’s trabsaction i.e Program through SE38
and Goto -> Object Directory Entry -> Change the Development Class ->SAVE.

Page 34 of 35 Prepared By : Ganapati Adimulam


eMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
SAP Scripts
We Never Compromise in Quality. Would You ?
_______________________________________________________________________
_

EXERCISE:-

1) Develop a Custom layout to Issues the Offer Letter for Any no Of Employees at a
time ?

2) Develop a Custom layout to Issues the Experience Letter for Any no Of


Employees at a time ?

3) Change the Standard Layout MEDRUCK(Purchase Order) to Include the


Scanned Signature Of the Purchasing Manager if the Total Purchaser order
Amount is More the 1 lakh Document Currency ?

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 ?

Page 35 of 35 Prepared By : Ganapati Adimulam


eMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.

Você também pode gostar