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

Printing Problem or Formating Problem

Former Member
0 Likes
707

Dear all,

in one variable capture either 'ANSHUMAN' Or 'Anshuman' Or 'anshuman'.

i want to print as a Anshuman whether it is ANSHUMAN or Anshuman or anshuman

how can i do this

Plz help me

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
682

hi,

use Translate to lower case key word..

then using offset, get the first character and then translate it to upper case..

then concatenate into one variable...

Rgds.,

subash

5 REPLIES 5
Read only

Former Member
0 Likes
683

hi,

use Translate to lower case key word..

then using offset, get the first character and then translate it to upper case..

then concatenate into one variable...

Rgds.,

subash

Read only

0 Likes
682

can u give one example:

for offset

Read only

0 Likes
682

hi,

say var1 = 'ANSHUMAN' // to get length of var1 , use n =strnlen(var1).

translate var1 to lower case.. now var1 has anshuman.

then var2 = var1+0(1), now var2 it holds value 'a'.

var3 = var1+1(n), now var3 has nshuman.

now use translate var2 to upper case.

so var2 =A.

now concatenate var2 var3 into var1.

so now var1 has Anshuman.

Rgds.,

subash

Read only

Former Member
0 Likes
682

Hi Anshuman Singh ,

Jusy copy this code,you will get the desired output.

I am not giving the exact answere but I am giving an Idea to achieve your problem..just do in this way...

data:

w_str(10) type c value 'ANSHUMAN',

w_str1(10) type c,

w_str2(1) type c.

w_str2 = w_str+0(1).

w_str1 = w_str+1(7).

translate w_str1 to lower case.

concatenate w_str2 w_str1 into w_str1.

write:/ w_str1.

Regards

Kiran

Read only

Former Member
0 Likes
682

hi,


DATA:
  w_char(20) TYPE c VALUE 'anshuman',
  w_i TYPE i,
  w_c TYPE c.

TRANSLATE w_char TO LOWER CASE.
w_c = w_char+0(1).
TRANSLATE w_c TO UPPER CASE.
w_i = strlen( w_char ).
CONCATENATE w_c w_char+1(w_i) INTO w_char.
WRITE:/ w_char.

this will work.