Syntax Rules for Boolean Statements 

When you enter a Boolean Logic statement in the FI-SL application component, you must follow certain syntax rules. This section explains the syntax rules for creating a statement for the FI-SL application component.

The syntax rules described in this section are valid for validation and substitution statements that you enter directly and for statements that you enter using the Formula Builder in Release 4.0A. They do not apply for statements that you enter directly in rules.

You must use the following syntax rules when entering a statement in FI-SL:

  1. Define the table name and field name that you will use in your statement. The field name is the dimension that contains the values that you refer to in your statement.
  2. Enter the table name and field name in the following format:

    table_name-field_name

    You separate the table name and field name with a hyphen.

    GLT1-RACCT

    CCSS-KSTAR

    The system checks if a value(s) is/are in the dimension entered in front of the value. If the value is in the dimension, the statement is TRUE; if the value is not in the dimension, the statement is FALSE.

    You can also instruct the system to check only part of a field value. To enter this type of instruction, you enter the following:

    · The table name and field name ( table_name-field_name )

    · A blank space

    It is important that you insert a blank space before the first colon.

    · A colon ( : )

    · The digits that you want to be checked in the field name

    · A colon ( : )

    1 always represents the first digit of the field. (The number you enter does not represent a value; it represents the position of a value within the field string.)

    · GLT1-RACCT :1-3:

    The system checks only the first three digits of the field Account to determine if a condition is true.

    · GLT1-RACCT :5-7:

    The system checks digits 5, 6, and 7 of the field Account to determine if a condition is true.

    · GLT1-RACCT :2-:

    The system checks from digit 2 to the end of the field Account to determine if a condition is true.

  3. Separate the elements of your statement with at least one space.
  4. Enter single quotation marks ( ' ) around specific values.
  5. GLT1-RACCT = '500000'
    COBL-BLART = 'SA'

    For more information about the types of values you can refer to in a statement, see Types of FI-SL Statements .

  6. Enter set names as follows, depending on the type of set you enter:
  7. For basic and single-dimension sets, enter the set in the following format:

    a) The table name and the field name of the set ( table_name-field_name )

    b) The keyword IN

    c) The set name

    GLT1-RACCT IN ACCOUNTS

    For multi-dimension sets, enter the set in the following format:

    a) The keyword IN

    b) The set name

    IN ACCTSCNTRS

  8. If you use a rule in your statement, enter the rule name only (without a preceding ampersand sign (&)).
  9. Enter double quotation marks ( " ) around comments in the statement.
  10. Text in double quotation marks is not processed by the system; it is only used to describe the statement.

    You must enter comment text before the statement when you enter the statement directly or using the expert mode in the Formula Builder.

    You cannot use blank spaces in the comment text when you enter the text directly in the statement. Also, the text can be no longer than 58 characters. If you wish to enter comment text that is longer than 58 characters, you have to enter two sets of comments and separate each set of comments with a blank space.

  11. Use the Boolean Logic operators NOT, AND, OR, NAND, NOR, -->, and <->.
  12. The operator NOT has the highest priority and is processed first in the statement, except when parentheses are used within the statement.

    NOT (A OR B)

    In this example, the statement within the parentheses is processed first. The other operators are handled in the order in which they occur in the statement.

    For more information, see Using Boolean Operators in Truth Tables .

  13. Use the standard mathematical operators in the following table
  14. Operator

    Definition

    <

    Less than

    >

    Greater than

    <>

    Not equal to

    =

    Equal to

    <=

    Less than or equal to

    >=

    Greater than or equal to

     

  15. If entering a user exit in a statement:
  16. a) Enter the character u (for a user-defined user exit) or s (for a standard SAP user exit).

    b) Enter the user exit number (three digits) (for example, U123 ).

    You configure the form pool name that contains user exits in the table for client-dependent user exits (table T80D) in Customizing for Special Purpose Ledger by choosing Basic Settings ® User Exits ® Maintain Client-Dependent User Exits. The form pool name should conform to the customer naming convention (beginning with the letter Z ) so that is not overwritten when the next SAP upgrade is installed.

  17. If using mathematical processing in a statement:
  18. a) Use the mathematical operators in the following table.

    Symbol

    Operation

    +

    Addition

    -

    Subtraction

    *

    Multiplication

    /

    Division

     

    b) Use parentheses to define the order in which the mathematical expressions are to be evaluated.

    If you are creating a matrix validation or substitution, you can also use the operators in the following table when validating or substituting line items in a document.

    You must enter a blank space after the keyword and immediately before the opening parenthesis.

    Operator

    Description

    SUM ( )

    Total of the document

    AVG ( )

    Average sum of the document

    MAX ( )

    Maximum value of all document lines

    MIN ( )

    Minimum value of all document lines

    GROUP_BY

    Compare a group of totals with another group of totals.

     

    SUM ( BSEG-DMBTR ) < 50000

    In this example, the user cannot post more than the amount 50000 in local currency for a document.

    AVG ( TABLE-FIELD1 ) GROUP_BY TABLE-RYEAR TABLE-RVERS = AVG ( TABLE-FIELD2 ) GROUP_BY TABLE-RYEAR TABLE-RVERS

    In this example, the statement is true if the average value for each year/version combination for FIELD1 is the same as the average value for the year/version combination for FIELD2.

    You can also use rules within a statement that uses mathematical processing.

    SUM ( BSEG-DMBTR ) WHERE RULE_1 < SUM ( BSEG-DMBTR ) WHERE RULE_2

    In this example, the system calculates the total of the local currency (DMBTR) for the document lines where RULE1 is true. The system then calculates the total of the local currency for the document lines where RULE2 is true. The statement is TRUE if the first total is less than the second total.

  19. To enter a statement as true or false, you can enter TRUE or FALSE.
  20. To enter currency types in a Boolean statement, enter parentheses around the currency code.

You must specify a currency code in a Boolean statement when the currency amount has more or less than two decimal places.

You can only enter currency types in a Boolean statement when you enter the statement directly or using the expert mode in the Formula Builder.

BSEG-DMBTR < ‘10000(BEF)’

See also:

Example Boolean Statements