To print a text, you can use the function module PRINT_TEXT. However, you can format only one text with this function module. Formatting occurs according to the formatting information specified in the text header (style and form). If no form is defined for a text, the system implicitly underlays the form SYSTEM.
During formatting, the system
The function module automatically opens the form and closes it after formatting the text lines. All text lines transferred appear in the main window of the form (MAIN).
If you want to output a text module in such a way that you can view it in the text editor in ITF format, use the function module PRINT_TEXT_ITF. The system ignores the style and form specifications in the text header and uses the form SAPSCRIPT_ITF instead.
With each application program, you can specify different formatting parameters by using the parameter OPTIONS. The user gets a dialog window, in which he can change the default values of certain parameters. You can evaluate these changes by comparing the fields of the parameter OPTION with the corresponding fields of the return parameter RESULT of the program.
The function module PRINT_TEXT internally calls the function modules OPEN_FORM, WRITE_FORM_LINES, and CLOSE_FORM. Therefore, you cannot call PRINT_TEXT after a form has been opened using OPEN_FORM. The system then ends the function module with the exception UNCLOSED.
If the text module you want to print is not in ITF format, that is, the field TDTEXTTYPE of the text header is not empty, you cannot use the SAPscript composer to format this text. Instead, the system calls the function module PRINT_TEXT_FORMAT_xxx, which calls the word processing program appropriate for processing the specified text format. If this is impossible, PRINT_TEXT ends with an exception.