F43213GenerateSRSShipDates

F43213 Generate SRS Ship Dates

Minor Business Rule

Object Name: B3401440

Parent DLL: CMFG

Location: Client/Server

Language: C


1.Functional Description


1.1Purpose

This function is used to create/delete records in F43213 based on shipment pattern defined in 

Shipment Pattern Revisions (P43212).


1.2Setup Notes and Prerequisites


1.3Special Logic


2.Technical Specifications

cDaysArray[32] =

cSaveDaysArray[32] = 

cShipDay[7] = 

cShipWeek[6] = 

jdWeekPattern[6] = [0

jdDate = 0

jdCurrentDate = 0

jdSaveCurrentDate = 0


nDay = 1

nMonth = Month.EFFF

nYear = Year.EFFF

nBegin = Day.EFFF

nI = Day.EFFF

jdCurrentDate = EFFF


jdDate.nYear = nYear

jdDate.nMonth = nMonth

jdDate.nDay = nDay


I3401440_GetWorkDayCalendar 


If All WorkDay is selected

If cAllWorkDay = '1'

For i = 1 to 7

cShipDay[i] = '1'

End For

Endif


If a specific day is selected

If cSunday = '1' 

cShipDay[1] = '1'
Endif
.

.

If cSaturday = '1' 

cShipDay[7] = '1'
Endif


If a specific week is selected

If cWeek1 = '1'

cShipWeek[1] = '1'  
Endif

.

.

If cWeek5 = '1'

cShipWeek[5] = '1'  
Endif


nDayOfWeek = ' ' 


I3401440_DeleteF43213Records


If Day Of the Month is selected

If cSelection2_EV15 = '1'

If DOM >= 1 and  DOM <= 31

nI = DOM

nDay =  nI

If  nI < Day.EFFF

If nMonth = 12

nMonth = 1

nYear = nYear + 1

else

nMonth = nMonth + 1

End


   JdDate.nYear = nYear
jdDate.nMonth = nMonth
jdDate.nDay = nDay

I3401440_GetWorkDayCalendar

End


      nSaveYear = nYear

      nSaveMonth = nMonth

nSaveDay = nDay


While cDaysArray(nI) = blank

nI = nI -1

nDay = nDay - 1

End


jdDate.nYear = nYear

      jdDate.nMonth = nMonth
jdDate.nDay = nDay


While jdDate >= EFFF and jdDate <= EFFT

If cDaysArray(nI) = 'W'

VPDTE = jdDate

            Call I3401440_InsertRecords
Else

If BAF <> blank

If BAF ='1' 
jdDate = jdDate -1

If nMonth = 1 and nI = 1

nYear = nYear -1

nMonth = 12

nDay =31

End

End

If BAF = '2'

JdDate = jdDate + 1

If nMonth = 12 and nI =31

nYear = nYear +1

nMonth = 1

nDay =1

End

End


jdDate.nYear = nYear

jdDate.nMonth = nMonth
jdDate.nDay = nDay


If  jdDate >= EFFF and jdDate <= EFFT
I3401440_GetWorkDayCalendar

Continue

End

End

End


cDaysArray[32] =0

nYear  = nSaveYear 
nMonth = nSaveMonth
nDate  = nSaveDay 

nI  = nSaveDay 


If nMonth = 12

nMonth = 1

nYear = nYear + 1

else

nMonth = nMonth + 1

End


nSaveYear = nYear

nSaveMonth = nMonth


jdDate.nYear = nYear

jdDate.nMonth = nMonth
jdDate.nDay = nDay

I3401440_GetWorkDayCalendar

If cDaysArray(nI) = blank
While cDaysArray(nI) = blank
nI = nI -1

nDay = nDay - 1
End
jdDate.nYear = nYear

jdDate.nMonth = nMonth
jdDate.nDay = nDay
Continue
End

End

End

End



If a Specific Week or Week Pattern is selected

If cSelection4_EV17 = '1' and cSelection1_EV14 = '1' or If cSelection4_EV17 = '1' and 

cSelection3_EV16 = '1' 

Call I3401440_GetWeekOfTheMonth

nDayOfWeek = 0 

nI = nBegin

nDay = nBegin

jdSaveCurrentDate = 0


jdDate.nYear = nYear

jdDate.nMonth = nMonth
jdDate.nDay = nDay


While jdCurrentDate  >=  EFFF and jdCurrentDate  <=  EFFT

If nDayOfWeek = 0

Call I3401440_GetDayOfTheWeek

Endif


cInWeek = 0

If jdCurrentDate >= jdWeekPattern[1] and jdCurrentDate < jdWeekPattern[2] and cShipWeek[1] = 

'1'    '85'85'85'85

jdCurrentDate >= jdWeekPattern[5] and jdCurrentDate < jdWeekPattern[6] and cShipWeek[5] = '1'

cInWeek = '1'

Endif

cBAFFlag = BAF

If cInWeek = '1' and cDaysArray(nI) = 'W and cShipDay[nDayOfWeek] = '1' or

cDaysArray(nI) = 'W and cBAFFlag = '1'
VPDTE = jdCurrentDate

If cBAFFlag = '1'

cBAFFlag = ' '

End

Call I3401440_InsertRecords

Else

If BAF <> blank

If cDaysArray(nI) <> 'W' 
If cDaysArray(nI) <> 'E' and cShipDay[nDayOfWeek] = '1' and cInWeek = '1'
jdSaveCurrentDate = jdCurrentDate
nSaveI = nI

nSaveYear = nYear

nSaveMonth = nMonth

nSaveDay = nDay
cSaveDaysArray[ ] = cDaysArray[ ]

cBAFFlag = '1'
End
If cBAFFlag ='1' 

If BAF = '1'

JdCurrentDate = jdCurrentDate - 1

If nMonth = 1and nI = 1

nYear = nYear -1
nMonth = 12

nDay =31
End
End

If BAF = '2'
JdCurrentDate = jdCurrentDate + 1
If nMonth = 12 and nI =31
nYear = nYear +1
nMonth = 1

nDay =1

End

End

jdDate.nYear = nYear

jdDate.nMonth = nMonth
jdDate.nDay = nDay


jdCurrentDate.nYear = nYear

jdCurrentDate.nMonth = nMonth
jdCurrentDate.nDay = nDay


If  jdCurrentDate >= EFFF or jdCurrentDate <= EFFT
I3401440_GetWorkDayCalendar
Continue

End
CBAFFlag = ' '

End
End

End

End


If jdSaveCurrentDate <> 0
jdCurrentDate = jdSaveCurrentDate
nI = nSaveI

nYear = nSaveYear

nMonth= nSaveMonth
nDay = nSaveDay

cDaysArray[ ] = cSaveDaysArray[ ] 
cSaveCurrentDate = 0

Endif

If cDaysArray(nI) = '  '

cDaysArray[ ] = ' ' 

if nMonth = 12

nMonth = 1

nYear = nYear + 1

else

nMonth = nMonth + 1

end

nDay = 1


jdDate.nYear = nYear

jdDate.nMonth = nMonth

jdDate.nDay = nDay


jdCurrentDate.nYear = nYear
jdCurrentDate.nMonth = nMonth
jdCurrentDate.nDay = nDay


Call I3401440_GetWorkDayCalendar

Call I3401440_GetWeekOfTheMonth


nDay = 1
nI = 1
Continue

End


If cDaysArray(nI) <> blank

nDayOfWeek = nDayOfWeek + 1

End

If nDayOfWeek > 7

nDayOfWeek = 1
End


nI = nI + 1

nDay  = nDay + 1

jdCurrentDate = jdCurrentDate + 1

End

End



If Week Pattern and certain Day of the Week is selected

If cSelection5_18 = '1' and cSelection1_14 = '1' or cSelection5_18 = '1' and cSelection3_16 = '1' 


jdCurrentDate = EFFF

jdDate = EFFF

nWeek =RCUR

nNUM = 1


While JdCurrentDate >=  EFFF and JdCurrentDate <= EFFT

If nDayOfWeek = 0

Call I3401440_GetDayOfTheWeek

Endif


If nWeek = RCUR and cDaysArray(nI) = 'W' and cShipDay[nDayOfWeek] = '1' or

cDaysArray(nI) = 'W' and cBAFFlag = '1'
VPDTE = jdCurrentDate

If cBAFFlag = '1'
cBAFFlag = ' '
End
Call I3401440_InsertRecords
End


If VDBAF <> blank
If cDaysArray(nI) <> 'W' and cDaysArray(nI) <> blank
If cDaysArray(nI) <> 'E' and cShipDay[nDayOfWeek] = '1' and jdSaveCurrentDate = 0
If RCUR = nWeek
jdSaveCurrentDate = jdCurrentDate
nSaveI = nI
nSaveYear = nYear

nSaveMonth = nMonth

nSaveDay = nDay
nSaveDayOfTheWeek = nDayOfTheWeek 

cSaveDaysArray[ ] = cDaysArray[ ]

cBAFFlag = '1'
End
End
If cBAFFlag ='1' 

If BAF = '1'
JdCurrentDate = jdCurrentDate - 1

If nMonth = 1and nI = 1

nYear = nYear -1
nMonth = 12

nDay =31
End
End
If BAF = '2'
JdCurrentDate = jdCurrentDate + 1
If nMonth = 12 and nI =31
nYear = nYear +1
nMonth = 1

nDay =1

End

       End

jdDate.nYear = nYear

jdDate.nMon'1a'1a

Data Structure

D3401440 - F43213 Generate SRS Ship Dates

Data Item Data Structure DescriptionI/ORequiredNotes
DOCO            Document Number                  I

DCTO            Document type                  I

LNID            Line ID                        I

MMCU            Branch                        IY

AN8            Supplier                        IY

ITM            Short Item Number                  I

LITM            Second Item Number            I

AITM            Third Item Number                  I

EFFF        Effective From Date            IY

EFFT            Effective To Date                  IY

DOW1            Sunday                        I

DOW2            Monday                        I

DOW3            Tuesday                        I

DOW4            Wednesday                        I

DOW5            Thursday                        I

DOW6            Friday                        I

DOW7            Saturday                        I

WOM1            Week1                           I

WOM2            Week2                              I

WOM3            Week3                              I

WOM4            Week4                              I

WOM5            Week5                              I

EV01            Selection1                        I

EV02            Selection2                        I

EV03            Selection3                        I

EV04            Selection4                        I

EV05            Selection5                        I

AWDY            All Work Day                  I

DOM            Day Of The Month                  I

BAF            Before/After Flag                  I

RCUR            Recur Every Weeks                  I

SUPPS            Suppress Error Message            I      '1' = Suppress runtime error 

message  

                                                                        ' ' = Allow runtime error 

message

DTAI            Error Message ID                  O      ' ' = Success 

                                                                        '3143' = Table access error 


^

Parameter NameData ItemData TypeReq/OptI/O/Both
mnDocumentOrderInvoiceEDOCOMATH_NUMERICOPTNONE

A number that identifies an original document. This document can be a voucher, a sales order, an invoice, unapplied cash, a journal entry, 
and so on.

szOrderTypeDCTOcharOPTNONE

A user defined code (00/DT) that identifies the type of document. This code also indicates the origin of the transaction. J.D. Edwards has 
reserved document type codes for vouchers, invoices, receipts, and time sheets, which create automatic offset entries during the post 
program. (These entries are not self-balancing when you originally enter them.) The following document types are defined by J.D. Edwards and 
should not be changed: P Accounts Payable documents   R Accounts Receivable documents   T Payroll documents   I Inventory documents  
O Purchase Order Processing documents   J General Accounting/Joint Interest Billing documents   S Sales Order Processing documents

mnLineNumberLNIDMATH_NUMERICOPTNONE

A number that identifies multiple occurrences, such as line numbers on a purchase order or other document. Generally, the system assigns 
this number,but in some cases you can override it.

szCostCenterAltMMCUcharOPTNONE

A code that represents a high-level business unit. Use this code to refer to a branch or plant that might have departments or jobs, which 
represent lower-level business units, subordinate to it. For example:     o Branch/Plant (MMCU)     o Dept A (MCU)     o Dept B (MCU)     o Job 123 
(MCU) Business unit security is based on the higher-level business unit.

mnAddressNumberAN8MATH_NUMERICOPTNONE

A number that identifies an entry in the Address Book system, such as employee, applicant, participant, customer, supplier, tenant, or 
location.

mnIdentifierShortItemITMMATH_NUMERICOPTNONE

An inventory item number. The system provides three separate item numbers plus an extensive cross-reference capability to other item 
numbers (see data item XRT) to accommodate substitute item numbers, replacements, bar codes, customer numbers, supplier numbers, and 
so forth. The item numbers are as follows:   o Item Number (short) - An eight-digit, computer-assigned item number     o 2nd Item Number - The 
25-digit, free-form, user defined alphanumeric item number     o 3rd Item Number - Another 25-digit, free-form, user defined alphanumeric item 
number

szIdentifier2ndItemLITMcharOPTNONE

A number that identifies the item. The system provides three separate item numbers plus an extensive cross-reference capability to 
alternative item numbers. The three types of item numbers are: Item Number (short) An 8-digit, computer-assigned item number. 2nd Item Number A 
25-digit, user defined, alphanumeric item number. 3rd Item Number  Another 25-digit, user defined, alphanumeric item number. In addition to 
these three basic item numbers, the system provides an extensive cross-reference search capability. You can define numerous 
cross-references to alternative part numbers. For example, you can define substitute item numbers, replacements, bar codes, customer numbers, or 
supplier numbers.

szIdentifier3rdItemAITMcharOPTNONE

The system provides three separate item numbers plus an extensive cross-reference capability to alternate item numbers. These item 
numbers are as follows: 1.  Item Number (short) - An 8-digit, computer-assigned item number. 2.  2nd Item Number - The 25-digit, free-form, user 
defined alphanumeric item number. 3.  3rd Item Number - Another 25-digit, free-form, user defined alphanumeric item number.  In addition to 
these three basic item numbers, an extensive cross-reference search capability has been provided (see XRT). Numerous cross references to 
alternate part numbers can be user defined, such as substitute item numbers, replacements, bar codes, customer numbers, or supplier 
numbers.

jdEffectiveFromDateEFFFJDEDATEOPTNONE

A date that indicates one of the following:     o When a component part goes into effect on a bill of material     o When a routing step goes into 
effect as a sequence on the routing for an item     o When a rate schedule is in effect The default is the current system date. You can enter 
future effective dates so that the system plans for upcoming changes. Items that are no longer effective in the future can still be recorded and 
recognized in Product Costing, Shop Floor Management, and Capacity Requirements Planning. The Material Requirements Planning system 
determines valid components by effectivity dates, not by the bill of material revision level. Some forms display data based on the effectivity 
dates you enter.

jdEffectiveThruDateEFFTJDEDATEOPTNONE

A date that indicates one of the following:     o When a component part is no longer in effect on a bill of material     o When a routing step is no 
longer in effect as a sequence on the routing for an item     o When a rate schedule is no longer active The default is December 31 of the 
default year defined in the Data Dictionary for Century Change Year. You can enter future effective dates so that the system plans for upcoming 
changes. Items that are no longer effective in the future can still be recorded and recognized in Product Costing, Shop Floor Management, 
and Capacity Requirements Planning. The Material Requirements Planning system determines valid components by effectivity dates, not by 
the bill of material revision level. Some forms display data based on the effectivity dates you enter.

mnDayOfTheMonthDOMMATH_NUMERICOPTNONE

Day of the month ( 1 thru 31)

cSuppressErrorMessageSUPPScharOPTNONE

A flag indicating whether or not runtime error messaging will occur when an error message is issued from a business function.        0 = allow 
runtime error message handling.        1 = suppress runtime error message handling.

szErrorMessageIDDTAIcharOPTNONE

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 
special characters such as %, &, or +. You create new data items using system codes 55-59. You cannot change the alias.

cSundayDOW1charOPTNONE

First day of the week.

cMondayDOW2charOPTNONE

Second day of the week.

cTuesdayDOW3charOPTNONE

Third day of the week.

cWednesdayDOW4charOPTNONE

Fourth day of the week.

cThursdayDOW5charOPTNONE

Fifth day of the week.

cFridayDOW6charOPTNONE

Sixth day of the week.

cSaturdayDOW7charOPTNONE

Seventh day of the week.

cWeek1WOM1charOPTNONE

First week of the month. If you check this box, the shipment pattern you define will be valid for the 1st through the 7th of the month.

cWeek2WOM2charOPTNONE

Second week of the month. If you check this box, the shipment pattern you define will be valid for the 8th through the 14th of the month.

cWeek3WOM3charOPTNONE

Third week of the month. If you check this box, the shipment pattern you define will be valid for the 15th through the 21st of the month.

cWeek4WOM4charOPTNONE

Fourth week of the month. If you check this box, the shipment pattern you define will be valid for the 22nd through the 28th of the month.

cWeek5WOM5charOPTNONE

Fifth week of the month. If you check this box, the shipment pattern you define will be valid for the 29th through the end of the month, if 
applicable.

cAllWorkDaysAWDYcharOPTNONE

A code for selecting all work days in a week.

cSelection1EV01charOPTNONE

An option that specifies the type of processing for an event.

cSelection2EV02charOPTNONE

An option that specifies the type of processing for an event.

cSelection3EV03charOPTNONE

A radio button that specifies the level at which trace/track result is to be displayed.  Select the Detail to display all transactions except IB, IX, 
and IZ types.  Or, select Derivative Lots Only to display only those transactions that may have created new derivative lot. 

cSelection4EV04charOPTNONE

PeopleSoft event point processing flag 04.

cSelection5EV05charOPTNONE

A flag that indicates whether automatic spell check is turned on.

cBeforeAfterFlag9BAFcharOPTNONE

Before/After Flag    blank No ship day will be created if a selected day is a non-work day    1       Create a ship day on the day before the 
selected day if it falls on a non-work day.    2       Create a ship day on the day after the selected day if it falls on a non-work day.

mnRecurEveryWeeksRCURMATH_NUMERICOPTNONE

A code that determines the weekly pattern that the system builds based on the effective from date. Valid codes are:    1   Every week is 
scheduled    2   Every second week is scheduled 

Related Functions

None

Related Tables

F43213 SRS Ship Dates
absolute; left: 0.500000in">Continue

End

End

End

End



If a Specific Week or Week Pattern is selected

If cSelection4_EV17 = '1' and cSelection1_EV14 = '1' or If cSelection4_EV17 = '1' and 

cSelection3_EV16 = '1' 

Call I3401440_GetWeekOfTheMonth

nDayOfWeek = 0 

nI = nBegin

nDay = nBegin

jdSaveCurrentDate = 0


jdDate.nYear = nYear

jdDate.nMonth = nMonth
jdDate.nDay = nDay