Documente Academic
Documente Profesional
Documente Cultură
1.
2.
3.
4.
5.
6.
7.
Header
It contains header information of SAP Script i:e administrative data and basic settings of SAP
script.
Administrative Data: It contains administrative data like package, client, user and language.
Basic Settings: It contains settings like page format, first page, default paragraph etc.
Pages
SAP Script is a group of pages, each page contains layout.
The layout is used to design page.
Page is a group of windows.
In SAP Scripts we can create 99 pages only.
Windows
A window is a container which contains some information to display, the entire page is designed
using windows.
There are four types of windows.
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.
Constant Window:
A Window which is constant for all the pages is called constant Window.
Variable Window:
A Window which does not expand i.e., width and height is fixed .
Graphical Window:
A window which is used to display graphics or images.
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.
OPEN_FORM
This is used to open a form for execution by loading it into memory.
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.
Driver Program
A program which contains business logic statements i.e., all select statements ,loops,appends
etc, is called Driver prg.
TABLES : ADRC,LFA1,EKKO.
PARAMETERS : P_EBELN TYPE EKKO-EBELN .
*DATA DECLARATIONS
DATA : WA_EKKO TYPE EKKO .
DATA : WA_EKPO TYPE EKPO .
DATA : IT_EKPO TYPE TABLE OF EKPO .
DATA : WA_LFA1 TYPE LFA1 .
DATA : WA_ADRC TYPE ADRC .
DATA : V_TOT TYPE EKPO-NETWR .
*READ PO HEADER DETAILS
SELECT SINGLE * FROM EKKO
INTO WA_EKKO
WHERE EBELN = P_EBELN .
*READ PO ITEM DETAILS
SELECT * FROM EKPO
INTO TABLE IT_EKPO
WHERE EBELN = P_EBELN .
READ TABLE IT_EKPO INTO WA_EKPO INDEX 1.
DO 100 TIMES .
APPEND WA_EKPO TO IT_EKPO .
ENDDO.
*READ VENDOR MASTER DATA TO FIND THE ADDRESS NUMBER
SELECT SINGLE * FROM LFA1 INTO WA_LFA1 WHERE LIFNR = WA_EKKO-LIFNR .
SELECT SINGLE * FROM ADRC INTO WA_ADRC WHERE ADDRNUMBER = WA_LFA1ADRNR .
*OPEN THE FORM
CALL FUNCTION 'OPEN_FORM'
EXPORTING
FORM = 'ZV_PO'
LANGUAGE = SY-LANGU.
EXPORTING
ELEMENT = 'TOTAL'
WINDOW = 'MAIN'.
ENDAT.
ENDLOOP .
CALL FUNCTION 'END_FORM' .
*The start form is used to call another SAP SCRIPT form for printing TERMS&CONDITIONS.
*This form can be reusable by al forms as it is only for printing TREMS&CONDITIONS
CALL FUNCTION 'START_FORM'
EXPORTING
* ARCHIVE_INDEX = ARCHIVE_INDEX
FORM = 'ZV_PO_TERMS'
LANGUAGE = SY-LANGU
.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'TERMS'
WINDOW = 'MAIN'.
CALL FUNCTION 'END_FORM' .
CALL FUNCTION 'CLOSE_FORM'
.