Tuesday, September 6, 2011

ABAP Length Of Character

The function is used to retrieve the length of the input text.

Function: STRLEN (INPUT TEXT)

Sample: 

DATA: output TYPE I,
input1(20) VALUE '12345',
input2(20) VALUE ' ABCD EFGH',

output = STRLEN( input1). 
WRITE output.

output = STRLEN( input2 ). 
WRITE / output.

Output:

5
10

Note: The spaces will be included in the character length count.

To remove the leading & tailing spaces or spaces within the text, please refer to CONDENSE ... NO-GAPS

No comments:

Post a Comment