05-13-2009 12:08 PM
Hi,
Is there any function module to get the TIMESTAMP as Outout , if i give input Time and Date.
Or,
If I go for the concatenate statement.. Do I need to concate the commas in to the target field?
Because,
I am not getting the proper result with this concatenate statement where I concatenated the YYYYMMDDHHMMSS in to the DECIMAL 15 Variable.
Thanks,
Naveen Inuganti.
05-13-2009 12:15 PM
Hi Naveen,
Check with below
for Date + time -- > time stamp
ABI_TIMESTAMP_CONVERT_INTO
for time stamp ---> date + time
ABI_TIMESTAMP_CONVERT_FROM
Thanks!
05-13-2009 12:15 PM
Hi Naveen,
Check with below
for Date + time -- > time stamp
ABI_TIMESTAMP_CONVERT_INTO
for time stamp ---> date + time
ABI_TIMESTAMP_CONVERT_FROM
Thanks!
05-13-2009 12:16 PM
05-13-2009 12:18 PM
Check this.
LTRM_TIMESTAMP_CONVERT_INTO
RKE_TIMESTAMP_CONVERT_INPUT
05-13-2009 12:28 PM
Hi Naveen,
LTRM_TIMESTAMP_CONVERT_INTO
or
OII_CALC_DIFF_BT_TIMESTAMPS try this FM
Use FM CCU_TIMESTAMP_DIFFERENCE
It gives you the difference between two timestamps in seconds.
which you can divide by 3600 to get hours.
or
G_BIW_CONVERT_INTO_TIMESTAMP
Regards,
Venkat M.
05-13-2009 12:36 PM
Thanks for your inputs.
There are more than one record for same date in one of my tables,
But there is no date field in that table. There is a TIMESTAMP.
And my report selection screen can have DATE field only.
So based on that date I need to fetch all the records in that table.
As we know before that select I need to modify selection screen DATE as the TIMESTAMP.
And that should fetch all records...as there is no time restriction.
Finally we need to create Ranges where lower limit with DAY START TIME
and upper limit with DAY END TIME.
I tried to modify the SY_UZEIT before passing to above function modules.
as SY-UZEIT = 000000 for lower limit.
as SY_UZEIT = 125959 for upper limit.
Its not giving the proper time stamp, what would you suggest.
Thanks,
Naveen.I
05-13-2009 12:44 PM
Hi use
IB_CONVERT_INTO_TIMESTAMP' or IB_CONVERT_FROM_TIMESTAMP'
Example:
* Declaring the work variables.......................
DATA :
timestamp like TZONREF-TSTAMPS,
time like sy-uzeit,
date like sy-datum.
* The following function module is used to convert the
* time and date into GMT timestamp
CALL FUNCTION 'IB_CONVERT_INTO_TIMESTAMP'
EXPORTING
i_datlo = sy-datum
i_timlo = sy-uzeit
I_TZONE = 'INDIA'
IMPORTING
E_TIMESTAMP = timestamp.
* The following function module is used to convert the
* above obtained timestamp to PST time zone date and time.
CALL FUNCTION 'IB_CONVERT_FROM_TIMESTAMP'
EXPORTING
i_timestamp = timestamp
I_TZONE = 'PST'
IMPORTING
E_DATLO = date
E_TIMLO = time.
write 😕 'Date and Time at PST zone is ',date, time.
05-13-2009 12:38 PM
05-13-2009 12:43 PM
No Srinivas,
Its Not working,
data: lv_timestamp type TZNTSTMPS,
lv_date type SY-DATLO,
lv_time type SY-TIMLO.
sy-uzeit = 000000.
call function 'ABI_TIMESTAMP_CONVERT_INTO'
exporting
iv_date = sy-datum
iv_time = sy-uzeit
IMPORTING
EV_TIMESTAMP = lv_timestamp
* EXCEPTIONS
* CONVERSION_ERROR = 1
* OTHERS = 2
.
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
write:/ lv_timestamp.
Output:
> 20,090,512,220,000
But it should be:
> 20,090,513,000,000
--Naveen
05-13-2009 1:15 PM
Hi,
Try using this instead of a function module
Convert dates to timestamp
CONVERT DATE sy-datum TIME sy-uzeit
INTO TIME STAMP g_timestmp1 TIME ZONE sy-zonlo.
Regards,
Hema.