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: 

Middle name to upper case

Former Member
0 Kudos

Hi,

I have an issue in my program can someone tell me how to approach the solution ?

Ex-

TRANSLATE l_first(1) TO UPPER CASE.

TRANSLATE l_last(1) TO UPPER CASE

First Name Last Name

sanjay kumar yadav

current o/p is

Sanjay kumar Yadav

Required O/p is

Sanjay Kumar Yadav

Please let me know.

Kind regards

Sanjay

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hello,

You may SPLIT the entire name to NAME1, NAME2 and NAME3. Then use TRANSLATE for NAME2. Now, CONCATENATE NAME1, NAME2 and NAME3.

Thanks,

Venu

3 REPLIES 3

Former Member
0 Kudos

Man for Sanajy Kumar Seems K is in SMALL correct??

See its the data problem of any way to handle it manually

You need to use

split firstname into f1 f2 at space.

now take F2 and write as Translate f2 at upper case.

now CLEAR FIRSTNAME.

CONCATENATE F1 F2 INTO firstname seperated by space.

satish

Former Member
0 Kudos

Hello,

You may SPLIT the entire name to NAME1, NAME2 and NAME3. Then use TRANSLATE for NAME2. Now, CONCATENATE NAME1, NAME2 and NAME3.

Thanks,

Venu

kesavadas_thekkillath
Active Contributor
0 Kudos

DATA:lv_string TYPE char255.

DATA:len TYPE i.

DATA:lv_val TYPE i.

lv_string = 'Sanjay kumar yadav'.

len = STRLEN( lv_string ).

CONDENSE lv_string.

DO.

IF lv_string+lv_val(len) CA ` `.

lv_val = sy-fdpos + lv_val + 1.

TRANSLATE lv_string+lv_val(1) TO UPPER CASE.

ENDIF.

IF lv_val > len.

EXIT.

ENDIF.

ENDDO.

WRITE lv_string.