Docsity

ABAP Document: Understanding SAP Dates, Currency, and Units of Measure, Slides of Computer Programming

Partial preview of the text

Download ABAP Document: Understanding SAP Dates, Currency, and Units of Measure and more Slides Computer Programming in PDF only on Docsity!

Introduction ABAP

Dates

Lecture Overview

 I go into more depth than your book about how currency and quantity values work

Dates (Data Type)

 We have a couple of ways to deal with dates  The primary date data type  System fields for date and time that come from the SYST struct

The SYST Structure

(Illustration)

The Date (D) Data Type (1)

 It’s just an 8 character string

The Date (D) Data Type (2)

 The internal format is YYYYMMDD  There are ABAP dictionary fields for dates  sy-datum gets the value of the system date  Example to print the current date

The Time (T) Data Type

 The Time (T) data type stores the time as a character string HHMMSS  ABAP dictionary types store timestamps in UTC format  TIMESTAMP (YYYMMMDDDhhmmss)  TIMESTAMPL (YYYMMDDhhmmssmmmuuun)  sy-uzeit gets the system time

Manipulating Date Parts

 When subtracting two dates, you get the number of elapsed days

Manipulating Time Parts

Introduction to Reference

Fields

 Quantity and currency amounts use reference fields  Quantities work with UNIT (units)  Currency fields work with (a currency key) CUKY  The reference table contains a field with the currency key (CUKY) Or unit of measure UNIT

Quantity and Currency Fields

 They are not primary data types  They are components of a structure in the ABAP dictionary

Currency Fields

 They are used to convert amounts from one currency to another

 They are really packed (P) BCD numbers  A currency must also have currency key, which designates the currency  CUKY type  Use of the CURR data type is discouraged

Currency Tables

 TCURC currency codes  TCURF conversion factors  TCURR exchange rate

Currency (Example)

 Using the table ZEKEDAHLTEST  PRICE is of type CURR