SAP Tutorials Blog


SEARCH – Searches for a sub string in main string. If found then sy-subrc is set to 0, else set to 4.
DATA: string(30) VALUE 'SAP ABAP Development',
      str(10) VALUE 'ABAP'.

SEARCH string FOR str.
IF sy-subrc = 0.
  WRITE:/ 'Found'.
ELSE.
  WRITE:/ 'Not found'.
ENDIF.

Serkan AKKAVAK
Computer Engineer BSc
SAP Department Deputy Manager
Contact : serkurumsal@yandex.com