Friday, June 28, 2024

Understanding the ABAP SUBSTRING Function with Examples

ABAP SUBSTRING Examples

ABAP SUBSTRING Function Examples

DATA(source) = 'Hello, World!'.
DATA(result) = substring( val = source length = 3 offset = 1 ).
WRITE result. " Outputs: 'ell'
DATA(source) = 'Hello, World!'.
DATA(result) = substring( val = source length = 5 offset = 0 ).
WRITE result. " Outputs: 'Hello'
DATA(source) = 'Hello, World!'.
DATA(length) = strlen( source ).
DATA(result) = substring( val = source length = 6 offset = length - 6 ).
WRITE result. " Outputs: 'World!'

ABAP Inline Declarations: A Byte-Sized Guide with Examples

ABAP Inline Declarations ABAP Inline Declarations ABAP inline declarations are a feature intr...