RefreshActualsWithSalesOrder

Refresh ActualsWithSalesOrder

Major Business Rule

Object Name: N3401410

Parent DLL: CMFG

Location: Client/Server

Language: NER

1.Functional Description

1.1Purpose
This function will read Sales Order History File (F42119) and Sales Order Detail File (F4211), if 
required and create Detail Forecast records.


1.2Setup Notes and Prerequisites


1.3Special Logic


2.Technical Specifications


2.4Processing 

1.F42119.Select (Depending upon Begin Date, Item Number and Branch)

2.F42119.FetchNext

3.While File_IO_Status = SUCCESS 

If Requested Date is <= End Date
Verify that the combination of the order type, line type and status code exist in the 
Inclusion Rules file by chaining to F34004 with keys 

F34004.FetchSingle

VersionInclusionRule

DocumentTypeSDDCTO

LineTypeSDLNTY

StatuCodeSDNXTR

 
End

If  File_IO_Status = SUCCESS and SubstituteItem(sdso05 from F42119) is not equal to  '1'
If LargeCustomers not equal to blank

If ShipTo = '1'
F0101.FetchSingle for the ship to (SDSHAN) off the record
Else

F0101.FetchSingle for the sold to (SDAN8) off the record

End

If File_IO_Status = SUCCESS

If ShipTo equals '1'

F0301.FetchSingle (Customer Master table (F0301)) with 

                                              SDSHAN

Else

F0301.FetchSingle (Customer Master table (F0301)) with

                 SDAN8

End


If File_IO_Status = SUCCESS and ABCSalesCode (A5ABC1) = 'A'
Call Update 'A' forecast Records (B3400780) 
ShortItemNumberShortItemNumber

SecondItemNumberSecondItemNumber

ThirdItemNumberThirdItemNumber 

BranchBranch

ForecastTypeForecastType

If AmountQuantity is not equal to '2'

SDPQORQuantity

End

If AmountQuantity is not equal to '1'

SDAEXPAmount

End

If ShipTo equals '1'

Move SDSHANSoldTo

Else

Move SDAN8SoldTo

End

DatePattensDatePatterns

SDDRQJRequestedDate

SummarizeForecastsSummarizeForecasts

RetreiveCatCodesRetrieveCatCodes

SummaryCodeSummaryCode

LinkListPtrLinkListPtr

ProgramIDProgramID

End

End

Else
Call Update 'A' forecast Records (B3400780) 
ShortItemNumberShortItemNumber

SecondItemNumberSecondItemNumber

ThirdItemNumberThirdItemNumber 

BranchBranch

ForecastTypeForecastType

If AmountQuantity is not equal to '2'

SDPQORQuantity

End

If AmountQuantity is not equal to '1'

SDAEXPAmount

End

Move blanks to SoldTo

DatePattensDatePatterns

SDDRQJRequestedDate

SummarizeForecastsSummarizeForecasts

RetreiveCatCodesRetrieveCatCodes

SummaryCodeSummaryCode

LinkListPtrLinkListPtr

ProgramIDProgramID

End

End

End

              F42119.FetchNext

EndWhile            


4.If IncludeSalesOrderDetail = '1'

5.F4211.Select (Depending upon Begin Date, Item Number and Branch)
6.F4211.FetchNext

7.While File_IO_Status = SUCCESS 
If Requested Date is <= End Date
Verify that the combination of the order type, line type and status code exist in 

the Inclusion Rules file by chaining to F34004 with keys 

F34004.FetchSingle
VersionInclusionRule

DocumentTypeSDDCTO

LineTypeSDLNTY

StatuCodeSDNXTR

 
End
If  File_IO_Status = SUCCESS and SubstituteItem(sdso05 from F4211) is not equal to  '1'
If LargeCustomers not equal to blank

If ShipTo = '1'
F0101.FetchSingle for the ship to (SDSHAN) off the record
Else

F0101.FetchSingle for the sold to (SDAN8) off the record

End

If File_IO_Status = SUCCESS

If ShipTo equals '1'

F0301.FetchSingle (Customer Master table (F0301)) with 

                                                     SDSHAN

Else

F0301.FetchSingle (Customer Master table (F0301)) with

                      SDAN8

End


If File_IO_Status = SUCCESS and ABCSalesCode (A5ABC1) = 'A'
Call Update 'A' forecast Records (B3400780) 
ShortItemNumberShortItemNumber

SecondItemNumberSecondItemNumber

ThirdItemNumberThirdItemNumber 

Branch Branch

ForecastType ForecastType

If AmountQuantity is not equal to '2'

SDPQOR Quantity

End

If AmountQuantity is not equal to '1'

SDAEXP Amount

End

If ShipTo equals '1'

Move SDSHANSoldTo

Else

Move SDAN8SoldTo

End

DatePattens DatePatterns

SDDRQJ RequestedDate

SummarizeForecastsSummarizeForecasts

RetreiveCatCodesRetrieveCatCodes

SummaryCode SummaryCode

LinkListPtr LinkListPtr

ProgramID ProgramID

End

End

Else
Call Update 'A' forecast Records (B3400780) 
ShortItemNumberShortItemNumber

SecondItemNumberSecondItemNumber

ThirdItemNumberThirdItemNumber 

Branch Branch

ForecastType ForecastType

If AmountQuantity is not equal to '2'

SDPQOR Quantity

End

If AmountQuantity is not equal to '1'

SDAEXP Amount

End

Move blanks to SoldTo

DatePattens DatePatterns

SDDRQJ RequestedDate

SummarizeForecastsSummarizeForecasts

RetreiveCatCodesRetrieveCatCodes

SummaryCode SummaryCode

LinkListPtr LinkListPtr

ProgramID ProgramID

End

End

              F4211.FetchNext

EndWhile            

End



^

Data Structure

D3401410 - RefreshActualsWithSalesOrder


Data Item Data Structure DescriptionI/ORequiredNotes

ITM            ShortItemNumber                  IR

LITM            SecondItemNumber                  IR

AITM            ThirdItemNumber                  IR

MCU            Branch                        IR

TYPF            ForecastType                  IR

DRQJ            BeginDate                        IR

EV01            LargeCustomers                  IR

MVER            ResourceVersion                  IR

EV02            SummarizeForecasts            IR

EV03            RetrieveCatCodes                  IR

KVER            SummaryCode                        IR

DRQJ            EndDate                        IR

EV01            MonthlyVsWeekly                  IR      '1' = monthly, 

                                                                        ' ' = weekly

GENLNG      PointerToDates                  IR

EV01            ShipTo                        IR

GENLNG      LinkListPtr                        I/OR

PID            ProgramID                        I

EV01            AmountQuantity                  IR      '1' = quantity,  

                                                                        '2' = amount 

                                                                        ' ' = both

EV02            IncludeSalesOrderDetail            I      '1' = include Sales Order 

Detail 

                                                                        '  ' = Sales Order History 

Only


^

Parameter NameData ItemData TypeReq/OptI/O/Both
mnShortItemnumberITMMATH_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

szSecondItemNumberLITMcharOPTNONE

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.

szThirdItemNumberAITMcharOPTNONE

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.

szBranchMCUcharOPTNONE

An alphanumeric code that identifies a separate entity within a business for which you want to track costs. For example, a business unit 
might be a warehouse location, job, project, work center, branch, or plant. You can assign a business unit to a document, entity, or person for 
purposes of responsibility reporting. For example, the system provides reports of open accounts payable and accounts receivable by 
business unit to track equipment by responsible department. Business unit security might prevent you from viewing information about business units 
for which you have no authority.

szForecastTypeTYPFcharOPTNONE

A user defined code (34/DF) that indicates one of the following:     o The forecasting method used to calculate the numbers displayed about 
the item     o The actual historical information about the item 

jdBeginDateDRQJJDEDATEOPTNONE

The date that an item is scheduled to arrive or that an action is scheduled for completion.

cLargeCustomersEV01charOPTNONE

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

szResourceVersionMVERcharOPTNONE

A user defined code (40/RV) that identifies an inclusion rule that you want the system to use for this branch/plant. The Manufacturing and 
Warehouse Management systems use inclusion rules as follows:     o For Manufacturing:        Allows multiple versions of resource rules for 
running MPS, MRP, or DRP.     o For Warehouse Management:        Allows multiple versions of inclusion rules for running putaway and picking. The 
system processes only those order lines that match the inclusion rule for a specified branch/plant.

cSummarizeForecastEV02charOPTNONE

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

cRetrieveCatCodeEV03charOPTNONE

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. 

szSummaryCodeKVERcharOPTNONE

A user defined code (40/KY) that indicates the type of summary forecast.

cMonthlyVsWeeklyEV01charOPTNONE

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

jdEndDateDRQJJDEDATEOPTNONE

The date that an item is scheduled to arrive or that an action is scheduled for completion.

idPointerToDatesGENLNGIDOPTNONE

General purpose ID variable.

szProgramIDPIDcharOPTNONE

The number that identifies the batch or interactive program (batch or interactive object). For example, the number of the Sales Order Entry 
interactive program is P4210, and the number of the Print Invoices batch process report is R42565. The program ID is a variable length value. 
It is assigned according to a structured syntax in the form TSSXXX, where: T The first character of the number is alphabetic and identifies the 
type, such as P for Program, R for Report, and so on. For example, the value P in the number P4210 indicates that the object is a 
program. SS The second and third characters of the number are numeric and identify the system code. For example, the value 42 in the number P4210 
indicates that this program belongs to system 42, which is the Sales Order Processing system. XXX The remaining characters of the numer are 
numeric and identify a unique program or report. For example, the value 10 in the number P4210 indicates that this is the Sales Order Entry 
program.

cShipToEV01charOPTNONE

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

cAmountQuantityEV02charOPTNONE

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

idLinkListPtrGENLNGIDOPTNONE

General purpose ID variable.

cIncludeCurrentSalesEV03charOPTNONE

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. 

cBeforeImageProcessingBIPROCcharOPTNONE

This flag controls image processing in interoperability transactions.

szTypeTransactionTYTNcharOPTNONE

The qualifier used to identify a specific type of transaction.

Related Functions

None

Related Tables

None