SAP Smart Forms - Form Logic

In a SAP smart form, the form logic defines the data to be read from the database, then to define the condition and lastly to control the flow of the form output. Form logic is defined in the Form Builder, where the form structure is defined on the left side of the SMART FORMS interface. When a smart form creation window is opened, on the left side you have default nodes.

The Global setting node and has the three following subfolders −

  • Form Attributes
  • Form Interface and
  • Global Definitions

These show up when you create a new smart form.

Form Logic

To define form logic, you should define the hierarchical structure under the node pages in the navigation pane and this structure defines the rule for processing of the smart form. This form logic can be used to control the form output.

You should remember the following points about Form Logic −

  • In a tree structure, there is a tab defined for each node and each node can be linked to a condition. When the condition is met in the form, the system processes that node and if it is not met, the system doesn’t process that node.

  • In a general scenario, nodes in the tree structure are processed from top to bottom.

  • Page break on each page depends on how much space is left on the current page.

  • A Flow control is defined for each page; however, you can also go to any page.


SAP Smart Forms – Flow Control

You can also control the flow processing in a SAP smart form for the tree hierarchy defined in a navigation pane.

There are different options that can be used to define Flow Control, some of these are listed below −

  • Output Condition − To define processing of nodes/sub-nodes as per the output condition.

  • Alternative − It can be used to process one of two inferior nodes.

  • Repeated Output − You can use a loop to process the output repeatedly.

  • Dynamic processing − You can also process pages dynamically by defining page sequence using command line.

Output Condition

You can pass an output condition to suppress node/sub-node processing. To enter the output condition for a node, go to the Condition Tab.

In the condition tab, you can pass each line a condition with two operands. An operand can be a field or a value.

You can also pass logical operators; the most important operators are −

  • AND
  • OR
Output Condition

You can also perform a local check to validate an output condition. To perform a condition check, click on the Check Button as shown in the following screenshot.

Condition Check

You can also link an output condition to output events of pages and windows. You can use an Additional event box and these events are linked using the AND condition.

Additional Event Box

When the condition is met, the system processes the node/sub-node as per the condition value. When the condition fails, the system ignores node and processes the next value in the flow control.

To process the output repeatedly, the loop node must be used which reads the data from an internal table. You use a loop to read customer data and display. To display repeated output, you can create a node – type loop and enter the unique name and description.


The next step is to read the data from an internal table into a work area and create inferior nodes in which you display the fields of the read table lines.

Create Inferior