Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Changing Case

Former Member
0 Likes
1,324

Does anyone know of a subroutine, function, etc. that will translate upper case text to title case?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
794

hi jane,

check the fm <b>SWA_STRING_TO_UPPERCASE</b>

set this parameter PRESERVE_EXISTING_CAPITALS = SPACE

8 REPLIES 8
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
794

Title case = camel case?

Example......... Rich Heilman

Regards,

Rich Heilman

Read only

Former Member
0 Likes
794

HI jane,

in SE37 GIVE THE FM NAME AS TRANSLATE* AND CHECK FOR THE RESULTS..

Check this thread out

Regards,

Santosh

Read only

Former Member
0 Likes
795

hi jane,

check the fm <b>SWA_STRING_TO_UPPERCASE</b>

set this parameter PRESERVE_EXISTING_CAPITALS = SPACE

Read only

0 Likes
794

Hi Priya,

I tried this and this is working for me. Thank you very much for the information.

Regards,

Ben.

Read only

0 Likes
794

Check out this sample program.



report  zrich_0005.

data: str type string.
data: istr type table of string with header line.
data: xstr(50) type c.
data: output_string type string.

str = 'THIS IS THE TITLE OF THE REPORT'.

split str at ' ' into table istr.

loop at istr into xstr.
  translate xstr to lower case.
  translate xstr+0(1) to upper case.
  istr = xstr.
  modify istr.
endloop.


clear output_string.
loop at istr.
  concatenate output_string istr into output_string separated by space.
endloop.
shift output_string left deleting leading space.

write:/ str.
write:/ output_string.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
794

Title case has the first letter of each word in upper case; remaining letters in lower case.

Example: Purdue University.

Jane

Read only

Former Member
0 Likes
794

hi Jane,

Check this out

<b>DATA : wa1 TYPE c,

wa(255) type c,

cpt TYPE i.

parameters p_vorna(50) lower case default 'santosh'.

wa1 = p_vorna(1).

wa = p_vorna.

cpt = strlen( p_vorna ).

TRANSLATE wa1 TO UPPER CASE.

TRANSLATE wa TO LOWER CASE.

WRITE wa1 to wa(1).

write wa.</b>

Regards,

Santosh

Read only

Former Member
0 Likes
794

Thanks so much to everyone who replied. The colleague with this issue took Rich's code.

Jane Martin