Convert Date <-> Timestamp in ABAP/4
Tuesday, 30. May 2006, 07:45:10
Web www.howforge.com
Home » blogs » thitima's blog
Convert Date <-> Timestamp in ABAP/4
Submitted by thitima on Wed, 2006-01-11 17:49. ABAP/4 | English | IT | Programming | SAP R/3
Date to Timestamp
Example
*&---------------------------------------------------------------------*
*& Form convert_date_to_timestamp
*&---------------------------------------------------------------------*
form convert_date_to_timestamp using par_date
par_time
par_time_zone
changing par_timestamp.
clear par_timestamp.
CONVERT DATE par_date TIME par_time INTO
TIME STAMP par_timestamp TIME ZONE par_time_zone.
endform.
" convert_date_to_timestamp
Timestamp to Date
Example
*&---------------------------------------------------------------------*
*& Form convert_timestamp_to_date
*&---------------------------------------------------------------------*
form convert_timestamp_to_date using par_timestamp
par_time_zone
changing par_date
par_time.
data: lc_timestamp type timestamp.
clear: par_date, par_time, lc_timestamp.
lc_timestamp = par_timestamp.
CONVERT TIME STAMP lc_timestamp TIME ZONE par_time_zone INTO
DATE par_date TIME par_time.
endform. " convert_timestamp_to_date
* Chained Statement in ABAP/4
* Options of NEW-PAGE statement in ABAP/4
* Formatting Options in SAPscript: Symbol Length
* How to get long text in ABAP/4
* How to Find the Number of Entries of Internal Table in ABAP/4
* BOTTOM ... ENDBOTTOM Command in SAPscript
* How to Assign Dynamic Fields using Filed-Symbols in ABAP/4
* AT Statement in a Loop of ABAP/4
* ABAP/4 Example Code: Download OTF Spool to PDF
* Formatting Options in SAPscript: Move Sign to Left and Right
» thitima's blog | add new comment | 395 reads | del.icio.us


How to use Quote function: