Skip to Content
author's profile photo
Former Member

How to capitalize the first letter of each word in a sentence?

Can anyone please explain how to split a sentence at a comma, or space or hyphen in to words and capitalize the first letter of each word. But I don't know how many words the sentence contains.

Add comment
10|10000 characters needed characters exceeded

2 Answers

  • Best Answer
    author's profile photo
    Former Member
    Posted on Aug 20, 2007 at 03:31 PM

    HI,

    data : begin of itab occurs 0,

    words(40),

    end of itab.

    data : v_sentence(1000).

    data : lv_firstchar.

    split v_sentence at ',' into table itab.

    loop at itab.

    translate itab-words+0(1) to upper case.

    modify itab index sy-tabix.

    endloop.

    Add comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 20, 2007 at 03:29 PM

    Check this out.

    Changing Case

    Regards,

    RIch Heilman

    Add comment
    10|10000 characters needed characters exceeded