SAP Tutorials Blog

 

Key definition for internal tables:

....WITH KEY <k1> = <f1> ... <kn> = <fn> ...

The self-defined key consists of the table components <k1>...<kn>. If the data type of <fi> is not compatible to the data type of <ki>, then <fi> is converted to the type of <ki>. You can specify an offset and length for any component you use in the key. You can set key fields at runtime by replacing <ki> with (<ni>). The key field is the contents of the field <ni>. If <ni> is blank at runtime, the system ignores this key field. If <ni> contains an invalid component name, a runtime error occurs.

....WITH KEY = <value> ...

Defines entire line as key (will be converted if necessary).

....WITH KEY <value> ...

The system compares the (left-justified) beginning of a line with <value>. <value> cannot contain an internal table or a structure containing an internal table. In contrast to the above two options, the comparison is processed using the data type of <value>.


Serkan AKKAVAK

Computer Engineer BSc

SAP Department Manager

Contact : serkurumsal@yandex.com