06-14-2011 4:43 AM
HI expert.
I want to replace '.' with space . so I proceed below.
itab is composed to two feilds.
date1 type char10
date2 type char10
the field's values are '2011.01.01'.
REPLACE ALL OCCURRENCES OF REGEX '\b(.)\b'
IN TABLE ITAB WITH SPACE
RESPECTING CASE.
result.
date1 : '2011010120'
date2 : '110101'
but I want the result below.
date1 : '20110101'
date2 : '20110101'
what should i do?
please help.
06-14-2011 4:50 AM
Hi,
As u mention ur date is 2011.01.01 u want to make it as 20110101 as use the FM CONVERT_DATE_TO_INTERNAL.
REGARDS,
ZAFAR
06-14-2011 4:50 AM
Hi,
As u mention ur date is 2011.01.01 u want to make it as 20110101 as use the FM CONVERT_DATE_TO_INTERNAL.
REGARDS,
ZAFAR
06-14-2011 5:03 AM
06-14-2011 5:13 AM
06-14-2011 5:41 AM
Hi Jake,
Using convert date to internal as mentioned by Zafar is a good idea, i don't see how this concerns the no of records, do update the post if you have a special requirement/concerns about using that FM.
Anyways the other way to do it using the offsets,
data: l_data type char10 value '2011.01.01',
l_date2 type char10.
concatenate l_data+0(4) l_data+5(2) l_data+8(2) into l_date2.
or
l_date2+0(4) = l_data+0(4).
l_date2+8(2) = l_data++5(2).
l_date2+8(2) = l_data+8(2).
Regards,
Chen
06-14-2011 7:38 AM
Try this.
data: l_data type char10 value '2011.01.01',
l_date2 type char10.
concatenate l_data+0(4) l_data+5(2) l_data+8(2) into l_date2 sepArated by space.
write l_date2.