SQL Server administration and T-SQL development, Web Programming with ASP.NET, HTML5 and Javascript, Windows Phone 8 app development, SAP Smartforms and ABAP Programming, Windows 7, Visual Studio and MS Office software SAP ABAP Programming and HANA Database Tutorials
Development resources, articles, tutorials, code samples and tools and downloads for ASP.Net, SQL Server, R Script, Windows, Windows Phone, AWS, SAP HANA and ABAP, like SAP UI5, Screen Personas, etc.

Install SAP Free

Convert Date and Time to Timestamp in ABAP

ABAP programmers can join date and time values stored in SAP tables to convert datetime to timestamp using ABAP code sample given in this tutorial. In SAP, it is frequently seen that datetime values are stored as date and time parts seperately. ABAP developers can convert datetime values to timestamp data type easily.

For this tutorial, I will use the ERDAT and ERZET fields on SAP sales documents table VBAK.

convert to timestamp in ABAP

Here is our sample ABAP code to build timestamp variable from date and time parts (erdat and erzet fields) of SAP VBAK table.

DATA lv_vbeln TYPE vbeln VALUE '0100001418'.
DATA lv_timestamp_string TYPE string.

SELECT SINGLE erdat, erzet INTO @DATA(ls_datetime)
 FROM vbak WHERE vbeln = @lv_vbeln.

CONCATENATE ls_datetime-erdat+0(4)
  INTO lv_timestamp_string.
WRITE: ls_datetime-erdat, ls_datetime-erzet, lv_timestamp_string.

The output is in form YYYYMMDDHHMISS

ABAP convert to timestamp using Date and Time

SAP Tutorials

SAP Tutorial

SAP Forums

SAP Tools

SAP Transaction Codes Table

Meetup Sunumu 1 meetup

Copyright © 2004 - 2020 Eralper YILMAZ. All rights reserved.
Community Server by Telligent Systems