Checking and Testing a Smart Form 
Checks
To generate a Smart Form, the individual nodes as well as the interactions between the nodes must be correct. To achieve this, the system offers a large variety of checks.
Before you can use a Smart Form, you must activate it. During activation, the system checks the entire form (all individual checks executed together). If this check does not reveal any errors, the system generates the form, which means that it creates a new function module. Then you can start testing.
Each node and each tab has its own check function (Check pushbutton on tab). This check is always a local check for the current node or tab. The type of check depends on the type of node. The system checks the conditions which were already mentioned during the discussion of the individual nodes in the preceding sections.
In addition, the application toolbar contains a Check function for an overall check of the form. This check executes any existing individual checks plus some special checks that are reasonable only in the overall context. The result of this overall check is displayed in an error list (see also
Field List and Error List).
In the overall check, the system displays only the first error in a message, provided the error occurs in the interface or global data. In this case it is impossible to execute any valid individual checks (resultant errors).
Data Flow Analysis
The system checks whether a particular field used in a text has a defined value at the moment the text is displayed in a window of the form. This check is called data flow analysis. The data flow analysis is part of the overall check of the form (see above).
After a modification of the output control, you can check whether any printed data still has a defined value or whether the modification created a state in which some data is still initial at the moment it is printed.
The system assumes that a data object of a node has a defined value if one of the following conditions is true:
For globally defined data objects there are three statements concerning the defined value:
The system checks for all nodes whether the symbols in use have defined values. If not, the system displays a list of warnings (see also
Field List and Error List). These warnings do not terminate the activation or generation.Checking Text
You can check whether all fields that appear in the text are declared in the form interface or in the global data of the form.
To do this, go to node type Text and choose Check.
Testing the Smart Form
To test a Smart Form use the function module test. After activating the Smart Form choose Test. The initial screen of the Function Builder (transaction SE37) appears. Choose Single test to go to the test mode for the generated function module. Now you can use all the methods for testing a single function module that the Function Builder provides.
Since the application program for data retrieval is not called in this case, the Smart Form is not filled with data. If you want data to appear, you must execute the relevant application program.
Runtime Errors
Each Smart Form can trigger a number of exceptions during its execution. To limit this number of exceptions, you can bundle the occurring errors in error classes and store them in an error log in the composer. For each error, you store an internal error number and (if possible) a message from table T100 (work area, message number, message text and parameters) in addition to the error class. To each error class, you assign an exception, which means that if the recognized error teminates the form processing, the system triggers exactly this exception. When an exception occurs, the caller of the Smart Form can use predefined function modules to read the error log and then decide which reaction is appropriate in the respective error context.
Possible exceptions for the generated function module are:
In addition, you can define your own exceptions.
If an error (or a warning) occurs, the system internally fills an error table. The application can now read this table as soon as the function module for the form is processed to the end. To read the table that contains all errors and warnings that occurred, call function module SSF_READ_ERRORS. The table has structure SSFERROR. The fields in the table are the number of the document within the job, the form name, an error number, a message class, a message type, a message number and four additional message variables. If processing is terminated, the application can dynamically display a message. The error numbers are defined in the include SSF_ERROR.
If you want to trigger your own exception in the free coding of the Smart Form, you can use one of the following methods:
The
system field &SFSY-EXCEPTION& contains the name of the triggered exception.