2007 Feb 26 11:46 AM
friends,
i have an int. table which has one col. with long text...the text's value of every row can vary, from a letter to a max of 72 characters...now, i want to find the row that has the max. length (in the below case, it's 5 th row - strlen is 13)...is there any command to retrieve the max length of a col. in int table...i don't want to compute each and every row's strlen and compare vs. the next row...any helpful answer will be rewarded...thanks all
tdname
ABCDE
ABCDEFG
ABC
ABCDEFGHI
ABCDEFGHIJKLM
cheers,
Sathish. R
2007 Feb 26 11:52 AM
Regards,
MB
Message was edited by:
M B
2007 Feb 26 11:50 AM
Hi!
You can solve it somhow like this:
DATA: gv_length TYPE i, gv_max TYPE i.
CLEAR gv_length. CLEAR gv_max.
LOOP AT itab INTO wa.
gv_length = strlen(wa-text).
IF gv_lenght > gv_max.
gv_max = gv_length.
ENDIF.
ENDLOOP.
Unfortunately there is no other way, I think it at least...
Regards
Tamá
2007 Feb 26 11:52 AM
2007 Feb 26 11:56 AM
Hi,
May be you can sort your internal table by that field where you have the text and with the option AS TEXT, and I think then the field with most number of character will be last in the but works only if there is only one field with this maximum length.
Regards,
Sesh
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |