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

name: MIX case

Former Member
0 Likes
874

How do I convert Name (any case string characters) to the mix case for example 'HELEN' to 'Helen'

Thanks,

Helen

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
833

Hi Helen,

Use Function Module <b>STRING_UPPER_LOWER_CASE</b>.

Otherwise try the code.

<b>translate v_name+0(1) to upper case.

translate v_name+1 to lower case.</b>

Thanks,

Vinay

How do I convert Name (any case string characters) to the mix case for example 'HELEN' to 'Helen'

Thanks,

Helen

6 REPLIES 6
Read only

Former Member
0 Likes
833

Cook your own logic:

split name at space into name1 name2.

a = strlen( name1 ) - 1.

b = strlen( name2 ) - 1.

translate name1(a) to name1(a) lower case.

translate name2(b) to name1(a) lower case.

concatenate name1 name2 into new_name separated by space.

<b>SORRY THIS WOULDN'T WORK:</b>

Regards,

ravi

Read only

LucianoBentiveg
Active Contributor
0 Likes
833

i = ( strlen( c ) - 1 ).

TRANSLATE c(1) TO UPPER CASE.

TRANSLATE c+1(i) TO LOWER CASE.

Read only

Former Member
0 Likes
833

Hi,

There is no direct way

what u can do is

Name type char15.

temp char1.

namestr string

lv_lenght = strlen( Name ).

temp = Name ......hold one char

namestr = name+0(lv_lenght)

TRANSLATE temp TO UPPER CASE.

TRANSLATE namestr TO LOWER CASE.

concatenate temp namestr into Name.

Mark Helpful Answers

Read only

Former Member
0 Likes
833

Hi ,

There is no standard function to convert like this.

But many mehtods are available to convert mix case.

My method is,

DATA : SAMPLE(20) TYPE C VALUE 'HELEN'.

DATA : FIRST TYPE C.

DATA : LAST(20) TYPE C.

DATA : NAME(20) TYPE C.

FIRST = SAMPLE+0(1) .

LAST = SAMPLE+1(19).

TRANSLATE FIRST TO UPPER CASE.

TRANSLATE LAST TO LOWER CASE.

CONCATENATE FIRST LAST INTO NAME.

WRITE NAME.

Plz reward if it helps.

With Regards,

Neptune.M

Read only

sridhar_k1
Active Contributor
0 Likes
833

Try this FM: STRING_UPPER_LOWER_CASE

Regards

Sridhar

Read only

Former Member
0 Likes
834

Hi Helen,

Use Function Module <b>STRING_UPPER_LOWER_CASE</b>.

Otherwise try the code.

<b>translate v_name+0(1) to upper case.

translate v_name+1 to lower case.</b>

Thanks,

Vinay