1.1Purpose
This NER will calculate the calendar year for a given date, then return the end date of each month to the calling UBE or Application.
1.2Setup Notes and Prerequisites
1.3Special Logic
There are 2 system functions used within this NER to manuipulate dates. The first is called "add_days". There are two parameters to this system
function: (date, days). You pass in a date and how many days you want added to that day and assign it to variable. The other system function is called
"last_day". This system function accepts a date and will return the last day of the month for that date.
Both of these system functions will handle leap year and year 2000 issues.
2.4Processing
//
// Initializing 'Date' to be 1/1/XX, XX being the year of the date passed in
//
VA_szMonthDay = "01/01/"
VA_szYearReturned = date_year(BF jdDateOfCalendarYear)
VA_szYearReturned = substring (VA_szYearReturned, 3, 2)
VA_szDate = concat (VA_MonthDay, VA_YearReturned)
Convert String to Date
VA_jdDate <- jdDateConvertedDate
VA_szDate -> szStringToConvert
//
// Calculating End Dates of Calendar Year
//- Period 13 & 14 are the same date as Period 12
//
Period1EndDate = last_day(VA_jdDate)
VA_jdDateadd_day(Period1EndDate, 1)
Period2EndDate = last_day(VA_jdDate)
VA_jdDate = add_day(Period2EndDate, 1)
Period3EndDate = last_day(VA_jdDate)
VA_jdDate = add_day(Period3EndDate, 1)
Period4EndDate = last_day(VA_jdDate)
VA_jdDate = add_day(Period4EndDate, 1)
Period5EndDate = last_day(VA_jdDate)
VA_jdDate = add_day(Period5EndDate, 1)
Period6EndDate = last_day(VA_jdDate)
VA_jdDate = add_day(Period6EndDate, 1)
Period7EndDate = last_day(VA_jdDate)
VA_jdDate = add_day(Period7EndDate, 1)
Period8EndDate = last_day(VA_jdDate)
VA_jdDate = add_day(Period8EndDate, 1)
Period9EndDate = last_day(VA_jdDate)
VA_jdDate = add_day(Period9EndDate, 1)
Period10EndDate = last_day(VA_jdDate)
VA_jdDate = add_day(Period10EndDate, 1)
Period11EndDate = last_day(VA_jdDate)
VA_jdDate = add_day(Period11EndDate, 1)
Period12EndDate = last_day(VA_jdDate)
Peirod13EndDate = Period12EndDate
Period14EndDate = Period12EndDate
D1700820 - Calculate Calendar Year
Parameter Name | Data Item | Data Type | Req/Opt | I/O/Both |
---|---|---|---|---|
jdDateOfCalendarYear | DATE01 | JDEDATE | OPT | NONE |
Event point for JDE Date. | ||||
cSuppressErrorMessage | SUPPS | char | OPT | NONE |
A flag indicating whether or not runtime error messaging will occur when an error message is issued from a business function.
0 = allow
| ||||
szErrorMessageID | DTAI | char | OPT | NONE |
A code that identifies and defines a unit of information. It is an alphanumeric code up to 8 characters long that does not allow blanks or
| ||||
jdPeriod1EndDate | DATE01 | JDEDATE | OPT | NONE |
Event point for JDE Date. | ||||
jdPeriod2EndDate | DATE01 | JDEDATE | OPT | NONE |
Event point for JDE Date. | ||||
jdPeriod3EndDate | DATE01 | JDEDATE | OPT | NONE |
Event point for JDE Date. | ||||
jdPeriod4EndDate | DATE01 | JDEDATE | OPT | NONE |
Event point for JDE Date. | ||||
jdPeriod5EndDate | DATE01 | JDEDATE | OPT | NONE |
Event point for JDE Date. | ||||
jdPeriod6EndDate | DATE01 | JDEDATE | OPT | NONE |
Event point for JDE Date. | ||||
jdPeriod7EndDate | DATE01 | JDEDATE | OPT | NONE |
Event point for JDE Date. | ||||
jdPeriod8EndDate | DATE01 | JDEDATE | OPT | NONE |
Event point for JDE Date. | ||||
jdPeriod9EndDate | DATE01 | JDEDATE | OPT | NONE |
Event point for JDE Date. | ||||
jdPeriod10EndDate | DATE01 | JDEDATE | OPT | NONE |
Event point for JDE Date. | ||||
jdPeriod11EndDate | DATE01 | JDEDATE | OPT | NONE |
Event point for JDE Date. | ||||
jdPeriod12EndDate | DATE01 | JDEDATE | OPT | NONE |
Event point for JDE Date. | ||||
jdPeriod13EndDate | DATE01 | JDEDATE | OPT | NONE |
Event point for JDE Date. | ||||
jdPeirod14EndDate | DATE01 | JDEDATE | OPT | NONE |
Event point for JDE Date. |
None |
None |