MRPGetBucketDateFromCache

MRP, Get Bucket Date from Cache

Major Business Rule

Object Name: B3400550

Parent DLL: CMFG

Location: Client/Server

Language: C

1.Functional Description
This business function will get the nearest Bucket Date for a given date based on the data in the MRP 
Bucketless Date Cache. This is used in the MRP Program to get the bucket date nearest to the given 

date. As of 1/2/97, it can also look for a nearest Forecast Consumption Bucket Date from the Bucketless 

Date Cache.


1.1Purpose

This function is used to get the bucket date nearest to the Input date or the nearest Forecast 
Consumption Bucket Date.
.

1.2Setup Notes and Prerequisites

The MRP Bucketless Date Cache must be have been loaded using B3400360 before calling this function.

1.3Special Logic

None

2.Technical Specifications

The following actions have to be performed by the Business Function.

1. Calculate Output Date

Output Date = Input Date
Call B3401270 with Action Code = '9' (Get Nearest) with key values Branch and Input Date, comparison 

flag is 'A'. (This will fetch a date record >= Input Date).

If Cache Error Code = '0'

If (Input Find Forecast Cons Bucket = '1' And Forecast Con Flag from Cache <> ' ' )  OR(Input 

Find Forecast Cons Bucket <> '1' And Bucket Flag from Cache = 'B')

Output Date = Date from Cache

Else

Output Error Code = '1'

Call B3401270 with Action Code = '1' (Get) with key values Branch and Date from 

Cache,Sequential Fetch is '1'. (This will fetch a date record = Date from Cache).

While Cache Error Code = '0'

If (Input Find Forecast Cons Bucket = '1' And Forecast Con Flag from Cache <> 

' ' )OR(Input Find Forecast Cons Bucket <> '1' And Bucket Flag from Cache =  'B')

Output Date = Date from Cache

Output Error Code = '0'

break

End If

End While

End If

Else

Output Error Code = '1'

End If


2. If any Errors, Exit program with Error code = '1' and Error Message = '3143' 
3.Also, free any cursor pointers and close cursor used by this function.


Data Structure

D3400550 - MRP, Get Bucket Date from Cache

Parameter NameData ItemData TypeReq/OptI/O/Both
szBranchMCUcharNONENONE

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.

jdInputDateDATE01JDEDATENONENONE

Event point for JDE Date.

cSuppressErrorMessageEV01charNONENONE

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

jdOutputDateDATE02JDEDATENONENONE

Event point for JDE Date.

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).

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

cFindForecastConsumptionBucketEV01charNONENONE

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

Related Functions

B3401270 Cache, Process MRP Bucketless Dates

Related Tables

None