Start of Content Area

OPEN_FORM   Locate the document in its SAP Library structure

The function module OPEN_FORM opens form printing. You must call this function module before you can use any other form function (WRITE_FORM, START_FORM, CONTROL_FORM...).

You need not specify a form name. If you omit the name, you must use the function module START_FORM to open a form before starting the output.

You must end form printing by using the function module CLOSE_FORM. Otherwise, the system does not print or display anything.

Within a program, you can use several OPEN_FORM.. CLOSE_FORM pairs. This allows you to write output to several different spool requests from within one program.

Function call:

 

CALL FUNCTION 'OPEN_FORM'

EXPORTING FORM = SPACE

LANGUAGE = SY-LANGU

DEVICE = 'PRINTER'

DIALOG = 'X'

OPTIONS = SPACE

APPLICATION = 'TX'

ARCHIVE_INDEX = SPACE

ARCHIVE_PARAMS = SPACE

IMPORTING LANGUAGE =

RESULT =

NEW_ARCHIVE_PARAMS =

EXCEPTIONS CANCELED =

DEVICE =

FORM =

OPTIONS =

UNCLOSED =

 

Export parameters:

FORM

You can enter the name of a form here, which then controls output formatting. After calling OPEN_FORM, you can immediately output texts to the form using other function modules.

If you leave the parameter blank, you must call START_FORM with a valid form name before starting any output functions.

Default value: SPACE

LANGUAGE

Forms are language-dependent. Enter the desired language. If a form does not exist in this language, the system tries to call the form in its original language.

Reference field: THEAD-TDSPRAS

Default value: SY-LANGU

DEVICE

SAPscript can format a text for output on different device types. Enter the desired device type here.

Possible values:

'PRINTER' print output

'TELEX' telex output

'TELEFAX' telefax output

'ABAP' screen output as ABAP list

(interface of the calling program)

'SCREEN' screen output as ABAP list

(interface controlled by SAPscript,

can be set with parameter APPLICATION)

The user can display output formatted for PRINTER, TELEX, or TELEFAX as print view on the screen. From within the program, you can set the field TDPREVIEW (structure ITCPO) in the parameter OPTIONS, or the user can call the function on the print control screen.

The fields TDSENDTIME and TDSENDDATE designed for fax output (structure ITCPO) will be used for future enhancements; they are not used at present.

Default value: 'PRINTER'

DIALOG

Use parameter DIALOG to determine whether to display a dialog box before printing, in which the user can set several spool parameters for print formatting.

Possible values:

' ' display no print parameter screen

'X' display print parameter screen

Default value: 'X'

OPTIONS

Use parameter OPTIONS to set several options for print formatting. The parameter has the structure ITCPO. The user can change some of the defined settings on the print control screen.

Structure: ITCPO

Default value: SPACE

APPLICATION

For the device type SCREEN, the system displays the text formatting on the screen. This requires an interface in which the different menu entries are defined. The same applies if the user chooses to display a print view on the screen for the other device types.

Enter one of the interface names provided by SAPscript. You usually use the interface that is assigned to the respective text object in table TTXOB.

Reference field: TTXOB-TDAPPL

Default value: 'TX'

ARCHIVE_INDEX

Enter the index information for the print output you want to archive. This information (DARA line) is stored in the archive together with the print output. Thus, you can use the index information to access the print output directly in the archive.

Structure: TOA_DARA

Default value: SPACE

ARCHIVE_PARAMS

The system interprets the settings passed in this parameter when archiving the output. The archive parameters have the ABAP Dictionary structure ARC_PARAMS.

Structure: ARC_PARAMS

Default value: SPACE

 

Import parameters:

LANGUAGE

The parameter tells you which language variant of the form the system actually used.

Reference field: THEAD-TDSPRAS

RESULT

The parameter contains results of the print formatting process. By comparing the corresponding fields of parameter OPTIONS with those of parameter RESULT, you can determine whether the user made changes to any settings on the print control screen.

Structure: ITCPP

NEW_ARCHIVE_PARAMS

The parameter contains results of the archiving process, including the archive parameters the user changed on the print control screen. The parameter has the ABAP Dictionary structure ARC_PARAMS.

Structure: ARC_PARAMS

 

Exceptions:

CANCELED

When starting SAPscript print formatting, the system displayed a selection screen, on which the user can enter settings for the output, such as:

  • Printer name
  • Information on the cover page
  • Page selection
  • Number of copies

The user did not call any subsequent actions allowed on this screen, but canceled the output formatting instead. The function module was ended without further action. No form is open for output anymore.

DEVICE

The parameter DEVICE contains an invalid device type.

FORM

The parameter FORM contains the name of a form that the system could not find.

Possible reasons:

  • The form does not exist.
  • There is no active version of this form.

SAPscript first searches for the form in the current client and in the specified language. If the form does not exist there, it tries the original language of the form. If the form is still not found, it searches in client 0, first in the specified language, than in the original form language.

OPTIONS

The parameter OPTIONS contains invalid values for the formatting options.

Possible errors:

  • The output device specified in field TDDEST does not exist.
  • The field TDPAGESLCT for selecting the pages to be printed contains invalid characters.

UNCLOSED

The system was told to open a new form even though an old form is still active. The old form must be closed first (CLOSE_FORM or END_FORM).