F03B20FetchNextRunID

F03B20 Fetch Next Run ID

Minor Business Rule

Object Name: B03B0162

Parent DLL: CFIN

Location: Client/Server

Language: C

B03B0162
F03B20 Fetch Next Run ID


Functional Description


Purpose

This function determines the value of Batch Run ID from F03B20 and returns it back to the caller.  

The function finds the highest number of Run ID from F03B20, adds it by 1, and returns it back to the 

caller.  


Setup Notes and Prerequisites


Special Logic

Since the Run ID can contain only three digits, the highest number of Run ID is 999.  If the highest 
Run ID fetched from F03B20 is 999, the function will fetches the next highest Run ID.  If it is less 

than the previous one more than 1, the function will add it by 1 and return the value back to the 

caller.  If not, the function will loop, until it can find a unique Batch Run ID.  If there is no Batch Run 

ID except 999, the function will assign 1 to the Batch Run ID and return it back to the caller.


Technical Specifications

Parameters

ItemDescription I/OReq?Notes

RNIDBatch Run IDOYes


Related Tables

F03B20A/R Notification History

Related Business Functions

Processing

• Fetch Batch Run ID from F03B20; sort Batch Run ID descending.
• If JDBReturn is not equal to JDEDB_PASSED,
• Assign a '1' to Batch Run ID.
• Else,
• If Batch Run ID (fetched) is a '0',
• Assign a '1' to Batch Run ID (output).
• Else,
• If Batch Run ID (fetched) is equal to or greater than 999,
• While bFetchFlag  = '1',
• Fetch next Batch Run ID from F03B20.
• If JDBReturn is not equal to JDEDB_PASSED,
• Assign a '1' to Batch Run ID (output).
• bFetchFlag = '0.'
• Else,
• mnDiff = mnPrevRunID (the initial value is 999)  - Batch Run ID (fetched)
• If mnDiff is greater than 1,
• Add one to Batch Run ID and move it to Batch Run ID (output).
• End if
• Assign Batch Run ID(fetched) to mnPrevRunID.
• End if.
• End while.
• Else,
• Add 1 to Batch Run ID (fetched) and move it to the Batch Run ID (output).
• End if.
• End if.
• End if.

^

Data Structure

D03B0162 - F03B20 Fetch Next Run ID

Parameter NameData ItemData TypeReq/OptI/O/Both
mnBatchRunIDRNIDMATH_NUMERICNONENONE

This is an internally assigned number that groups transaction records with a batch header record based on a particular execution of the G/L 
Post for that batch.

Related Functions

None

Related Tables

F03B20 A/R Notification History