F41291GetLandedCostRecord

Get Landed Cost Record

Major Business Rule

Object Name: B4301030

Parent DLL: CDIST

Location: Client/Server

Language: C

Functional Description

Purpose

To read the landed cost file.


Setup Notes and Prerequisites

The Key will determine how to read the file - by Item/Branch or Landed Cost.

If the Key is sent in, the appropriate parameter must also be sent.

If the Key is blank, the fetch will be first by Item/Branch then by Landed Cost Rule, if no record 

for the item/branch existed.


A date may also be sent to determine if the record is effective.


Special Logic


Called from named ER Landed Cost Selection.


Technical Specification


If the key is blank.

If the item #, B/P and landed cost rule are all blank, return with error.

Read the landed cost file first by the item # and Branch.  

If no record is found, read Landed Cost file by Landed Cost rule.

Set the Key (KEYD) = 1 or 2.

End If


If the key = 1

If the Item # or Branch are blank, set error = 1 and return.

Set the pointer and read the next record with the Item/Branch.

End If

 

If the key = 2

If the Landed Cost Rule is blank, set error = 1 and return.

Set the pointer and read the next record with the Landed Cost Rule.

End If


If End of key, set error to 2 and return.


If Date passed (RCJD) is not zero

Check if the Date passed (RCDJ) >= Effective from (IGEFFF) and <= Effective Thru (IGEFFT).
If invalid, read next record until valid record found or end of file.
Endif

Load output fields.

Set GENLNG pointers.


Data Structure

D4301030 - Get Landed Cost Record

Parameter NameData ItemData TypeReq/OptI/O/Both
szLandedCostRulePRP5charNONENONE

Special Input Expected
PRP5ab  szLandedCostRuleab  I/Oab Not required with  ITM/MCUab 


^

mnItemNumberITMMATH_NUMERICNONENONE

ITMab  mnItemNumberab  I/Oab  ab Not required with  PRP5ab 

^

szBranchPlantMCUcharNONENONE

MCUab  szBranchPlantab  I/Oab  ab Not required with  PRP5ab 

^

szCostLevelLVLAcharNONENONE

User defined code (table 40/CA) designating an add-on cost. This code also specifies the sequence of the cost add-ons for a particular 
item or group of items.

szBasedOnLevelLVLBcharNONENONE

User defined code (table 40/CA) designating the basis of cost for an item. If you use this code, you can roll costs based on a previous level 
total.

mnPercentOfCostPCSTMATH_NUMERICNONENONE

Percentage of the item's primary purchasing cost that the system add as a landed cost component to the base cost of the item as indicated 
on a purchase order.

mnPlusAmountPAMTMATH_NUMERICNONENONE

An amount to be added to the indicated cost to equal the total cost amount.

mnWeightRateRATFMATH_NUMERICNONENONE

The system multiplies the rate you add to this field by the unit weight you specify for an inventory item to calculate a landed cost 
component.

mnVolumeRateRATVMATH_NUMERICNONENONE

The system multiplies the rate you add to this field by the unit volume you specify for an inventory item to calculate a landed cost 
component.

mnSupplierAN8MATH_NUMERICNONENONE

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

szGLClassCodeGLPTcharNONENONE

A user defined code (41/9) that identifies the G/L offset that system uses when it searches for the account to which it posts the transaction. If 
you do not want to specify a class code, you can enter **** (four asterisks) in this field. You can use automatic accounting instructions (AAIs) to 
predefine classes of automatic offset accounts for the Inventory Management, Procurement, and Sales Order Management systems. You 
might assign G/L class codes as follows:    IN20   Direct Ship Orders    IN60   Transfer Orders    IN80   Stock Sales  The system can generate 
accounting entries based upon a single transaction. For example, a single sale of a stock item can trigger the generation of accounting entries 
similar to the following:         Sales-Stock (Debit) xxxxx.xx     A/R Stock Sales (Credit) xxxxx.xx     Posting Category: IN80             Stock Inventory 
(Debit) xxxxx.xx     Stock COGS (Credit) xxxxx.xx The system uses the class code and the document type to find the AAI.

cIncludeInUnitCostINYNcharNONENONE

Code indicating whether you want the landed cost to be added to the item's unit cost. Valid codes are:    Y Add the landed cost to the unit 
cost    N Do not add the landed cost to the unit cost

jdDateRCDJJDEDATENONENONE

RCDJab jdDate (I) Date used to compare effective  datesab 

^

cVoucherRCYNcharNONENONE

Code indicating whether the landed cost is to be displayed during Voucher Match or not.  The possible values are as follows:    Y A receipt 
record (F43121) is created, and the landed cost may be vouchered in the Voucher Match program.  The Landed Cost Code (LAND) field in 
the receipt record will contain a value of 2.    N A receipt record (F43121) is created, but the landed cost is not allowed to be vouchered in the 
Voucher Match program.  The Landed Cost Code (LAND) field in the receipt record will contain a value of 3.  The receipt record is necessary if 
the receipt is reversed. NOTE:   Journal entries are still created when the value is N.  As a result, you may want the Landed Cost AAI's 
(4385/4390) pointed to the same G/L account, in order to cancel out the entries.

cKeyUsedKEYDcharNONENONE

KEYDab  cKeyUsedab  (I/O)ab  (Yes)ab 

Initialize:KEYD = blank Subsequently: KEYD = cKeyUsed, that is 1 = Use Item/Branch for key 2 = Use 

Landed Cost Rule for  keyab 


^

cErrorERRcharNONENONE

ERRab  cErrorab (O)1 = parameter error 2 = EOF or file  errorab 

^

idPointerGENLNGIDNONENONE

GENLNGab  idPointerab  I/Oab Yes if KEYD passed  inab  ab 

^

idHRequestGENLNGIDNONENONE

GENLNGab  idHRequestab  I/Oab Yes if KEYD passed  inab  ab 

^

Related Functions

None

Related Tables

F41291 Item Cost Components