2008 May 20 2:25 PM
Hi All,
i have one field(char) which have date in format as dd.mm.yyyy.
now i want to add 5 dayes in that field.
i can do it by using concatenate and split. but i want to do it by FM because i need same format as dd.mm.yyyy after calculation.
is there any FM to convert char into date?
Amit.
2008 May 20 2:27 PM
Why dont you define you field of type sydatum, do all the calculations and then convert it to you required format. It is easier to deal with sydatum type variables
Why dont you define you field of type sydatum, do all the calculations and then convert it to you required format. It is easier to deal with sydatum type variables
2008 May 20 2:27 PM
Why dont you define you field of type sydatum, do all the calculations and then convert it to you required format. It is easier to deal with sydatum type variables
2008 May 20 2:30 PM
2008 May 20 2:32 PM
Use FMS
"CONVERT_DATE_TO_INTERNAL" or
"CONVERT_DATE_TO_EXTERNAL"
Regards,
Santosh
2008 May 20 2:33 PM
'RP_CALC_DATE_IN_INTERVAL'
HR_SEN_CALE_DAYS_DATE
CONVERSION_EXIT_SDATE_OUTPUT
2008 May 20 2:40 PM
Hi All,
thanks for your replies.
But i have date value in char field.
i need to convert it into as date type.
Amit.
2008 May 20 2:42 PM
When all else fails.. Use a bigger hammer.
DATA: my_cdate(10) TYPE c VALUE '31.05.2008',
my_ddate TYPE d.
write:/ my_cdate.
my_ddate+0(4) = my_cdate+6(4). "YYYY
my_ddate+6(2) = my_cdate+0(2). "DD
my_ddate+4(2) = my_cdate+3(2). "MM
my_ddate = my_ddate + 5.
concatenate my_ddate+6(2)
my_ddate+4(2)
my_ddate+0(4) into my_cdate
separated by '.'.
write:/ my_cdate.
Output
31.05.2008
05.06.2008
2008 May 20 2:56 PM
Well Paul I did already exactly same as you suggest.
Thank you All.
Amit.
2008 May 20 2:59 PM
Hi Jony,
Do as follow...
data : dt_chr(10) TYPE c VALUE '20.05.2008'.
data : P_DATE TYPE SY-DATUM.
DATA : pa_end TYPE sy-datum.
data: DD(2) TYPE C,
MM(2) TYPE C,
YY(4) TYPE C,
temp_DATE(8) TYPE C.
*DATE1 = SY-DATUM.
DD = dt_chr+0(2).
MM = dt_chr+3(2).
YY = dt_chr+6(4).
CONCATENATE YY mm dd INTO temp_DATE.
p_date = temp_date.
CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
EXPORTING
date = p_date
days = '05'
months = '00'
signum = '+'
years = '00'
IMPORTING
calc_date = pa_end.
WRITE : pa_end. " Required Date
again use concatenate stmt to make it in dd.mm.yyyy format...
it will give accurate result..
Hope it will solve your problem
Reward points if useful...
Thanks & Regards
ilesh 24x7
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |