‎2009 May 12 11:36 AM
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
‎2009 May 12 11:45 AM
Hi,
Whatever u give within single quotes is case-sensitive.where exactly u r using this?
Thanks,
Nithya
‎2009 May 12 11:46 AM
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.
‎2009 May 12 12:17 PM
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
‎2009 May 12 12:18 PM
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