This is a very simple example for using SapScript, which can also be used as the basic frame for a new SapScript development.
A SapScript is always controlled by an ABAP, which executes the following steps:
The OPEN_FORM routine has a parameter "dialog". If this one is ticked with 'X', then a popup dialog appears, which allows to enter the required print parameters. If you do not like the popup, you must supply all necessary print information in the parameter OPTIONS which is defined according structure ITCPO.