Program DATA : str1 TYPE string VALUE ‘XYZ’, str2 TYPE string, times TYPE i VALUE 5. WRITE ‘ Before string Repeat:’, str1. str2 = repeat( val = str1 occ = times ). “repeats the string 5 times WRITE
‘After string Repeat :’, str2. Step1. Step2. Output:
Author: coderobbot
String Operation – Reverse
Program DATA : str1 TYPE string VALUE ‘SAP ABAP PROGRAM’, str2 TYPE string VALUE ”. WRITE ‘Before Reverse:’, str1. str2 = reverse( str1 ). ” reverse () function in ABAP WRITE
‘Aftre Reverse:’, str2. Output ———————————————————————————————————————————
String Operation – Compare
Comparisons can be applied on strings with types C, D, N, and T. <operator> Meaning CO Contains Only CN Contains Not only CA
String Operation – Shift
SHIFTing- is likely to repositioning the string. In ABAP – Left shift, Right Shift and circular left and circular right shift. Step1. Code ” SHIFTING “ DATA :
String Operation – Replace
REPLACE: Replace changes the text with another text in the string. Step1. Execute the program. Step2. Mark the output:
String Operation – Condense
Condense – removes the extra spaces in a string. Step1. Execute the program. Step2. Observe the output. Step3. Execute the program. Step4. Observe the