F3112GetPreviousNextOpSeq

F3112 Get Previous or Next Operation Sequence

Major Business Rule

Object Name: B3101140

Parent DLL: CMFGBASE

Location: Client/Server

Language: C

1.Functional Description

1.1Purpose

This function will retrieve either the Previous Operation Sequence Number or the Next Operation 

Sequence Number and its related quantities depending on input options. 



1.2Setup Notes and Prerequisites

Order Number and Operation Sequence Number are required input.  If calling function requires the Next 

Operation Sequence Number, set PrevNext Flag = 'N'.  If calling function requires the Previous 

Operation Sequence Number, set PrevNext = 'P'.   If PrevNext Flag is not set, the default will be to return 

the Previous Operation Sequence Number.


1.3Special Logic

Process Edit Flag: If this flag is set to '1', this function will check if the fetched is valid.  A 

valid record is not an outside operation or a special Type of Operation.  An outside operation is 

defined as having a related order number and related order type.  Type of Operation must be ' ' or else it 

is considered a special record and will not be used.  For example: Type of Operation = 'T' means that 

this is a text line.  If the flag is set to '1', this function will not return any of the above 

records.  It will fetch until a valid record is retrieved or the end of file is reached.  If the user wants 

the next/previous record regardless of type, send in Process Edit Flag = '0'.


2.Technical Specifications


2.4Processing 


/********** Setup Processing *********/

Check for Required Input

If Input Order Number or Input Operation Sequence Number is blank

Issue error and return

Else

Open Table F3112 
Using index 7, 1 key - Order Number
End If

/************ Main Processing ***********/
If Setup processing successful

Select Record

If Previous/Next Flag = 1
Select records in ascending order where record's OPSQ > Input Op Sequence

and Selected record's Order Number = Input Order Number

Else

Select records in descending order where record's OPSQ < Input Op Sequence 

and Selected record's Order Number = Input Order Number
End If

End Select

Fetch  Record
Record Found Flag = '0'

If Input Process Edits = '1'

While Record Found Flag = '0' and fetch is successful

If  (the fetched Related Order Number (RORN) and the fetched Related

      Order Type  (RCTO) are not blank)  OR (the Type of Operation (OPSC)
      is not blank)

Fetch the next record

Else

Record Found Flag = '1'

End If

End While
End If

If the Fetch was not successful

Set Error Message ID: 017F - Fetch Failed

Set Error Code = '1'

Else

Copy Fetched ToOutput

WLOPSQ 'aemnNextPrevOperation
WLUORG'aemnQuantityOrdered

WLSOQS'aemnQuantityCompleted

WLSOCN'aemnQuantityScrapped

WLQMTO'aemnQuantityAtOperation

WLUOM'aeszUnitOfMeasure

End If
End Fetch Record

/************ End Main Processing ***********/

Close Table

Return 


Data Structure

D3101140 - F3112 Get Previous or Next Operation Sequence

Parameter NameData ItemData TypeReq/OptI/O/Both
mnOrderNumberDOCOMATH_NUMERICNONENONE

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.

mnOperationSequenceOPSQMATH_NUMERICNONENONE

A number used to indicate an order of succession. In routing instructions, a number that sequences the fabrication or assembly steps in the 
manufacture of an item. You can track costs and charge time by operation. In bills of material, a number that designates the routing step in the 
fabrication or assembly process that requires a specified component part. You define the operation sequence after you create the routing 
instructions for the item. The Shop Floor Management system uses this number in the backflush/preflush by operation process. In engineering 
change orders, a number that sequences the assembly steps for the engineering change. For repetitive manufacturing, a number that 
identifies the sequence in which an item is scheduled to be produced. Skip To fields allow you to enter an operation sequence that you want to begin 
the display of information. You can use decimals to add steps between existing steps. For example, use 12.5 to add a step between steps 
12 and 13.

cNextPrevFlagEV01charNONENONE

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

cSuppressErrorMessagesEV02charNONENONE

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

mnNextPrevOperationNXOPMATH_NUMERICNONENONE

The operation number with which the current operation can be simultaneously processed.

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.

cProcessEditsEV03charNONENONE

A radio button that specifies the level at which trace/track result is to be displayed.  Select the Detail to display all transactions except IB, IX, 
and IZ types.  Or, select Derivative Lots Only to display only those transactions that may have created new derivative lot. 

mnQuantityOrderedUORGMATH_NUMERICNONENONE

The quantity of units affected by this transaction.

mnQuantityCompletedSOQSMATH_NUMERICNONENONE

The number of units committed for shipment in Sales Order Entry, using either the entered or the primary unit of measure defined for this 
item. In the Manufacturing system and Work Order Time Entry, this field can indicate completed or scrapped quantities. The quantity type is 
determined by the type code entered.

mnQuantityScrappedSOCNMATH_NUMERICNONENONE

The number of units canceled in Sales Order or Work Order Processing, using either the entered or the primary unit of measure defined for 
this item. In manufacturing, this can also be the number of units scrapped to date.

mnQuantityAtOperationQMTOMATH_NUMERICNONENONE

The quantity that is physically at the step at the work center.

szUnitOfMeasureUOM1charNONENONE

A user defined code (00/UM) that identifies the unit of measure that the system uses to express the quantity of an item, for example, EA 
(each) or KG (kilogram).

mnPercentCumPlannedCPYPMATH_NUMERICOPTNONE

The cumulative planned output yield percent for a step. The system uses this value to adjust the operation step scrap percent for the 
components at that operation step. This enables the MRP system to use the operation step scrap percent along with the existing component scrap 
percent to plan component demand.

Related Functions

None

Related Tables

F3112 Work Order Routing