Show TOC

Program LinesLocate this document in the navigation structure

Use

You use program lines nodes to enter free ABAP code. These nodes are evaluated at the moment they are processed according to their position in the tree. If you insert program lines at the appropriate position in the tree structure, you can use it, for example, to calculate subtotals and grand totals in tables.

Program lines nodes are not intended to print output in the form. Therefore, they have no Output options tab.

Integration

When generating the function module, the program lines node becomes a subroutine in ABAP. SAP Smart Forms then calls this subroutine according to its position in the navigation tree.

Note

You can use the program lines node to call your own subroutines, which you must have defined on the Form Routines tab of the node Global Definitions.

Visibility Rules

You can use the following variables:

  • Global fields (fields from the global definitions or from the form interface), which you enter in the tables Input parameters and Output parameters of the General Attributes tab.

  • Variables that you define locally within the program lines node.

Global Fields as Input/Output Parameters

Distinguishing between input and output parameters enables the global check to execute a data flow analysis. Since both input and output variables are global, changes of these variables in the program lines node have global effects. This distinction between input and output parameters thus is of importance only for the check, but does not restrict the visibility of the specified fields.

Local Variables

As you do in a FORM routine, you can use the DATA statement within program lines nodes to define and use local variables. They are visible only within the program lines node in which they are defined.

Prerequisites

You must be familiar with ABAP programming.

Note

See also: ABAP Programming (BC-ABA)

Features

Editor Functions

The inline editor corresponds to any ABAP editor and offers the following functions:

Available ABAP Statements

You can use all ABAP statements that are allowed in ABAP subroutines. Consequently, statements such as PARAMETERS or SELECT-OPTIONS are not allowed. In addition, there are statements that are allowed by the syntax check but make no sense in the SAP Smart Forms context, for example, LEAVE TO SCREEN.

The syntax check is customized for SAP Smart Forms only as far as the fields defined in the parameter interface are concerned.