DATA: lv_string TYPE string,
lt_words TYPE STANDARD TABLE OF string,
lt_letters TYPE STANDARD TABLE OF string,
lv_word TYPE string.
lv_string = `ABАP is excellent `.
SPLIT lv_string AT | | INTO TABLE lt_words.
DELETE lt_words WHERE table_line = ''.
WRITE: / |Number of words: { lines( lt_words ) }|.
LOOP AT lt_words INTO lv_word.
WRITE: / |Number of unique characters in the word: { lv_word } -|.
CLEAR lt_letters.
WHILE lv_word <> ''.
APPEND lv_word(1) TO lt_letters.
lv_word = lv_word+1.
ENDWHILE.
SORT lt_letters.
DELETE ADJACENT DUPLICATES FROM lt_letters.
WRITE |{ lines( lt_letters ) }|.
ENDLOOP.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |