Application Development 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: 

String Translation

Former Member
0 Kudos
129

Hello,

I need to find a FM that allows me to translate a string from:

THIS IS A TEST STRING

to

This Is A Test String

Does anybody know which is it?

10nks,

Gabriel P.

1 ACCEPTED SOLUTION

former_member225631
Active Contributor
0 Kudos
91

Hi,

Use this funtion module.

SWA_STRING_TO_UPPERCASE

input_string = ' this is test string'

preserve_existing.. = space

capitalize = 'X'

language = enter as required

5 REPLIES 5

Former Member
0 Kudos
91

Hi,

I am not sure if there is any function module exists..But try this..

Check this sample code..

DATA: V_str type string.

v_str = 'THIS IS A TEST STRING'.

data: t_str type string occurs 0 with header line.

data: v_final type string.

data: v_char(100).

translate v_str to lower case.

split v_str at space into table t_str.

loop at t_str.

v_char = t_str.

translate v_char(1) to upper case.

concatenate v_final v_char into v_final separated by space.

endloop.

condense v_char.

write: / v_final.

Thanks,

Naren

Former Member
0 Kudos
91

also chk this

data: a type RSTXP-TDLINE.
data: b type RSTXP-TDLINE.

a = 'aabbccddeeff'.

CALL FUNCTION 'EDITOR_LINE_TRANSLATE_CASE'
EXPORTING
I_LINE = a
WANTED_CASE = 'UPPER'
IMPORTING
O_LINE = b.

write:/ b.

former_member225631
Active Contributor
0 Kudos
92

Hi,

Use this funtion module.

SWA_STRING_TO_UPPERCASE

input_string = ' this is test string'

preserve_existing.. = space

capitalize = 'X'

language = enter as required

0 Kudos
91

Check

SWA_STRING_TO_UPPERCASE - Lowercase to uppercase

Regards,

Santosh

Former Member
0 Kudos
91

Sorry chk this

check the function module SWA_STRING_TO_UPPERCASE to convert uppercase to title case

for titlecase..

PARAMETER->PRESERVE_EXISTING_CAPITALS = SPACE.