Download presentation
Presentation is loading. Please wait.
Published byMadlyn Bradley Modified over 9 years ago
1
Introduction ABAP Dates
2
Slide 2 Lecture Overview I go into more depth than your book about how currency and quantity values work
3
Slide 3 Introduction (Dates) If you come from a.NET or most worlds, dates are treated much differently from what you are used to In SAP, dates are not numerical. They are just a special character type Arithmetic operations are performed by SAP converting data internally for you
4
Slide 4 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
5
Slide 5 The SYST Structure (Illustration)
6
Slide 6 The SYST Structure (Illustration)
7
Slide 7 The Date (D) Data Type (1) It’s just an 8 character string
8
Slide 8 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
9
Slide 9 The Date (D) Data Type (3) We can perform arithmetic on dates Add 30 days to the current date
10
Slide 10 The Date (D) Data Type (4) We extract parts using positional params +n denotes the starting position (offset specification) (n) denotes the number of characters to get
11
Slide 11 Manipulating Date Parts When subtracting two dates, you get the number of elapsed days Adding an integral value adds days to a date
12
Slide 12 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
13
Slide 13 The Time (T) Data Type (Example) Declare a time variable and store the current time in it
14
Slide 14 The Time (T) Data Type (Example) Get the time parts (hour, minute, second)
15
Slide 15 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
16
Slide 16 Introduction to Reference Fields From help.sap.com
17
Slide 17 Quantity and Currency Fields They are not primary data types They are components of a structure in the ABAP dictionary
18
Slide 18 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
19
Slide 19 Currency Tables
20
Slide 20 Currency Tables TCURC currency codes TCURF conversion factors TCURR exchange rate
21
Slide 21 Currency (Example) Using the table ZEKEDAHLTEST PRICE is of type CURR
22
Slide 22 Currency (Example) Reference table is TCURL (Leading Currency)
23
Slide 23 Currency (Example) The TCURL Table (Edit using IMG)
24
Slide 24 Currency (Example) And finally the leading currency in an exchange quotation
25
Slide 25 Currency (Configuring) Exchange ratios are maintained using transaction code OBBS Exchange rates are maintained using OB08 Transactions are cleared between company codes
26
Slide 26 Currency (Configuring Exchange Ratios) OBBS – Translation ratios define the unit ration between the from and to currencies
27
Slide 27 Currency (Configuring Exchange Rates) OB08 – Note that ratios and rates are keyed by the exchange rate type
28
Slide 28 Steps in Currency Configuration 1. Check Currency Codes - OBY3 2. Set Decimal Places for Currencies - OBY4 3. Check Exchange Rate Types - OB07 4. Enter Exchange Rates - OB08 5. Define Translation Ratios for Currency Translation - OBBS 6. Define Additional Local Currencies - OB22 7. Define Accounts for Exchange Rate Differences - OB09
29
Slide 29 It’s About Units of Measure There are four “units of measure” for “things” Base unit of measure is used for all material stocks All quantities entered in other units are “converted” to the base unit of measure Basic view of the material definition Sales unit of measure allows materials to be sold in different units Material master sales view
30
Slide 30 It’s About Units of Measure Purchase unit of measure is used for “purchasing increments” Material master, purchasing view Unit of issue is the quantity issued from the warehouse Material master, work scheduling view Alternate unit of measure is defined in table MARM
31
Slide 31 Creating a Unit of Measure Define / use a dimension The seven base dimensions are length, weight, time, electrical current, temperature, molecular mass, brightness We rarely need to create these Create units of measure for the dimension CUNI is the transaction code
32
Slide 32 Unit of Measure (Example) Let’s use time First, Check Units of Measurement from IMG
33
Slide 33 Unit of Measure (Example) Look at the Units of measure for time
34
Slide 34 Unit of Measure (Example) Everything is measured relative to seconds
35
Slide 35 Unit of Measure (Example) The conversion factor for minutes. There are 60 seconds in a minute
36
Slide 36 Unit of Measure (Example) The conversion factor for months
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.