03-30-2009 11:42 AM
Hi all,
I have a string in this format 20080315 , but i want it to get displayed as 2008-03-15, how to fit this "-" in between this string using string function ?
Few more examples below
YYYYMMDDhhmmss should get displyed like this "YYYY-MM-DDThh:mm:ssZ"
Thanks in advance
Asha
03-30-2009 11:55 AM
Hi,
assume str contains the 'YYYYMMDDhhmmss'
split the string two substrings
concatenate str0(4) str4(2) str+6(2) into str1 separated by '-'
concatenate str8(2) str10(2) str+12(2) into str2 separated by ':'
again concate str2 'Z' into str3
now, concatenate str1 str3 into str4 separated by 'T'.
Regards,
Sunitha
03-30-2009 11:55 AM
use for example CONCATENATE:
DATA: lv_date TYPE d VALUE '20090330',
lv_date_char TYPE char10.
CONCATENATE lv_date+0(4)
lv_date+4(2)
lv_date+6(2)
INTO lv_datechar SEPARATED BY '-'.
But when you want to display on screen via WRITE statement you can also use USING EDIT MASK.
See F1 help.
03-30-2009 11:57 AM
Hi,
data : result type string,
input type string.
input = '20080315'.
concatenate input0(4) input4(2) input+6(2) into result separated by '-'.
hope it works...
Ram
03-30-2009 12:17 PM
03-30-2009 1:37 PM
03-30-2009 1:02 PM