Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Coverting first letter of each word to upper case

Hi,

I want to convert the first letter of each word to upper case.

george william bush

to George William Bush.

Is there any function module for this.

regards

Bala

Tags:
Former Member
replied

I don't think about any FM. but you can use this code:

REPORT  ZTEST_NP.

DATA: L_TEXT(200) VALUE 'george william bush'.

DATA: BEGIN OF ITAB OCCURS 0,
      TEXT(100),
      END   OF ITAB.

SPLIT L_TEXT AT ' ' INTO TABLE ITAB.

CLEAR L_TEXT.

LOOP AT ITAB.
  TRANSLATE ITAB-TEXT+0(1) TO UPPER CASE.
  CONCATENATE L_TEXT ITAB-TEXT INTO L_TEXT SEPARATED BY ' '.
ENDLOOP.

L_TEXT = L_TEXT+1.

WRITE: L_TEXT.

Regards,

Naimesh Patel

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question