Entering content frame

Procedure documentation Selecting Data Records Locate the document in its SAP Library structure

When you load application data, you can select the data records to be loaded according to their content.

The conditions defined here can be negated with NOT, linked with AND and OR, or encapsulated as required. The Loader evaluates the operators accordingly.

Syntax

<condition> ::= <simple_condition> 
| (<condition>) 
| <condition> AND <condition>
| <condition> OR <condition> 
| NOT <condition>

<simple_condition> ::=
  POS <
field_pos> <field_format> [HEX] <compare_operator> '<valLITERAL>'

<field_format> ::= /* empty */ | CHAR | DECIMAL [<valFRACTION>]
| ZONED [<valFRACTION>] | INTEGER | REAL

<compare_operator> ::= < | > | = | <= | >= | !=

valLITERAL

Constant

valFRACTION

Number of decimal places for the external data types DECIMAL and ZONED

See also:

Table Description

Explanation

The Loader distinguishes between simple conditions (simple_condition)and compound conditions. Simple conditions can be negated with NOT, combined with AND and OR to form compound conditions, or encapsulated as required.

Operators in parentheses are evaluated before those that are not in parentheses.

If no operators are in parentheses, the Loader weights them as follows:

·        NOTtakes precedence over ANDand OR

·        ANDtakes precedence over OR

·        If the weighting is identical, the operators are evaluated from left to right.

Only those records to which the simple or compound condition applies are loaded.

Example

You only want to load those data records from the source data stream room.data to the target table room  for which the price is below 200.00 and in which the room type double is specified.

DATALOAeD TABLE room
  IF POS 16-22 < '200.00' AND POS 06-11 = 'double'
    hno     01-05
    type    06-11
    free    12-15
    price   16-22
INSTREAM 'room.data' FORMATTED

<simple_condition>

You use the syntax rule simple_condition to define the selection criterion that determines which records from the data stream are loaded to which target table. The data records that you want to load are selected by comparing them with a constant.

As with the other fields in a data record, you use the position of a value that you want to compare to describe it. You only need to specify the external data type of this value if the data type is not CHAR.

You specify a constant as a plain text value and place it in quotation marks. The constant is converted to the data type of the value that you want to compare in the data record.

If the constant you want to use as a comparison value is a number, it must have a valid number format, that is, it must be a floating point number in mantissa/exponent notation or a fixed-point number with the currently defined decimal representation or the default decimal representation in the Loader.

<field_format>

You use the syntax rule field_format to describe the external data type of the data fields in the data streams.

You only need to specify the data type in a load or unload command or in a condition if the data field in question is to be read or output using a data type other than CHAR. Every internal database column format in the database can be read and output in CHAR format.

 

Leaving content frame