09-23-2008 8:20 AM
hi,
i am passing a date field in my program as 23.09.2008, but i want to remove the '.' before process it. can any one advice what is the code to remove '.'? i believe there is but i already forgotten of it. thanks
09-23-2008 8:21 AM
09-23-2008 8:24 AM
09-23-2008 8:24 AM
DATA: w_var(10) TYPE c.
w_var = '31.12.2008'.
REPLACE ALL OCCURRENCES OF '.' in w_var WITH '' .
WRITE / w_var.
09-23-2008 8:28 AM
Hi ben,
Replace will only remove .(dots) and give the date as 23092008 but the internal date format is 20080923.
So use the FM CONVERT_DATE_TO_INTERNAL to convert a date to internal format.
Revert Back if you have doubts.
Regards
Karthik d
09-23-2008 8:31 AM
hi
DATA :
w_d TYPE d,
w_d1 TYPE sy-datum.
w_d1 = sy-datum.
CONCATENATE w_d1+0(4) w_d1+4(2) w_d1+6(2) INTO w_d.
WRITE :
/ w_d.
Regards
Pavan
09-23-2008 8:34 AM
Hi,
Try like this:
data: fld1(12) type c,
fld2(12) type c,
fld3(2) type c,
fld4(2) type c,
fld5(4) type c.
fld1 = '23.09.2008'.
fld3 = fld1+0(2).
fld4 = fld1+3(2).
fld5 = fld1+6(4).
concatenate fld3 fld4 fld5 into fld2.
write: / fld1,
/ fld2.
Regards,
Bhaskar
09-23-2008 8:50 AM
believe there is but i already forgotten of it
But SDN database is still Active and Up so you need to just search nothing else