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: 

Simple ABAP

Former Member
0 Kudos

Hi All,

I need to convert the upper/ lower case letters for a name into Initial letters capital.

e.x. input is : RAVI SHEKAR or ravi shekar

output should be Ravi Shekar

Is there any function module to solve this.

Thanks & regards,

Kranthi

1 ACCEPTED SOLUTION

naimesh_patel
Active Contributor
0 Kudos

Check FM: STRING_UPPER_LOWER_CASE

Other FM: SWA_STRING_TO_UPPERCASE

Like


      call function 'SWA_STRING_TO_UPPERCASE'
           exporting
                input_expression           = input_expr
                preserve_existing_capitals = ' '
           importing
                output_expression          = output_expr.

Regards,

Naimesh Patel

Edited by: Naimesh Patel on Oct 21, 2008 1:05 PM

6 REPLIES 6

naimesh_patel
Active Contributor
0 Kudos

Check FM: STRING_UPPER_LOWER_CASE

Other FM: SWA_STRING_TO_UPPERCASE

Like


      call function 'SWA_STRING_TO_UPPERCASE'
           exporting
                input_expression           = input_expr
                preserve_existing_capitals = ' '
           importing
                output_expression          = output_expr.

Regards,

Naimesh Patel

Edited by: Naimesh Patel on Oct 21, 2008 1:05 PM

0 Kudos

Hi Naimesh,

When i try to execute the FM STRING_UPPER_LOWER_CASE

by giving values:

delimiter = space

input = RAVI SHEKAR

i am getting output as RaviShekar. I am not getting exact name. i mean i need to get as Ravi Shekar (same input format).

To get so what could be the input value for delimiter.

thanks

kranthi

0 Kudos

Hi Kranthi,

Check out the


 Funciton Moudle HR_P06I_CONVERT_TO_LOWERCASE

Just enter your name in the internal table it will give you the output as per your requirement.

Thanks,

Chidanand

Former Member
0 Kudos

Hi,

you can change them using PATTERN addition to Translate statement.

TRANSLATE text {TO {UPPER|LOWER} CASE}

| {USING pattern}.

try to check Help to get more on this.

Thanks,

Sree.

Former Member
0 Kudos

Hi Kranthi,

Translate is the keyword which is used to translate the case of alphabets

Check this simple example.

DATA: t(10) TYPE c VALUE 'AbCdEfGhIj',

string LIKE t,

rule(20) TYPE c VALUE 'AxbXCydYEzfZ'.

string = t.

WRITE string.

TRANSLATE string TO UPPER CASE.

WRITE / string.

string = t.

TRANSLATE string TO LOWER CASE.

WRITE / string.

string = t.

TRANSLATE string USING rule.

WRITE / string.

Cheers!!

Balu

former_member705122
Active Contributor
0 Kudos

Refer Naimesh's reply in this thread for: