2007 Dec 20 6:19 AM
Hello there ,
I m coverting date to timestamp but not satisfied with the outcome .
input date is 20071213
and output is 20.071.213.000.000 .
i want output to be 20071213000000 or 2007121700:00:00.
plz provide help on this .
Thanks ,
Abhi .
Hello there ,
I m coverting date to timestamp but not satisfied with the outcome .
input date is 20071213
and output is 20.071.213.000.000 .
i want output to be 20071213000000 or 2007121700:00:00.
plz provide help on this .
Thanks ,
Abhi .
2007 Dec 20 6:25 AM
Hi Abhi,
FMs:
BDL_GET_CENTRAL_TIMESTAMP
DATE_2D_TO_4D_CONVERSION
DATE_CONV_EXT_TO_INT
DATE_TIME_CONVERT
Another Way
The timestamp is in the format <date><time>. In your example (20072404161312), the date is 20072404 and time is 161312. You can transfer the timestamp into a string and then split the data. You can use the following ABAP code to separate the date from the time:
"w_ts is your timestamp, w_s is the temporary string
"w_date and w_time will be your final date and time.
data: w_ts type timestamp.
data: w_s type string.
data: w_date type sy-datum,
w_time type sy-uzeit.
w_ts = '20071111161312'.
w_s = w_ts.
w_date = w_s(8).
w_time = w_s+8(6).
Kanagaraja L
2007 Dec 20 6:27 AM
Hi Abhishek,
Can u post ur code that does this part with the declaration so that i can analyze it better...
Regards
Naveen
2007 Dec 20 6:30 AM
Hi,
Use this.
data: str type string.
concatenate sy-datum sy-uzeit ',' '0000000' into str.
write:/ str.
or use this FM. 'FRE_CONVERT_DATE_TO_TIMESTMP'
Cheers,
Simha.
2007 Dec 20 6:48 AM
Hi Kanagaraja L,
ur second idea helps me .
after concatenate assign it to timestamp varaible so that we donot get unwanted seperators .
Thanks ,
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |