MRPCalculateAvailableTransferQty

MRP, Calculate Available Transfer Qty from Cache

Major Business Rule

Object Name: B3500040

Parent DLL: CMFG

Location: Client/Server

Language: C

1.Functional Description
This function will read and calculate the available quantity for transfer given a supply branch.

1.1Purpose
This function will return the quantity available before adjusting for lot expired quantities and the 
quantity available after adjusting lot expired quantities and quantities transferred to other demand 

branches.


1.2Setup Notes and Prerequisites


1.3Special Logic


2.Technical Specifications

1.Open F35UI001
2.If Failed Exit Function with errors

3.Output Error Code = '0'

4.FetchKeyed from F35UI001 using JOB, CTID, and Input Supply Branch

5.If Fetch Successful

6. Output Quantity Available Before (MATH01) = Quantity From Cache Record(MAPQOH)

7. Output Quantity Available After(MATH02) = Quantity From Cache Record.(MATRQT)

8.End If

9.If Input $LEXP = '1' And Output Quantity Available After(MATH02) > 0 

10. // Adjust Qty Available for Lot Expired Quantities up to @DT[$X]

11. Wk Lot Expired Total = 0

12.  

13. Call B3401290 in mode '1' using Input Supply Branch, 'LXU'.

14. While Cache Code Error = '0'

15. If Date From Cache Record(DRQJ) > Input Supply Date then

16. Call B3401290 to Close Cursor and Free Ptr

17. Break From While Loop

18. End If

19. Wk Lot Expired Total = Wk Lot Expired Total + Lot Expired Qty from Cache

20. Call B3401290 in mode '6' using Input Supply Branch, 'LXU' to fetch next 

record.

21. End While

22.

23. Wk Difference = MAPQOH - MATRQT  

24. If Wk Difference > Wk Lot Expired Total

25. Wk Lot Expired Qty = 0

26. Else

27. Wk Lot Expired Qty = Wk Lot Expired Total - Wk Difference

28. End If

29. Output Quantity Available After(MATH02) = Output Quantity Available  After(MATH02) - 

Wk Lot Expired Qty

30.End If

31.If Cache Cursor <> 0

32. Call B3401290 to close cursor, mode '9'

33.End If

34.If Output Quantity Available After(MATH02) < 0 then

35. Output Quantity Available After(MATH02) = 0

36.End IF


^

Data Structure

D3500040 - MRP, Calculate Available Transfer Qty from Cache

Parameter NameData ItemData TypeReq/OptI/O/Both
jdSupplyDateDRQJJDEDATENONENONE

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

cIncludeLotExpiredQtysEV01charNONENONE

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

szSupplyBranchMMCUcharNONENONE

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.

mnQtyAvailBeforeLotExpiredMATH01MATH_NUMERICNONENONE

- - - Good Performance Low Value. 

mnQtyAvailAfterLotExpiredMATH02MATH_NUMERICNONENONE

- - - Good Performance High Value. 

cErrorCodeERRCcharNONENONE

This error code indicates if any errors occurred during the creation of the Trip Document Detail (F4914) records by the Delivery Document 
Set Server program (XT4914).

cSuppressErrorMessageSUPPScharNONENONE

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.

szErrorMessageIDDTAIcharNONENONE

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.

szJobNumberJOBcharNONENONE

Job Number

mnJobNumberJOBSMATH_NUMERICNONENONE

The job number (work station ID) which executed the particular job.

szComputerIDCTIDcharNONENONE

Related Functions

B3401290 Cache, Process MRP Item Quantities

Related Tables

F35UI001 MPS/MRP Planning - Multiple Plant User Index