Script PP
Script PP
Script PP
BY ----Arjun
Window types
FM's Driver prg and Passing Data 5 Examples on displaying text, variables from driver prog, logo, Address, StandardText
1.define
2.address 3.top..endtop 4.bottom...endbottom 5.protect...endprotect 6.standard text/pageno 7.NEW-PAGE 8.IF...ENDIF.. 9.CASE...ENDCASE
SAP AG 2001, Smart Forms - the Form Printing Solution,
Claudia Binder / Jens Stumpe 4
10.PERFORM(EXT SUBROUTINE)
Overview
SAP SCRIPT It is an SAP tool which is used to generate printable business documents like invoice , sale order, delivery note,Employee forms etc.,
The advanced version of script is smart form . SAP scripts are client dependent i.e. If a script is developed in client 100, it is not visible in another client 120 or 130. Smart forms are client independent
6.Charecterformat
7.Layout
SAP AG 2001, Smart Forms - the Form Printing Solution,
Claudia Binder / Jens Stumpe 11
HEADER
It contains the header information of the SAP Script . Administrative data It contains the data related to package name , clientno,username and languages
Pages:
SAP script is a group of pages. Each page contains a layout. The layout is used to design the page. Page is a group of windows.
Windows:
A window contains some information to display on script. The entire page information is divided in the form of windows. There are four types of windows:
Main
Main window:
A Window which automatically expands depending upon the data is called main window. Each page contains only one main Window. As there are 99 pages only in scripts, we can have maximum 99 main windows only The main Window data is divided into blocks called as text elements. Text Element: It is used to display the specific block of information. Text elements are represented by /E. The entire main Window data is divided into blocks called as text elements. Now,Display a particular text element, so that only that specific info related to text element is displayed
SAP AG 2001, Smart Forms - the Form Printing Solution,
Claudia Binder / Jens Stumpe 16
A Window which does not expand i.e., width and height is fixed .
Graphical Window:
Page windows:
The windows assigned to particular page are called page windows.
Paragraph format :
It is used to specify a particular format (font size/family/Bold/italic/underlined) for all the characters in a paragraph . We can also specify TABS.
Tabs : Tabs are used to specify a position in sap script so that the
text will be displayed at that particular position.
Tabs are represented by ,, (2 commas).
Character format :
A format which is used by a group of characters inside a paragraph is called a character format .
Layout:
It is a place where we design the page with windows
WRITE_FORM
It is used to write Some information on the SAP Script form using Text Element.
CLOSE_FORM
It is used to close the form which is opened by open form
START_FORM
It is used to call another SAP Script into current SAP Script(Nested Scripts).
END_FORM
It is used to end the form which started by START_FORM.
SAP AG 2001, Smart Forms - the Form Printing Solution,
Claudia Binder / Jens Stumpe 21
Driver Program
Driver Program::
CALL FUNCTION WRITE_FORM EXPORTING ELEMENT = MAIN WINDOW = MAIN. CALL FUNCTION CLOSE_FORM.
SAVE ,ACTIVATE AND TEST IT.
SAP AG 2001, Smart Forms - the Form Printing Solution,
Claudia Binder / Jens Stumpe 25
EXAMPLES Example on sample script to display TITLE and some info on MAIN window Example on sample script to display variable from driver prog.
LOGO/GRAPHICS IN SCRIPTS
Address EndAddress :
It is the command used to print the Address of customer or vendor
/: Addressnumber &Addressno&
/ : Endaddres
SAP AG 2001, Smart Forms - the Form Printing Solution,
Claudia Binder / Jens Stumpe 31
Example on displaying ADDRESS Create a window by name ADDRESS Double click on it and write the below code /: Address /: Addressnumber 122 / : Endaddres
STANDARD TEXT
STANDARD TEXT IN SCRIPTS : It is a text which is reusable by multiple scripts or Smartforms is called standard texts .
Once stanadard text is created,follow the below steps Goto Main windowDouble click Click on INSERT->TEXT->STANDARD A popup is raised GIve the text name as ZARJUNPress enter The below code will be generated /:Include ZARJUN object TEXT id ST Save,activate,Test
Symbols are place holders for storing a value and printing them In SAP SCRIPT. There are mainly 3 types of symbols in SAP Script .
Programsymbols : Driver program symbols System symbols : symbols defined by system Standard symbols : symbols which are declared at a standard place i.e. table(TTDTG) so that they can be reusable by multiple scripts are called standard symbols
CONTROL COMMANDS
CONTROL COMMANDS
The commands which are used to format or change the output
Of SAP SCRIPT are called control commands DEFINE /: DEFINE &LV_NAME& = RELIANCE. * &LV_NAME&
CONTROL COMMANDS
Address EndAddress :
It is used to print the Address of customer or vendor syntax : /: Address /: Addressnumber &Addressno& / : Endaddres
Top Endtop :
It is used to display the constant page heading in the main window across all the pages . syntax : /: Top * here pageheading / : Endtop
SAP AG 2001, Smart Forms - the Form Printing Solution,
Claudia Binder / Jens Stumpe 40
Bottom . Endbottom :
It is used to display constant footer in main window across all pages .
syntax :
/: Bottom
* here footer information / : Endbottom
Protect . Endprotect :
syntax : /: protect
CONTROL COMMANDS
New-page :
it is used to start a new page to display some information . * this is some data ON PAGE1 /: new-page * this is some data ON PAGE2
IF.ENDIF
It is a conditional statement which is same as ABAP .
/: DEFINE &LV_NAME& = RELIANCE. / : IF &LV_NAME& = RELIANCE. * RELIANCE GLOBAL SERVICES /: endif similarly we use IFELSEENDIF. IFELSEIF.ELSEIF.ELSEIF..ELSE.ENDIF CASE..ENDCASE
SAP AG 2001, Smart Forms - the Form Printing Solution,
Claudia Binder / Jens Stumpe 43
Purchase Order
Go to NACE tcode
Select the Appliction EX--- EF for purchase order
V1 for sales
V2 for Billing
SAP AG 2001, Smart Forms - the Form Printing Solution,
Claudia Binder / Jens Stumpe 46
Convert Original language Give the Original Language as EN. Press Enter.
SAP AG 2001, Smart Forms - the Form Printing Solution,
Claudia Binder / Jens Stumpe 50
Double click on LOGO window & insert the image by clicking on INSERT--GRAPHICS
Test it
Testing
Goto ME22N Give purchase order no : 4500012164 Enter Click on print preview Our ZMEDRUCK will be dispalyed.
using <v1>
Changing <v2> Endperform. Syntax for form definition : Form <formname> tables intab structure ITCSY Outtab structure ITCSY. Endform.
Where, ITCSY is a structure for storing name and value of exported variable from perform statement. In the subroutine implementation, we write the custom logic i.e all our select statements
Business requirement :
Modify the standard script MEDRUCK to print PO document type in the layout .
Go to se71. Give the form name as zmedruckClick on Change. Create a window by name document type Double click on it and write the below code. /: perform GET_BSART in program ZGET_BSART. /: using &EKKO-EBELN& /: changing &V_BSART& Doc. Type : &V_BSART&.
Create a program by name ZGET_BSART in se38 of type subroutine pool and Write the below code
Review
--