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

Mixcase Printing

Former Member
0 Likes
609

Dear all,

I have a variable which contains string in Upper Case.

Ex.: W_string = 'ANSHUMAN KUNAL'

now i want to print W_STRING in Mix Case.

like: 'Anshuman Kunal'

How can i do..........?

Have any function through we can print the text in mix case?

Plz help me

Thanx in advance

4 REPLIES 4
Read only

Former Member
0 Likes
590

Hi,

Whatever u give within single quotes is case-sensitive.where exactly u r using this?

Thanks,

Nithya

Read only

Former Member
0 Likes
590

Hi Anshuman,

You want to print a variable on the list or a print out??

Well if you want it on the list you can use the following code of a parameter and then put it on list.

REPORT DEMO.

PARAMETERS: FIELD1(10),
FIELD2(10) LOWER CASE.

WRITE: FIELD1, FIELD2.

This prints exactly wat you write in that parameter(Upeer case or lower).

Much Regards,

Amuktha.

Read only

Former Member
0 Likes
590

Hi Anshuman ,

here is the code that meets the requirement hpe it helps.....

u can create a zfunction module using the same



data:
w_str type string value 'ANSHUMAN KUNAL',
w_sub1 type string,
w_sub2 type string,
w_substr type string,
w_char type c,
w_str1 type string,
w_len type i.

translate w_str to lower case.
w_str1 = w_str.
do.
split w_str1 at space into w_sub1 w_sub2.
w_substr = w_sub1.

w_char = w_sub1(1).
w_len = strlen( w_sub1 ).
translate w_char to upper case.
replace w_sub1(1) with w_char into w_sub1.
replace w_substr with w_sub1 into w_str.
clear w_substr.
w_str1 = w_sub2.

if w_sub2 co space.
  exit.
  endif.

enddo.

write:/10 w_str.

Regards,

Mdi.Deeba

Read only

Former Member
0 Likes
590

Hi,

Use the code given below... this will surely resolve your issue...

data : w_len type i,
         w_count type i,
         fl_flag type c,
         w_str type char1024.

w_str = w_string.
w_len = strlen( w_string ).
do w_len times.

  if w_str+w_count(1) eq space.
    clear fl_flag.
  else.
    if fl_flag is initial.
      translate w_str+w_count(1) to upper case.
      fl_flag = 'X'.
    else.
      translate w_str+w_count(1) to lower case.
    endif.
  endif.
  add 1 to w_count.  
enddo.
w_string = w_str.

Regards,

Siddarth