Named ER Specification
Source NameN4302000DesignerKelly Huffman
Data Structure D4302000Programmer
Function NameF4101 Get Substitute ItemsSystem Code43
Function DescriptionF4101GetSubstitueItemsFunction Category
 Function UseGet
 Function TypeNER
Revisions Log 
DateModifications bySAR NumberDescription
05/20/98Kelly HuffmanDesigned
1.Functional Description
1.1Purpose
This Named ER will check the F4104 for substitute items.  
1.2 Setup Notes and Prerequisites
None
1.3Special Logic
None
2.Technical Specifications
2.1Parameters:
Data Item Data Structure DescriptionI/ORequiredNotes
XRTCross RefI/OYes
TRDJDateI/OYes
ERNOError Message NumberI/ONo
MCUBranch/PlantIYes
UITMItem Number Unknown FormatIYes
AN8Address NumberIYes
ERRCError CodeNo
2.2Related Tables 
Table Table Description
F4104Item Cross Reference Table
2.3Related Business Functions
Source NameFunction Name
B5100003F0006 Check Business Unit Existence
B4101040F4101 Get Item Master Information
X0005Get UDC
X4101Get Item Master Row
B4300060Get Purchasing Instructions
2.4Processing 
//  Set Event Variables
VA evt_EV02_EndProcessNow = '0 '
VA evt_EDF2_ItemRestrictions = '  '
VA evt_ERRC_ErrorFlag = '0'
VA evt_EV01_FoundFlag = '  '
VA evt_EV03_NoMoreRecords = '0'
VA evt_XRTC_XrefType = "IR"
//  Use B4300060 to retrieve Item Restriction Flag from F0401
If BF mnAddressNumber is not equal to 
 F0401 Get Purchasing Instructions
 BF mnAddressNumber->mnAddressNumber
 VA evt_EDF2_ItemRestrictions<-cItemRestrictions
 VA evt_ERRC_ErrorFlag<-cErrorCode
End if
//  Is record valid?
If VA evt_ERRC_ErrorFlag is not equal to '0'
 BF cErrorFlag = '1'
 BF szErrorMsgNumber = '0069'
 VA evt_EndProcessNow = '1'
End If
// Are there any item restrictions?
If VA evt_EDF2_ItemRestrictions is not equal to 
 F0401.Open
End if
// Validate Branch Plant
If VA evt_EndProcessNow is equal to '0'
 F0006 Check Business Unit Existence
 BF szBranchPlant<->szBusinessUnit
 VA evt_EV01_FoundFlag<-cFoundFlag
 If VA evt_EV01_FoundFlag is not equal to '1'
 BF cErrorFlag = '1'
 BF szErrorMsgNumber = '0726'(Business Unit Invalid)
 VA evt_EndProcessNow = '1'
 End If
End If
// Validate Item Number
If VA evt_EndProcessNow is equal to '0'
 F4101 Get Item Master Information
 VA evt_ITM_ShortItemNo<-mnShortItemNumber
 BF szItemNoUnknownFormat->szPrimaryItemNumber
 '1'->cSuppressErrorMessage
 BF szErrorMsgNumber<-szErrorMessageID
 VA evt_MCU_BusinessUnit<-szBranchPlant
// Is Business Unit blank?
 End If
// Validate szXRefType, unless it is blank.  User can view substitute/obsolete screen even if the processing option //is blank.
 If BF szXRefType is greater than '0'
 Get UDC
 "XRT"->szDataDictionaryItem
 VA evt_SY_UDCSystemCode->szRecordTypeCode
 VA evt_RT_UDCRecordType->szRecordTypeCode
 BF szXRefType->szUserDefinedCode
 '0'->cSuppressErrorMessage
 BF szErrorMsgNumber<-szErrorMessageID
 If szErrorMessageID is not equal to 
 BF cErrorFlag = '1'
 BF szErrorMsgNumber = '0027'(User Define Code Error)
 VA evt_EndProcessNow = '1'
 End If
 End If
End If
// Retrieve records from the F4104
F4104.Open
If BF szXRefType is greater than '0'
 F4101.Select
 BF szXRefType=TK Type - Cross-Reference Type Code
 VA evt_ITM_ShortItem=TK Item Number - Short
Else
 F4104.Select
 VA evt_ITM_ShortItem=TK Item Number - Short
End if
If SV File_IO_Status is equal to CO SUCCESS
 While VA evt_EV02_NoMoreRecords is equal to '0'
 //
 F4104.FetchNext
 VA evt_AN8_AddressNumber<-TK AddressNumber
 VA evt_XRT_XrefType<-TK Type - Cross-Reference 
 VA evt_ITM_ItemNumberShort<-TK ShortItemNumber
 VA evt_EXDJ_ThruDate<-TK Date - Expired
 VA evt_EFTJ_FromDate<-TK Date - Effective
 VA evt_CITM_ItemNumber<-TK Customer/Supplier ItemNo
 If File_IO_Status is equal to CO SUCCESS
 VA evt_EV02_RecordsSelected = '1'
// Bypass this item if it is defined specifically for another supplier
 If VA evt_AN8_AddressNumber is not equal to '0'
 And VA evt_AN8_AddressNumber is not equal to BF mnAddressNumber
 VA evt_EV02_RecordsSelected = '0'
 End if
// Bypass this item if it is not within the appropriate Date range
 If VA evt_EFTJ_FromDate is not equal to '0'
 And BF jdDateTransactionJulian is greater than VA evt_EFTJ_FromDate
 VA evt_EV02_RecordsSelected = '0'
 End if
 If VA evt_EXDJ_ThruDate is not equal to '0'
 And BF jdDateTransactionJulian is greater than VA evt_EXDJ_ThruDate
 VA evt_EV02_RecordsSelected = '0'
 End if
// Validate item number
 If VA evt_EV02_RecordsSelected = '1'
 F4101 Get Item Maser Row
 VA evt_CITM_ItemNumber->szPrimaryItemNumber
 BF szBranchPlant->szBranchPlant
 VA evt_ITM_ItemNumberShort->mnShortItemNumber
 BF cErrorFlag->cErrorCode
 '1'->cSuppressErrorMsg
 '1'->cCallType
// Does item number exist in Branch/Plant?
 If BF cErrorFlag is equal to blank
 F4102 Get Item Branch Row
 BF szBranchPlant->szBranchPlant
 VA evt_ITM_ItemNoShort->          mnShrtItemNo
 '1'->mnIndex
 '2'->mnKeys
 '1'->cCallType
 BF cErrorFlag->cErrorCode
 If BF cErrorFlag = '1'
 VA evt_EV02_RecordsSelected = '0'
 End if
 Else
 VA evt_EV02_RecordsSelected = '0'
 End if
 If  VA evt_EV02_RecordsSelected = '1'
 // Retrieve item record from F0401.
 
 If VA evt_EDF2_ItemRestrictions is not equal to 
 
      Convert Math Number to String
 BF mnAddressNo->mnMahNumeric01
 VA XRVF_Supplier<-szVideoConstant
  Convert Math Number to String
 VA ITM_ShortItem->mnMahNumeric01
 VA XRVT_ShortItem<-szVideoConstant
      F4013.FetchSingle
 VA XRTC_=CrossRefTypeCode
 VA XRVT_Supplier=CrossRefValue-From
 VA XRVT_ShortItem=CrossRefValue-To
      If SV File_IO_Status is equal to CO SUCCESS
      And VA evt_EDF2_ItemRestrictions is equal to 'E'
      Or SV File_IO_Status is not equal to CO SUCCESS
      And VA evt_EDF2_ItemRestrictions is equal to 'I'
 VA evt_EV02_RecordsSelected = '0'
      End if
 End if
 End if
 End if
 End if
 End While
End if
If VA evt_EDF2_ItemRestrictions is not equal to 
 F4104.Close
 F4013.Close
End if
D4302000 - F4104 Get Cross Reference Items
| Parameter Name | Data Item | Data Type | Req/Opt | I/O/Both | 
|---|---|---|---|---|
| szBranchPlant | MCU | char | OPT | INPUT | 
An alphanumeric code that identifies a separate entity within a business for which you want to track costs. For example, a business unit 
  | ||||
| mnAddressNumber | AN8 | MATH_NUMERIC | OPT | INPUT | 
A number that identifies an entry in the Address Book system, such as employee, applicant, participant, customer, supplier, tenant, or 
  | ||||
| jdDateTransactionJulian | TRDJ | JDEDATE | OPT | INPUT | 
The date that an order was entered into the system. This date determines which effective level the system uses for inventory pricing.  | ||||
| szCrossReferType | XRT | char | OPT | INPUT | 
A user defined code (41/DT) that identifies the type of cross-reference set up for this customer. Examples of cross-reference types include:
   
  | ||||
| szErrorMessage | ERNO | char | OPT | OUTPUT | 
The error number assigned by the JDE edit/update programs designating the exact error that occured.  | ||||
| cErrorCode | ERRC | char | OPT | OUTPUT | 
This error code indicates if any errors occurred during the creation of the Trip Document Detail (F4914) records by the Delivery Document 
  | ||||
| szItemNoUnknownFormat | UITM | char | OPT | INPUT | 
A number that the system assigns to an item. It can be in short, long, or third item number format.  | ||||
| cItemRestrictions | EDF2 | char | OPT | OUTPUT | 
A code that designates whether restrictions have been placed on the sale of items to this customer.
Valid values are:
   Blank No restrictions.
 
  | ||||
| None | 
| None |