F1207GetRows

F1207 Get Rows

Minor Business Rule

Object Name: B1200070

Parent DLL: CMFG

Location: Client/Server

Language: C

Functional Description

Purpose

This function is to read all rows from the Maintenance Schedule table (F1207) by the user input 
index/key combination, and return the row information.


Setup Notes and Prerequisites

The following is a list of valid values for the index/key combination.  Partial keys may be used.

1 = NUMB, SRVT, CPLD

2 = WONA

3 = Not available (Invalid Index)

4 = APID, MSTS, SRVT, CPLD

5 = NUMB, MSTS, SRVT, CPLD


Special Logic

This function will open the F1207 table and store the hRequest in the hRequest parameter. A special 

call to FreeUserAndHrequest (Description: Memory, Free User And Hrequest) in C4102A1 must be made by 

the user to close the table and free the pointer storage location for the hRequest. Pass in only the 

hRequest to this function.




Technical Specification



1.Test for a valid key.
2.If the input hRequest is equal to zero,

a.Open the Maintenance Schedule table (F1207).
b.Perform a select based upon the input index/key combination.

c.Fetch the matching record and return the field values to the data structure.

d.Save off the hRequest to the data structure.

3.If the input hRequest is not equal to zero,

4.Perform a fetch to retrieve the next row using the hRequest, and return all table information 

to the data structure.

5.Error processing:

a.If the fetch fails return an error (0002).
b.Return an error code of '1' if the end of file is reached; otherwise, return a zero.

c.All other errors will return an error message (3143).




Data Structure

D1200070 - F1207 Get Rows

Parameter NameData ItemData TypeReq/OptI/O/Both
mnAssetItemNumberNUMBMATH_NUMERICOPTBOTH

An 8-digit number that uniquely identifies an asset.

szServiceTypeSRVTcharOPTBOTH

A user defined code (12/ST) that describes the preventive maintenance service to be performed. Examples of codes include CLUTCH for 
adjust clutch, OIL for change oil, and 10H for 10 hour service.

jdCompletedDateCPLDJDEDATEOPTBOTH

This is the actual date that the maintenance was completed.

mnAssignedWorkOrderNumberWONAMATH_NUMERICOPTBOTH

The Work Order Number related to a particular Equipment Maintenance line item. The system assigns this number from next numbers.

szUnitNumberAPIDcharOPTBOTH

A 12-character alphanumeric code used as an alternate identification number for an asset. This number is not required, nor does the 
system assign a number if you leave the field blank when you add an asset. If you use this number, it must be unique. For equipment, this is 
typically the serial number.

szMaintenanceStatusMSTScharOPTBOTH

A user defined code (12/MS) that indicates the maintenance status of a piece of equipment, such as 50 for maintenance due or 60 for 
waiting for parts. Note: Status code 98 is reserved for cancelled maintenance. Status code 99 is reserved for completed maintenance. Status code 
01 (default) is reserved for initial maintenance setup.

szSerialNumberASIDcharOPTOUTPUT

A 25-character alphanumeric number that you can use as an alternate asset identification number. You might use this number to track 
assets by the manufacturer's serial number. You are not required to use a serial number to identify an asset. Every serial number that you enter 
must be unique.

cMaintenancePriorityMPRIcharOPTOUTPUT

This field is used to indicate the relative priority that this maintenance has in relation to all other maintenance.

szUserDefinedCodeKYcharOPTOUTPUT

A list of valid codes for a specific user defined code list.

mnAssignedToAddressNumberANPMATH_NUMERICOPTOUTPUT

The address book number of the person assigned to do the work.

szRemarkRMKcharOPTOUTPUT

A generic field that you use for a remark, description, name, or address.

mnServiceDaysSRVDMATH_NUMERICOPTOUTPUT

The number of days to elapse before you schedule maintenance.

mnServiceMilesSRVMMATH_NUMERICOPTOUTPUT

The number of miles to be expended before you schedule maintenance. To determine if maintenance is due, the Update PM Schedule 
Status program (R12807) uses this quantity and the threshold percent from the Maintenance Rules table (F1393). For example, it calculates the 
total miles as the service miles plus the miles operated as of the last date you performed maintenance. It then compares this amount to the 
actual miles from the AA ledger for the FMB automatic accounting instructions to determine if maintenance is due. Note: You can define other 
statistical units appropriate to your organization within the FMB automatic accounting instructions.

mnServiceFuelSRVHMATH_NUMERICOPTOUTPUT

The amount of fuel to be consumed before you schedule maintenance. To determine if maintenance is due, the Update PM Schedule 
Status program (R12807) uses this quantity and the threshold percent from the Maintenance Rules table (F1393). For example, it calculates the 
total fuel as the service fuel plus the fuel consumed as of the last date you performed a maintenance. It then compares this quantity to the actual 
fuel consumed from the AA ledger for the FMA automatic accounting instruction to determine if maintenance is due. Note: You can define 
other statistical units appropriate to your organization within the FMA automatic accounting instructions.

jdScheduleDateTDTJDEDATEOPTOUTPUT

The date that you want to receive a reminder message about an asset.

mnCompletedMilesCPLMMATH_NUMERICOPTOUTPUT

Actual miles at completion of maintenance.

mnConsumedFuelCPLHMATH_NUMERICOPTOUTPUT

Actual quantity of fuel consumed at completion of maintenance.

mnLastCompletedMilesLSTMMATH_NUMERICOPTOUTPUT

Number of miles at last maintenance.

mnLastCompletedFuelConsumedLSTHMATH_NUMERICOPTOUTPUT

Fuel consumed at last maintenance.

mnOrderNumberDOCOMATH_NUMERICOPTOUTPUT

A number that identifies an original document. This document can be a voucher, a sales order, an invoice, unapplied cash, a journal entry, 
and so on.

mnPercentDueMPCMATH_NUMERICOPTOUTPUT

A percentage measure that indicates how close a piece of equipment is to requiring maintenance. This percentage is based on the greater 
of the actual date, miles, hours, or fuel consumption compared to the threshold date, miles,hours, or fuel consumption. A percentage of 090 
means that the piece of equipment is 10% away from requiring maintenance. A percentage greater than 100 means that maintenance is past 
due.

mnServiceHoursSRVFMATH_NUMERICOPTOUTPUT

The hours to be expended before you schedule maintenance. To determine if maintenance is due, the Update PM Schedule Status 
program uses this quantity and the threshold percent from the maintenance rules table. It calculates the total hours as the service hours plus the 
hours run as of the last date you performed a maintenance. It then compares this amount to the actual hours from the AA ledger for the AT00 
automatic accounting instruction to determine if maintenance is due. NOTE: Hours is only an example of a statistical unit. You can define other 
statistical units appropriate to your organization within the AT00 automatic accounting instructions.

mnCompletedHoursCPLFMATH_NUMERICOPTOUTPUT

Actual hours at completion of maintenance.

mnLastCompletedHoursLSTFMATH_NUMERICOPTOUTPUT

Number of hours at last maintenance.

cMultipleWOCodeMLTWcharOPTOUTPUT

This code determines whether maintenance service types can be rescheduled and can come due again before the maintenance task for 
the originally scheduled service type has been completed. Valid vlaues are:    Blank One Cycle (default). Maintenance is not rescheduled 
until the original maintenance task has been completed.    1       Multiple Cycle with Multiple Work Orders. When the service type has come due, 
it is automatically rescheduled to come due again regardless if the original maintenance is completed. Multiple work orders can accrue.    2   
    Multiple Cycle. When the service type has come due, it is automatically rescheduled to come due again regardless if the original 
maintenance is completed. Only one work order can accrue.    3       Maintenance Loop. The Update PM Schedule program assigns the Maintenance 
Loop code to PM schedules generated through maintenance loops. These PM schedules are not repeated in the PM cycle. Maintenance 
tasks for all equipment indicated in the maintenance loop are performed under a single work order.    4       Warranty. A code that indicates that 
the equipment is under warranty. The system provides a warning on the Work Order Inventory Issues form and the Purchase Request form 
(when accessed from the Work Order Parts List).            When a PM that includes warranty service types is completed, the system includes the 
warranty service in the PM history record, but does not reschedule the warranty service types.

mnOriginalMilesORGMMATH_NUMERICOPTOUTPUT

The balance for the statistical account which tracks the original miles meter reading.

mnOriginalFuelORGFMATH_NUMERICOPTOUTPUT

The balance for the statistical account which tracks the original fuel meter reading.

mnOccurencesOCCUMATH_NUMERICOPTOUTPUT

The estimated number of occurrences per year for the service type. The PM Projections program uses information from this field, in 
combination with the last completed date, to project future schedule requirements. You can use processing options to automatically calculate the 
estimated occurrences, based on one of the following:     o One year of PM history     o Two years of PM history     o Inception-to-date PM history 

cFrequencyIndicatorFRINcharOPTOUTPUT

When used in conjunction with Schedule Date, this field indicates the frequency at which the system schedules maintenance. When 
maintenance is completed, the system automatically schedules the next maintenance according to the value that you enter in this field. Valid values 
are:    blank No frequency indicator    1       Same date each month    2       Last date each month    3       Same date each quarter    4       Same 
date each year    5       Same day each week    6       Semi-annually (same date at six month intervals)

mnTimeLastUpdatedUPMTMATH_NUMERICOPTOUTPUT

The time that specifies when the program executed the last update to this record.

szBusinessUnitMCUcharOPTOUTPUT

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.

mnParentNumberAAIDMATH_NUMERICOPTOUTPUT

A parent number groups related components together. You can associate each item of property and piece of equipment with a parent item. 
For example, you can associate a mobile telephone with a specific automobile (the parent), a printer with a computer (the parent), or a flat 
bed with a specific truck chassis (the parent). Note: If this is a data entry field, the default value is the asset number. For example, if the asset 
number is 123, the system assigns 123 as the default parent number.

mnCriticalityCRTLMATH_NUMERICOPTOUTPUT

A code that indicates the criticality of the piece of equipment or PM schedule. This code is used in calculating the criticality of the work 
order.

jdPlannedStartDatePNSTJDEDATEOPTOUTPUT

The date when the item or line of work is to start.

szPMCategoryCode1PMC1charOPTOUTPUT

A User Defined Code (system 13, code P1) used to classify PM schedules.

szPMCategoryCode2PMC2charOPTOUTPUT

A User Defined Code (system 13, code P2) used to classify PM schedules.

mnDowntimeRequiredDNHRMATH_NUMERICOPTOUTPUT

This is the estimated duration of downtime for the piece of equipment in order to do the maintenance.

cPredictiveFlagPDFLcharOPTOUTPUT

A code that indicates the functional status of a piece of equipment, as assessed by a condition-based maintenance system. For 
maintenance schedules that are condition-based, the preventive maintenance system uses this code to determine whether maintenance is due. Enter 
a valid value from UDC table 13/AL (Alert Level).

nIndexINT01integerOPTINPUT

Number of Days in Future to Query for Responses Due. 

nKeysINT02integerOPTINPUT

Number of Days in the Past to Query for Quote Requests Received. 

idhRequestGENLNGIDOPTBOTH

General purpose ID variable.

cSuppressErrorMessagesEV01charOPTINPUT

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

szErrorMessageIDDTAIcharOPTOUTPUT

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.

cErrorCodeERRCcharOPTOUTPUT

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

mnOriginalHoursORGHMATH_NUMERICOPTOUTPUT

The balance for the statistical account which tracks the original hours meter reading.

jdLastCompletedDateLCPDJDEDATEOPTOUTPUT

Date of last maintenance.

mnUniqueKeyIDInternalUKIDMATH_NUMERICOPTOUTPUT

This field is a unique number used to identify a record in a file.

mnToleranceLimitUpperTOLUMATH_NUMERICOPTOUTPUT

Upper Tolerance Limit.

mnToleranceLimitLowerTOLLMATH_NUMERICOPTOUTPUT

Lower Tolerance Limit.

jdDateHoldHLDDJDEDATEOPTOUTPUT

This date is used to hold a PM schedule so that it will not be processed. This is especially useful for seasonal PM schedules.

mnHoursSpecificSPHRMATH_NUMERICOPTOUTPUT

The specific hours used to determine how often a PM will come due.

mnWeeksSpecificSPWKMATH_NUMERICOPTOUTPUT

The specific weeks used to determine how often a PM will come due.

mnMonthsSpecificSPMNMATH_NUMERICOPTOUTPUT

The specific months used to determine how often a PM will come due.

mnWeekNumberWKMATH_NUMERICOPTOUTPUT

The calander week.

cSpecificDayOfTheWeekSPDWcharOPTOUTPUT

A code that indicates the day of the week in certified payroll processing and reporting. Valid values are:    0   Sunday    1   Monday    2   
Tuesday    3   Wednesday    4   Thursday    5   Friday    6   Saturday 

Related Functions

None

Related Tables

F1207 Maintenance Schedule File