Upload
madlyn-bradley
View
222
Download
6
Tags:
Embed Size (px)
Citation preview
Introduction ABAP Dates
Slide 2
Lecture Overview I go into more depth than your book
about how currency and quantity values work
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
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
Slide 5
The SYST Structure (Illustration)
Slide 6
The SYST Structure (Illustration)
Slide 7
The Date (D) Data Type (1) It’s just an 8 character string
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
Slide 9
The Date (D) Data Type (3) We can perform arithmetic on dates Add 30 days to the current date
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
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
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
Slide 13
The Time (T) Data Type (Example) Declare a time variable and store the
current time in it
Slide 14
The Time (T) Data Type (Example) Get the time parts (hour, minute,
second)
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
Slide 16
Introduction to Reference Fields From help.sap.com
Slide 17
Quantity and Currency Fields They are not primary data types They are components of a structure in
the ABAP dictionary
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
Slide 19
Currency Tables
Slide 20
Currency Tables TCURC currency codes TCURF conversion factors TCURR exchange rate
Slide 21
Currency (Example) Using the table ZEKEDAHLTEST
PRICE is of type CURR
Slide 22
Currency (Example) Reference table is TCURL (Leading
Currency)
Slide 23
Currency (Example) The TCURL Table (Edit using IMG)
Slide 24
Currency (Example) And finally the leading currency in an
exchange quotation
Slide 25
Currency (Configuring) Exchange ratios are maintained using
transaction code OBBS Exchange rates are maintained using
OB08 Transactions are cleared between
company codes
Slide 26
Currency (Configuring Exchange Ratios) OBBS – Translation ratios define the unit
ration between the from and to currencies
Slide 27
Currency (Configuring Exchange Rates) OB08 – Note that ratios and rates are
keyed by the exchange rate type
Slide 28
Steps in Currency Configuration1. Check Currency Codes - OBY32. 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
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
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
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
Slide 32
Unit of Measure (Example) Let’s use time First, Check Units of Measurement from
IMG
Slide 33
Unit of Measure (Example) Look at the Units of measure for time
Slide 34
Unit of Measure (Example)
Everything is measured relative to seconds
Slide 35
Unit of Measure (Example) The conversion factor for minutes.
There are 60 seconds in a minute
Slide 36
Unit of Measure (Example) The conversion factor for months