To start a script, you have to run Transaction SE71 and this will open the Form Painter.
In the Form Painter, request screen, enter a name and language for a SAPscript form in the Form and Language fields, respectively. Let’s enter 'RVINVOICE01' and 'EN' respectively in these fields.
Paragraph provides all the information required to format a paragraph of text and fonts. To create a Paragraph, click the Paragraph Formats tab as shown in the following screenshot.
Enter the left margin, right margin, alignment and line spacing to define the Paragraph format.
Click the Character Formats tab to enter character format and meaning as shown in the following screenshot.
Enter the following settings for format option −
Then, you have to define Layout of the document. Click the Layout tab to design the window.
Using Layout, gives a GUI editor where you can drag the window position and it is easy to use.
By default, you can see the Main Window in the Layout. To create a new window, you can right-click on Layout → Create Window as seen in the following screenshot.
You can also add graph/logo to the layout part. Go to the Graph button next to Window tab and enter the details.
To make an element on the respective window, click the Edit text button.
You can define a driver program under Transaction SE38 to call this script. Use function modules to define the calling program −
This is how you can develop a script and add multiple windows and define the paragraph and layout of the form.
Form OPEN_FORM CALL FUNCTION 'OPEN_FORM' EXPORTING Form = 'FormName' Endform “OPEN_FORM
Form START_FORM CALL FUNCTION 'START_FORM' EXPORTING Form = 'FormName'. Endform “START_FORM
CALL FUNCTION 'WRITE_FORM' EXPORTING Window = 'GRAPHNAME’
CALL FUNCTION 'WRITE_FORM' EXPORTING Element = 'ELEMENTNAME' FUNCTION = 'SET' TYPE = 'BODY' Window = 'MAIN’ endform. " WRITE_FORM
CALL FUNCTION 'END_FORM' IMPORTING RESULT = EXCEPTIONS UNOPENED = 1 OTHERS = 5 endform. " END_FORM
CALL FUNCTION 'CLOSE_FORM' IMPORTING RESULT = EXCEPTIONS UNOPENED = 1 OTHERS = 5 endform. "CLOSE-FORM