SAP Tutorials Blog

 

BINARY SEARCH - performs a binary search instead of the standard sequential search (much faster). Table must be sorted.


SY-SUBRC = 0 : entry found, SY-TABIX = index of the found entry;

SY-SUBRC = 4 : entry not found, SY-TABIX = index of the next largest entry, output area remains unchanged;

SY-SUBRC = 8 : entry not found, the key is greater than last table entry, SY-TABIX = (number of all entries + 1), output area remains unchanged.

TRANSPORTING {<f1> ... <fn>|NO FIELDS} - only transports selected fields to the target area.

COMPARING {<f1> ... <fn>|ALL FIELDS} - reads single line with key or index into the target area. After reading the line, the components specified in fields list are compared to the corresponding components of the target area:

SY-SUBRC = 0 : line is read and the contents of the compared fields are the same;

SY-SUBRC = 2 : line is read, but the contents of the compared fields are not the same;

SY-SUBRC = 4 : no line was read.


Serkan AKKAVAK

Computer Engineer BSc

SAP Department Manager

Contact : serkurumsal@yandex.com