10-14-2008 4:50 AM
Dear All,
I have some problem in solving the date issues can anyone try to solve this problem,
Actually my input is 20.08.1013.,., i need output in the format of 13.10.2008.. Is there any function module
to convert this..,
Thanks,
Thirukumaran. R
10-14-2008 4:55 AM
Hi
Try out the below mentioned Funciton Module
CONVERT_DATE_TO_INTERNAL
Thanks,
Chidanand
10-14-2008 4:53 AM
Hi
IT is in the format of YYYYMMDD use OFFSET concept and concatenate the offset value to a string and after that pass it to a variable of type SY-DATUM your problem is solved.
example
DATA :
w_d1 TYPE sy-datum,
w_str TYPE string.
w_d2 TYPE sy-datum VALUE '20.08.1013'.
CONCATENATE w_d20(2) w_d23(2) w_d2+6(4) INTO w_str.
now in w_str the value will be '20081013'.
now assign
w_d1 = w_str .
Regards
Pavan
10-14-2008 5:11 AM
10-14-2008 5:34 AM
When i execute the following code the output is '13.10.2081'. date and month are right i need year as 2008.,
Recode my codings.,
constants: date type dats value '20081013'.
data : w_d1 TYPE sy-datum,
w_str TYPE string,
w_d2 TYPE sy-datum VALUE date.
CONCATENATE w_d20(2) w_d23(2) w_d2+4(4) INTO w_str.
w_d1 = w_str .
write : / w_d1.
Thanks,
ThiruKumaran. R
10-14-2008 5:39 AM
Hi
constants: date type dats value '20081013'.
data : w_d1 TYPE sy-datum,
w_str TYPE string,
w_d2 TYPE sy-datum VALUE date.
CONCATENATE w_d2+0(2) w_d2+3(2) w_d2+4(4) INTO w_str.
w_d1 = w_str .
write : / w_d1.
CONCATENATE w_d26(2) w_d24(2) w_d2+0(4) INTO w_str.
Now in w_str you will have date as '13102008'.
Regards
Pavan
10-14-2008 5:49 AM
Sorry,
my codings is like this,
constants: date type dats value '20.08.1013'.
data : w_d1 TYPE sy-datum,
w_str TYPE string,
w_d2 TYPE sy-datum VALUE date.
CONCATENATE w_d20(2) w_d23(2) w_d2+4(4) INTO w_str.
w_d1 = w_str .
write : / w_d1
Then how to post the message in your format .,.,
Thanks,
Thiru.
Edited by: thirukumaran rajendran on Oct 14, 2008 6:49 AM
10-14-2008 4:55 AM
Hi
Try out the below mentioned Funciton Module
CONVERT_DATE_TO_INTERNAL
Thanks,
Chidanand
10-14-2008 5:23 AM
Hi.
This code may help u.....
PARAMETERS: p TYPE sy-datum DEFAULT sy-datum.
DATA: d TYPE char10 .
WRITE p TO d MM/DD/YYYY.
10-14-2008 5:32 AM
Hi thiru,
When ever you want to print the date the format specified just use the following
Data : a type Sy-datum.
Write:a MM/DD/YYYY.
or Write: DD/MM/YYYY.
or write: YYYY/DD/MM.
Use the above write statement according to your convience.
Cheers!!