FOr the details like what can be done in the form painter go through the link,
Coming to your question, why do you need to write the select statement in a form? You can write the select statements in your form calling program and then you can call the form by using the function modules.
Small confusion , dose ur requirment don't have any driver program ?
if no, and if at all it is a standard program, then just write a perform in the form itself.
Eg: Perfrom gte_data in program Zxyz
using VAR1 VAR2...
changing VAR3 VAR4.
1 create a program with Zxyz
2 Form Zxyz in_tab like structure ITCSY
outtab like structure ITCSY
Ur select atatement.
every sapscript form is triggered (started an filled with data) from a print program.
Sometimes the print program is a complex standard module (like in purchasing) where you can not or do not want to change anything standard.
In this cas you copy a form to user name space. You can not select direcly in SAPSCRIPT, but you can call forms from sapscript.
See documentation on sapscript command PERFORM and note that paramaters passed to and from sapscript are pure text values.
Need more hints? feel free to ask.