Find Length of a String in ABAP using STRLEN function
To find the length of a string variable or character data in ABAP, developers use ABAP STRLEN string function. STRLEN ABAP string length function is also used to validate input string before using it or assigning to an other variable.
Below ABAP string code calculates the length of the input string variable using ABAP string function STRLEN, stores the length in an integer variable. Then using WRITE function, the length of the input string variable is displayed on the screen.
An other sample ABAP code below is validating the length of a date variable. If the input string variable has a length of 8 characters then it converts the date string into another date format.