Now let us learn how to split the contents of a string variable according to the specified delimiter ( character from where the split should happen ) in ABAP. This can be achieved by using SPLIt keyword in ABAP. The statement with SPLIT will split the contents and store the results into different variables or into an internal table.
Here is the syntax
- SPLIT field_variable AT delimiter_value INTO result_1 … result_n.
- SPLIT field_variable AT delimiter_value INTO TABLE itab.
If the size of a spitted string part is bigger than and defined destination variable, system field SY-SUBRC value will be 4, otherwise it will be zero ( shows successfully spitted ).
See the following sample source code and result for getting more idea about this statement