SAP Script

For Script designing in SAP First we have to create a Script Form using transaction code SE71 and then a driver program in SE38 and call designed script using three functions –
1. CALL FUNCTION 'OPEN_FORM'
2. CALL FUNCTION 'WRITE_FORM'
3. CALL FUNCTION 'CLOSE_FORM'

Example: UseT.Code SE71.
Now a window will occur containing tab – Page, Window, Page Window, Paragraph Format & Character Format.
In Basic Setting of Header Page we define the format of page like, portrait, landscape, A4 or Letter etc.
Page is used for designing no of page. Window is used for designing windows in page like smart forms.
Page Window is used for designing size of window and printing data. Each page window contain page text element. For creating text element double click page window and then click on Text Element. Now write what you have to add.
Note: Always use main window for printing table(repeatable) values.
Paragraph Format is used for design paragraph format. Character Format is used for designing character format. Now Create Driver program using T.Code SE38.

*&---------------------------------------------------------------------*
*& Report Y_DEMO_DURGESH *
*&---------------------------------------------------------------------*
*& *
*& *
*&---------------------------------------------------------------------*


REPORT y_demo_durgesh NO STANDARD PAGE HEADING LINE-SIZE 200.

DATA : BEGIN OF i_zqmrr OCCURS 0.
INCLUDE STRUCTURE zqmrr.
DATA : END OF i_zqmrr.

DATA : BEGIN OF i_itcpo.
INCLUDE STRUCTURE itcpo.
DATA END OF i_itcpo.

SELECT * INTO CORRESPONDING FIELDS OF TABLE i_zqmrr FROM zqmrr.
i_itcpo-tdnewid = 'X'.

CALL FUNCTION 'OPEN_FORM'
EXPORTING
form = 'Y_SCRIPT'
OPTIONS = i_itcpo.

LOOP AT i_zqmrr.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = 'MAIN'
window = 'MAIN'
EXCEPTIONS
element = 1
function = 2
type = 3
unopened = 4
unstarted = 5
window = 6
OTHERS = 7.
ENDLOOP.

CALL FUNCTION 'CLOSE_FORM'.
CLEAR : i_itcpo-tdnewid.