2010 Aug 27 8:45 AM
Hi All,
I have a requirement where each row in the Flat file should have different timestamp..... (There will be different time stamps for each individual row in the report)
"This date input will be the value of the timestamp from when the scheduled job was started"
Now the problem is i had used sy-datum and sy-uzeit to get the timestamp.... as the format was to have 2010-05-27 19:48:25
so here i get just 1 time stamp for all the rows....
Coded as below...
Inside the Loop.
MOVE sy-datum+0(4) TO lv_year.
MOVE sy-datum+4(2) TO lv_month.
MOVE sy-datum+6(2) TO lv_day.
CONCATENATE lv_year lv_month lv_day INTO lv_date SEPARATED BY c_colon.
MOVE sy-uzeit+0(2) TO lv_hh.
MOVE sy-uzeit+1(2) TO lv_mm.
MOVE sy-uzeit+2(2) TO lv_ss.
CONCATENATE lv_hh lv_mm lv_ss INTO lv_time SEPARATED BY c_colon.
CONCATENATE lv_date lv_time INTO wa_final-timestamp SEPARATED BY space.
Please let me know......
2010 Aug 27 10:06 AM
Hi friend,
I think get time will work.
because while debugging it takes time so time is updating. but if you run directly it run in a fraction of second so same time will update for all the records.
check large number of data then you will see a updating time.
Thanks and regards,
Viru.
Hi All,
I have a requirement where each row in the Flat file should have different timestamp..... (There will be different time stamps for each individual row in the report)
"This date input will be the value of the timestamp from when the scheduled job was started"
Now the problem is i had used sy-datum and sy-uzeit to get the timestamp.... as the format was to have 2010-05-27 19:48:25
so here i get just 1 time stamp for all the rows....
Coded as below...
Inside the Loop.
MOVE sy-datum+0(4) TO lv_year.
MOVE sy-datum+4(2) TO lv_month.
MOVE sy-datum+6(2) TO lv_day.
CONCATENATE lv_year lv_month lv_day INTO lv_date SEPARATED BY c_colon.
MOVE sy-uzeit+0(2) TO lv_hh.
MOVE sy-uzeit+1(2) TO lv_mm.
MOVE sy-uzeit+2(2) TO lv_ss.
CONCATENATE lv_hh lv_mm lv_ss INTO lv_time SEPARATED BY c_colon.
CONCATENATE lv_date lv_time INTO wa_final-timestamp SEPARATED BY space.
Please let me know......
2010 Aug 27 8:49 AM
According to your spec: ""This date input will be the value of the timestamp from when the scheduled job was started""
This implies that each row is to have the timestamp of the scheduled job. So they will be the same. If you need the timestamp the record was cut, then read the ABAP help on GET TIME.
matt
2010 Aug 27 8:53 AM
cording to your spec: ""This date input will be the value of the timestamp from when the scheduled job was started""
ok if they are talking about when the scheduled job was started then the logic what i have written is fine or not??
2010 Aug 27 9:09 AM
Looks fine to me. Except your first c_colon needs to be c_hyphen. And of course the construction of the timestamp can be outside the loop.
2010 Aug 27 9:48 AM
ok.. i did use get time... before using sy-datum and sy-uzeit.....
i guess this will work.... it showing me different time when i debug... but when i see the output without debugging it shows all same value
2010 Aug 27 9:20 AM
Hi ,
You can use the statement like below.
CONVERT DATE sy-datum TIME sy-uzeit INTO TIME STAMP l_timestamp TIME ZONE sy-zonlo.
Thanks
Subhankar
2010 Aug 27 9:52 AM
2010 Aug 27 10:37 AM
Without knowing the precise nature of the error, and without telepathy, it's hard to know precisely what you've done wrong, but you are aware, are you, that timestamp is a decimal fields - (type length 8 or 11 with 7 dp ).
Did you read the ABAP help on the statement?
GET TIME is only accurate (for sy-uzeit) to 1 second. Your ABAP probably manages to process all your records rather quicker than that.
Edited by: Matt on Aug 27, 2010 11:38 AM
2010 Aug 27 10:06 AM
Hi friend,
I think get time will work.
because while debugging it takes time so time is updating. but if you run directly it run in a fraction of second so same time will update for all the records.
check large number of data then you will see a updating time.
Thanks and regards,
Viru.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |