Date: 24/04/2011
Posting to General Ledger is an important task for all subledgers in the Sage Accpac ERP environment. However, it requires a significant amount of code and effort. To relieve the subledgers of this, accpac package provides a number of common services relating to the processing of General
Ledger transactions
The Subledger Services include:
• A facility for modifying General Ledger numbers via segment substitution.
• A standard interface that handles posting to either General Ledger or to an intermediate holding database.
• A database suitable for holding this data pending final posting through to General Ledger.
• A reporting service to list transactions held in the database.
• A transfer service to perform final posting through to General Ledger.
• Consolidation of ledger transactions.
• Additional speed in posting, if the client application selects deferred posting to General Ledger.
Subledger Services consist of three superviews and a callable VB UI program that provide these services. To call the superviews, use the standard routines for accessing and modifying data in other views.
The following table gives the Roto ID and description of each superview:
Roto ID View Name Description
GP0800 GPGLFMT Segment Substitution Superview
GP0930 GPGLPE Transaction Transfer Superview
GP0950 GPGLPO General Ledger Transaction Posting
Installation and Activation
Subledger Services installs with the System Manager. Activation occurs in one of two ways:
• Directly from Data Activation facility on the Administrative Services desktop.
• Invoked by the client application. In this case, no prompt to proceed with activation or meter box will appear.
Client applications that require Subledger Services should check that it is activated and activate it themselves if it is not. Subledger Services currently requires no other
applications. It will create export files if General Ledger is absent.
Integrity checking
Subledger Services has an integrity checker that appears on the Desktop. Users should run it as part of normal system testing.
Segment Substitution
General Ledger codes may have multiple segments. The account segment may not be modified. The other segments may differentiate locations, departments, or even separate corporations under a single management structure. In order to allow substitution, each General Ledger code has a “breakout ID” associated with it. This breakout ID indicates the order and kind of segments in the code. Substitution entails looking up the General Ledger number, getting the breakout ID, and then replacing the appropriate segments in the code with others. To format the General Ledger code, the resulting code is in turn looked up in the General Ledger database. General Ledger provides the database components necessary to deal with these segments, but does not provide the mechanism for taking a base General Ledger number and generating a segment-substituted one from it. The superview GPGLFMT supplies this service.
Usage Protocol
The substitution superview uses the following protocol to process the data:
Load and Open the view.
Put the base GL code and substitution values.
Process the view.
Get the resulting GL code and other information.
Close the view.
Unload the view.
Because this module does not modify data, it does not require transaction processing.
Substitution buffering
GPGLFMT buffers the results of previous segment substitution parameters for a given invocation (viewOpen … viewClose cycle). As a result, it does not go to General Ledger for every lookup, if the client is repeatedly substituting the same account codes. However, if you want to flush the buffers at any point, call CANCEL. Note that GPGLFMT does not retain results in a database, but merely caches them in the view handle; there are no leftovers from previous invocations to flush. There is currently no provision to adjust either the number of buffers or the caching scheme.
Error Codes and Messages
Process returns one of the following codes:
Code: Meaning:
0 Segment substitution was successful.
9901 A recoverable error occurred.
9902 An unrecoverable system resource error occurred.
9903 An unrecoverable internal error occurred.
9904 The base GL account does not exist.
9905 The result GL account does not exist.
9906 The GL data is inconsistent.
The client application can select error message reporting using the Browse entry point. Call Browse with bAscending set to TRUE to enable error messages or with bAscending set to FALSE to disable them. The system will return the error codes in either case to allow the client application to use its own error messages, or to continue processing in some other fashion.
For proper processing, both the base and result General Ledger numbers must exist. This is because the substitution pattern is a property of the General Ledger code.
However, because subledgers can add numbers at a later time, the substitution code will attempt to continue processing by providing reasonable values even if it cannot
find the General Ledger numbers.
If the base does not exist, the formatted number will be the base, and the unformatted result will be the base stripped ofits formatting characters. If the base exists but the result does not, both theformatted and unformatted results will be the substituted account number, built from the unformatted base.
If General Ledger is not installed, the calling protocol given above will work although GPGLFMT will not make substitutions. This allows applications to call GPGLFMT in the same way with or without General Ledger.
Field Descriptions
Name Type Size Description
GL Numbers (BASEGL) String 45 Base GL Number
Substitution values (SEGNUM1..9) String 6 Segment Number 1 to 9
SEGVAL1..9 String 15 Segment Value 1 to 9
SEGLENGTH1..9 Integer 2 Segment Length 1 to 9
SEGINSERT1..9 Integer 2 Segment Insert Point 1 to 9
RESULTGL String 45 Substituted GL Number
FORMATGL String 45 Formatted GL Number
OLDSEGVAL1..9 String 15 Old Segment Value 1 to 9
NEWSEGVAL1..9 String 15 New Segment Value 1 to 9
Will try to provide more detail related to the fields in my next blog post.
Aggyey