Date Business Functions in The EnterpriseOne
Date Business Functions in The EnterpriseOne
E1: BSFN: Date Business Functions in the EnterpriseOne (Doc ID 626493.1) To Bottom
In this Document
Purpose
Scope
Details
Summary Table of the Date Business Functions
What is JDE Julian Date?
Example
JDE Date Routines: Date Masks Available
API FormatDate
B0000127 ReturnTodaysDate
Purpose
Parameters
B0700068 RetrieveDayofWeek
Purpose
Parameters
B4201480 GetDayofWeek
Purpose
Parameters
B0800013 ConvertStringToDate
Purpose
Parameters
B0800208 ConvertStringDateToDateFormat
Purpose
Parameters
B3000250 GetMonthDescription
Purpose
Parameters
B3000260 GetYearDescription
Purpose
Parameters
B41B0470 FormatDateFromDMY
Purpose
Parameters
Special Instructions:
B7600920 ConvertNumbersAndDatesToString
Purpose
Parameters
B9100001 ConvertjulianDatetojdeDate
Purpose
Parameters
B9800210 Convert From and To Julian Date from JDEDATE
Purpose
ConvertDateToJulian
ConvertJulianToDate
Parameters
ConvertDateToJulian
ConvertJulianToDate
B4500490 DateConversiontoJulian
Purpose
Parameters
B0000200 SixDigitNumerictoDate
Purpose
Parameters
B0000200 DatetoSixDigitNumeric
Purpose
Parameters
B9800460 ConvertDateToString
Purpose
Parameters
N1700090 CalculateBeginDateofPeriod
Purpose
Parameters
N0701500 ConvertDateToStringFormatCode
Purpose
Parameters
Access Date Column in Foreign Table in Oracle Database using API JDB_OpenForeignTable
Release XE/8.0
Release 8.9 and above
Convert Time stored in UTC format in column JSSCHSTTIME in F91320 Scheduler Table to Local Date and Time format
Calculate Week Number of the Year based on a Given Date
References
APPLIES TO:
PURPOSE
This document details some of the most common Date Business Functions available in the EnterpriseOne, how to use the business
function and known issues.
SCOPE
This document is intended for the EnterpriseOne Developer who may need to use a Date Business Function while developing or
modifying an Interactive or Batch Application or Report.
DETAILS
N1700090 CalculateBeginDateofPeriod Period Number, Company, Period Begin Date, Period End
Fiscal Year and Century Date, Begin Date of Fiscal
Year, and/or Period Ending
Dates for all 14 Periods
N0701500 ConvertDateToStringFormatCode JDE Date String
All dates in the EnterpriseOne database are stored in a JDE Julian format. A date in JDE Julian format is a six-digit numeric field which
represents the century, year and day of the year. It should be updated using the following rules:
The first digit describes the century. A value of 0 indicates the 20th century (1900s). A value of 1 indicates the 21st century
(2000s);
The second and third digits represent the year (08, 09, 10, 11, etc);
The fourth, fifth and sixth digits represent the day in the year (001 for January 1, 112 for April 21, etc.)
Example
The date for January 31, 2010 = 110031 in a Julian date format (CYYDDD).
1 = 21st Century
10 = Year in the 21st Century
031 = Day in the year
NOTE: If the Business Function requires JDEDATE as an input/output parameter, users can only pass parameters with the attribute
of data dictionary item type 11 (Date) and class DATEW. The business function will not return correct information if the user passes
a numeric field of CYYDDD to the JDEDate parameter.
Mask Description
T Month Number
B Abbreviated Month Name, valid values are: Jan, Feb, Mar, Apr, May, Jun, Jul, Aug,
Sep, Oct, Nov, Dec
R 2 digit year
E 4 digit year
API FormatDate
This API works in combination with the Data Dictionary Item/Alias CenturyChangeYear/CENTCHG. This data dictionary has a default
value specified in the default value tab that indicates when the cutoff is for dates with a century of 20 and when dates should have a
century of 19. When the default value is 10, any date entered with a year up to 10 is preceeded by 20 - i.e. 2005, 2006, 2007, etc. Any
date entered with a year after 10 is preceeded by 19 and assumed to belong to that century - i.e. 1911, 1912, etc. If the current default
value of Alias CENTCHG is 10 and a date of "01/01/2011" is passed in to the API with the format mask of OSASR (as defined in JDE Date
Routines: Date Masks Available), the API will return the string date as "01/01/2011" with a 4-digit year as designed and not as
"01/01/11" with a 2-digit year. If the default value of Alias CENTCHG is changed to a larger default value such as 20 and the data
dictionary change is appropriately deployed throughout EnterpriseOne, then a date of "01/01/2011" passed in to the API with the format
mask of OSASR will be correctly formatted to "01/01/11" as intended.
B0000127 ReturnTodaysDate
Purpose
This function will return today's date in a Julian date (JDE format).
Parameters
B0700068 RetrieveDayofWeek
Purpose
This function will take a date and return the numeric day of the week (0-6) and its corresponding day description (SUNDAY thru
SATURDAY) in Uppercase.
0 SUNDAY
1 MONDAY
2 TUESDAY
3 WEDNESDAY
4 THURSDAY
5 FRIDAY
6 SATURDAY
Parameters
To format the Day Description from all Upppercase to only the first character in Uppercase and the remaining characters in Lowercase,
e.g. format WEDNESDAY to Wednesday, use ER Expression Manager TEXT function lower.
B4201480 GetDayofWeek
Purpose
This function will take a date, and return the numeric day of the week (0=Sunday, 1=Monday through 6=Saturday) and error code
(0=success).
Parameters
If using Associated Description feature to display the Day description associated with the parameter variable based on data dictionary
item DOW, add 1 to the value returned in the parameter-variable data item DOW. The Associated Description feature retrieves the
description in UDC JE42/DW that is defined in data dictinary item DOW. The Day description in UDC JE42/DW starts with 1 as Sunday
through 7 as Saturday.
A better alternate function to use when the Day Description is required for Display is business function B0700068 RetrieveDayofWeek.
B0800013 ConvertStringToDate
Purpose
This function will convert a string that is in a date format (MM/DD/YYYY) to a Julian date (JDE format).
The business function does NOT work on One Digit Day and/or Month input.
Parameters
B0800208 ConvertStringDateToDateFormat
Purpose
This function will convert a string that is in a date format to a Julian date (JDE format). The Date Mask passed as a literal to the function
describes the format of the string date. For example, if the string date is in a format of 05/29/2002 the format mask to be passed to the
function should be OSASE. If the date was in a format of 052902 the format mask would be OAR. Review the Date Masks Available as in
defined in JDE Date Routines: Date Masks Available.
Parameters
B3000250 GetMonthDescription
Purpose
This function will validate a two digit number entered within a range (1-12) and convert the 2-digit number to a string description of the
month. (1=January, 2=February, 3=March, etc.). The function will return "Invalid Entry" if the input number is not in the range.
Parameters
mnCalendarMonth MT MATH_NUMERIC I
B3000260 GetYearDescription
Purpose
This function will validate a number entered within a range (00-99) and convert a 2-digit number to a 4-digit description of the year. The
function will combine the century and year and give the description (i.e. 19 + 98 = 1998).
If the year is less than or equal to the default value of DCYR data item, then century will be '20'. If the year is greater than the default
value or DCYR data item, then century will be '19'
Parameters
mnCalendarYear YR MATH_NUMERIC I
B41B0470 FormatDateFromDMY
Purpose
This business function will convert 3 numeric values (YY, MM, DD) to a Julian date (JDE format). One digit number on the input month
and day is acceptable
Parameters
mnYear YR MATH_NUMERIC I
Special Instructions:
This business function calls B0000154. If YY is greater than the default value of CENTCHG (DD item), the century is 19. If YY is less
than the default value of CENTCHG (DD item), the century is 20.
B7600920 ConvertNumbersAndDatesToString
Purpose
This business function will convert a Julian date (JDE format) into a string DDMMYY format (0 pad for one digit day and month).
Parameters
B9100001 ConvertjulianDatetojdeDate
Purpose
This business function will convert a Julian numeric date (JDE Julian Format of CYYDDD) to a Julian date (JDE format). The first digit of
a Julian numeric date input represents the Century - 0 for 19's, 1 for 20's, 2 for 21's, etc..
Parameters
Purpose
ConvertDateToJulian
This function will convert a Julian date (JDE format) to a Julian numeric date (YYYYDDD)
NOTE: This Julian numeric date output is not in the JDE Julian Date format of CYYDDD, but rather in the YYYYDDD format.
ConvertJulianToDate
This function will convert Julian numeric date (YYYYDDD) to a Julian date (JDE format)
NOTE: The input Julian numeric date should not be in the JDE Julian Date format of CYYDDD, but rather in the YYYYDDD format.
Parameters
ConvertDateToJulian
ConvertJulianToDate
Data Dictionary item CDL is a 2 digit numeric data item. You might need to use other math numeric data items to pass in/out to the
business function. To get the numeric field to print out on the report, display decimal and edit code need to be changed on the field.
B4500490 DateConversiontoJulian
Purpose
This business function will convert a Julian date that is in JDE Date Format to a math numeric Julian date (JDE Julian Format of
CYYDDD). The first digit of a Julian numeric date input represents the Century - 0 for 19's, 1 for 20's, 2 for 21's, etc...
Parameters
B0000200 SixDigitNumerictoDate
Purpose
This business function will convert a math numeric that is in JDE Julian format of CYYDDD to a Julian date in JDE Date Format. The first
digit of a Julian numeric date input represents the Century - 0 for 19's, 1 for 20's, 2 for 21's, etc..
Parameters
B0000200 DatetoSixDigitNumeric
Purpose
This business function will convert a Julian date that is in JDE Date Format to a math numeric Julian date (JDE Julian Format of
CYYDDD). The first digit of a Julian numeric date input represents the Century - 0 for 19's, 1 for 20's, 2 for 21's, etc...
Parameters
B9800460 ConvertDateToString
Purpose
This business function will convert a Julian date (JDE format) into a string according to the selected MASK. Date Mask is defined in UDC
00/DF.
Parameters
*User can define the field by selecting Literal and doing a Visual Assist to get the List of valid Values.
NOTE
The business function has a very restrictive date format and will truncate a 4-digit year into a 2-digit year. It hardcodes slash
between the ( day, month, year), it requires a leading 0 for months and days that are a single digit, and outputs a string date that is
only 8 characters long. Therefore, a 4-digit year will be truncated into a 2-digit year as reported in Bug 10719222 with the following
response from Development :
"The data structure member which returns the converted date string to the calling application is only 8 characters long. Date formats
with 4 digit years would be 10 characters long and subsequently they are truncated to 8 characters. To change this data structure
member to a data item that is 10 characters long would require all of the approximately 90 applications and UBEs to reattach the call
to this function. Therefore, the change will not be made at this time.". A workaround solution is to use the the Expression Manager
Date functions ( date_year(), date_month(), date_day() ) to extract individually the year, month, day of the Input date and use the
Expressison Manager Text function concat() to assemble the individual extracted (year, month, day) into the desired date string
format.
Details of the Date and Text functions is in Document 626609.1 E1: FDA: Expression Manager Functions.
This business function uses API FormatDate, passing NULL to szDateFormat will force it to follow the Date Format set in Display
Preference in User Profile, if it is blank in the User Profile, it will follow system setting, for Windows, it is set in the Control Panel ->
Regional Options. For AS400, the date format is controlled by sysval QDATFMT however, AS/400 sysval qdatfmt does not have an
output 4 digit year option.
N1700090 CalculateBeginDateofPeriod
Purpose
This business function will return a period begin date, period end date, beginning date of the fiscal year, and/or the ending dates for all
14 periods of the fiscal year.
Parameters
mnPeriodNo PN MATH_NUMERIC I
szCompany CO STRING I
mnFiscalYear1 FY MATH_NUMERIC I
N0701500 ConvertDateToStringFormatCode
Purpose
This business function can be used to give a string format output of a date without having characters to indicate year, month and date.
1 - MMDDYYYY
2 - YYYYMMDD
3 - DDMMYYYY
4 - MMDDYY
5 - YYMMDD
6 - DDMMYY
Parameters
jdInputDate_DT DT JDEDATE I
NOTE
The function pads zero if length of year, month and day is 1 digit
To get year, month and day system function date_year(), date_month() and date_day() are used
B0000083 - MathNumericToStringZeroPad (Math Numeric to String Left Zero Pad, Convert) is used internally
Access Date Column in Foreign Table in Oracle Database using API JDB_OpenForeignTable
When coding a C business function using API JDB_OpenForeignTable in the Oracle database, the Date column in the foreign table is
accessed using the following data structure depending on the release :
Release XE/8.0
Use the JDEUTIME data structure and map the JDEUTIME back and forth to the JDEDATE structure with the following APIs :
Since in Oracle database, the JDEDATE and JDEUTIME items are stored in the same format which is DATE, the API
JDB_OpenForeignTable cannot distinguish between JDEDATE and JDEUTIME on a DATE column and the decision was made to go with
JDEUTIME since JDEUTIME can store more information including the time.
Convert Time stored in UTC format in column JSSCHSTTIME in F91320 Scheduler Table to Local Date and Time format
1. Make sure daylight saving rules are set up correctly in P00085 application.
2. Call business function B9800009-Get Time and Date From UTC to convert a UTC time in Local Date and Time format.
3. Call business function B9800188-Format MathNumeric to Time String to format the time from numeric format to hh:mm:ss format.
To convert Local Date and Time to a UTC time, call business function B9800009-Get UTC Time
Currently, there is no standard business function to calculate the week number of the year based on a given date. For example, March
29 2012 falls in Week 13 of Year 2012.
A custom NER business function will need to be created with the high-level logic steps described below:
1. Convert the Given date to the numeric JDE Julian Date, which is in the format of CYYDDD, using business function B0000200
DatetoSixDigitNumeric. For example, March 29 2012 in JDE Julian Date numeric format is 112089.
2. Extract the last 3 digits of the converted JDE Julian Date to get the Day component number of the JDE Julian Date.
3. Divide the Day Component number by 7. Round the result to the Nearest Whole Number to get the Week Number of the Year.
REFERENCES
Related
Products
JD Edwards EnterpriseOne > Tools and Technology > EnterpriseOne Tools > JD Edwards EnterpriseOne Tools > Tools - Business Function
JD Edwards EnterpriseOne > Tools and Technology > EnterpriseOne Tools > JD Edwards EnterpriseOne Tools > Tools - Business Function
Keywords
B0000127; B0700068; B0800013; B0800208; B3000250; B3000260; B4000770; B4201480; B4500490; B7600920; B9100001; B9800210; BUSINESS
FUNCTION; CENTCHG; DATE FORMAT; DAY MONTH YEAR; FORMAT MASK; JDE1BSFNDOC; JULIAN DATES; MONTH DAY YEAR
Back to Top