Start of Content Area

CLOSE_FORM   Locate the document in its SAP Library structure

The function module closes the form opened using OPEN_FORM. The system executes any terminating processing steps for the last opened form.

You must use this function module to close form printing. Otherwise, no output appears on printer or screen.

 

Function call:

 

CALL FUNCTION 'CLOSE_FORM'

IMPORTING RESULT =

TABLES OTFDATA = ?...

EXCEPTIONS UNOPENED =

 

Import parameters:

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

Among others, the structure ITCPP contains a field with the name of USEREXIT. This field tells you how the user left the print view:

Characters E, B, or C:

EXIT <-> E

BACK <-> B

CANCEL <-> C

 

Table parameters:

OTFDATA

If in the parameter OPTIONS the field TDGETOTF contains 'X', the system returns the formatted output in the OTF format in the optional table parameter OTFDATA.

In this case, the system does not output anything to printer, screen or fax/telex/teletex.

Structure: ITCOO

 

Exceptions:

UNOPENED

The system could not execute the current form function, since the form output was not yet initialized using OPEN_FORM.