F08330BeginDocTMBFCache

F08330 Transaction Business Function Cache

Minor Business Rule

Object Name: B0800030

Parent DLL: CHRM

Location: Client/Server

Language: C

Tupelo Wilco Son Volt
Functional Description


Purpose

The purpose of this function is to store header data relevant to table (F08330) in JDECache Memory.  

The header data is data common to all functions within N0800044.  This data can then be accessed for 

retrieval and manipulation prior to updating the table.


Setup Notes and Prerequisites

Records can be Read, Added, Deleted, or Updated to the cache, depending on Cache Action Code, CACTN, 

passed in. The following is a list of the modes used to select cache processing options:

Input

Processing TypeType

============                                  

Cache Get 1

Cache Add 2

Cache Update 3

Cache Delete 4

Cache Delete All 5

Cache Get Next 6

Cache Add/Update 7 (Do Not Use)

Cache End  8

Cache Close Cursor 9


Return errors through Error Message ID, DTAI.


The cache Key is as follows:

JobNumberA   (from next number server X0010)


The data can be accessed using the full key or a partial key using NumberKeys, NKEYS, to distinguish 
between a full or a partial fetch.  JobNumberA must always be part of the key. 


The Cache Cursor, GENLNG must be past to and from the BSFN.


When adding a record always attempt to Get the record first.  If no error is returned then the record 

already exists and it cannot be added.

Special Logic


Technical Specifications

include the header file b0800030.h

    

Declare Variable     

      IDnJDBReturn;

ID          idReturnValue= ER_SUCCESS;

char        szErrorID[11];          

int         iCacheActionCode;

   

Declare Data Structures

      DSD0800030B          dsCacheKey;

DSD0800030B          dsSaveData;

  

Declare pointers

      HUSER               hUser                    = (HUSER) NULL;

HCACHE              hCacheHandle             = (HCACHE) NULL;


Check for NULL pointers, if there are null pointers set error '4363'


Begin Main Processing

 

Initialization Of DS Structure and Save of Workfields  


Initialize the Behavior

If an error occurs initializing the behavior and if cSuppressErrorMessage does not = '1' then 

set error.

  

   iCacheActionCode=atoi(lpDS->szCacheActionCode);


Initialize the Cache 

Call internal function I0800030B_InitCache

If no error initializing cache then Process Action code


If iCacheActionCode past in = 1 (Get) then call internal function 

I0800030B_CacheGet.
If iCacheActionCode past in = 2 (Add) then call internal function 

 I0800030B_CacheAdd.

If iCacheActionCode past in = 3 (Update) then call internal function

I0800030B_CacheUpdate.
If iCacheActionCode past in = 4 (Delete) then call internal function

I0800030B_CacheDelete.
If iCacheActionCode past in = 5 (Delete All) then call internal function

I0800030B_CacheDeleteAll.

If iCacheActionCode past in = 6 (Get Next) then call internal functionI0800030B_CacheGetNext.

If iCacheActionCode past in = 7 (Add Update) then call internal function

I0800030B_CacheAddUpdate.

If iCacheActionCode past in = 8 (End) then call JDE function

 JdeCacheTerminateAll.

If iCacheActionCode past in = 9 (Close Cursor) then call internal 

Function I0800030B_CloseCursor.
If iCacheActionCode = anything else then Error.


Return value of saved fields after cache processing is completed

szErrorMessageID = szErrorID

cSuppressErrorMessage = cSuppressErrorMessage
    szCacheActionCode = dsSaveData.szCacheActionCode

    mnNumberKeys = mnNumberKeys);



Function Clean Up

Free the Behavior

If the pointer szErrorMessageID is not blank and cSuppressErrorMessage does not = '1' then set error.


Internal functions

Function:  I0800030B_InitCache   

Initialize cache for Plan Amounts

Declare Variables

JDECM_RESULT       jdeCacheCode = JDECM_PASSED;
Declare structures

DSD0800030BdsCacheKey;

JDECMINDEXSTRUCTIndex[1]; 

Main Processing

Initialize output

SzErrorID = ""

Initialize the cache

Setup And Initialize Cache-Keys to Create Cache once

Set Memory, memset(Index, 0x00, sizeof(JDECMINDEXSTRUCT));


Set the number of segments of the key to = '1'

The first segment of the key is mnJobNumberA

Index->CacheKey[0].nOffset = offsetof(DSD0800030B, mnJobnumberA); 

Index->CacheKey[0].nSize = sizeof(dsCacheKey.mnJobnumberA); 

Index->CacheKey[0].idDataType = EVDT_MATH_NUMERIC;


Set lphCacheHandle = "B0800030B", 

If there is an error szErrorID = ERR_INIT_CACHE



Function:  I0800030B_CacheGet   

Declare Variables

JDECM_RESULT       jdeCacheCode = JDECM_PASSED;

int   iNumberOfKeys;

    HJDECURSOR     hCursor        =  (HJDECURSOR) NULL;

   DSD0800030BdsCacheData;

BOOLbChangedKey;

Main Processing

Initialize output

Set Memory

memset((void *) (lpdsCacheKey),0x00,sizeof(DSD0800030B));
memset((void *) (&dsCacheData),0x00,sizeof(DSD0800030B));

szErrorID = ""

Initialize Variables  

MathNumericToInt((LPMATH_NUMERIC) &lpDS-
>mnNumberKeys,(LPINT)&iNumberOfKeys);

Open the Cursor if error then szErrorID = "ERR_OPEN_CURSOR"

If no error Reset Cursor 

If iNumberOfKeys = '0' then Fetch the first record

Else fetch the record matching the keys

If there is an error with the fetch then szErrorID = ERR_FETCH_RECORD

if the Cursor does not = NULL then close the cursor



Function:  I0800030B_CacheAdd 

Declare Variables

JDECM_RESULT       jdeCacheCode = JDECM_PASSED;
     int iNumberOfKeys;

HJDECURSOR        hCursor      = (HJDECURSOR) NULL;    
ID                idCacheCursor;                       

Main Processing

Initialize output 

SzErrorID = ""

Set the cache with the number or keys = mnNumberKeys

Set the cursor = idCacheCursor

Copy the memory needed the size of DSD0800030B


Add the record the size of DSD0800030B

If Add fails then szErrorID = ERR_ADD_RECORD



Function:  I0800030B_CacheUpdate   

Declare Variables 

int                iNumberOfKeys;
JDECM_RESULT       jdeCacheCode = JDECM_PASSED;

HJDECURSOR        hCursor      = (HJDECURSOR) NULL;  

   DSD0800030BdsCacheData;

ID                idCacheCursor;                       
Main Processing

Initialize output

SzErrorID = ""

Set the cache with the number or keys = mnNumberKeys

Set the cursor = idCacheCursor

Set the memory needed the size of DSD0800030B


Fetch the record, if record is found Update the record

If there is an error then szErrorID = ERR_UPDATE_RECORD


Close the Cursor



Function:  I0800030B_CacheDelete   

Declare Variables

JDECM_RESULT       jdeCacheCode = JDECM_PASSED;

int   iNumberOfKeys;

HJDECURSOR       hCursor       = (HJDECURSOR) NULL;  

Main Processing

Initialize Variables

SzErrorID = ""

Set the cache with the number or keys = mnNumberKeys


If Number Of Keys = 0 Then call internal function I0800030B_CacheDeleteAll

else

Initialize the cursor

Set the memory the size of DSD0800030B

Fetch the record

If fetch is successful then delete the record

If there is an error deleting then szErrorID = ERR_DELETE_RECORD

If there is an error fetching then szErrorID = ERR_FETCH_RECORD


Close the cursor



Function:  I0800030B_CacheDeleteAll   

Declare Variables

JDECM_RESULT       jdeCacheCode = JDECM_PASSED;

int   iNumberOfKeys;

HJDECURSOR       hCursor       = (HJDECURSOR) NULL;  


Main Processing

Initialize input and output

SzErrorID = ""

Copy the memory needed the size of DSD0800030B

Set the cache with the number or keys = mnNumberKeys


Open the Cursor

Delete all records

If there is an error on delete then szErrorID = ERR_DELETE_RECORD


 Close Cursor



Function:  I0800030B_CacheGetNext   

Notes:Assumption is made this function will be performed until the

Cache Index is no longer equal to the input index. If this function is prematurely ended, the cursor 

will have to be closed using function I0800030B_CloseCursor, or memory leaks will result from the 

cursor being left open.

 

Declare Variables

JDECM_RESULTjdeCacheCode = JDECM_PASSED;

intiNumberOfKeys;

BOOLbMatchKey=FALSE;

BOOLbChangedKey;

    HJDECURSOR     hCursor        = (HJDECURSOR) NULL;

    DSD0800030BdsCacheData;

    ID                idCacheCursor;                       

Main Processing

Initialize output 

SzErrorID = ""

Set the memory needed the size of DSD0800030B

Initialize Variables  

Set the cache with the number or keys = mnNumberKeys


Set cursor for either initial fetch or subsequent fetches

If idCacheCursor = 0L then this is a subsequent search 

Open Cursor

Copy the memory needed the size of DSD0800030B
Fetch the Next record

if hCursor does not = NULL then fetch the next record

If idCacheCursor <> 0L fetch the first record

If the fetch was successful 

If iNumberOfKeys > 0 then call I0800030B_ChangedKey and check that the keys match
If the keys do not match then szErrorID = ERR_FETCH_RECORD

If hCursor does not = NULL then close the cursor

set idCacheCursor   = 0L



Function:  I0800030B_CacheAddUpdate 

DO NOT USE THIS FUNCTION



Function:  I0800030B_CloseCursor   

Declare Variables    

HJDECURSOR         hCursor      = (HJDECURSOR) NULL;
Main Processing

If idCacheCursor does not equal 0L then close cursor 

Set idCacheCursor = 0L



Function:  I0800030B_ChangedKey   

Test to see if the key has changed

If it has changed then bChangedKey = True

Else

bChangedKey = FALSE;


End of Internal functions






Data Structure

D0800030B - F08330 Begin Doc TMBF Cache

Parameter NameData ItemData TypeReq/OptI/O/Both
mnJobnumberAJOBSMATH_NUMERICNONENONE

Special Input Expected
Next number from X0010 must be used

^

mnAddressNumberAN8MATH_NUMERICNONENONE

A number that identifies an entry in the Address Book system, such as employee, applicant, participant, customer, supplier, tenant, or 
location.

szCacheActionCodeCACTNcharNONENONE

Special Input Expected
Records can be Read, Added, Deleted, or Updated to the cache, depending on Cache Action Code, CACTN, 

passed in. The following is a list of the modes used to select cache processing options:


Cache get          1

Cache Add          2

Cache Update       3

Cache Delete       4

Cache Delete all   5

Cache Get Next     6

Cache Add/Update   7 (Do Not Use)

Cache End          8

Cache Close Cursor 9


^

mnNumberKeysNKEYSMATH_NUMERICNONENONE

Special Input Expected
Use a '1' for a full key fetch while passing in Job Number



^

cSuppressErrorMessageSUPPScharNONENONE

Special Input Expected
'1' Suppresses error messages


^

idCacheCursorGENLNGIDNONENONE

Special Input Expected
initialize to '0' and pass <--> to and from a variable


^

cWarningFlagEV01charNONENONE

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

cActionCode2ACTNcharNONENONE

A code that specifies the action that is performed. Valid values are: A Add C Change

cErrorConditionsEV01charNONENONE

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

szVersionVERScharNONENONE

A user-defined set of specifications that control how applications and reports run. You use versions to group and save a set of user-defined 
processing option values and data selection and sequencing options. Interactive versions are associated with applications (usually as a 
menu selection). Batch versions are associated with batch jobs or reports. To run a batch process, you must choose a version.

szErrorMessageIDDTAIcharNONENONE

Special Output Returned
error ID number


^

szProgramIdPIDcharNONENONE

The number that identifies the batch or interactive program (batch or interactive object). For example, the number of the Sales Order Entry 
interactive program is P4210, and the number of the Print Invoices batch process report is R42565. The program ID is a variable length value. 
It is assigned according to a structured syntax in the form TSSXXX, where: T The first character of the number is alphabetic and identifies the 
type, such as P for Program, R for Report, and so on. For example, the value P in the number P4210 indicates that the object is a 
program. SS The second and third characters of the number are numeric and identify the system code. For example, the value 42 in the number P4210 
indicates that this program belongs to system 42, which is the Sales Order Processing system. XXX The remaining characters of the numer are 
numeric and identify a unique program or report. For example, the value 10 in the number P4210 indicates that this is the Sales Order Entry 
program.

cUpdateEmpChangeFlagEV01charNONENONE

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

szCostCenterHomeHMCUcharNONENONE

The number of the business unit in which the employee generally resides.

cProcessEditsEV01charNONENONE

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

Related Functions

None

Related Tables

None
F08330DBACacheCheck

F08330DBACacheCheck

F08330 Transaction Business Function Cache

Minor Business Rule

Object Name: B0800030

Parent DLL: CHRM

Location: Client/Server

Language: C

Functional Description

Purpose

The purpose of this function is to store DBA data relevant to table (F08330) in JDECache Memory. This 

data can then be accessed for retrieval and manipulation prior to updating the table.


Setup Notes and Prerequisites

Records can be Read, Added, Deleted, or Updated to the cache, depending on Cache Action Code, CACTN, 

passed in. The following is a list of the modes used to select cache processing options:

Input

Processing TypeType

============                                  

Cache Get 1

Cache Add 2

Cache Update 3

Cache Delete 4

Cache Delete All 5

Cache Get Next 6

Cache Add/Update 7 (Do Not Use)

Cache End  8

Cache Close Cursor 9


Return errors through Error Message ID, DTAI.


The cache Key is as follows:

JobNumberA   (from next number server X0010)

mnPayDeductBenAccType
mnDBACounter

The data can be accessed using the full key or a partial key using NumberKeys, NKEYS, to distinguish 
between a full or a partial fetch.  JobNumberA must always be part of the key. 


The Cache Cursor, GENLNG must be past to and from the BSFN.


When adding a record always attempt to Get the record first.  If no error is returned then the record 

already exists and it cannot be added.

Special Logic


Technical Specifications

include the header file b0800030.h

    

Declare Variable     

      IDnJDBReturn;

ID          idReturnValue= ER_SUCCESS;

char        szErrorID[11];          

int         iCacheActionCode;

   

Declare Data Structures

      DSD0800030C          dsCacheKey;

DSD0800030C          dsSaveData;

  

Declare pointers

      HUSER               hUser                    = (HUSER) NULL;

HCACHE              hCacheHandle             = (HCACHE) NULL;


Check for NULL pointers, if there are null pointers set error '4363'


Begin Main Processing

 

Initialization Of DS Structure and Save of Workfields  


Initialize the Behavior

If an error occurs initializing the behavior and if cSuppressErrorMessage does not = '1' then 

set error.

  

   iCacheActionCode=atoi(lpDS->szCacheActionCode);


Initialize the Cache 

Call internal function I0800030C_InitCache

If no error initializing cache then Process Action code


If iCacheActionCode past in = 1 (Get) then call internal function 

I0800030C_CacheGet.
If iCacheActionCode past in = 2 (Add) then call internal function 

 I0800030C_CacheAdd.

If iCacheActionCode past in = 3 (Update) then call internal function

I0800030C_CacheUpdate.
If iCacheActionCode past in = 4 (Delete) then call internal function

I0800030C_CacheDelete.
If iCacheActionCode past in = 5 (Delete All) then call internal function

I0800030C_CacheDeleteAll.

If iCacheActionCode past in = 6 (Get Next) then call internal functionI0800030C_CacheGetNext.

If iCacheActionCode past in = 7 (Add Update) then call internal function

I0800030C_CacheAddUpdate.

If iCacheActionCode past in = 8 (End) then call JDE function

 JdeCacheTerminateAll.

If iCacheActionCode past in = 9 (Close Cursor) then call internal 

Function I0800030C_CloseCursor.
If iCacheActionCode = anything else then Error.


Return value of saved fields after cache processing is completed

szErrorMessageID = szErrorID

cSuppressErrorMessage = cSuppressErrorMessage
    szCacheActionCode = dsSaveData.szCacheActionCode

    mnNumberKeys = mnNumberKeys);



Function Clean Up

Free the Behavior

If the pointer szErrorMessageID is not blank and cSuppressErrorMessage does not = '1' then set error.


Internal functions

Function:  I0800030C_InitCache   

Initialize cache for Plan Amounts

Declare Variables

JDECM_RESULT       jdeCacheCode = JDECM_PASSED;
Declare structures

DSD0800030CdsCacheKey;

JDECMINDEXSTRUCTIndex[1]; 

Main Processing

Initialize output

SzErrorID = ""

Initialize the cache

Setup And Initialize Cache-Keys to Create Cache once

Set Memory, memset(Index, 0x00, sizeof(JDECMINDEXSTRUCT));


Set the number of segments of the key to = '4'

The first segment of the key is mnJobNumberA

Index->CacheKey[0].nOffset = offsetof(DSD0800030C, mnJobnumberA); 

Index->CacheKey[0].nSize = sizeof(dsCacheKey.mnJobnumberA); 

Index->CacheKey[0].idDataType = EVDT_MATH_NUMERIC;


Index->CacheKey[1].nOffset = offsetof(DSD0800030C, szPlanId); 

Index->CacheKey[1].nSize = sizeof(dsCacheKey.szPlanId); 

Index->CacheKey[1].idDataType = EVDT_CHAR;


Index->CacheKey[2].nOffset = offsetof(DSD0800030C,
szPlanAdditionalOption); 
Index->CacheKey[2].nSize = sizeof(dsCacheKey. 

 szPlanAdditionalOption); 

Index->CacheKey[2].idDataType = EVDT_CHAR;


Index->CacheKey[3].nOffset = offsetof(DSD0800030C, 

jdDateEffectiveRates); 
Index->CacheKey[3].nSize = sizeof(dsCacheKey. 

jdDateEffectiveRates); 
Index->CacheKey[3].idDataType = EVDT_JDEDATE;


Set lphCacheHandle = "B0800030C", 

If there is an error szErrorID = ERR_INIT_CACHE



Function:  I0800030C_CacheGet   

Declare Variables

JDECM_RESULT       jdeCacheCode = JDECM_PASSED;

int   iNumberOfKeys;

    HJDECURSOR     hCursor        =  (HJDECURSOR) NULL;

   DSD0800030CdsCacheData;

BOOLbChangedKey;

Main Processing

Initialize output

Set Memory

memset((void *) (lpdsCacheKey),0x00,sizeof(DSD0800030C));
memset((void *) (&dsCacheData),0x00,sizeof(DSD0800030C));

szErrorID = ""

Initialize Variables  

MathNumericToInt((LPMATH_NUMERIC) &lpDS-
>mnNumberKeys,(LPINT)&iNumberOfKeys);

Open the Cursor if error then szErrorID = "ERR_OPEN_CURSOR"

If no error Reset Cursor 

If iNumberOfKeys = '0' then Fetch the first record

Else fetch the record matching the keys

If there is an error with the fetch then szErrorID = ERR_FETCH_RECORD

if the Cursor does not = NULL then close the cursor



Function:  I0800030C_CacheAdd 

Declare Variables

JDECM_RESULT       jdeCacheCode = JDECM_PASSED;
     int iNumberOfKeys;

HJDECURSOR        hCursor      = (HJDECURSOR) NULL;    
ID                idCacheCursor;                       

Main Processing

Initialize output 

SzErrorID = ""

Set the cache with the number or keys = mnNumberKeys

Set the cursor = idCacheCursor

Copy the memory needed the size of DSD0800030C


Add the record the size of DSD0800030C

If Add fails then szErrorID = ERR_ADD_RECORD



Function:  I0800030C_CacheUpdate   

Declare Variables 

int                iNumberOfKeys;
JDECM_RESULT       jdeCacheCode = JDECM_PASSED;

HJDECURSOR        hCursor      = (HJDECURSOR) NULL;  

   DSD0800030CdsCacheData;

ID                idCacheCursor;                       
Main Processing

Initialize output

SzErrorID = ""

Set the cache with the number or keys = mnNumberKeys

Set the cursor = idCacheCursor

Set the memory needed the size of DSD0800030C


Fetch the record, if record is found Update the record

If there is an error then szErrorID = ERR_UPDATE_RECORD


Close the Cursor



Function:  I0800030C_CacheDelete   

Declare Variables

JDECM_RESULT       jdeCacheCode = JDECM_PASSED;

int   iNumberOfKeys;

HJDECURSOR       hCursor       = (HJDECURSOR) NULL;  

Main Processing

Initialize Variables

SzErrorID = ""

Set the cache with the number or keys = mnNumberKeys


If Number Of Keys = 0 Then call internal function I0800030C_CacheDeleteAll

else

Initialize the cursor

Set the memory the size of DSD0800030C

Fetch the record

If fetch is successful then delete the record

If there is an error deleting then szErrorID = ERR_DELETE_RECORD

If there is an error fetching then szErrorID = ERR_FETCH_RECORD


Close the cursor



Function:  I0800030C_CacheDeleteAll   

Declare Variables

JDECM_RESULT       jdeCacheCode = JDECM_PASSED;

int   iNumberOfKeys;

HJDECURSOR       hCursor       = (HJDECURSOR) NULL;  


Main Processing

Initialize input and output

SzErrorID = ""

Copy the memory needed the size of DSD0800030C

Set the cache with the number or keys = mnNumberKeys


Open the Cursor

Delete all records

If there is an error on delete then szErrorID = ERR_DELETE_RECORD


 Close Cursor



Function:  I0800030C_CacheGetNext   

Notes:Assumption is made this function will be performed until the

Cache Index is no longer equal to the input index. If this function is prematurely ended, the cursor 

will have to be closed using function I0800030C_CloseCursor, or memory leaks will result from the 

cursor being left open.

 

Declare Variables

JDECM_RESULTjdeCacheCode = JDECM_PASSED;

intiNumberOfKeys;

BOOLbMatchKey=FALSE;

BOOLbChangedKey;

    HJDECURSOR     hCursor        = (HJDECURSOR) NULL;

    DSD0800030CdsCacheData;

    ID                idCacheCursor;                       

Main Processing

Initialize output 

SzErrorID = ""

Set the memory needed the size of DSD0800030C

Initialize Variables  

Set the cache with the number or keys = mnNumberKeys


Set cursor for either initial fetch or subsequent fetches

If idCacheCursor = 0L then this is a subsequent search 

Open Cursor

Copy the memory needed the size of DSD0800030C
Fetch the Next record

if hCursor does not = NULL then fetch the next record

If idCacheCursor <> 0L fetch the first record

If the fetch was successful 

If iNumberOfKeys > 0 then call I0800030C_ChangedKey and check that the keys match
If the keys do not match then szErrorID = ERR_FETCH_RECORD

If hCursor does not = NULL then close the cursor

set idCacheCursor   = 0L



Function:  I0800030C_CacheAddUpdate 

DO NOT USE THIS FUNCTION



Function:  I0800030C_CloseCursor   

Declare Variables    

HJDECURSOR         hCursor      = (HJDECURSOR) NULL;
Main Processing

If idCacheCursor does not equal 0L then close cursor 

Set idCacheCursor = 0L



Function:  I0800030C_ChangedKey   

Test to see if the key has changed

If it has changed then bChangedKey = True

Else

bChangedKey = FALSE;


End of Internal functions








Data Structure

D0800030C - F08330 DBA Cache Check

Parameter NameData ItemData TypeReq/OptI/O/Both
mnJobnumberAJOBSMATH_NUMERICNONENONE

Special Input Expected
Use next number from X0010 

^

mnPayDeductBenAccTypePDBAMATH_NUMERICNONENONE

A code that defines the type of pay, deduction, benefit, or accrual. Pay types are numbered from 1 to 999. Deductions and benefits are 
numbered from 1000 to 9999.

jdDateEffectiveRatesEFTJDEDATENONENONE

The date that identifies when a date is first valid. The effective date is used generically. It can be a lease effective date, a price or cost 
effective date, a currency effective date, a tax rate effective date, or whatever is appropriate.

jdDateEndingEffectiveEFTEJDEDATENONENONE

The date on which the item, transaction, or table becomes inactive, or through which you want transactions to appear. This field is used 
generically throughout the system. It could be a lease effective date, a price or cost effective date, a currency effective date, a tax rate effective 
date, or whatever is appropriate.

mnNumberKeysNKEYSMATH_NUMERICNONENONE

Special Input Expected
Use a '3' for a full key fetch while passing in Job Number, PayDeductBenAccType, DBACounter, Or use a 

'1', or '2' for a partial key fetch. 

ab  ab 

^

szCacheActionCodeCACTNcharNONENONE

Special Input Expected
Records can be Read, Added, Deleted, or Updated to the cache, depending on Cache Action Code, CACTN, 

passed in. The following is a list of the modes used to select cache processing options:


Cache get          1

Cache Add          2

Cache Update       3

Cache Delete       4

Cache Delete all   5

Cache Get Next     6

Cache Add/Update   7 (Do Not Use)

Cache End          8

Cache Close Cursor 9


^

cSuppressErrorMessageSUPPScharNONENONE

Special Input Expected
'1' Suppresses error messages


^

szErrorMessageIDDTAIcharNONENONE

Special Output Returned
error ID number


^

idCacheCursorGENLNGIDNONENONE

Special Input Expected
initialize to '0' and pass <--> to and from a variable


^

Related Functions

None

Related Tables

None
F08330TMBFCache

F08330TMBFCache

F08330 Transaction Business Function Cache

Minor Business Rule

Object Name: B0800030

Parent DLL: CHRM

Location: Client/Server

Language: C

Functional Description

Purpose

The purpose of this function is to store data relevant to table (F08330) in JDECache Memory. This 

data can then be accessed for retrieval and manipulation prior to updating the table.


Setup Notes and Prerequisites

Records can be Read, Added, Deleted, or Updated to the cache, depending on Cache Action Code, CACTN, 

passed in. The following is a list of the modes used to select cache processing options:

Input

Processing TypeType

============                                  

Cache Get 1

Cache Add 2

Cache Update 3

Cache Delete 4

Cache Delete All 5

Cache Get Next 6

Cache Add/Update 7 (Do Not Use)

Cache End  8

Cache Close Cursor 9


Return errors through Error Message ID, DTAI.


The cache Key is as follows:

JobNumberA   (from next number server X0010)

SzPlanId
SzPlanAdditionalOption

jdDateEffectiveRates

The data can be accessed using the full key or a partial key using NumberKeys, NKEYS, to distinguish 
between a full or a partial fetch.  JobNumberA must always be part of the key. 


The Cache Cursor, GENLNG must be past to and from the BSFN.


When adding a record always attempt to Get the record first.  If no error is returned then the record 

already exists and it cannot be added.

Special Logic


Technical Specifications

include the header file b0800030.h

    

Declare Variable     

      IDnJDBReturn;

ID          idReturnValue= ER_SUCCESS;

char        szErrorID[11];          

int         iCacheActionCode;

   

Declare Data Structures

      DSD0800030          dsCacheKey;

DSD0800030          dsSaveData;

  

Declare pointers

      HUSER               hUser                    = (HUSER) NULL;

HCACHE              hCacheHandle             = (HCACHE) NULL;


Check for NULL pointers, if there are null pointers set error '4363'


Begin Main Processing

 

Initialization Of DS Structure and Save of Workfields  


Initialize the Behavior

If an error occurs initializing the behavior and if cSuppressErrorMessage does not = '1' then 

set error.

  

   iCacheActionCode=atoi(lpDS->szCacheActionCode);


Initialize the Cache 

Call internal function I0800030_InitCache

If no error initializing cache then Process Action code


If iCacheActionCode past in = 1 (Get) then call internal function 

I0800030_CacheGet.
If iCacheActionCode past in = 2 (Add) then call internal function 

 I0800030_CacheAdd.

If iCacheActionCode past in = 3 (Update) then call internal function

I0800030_CacheUpdate.
If iCacheActionCode past in = 4 (Delete) then call internal function

I0800030_CacheDelete.
If iCacheActionCode past in = 5 (Delete All) then call internal function

I0800030_CacheDeleteAll.

If iCacheActionCode past in = 6 (Get Next) then call internal functionI0800030_CacheGetNext.

If iCacheActionCode past in = 7 (Add Update) then call internal function

I0800030_CacheAddUpdate.

If iCacheActionCode past in = 8 (End) then call JDE function

 JdeCacheTerminateAll.

If iCacheActionCode past in = 9 (Close Cursor) then call internal 

Function I0800030_CloseCursor.
If iCacheActionCode = anything else then Error.


Return value of saved fields after cache processing is completed

szErrorMessageID = szErrorID

cSuppressErrorMessage = cSuppressErrorMessage
    szCacheActionCode = dsSaveData.szCacheActionCode

    mnNumberKeys = mnNumberKeys);



Function Clean Up

Free the Behavior

If the pointer szErrorMessageID is not blank and cSuppressErrorMessage does not = '1' then set error.


Internal functions

Function:  I0800030_InitCache   

Initialize cache for Plan Amounts

Declare Variables

JDECM_RESULT       jdeCacheCode = JDECM_PASSED;
Declare structures

DSD0800030dsCacheKey;

JDECMINDEXSTRUCTIndex[1]; 

Main Processing

Initialize output

SzErrorID = ""

Initialize the cache

Setup And Initialize Cache-Keys to Create Cache once

Set Memory, memset(Index, 0x00, sizeof(JDECMINDEXSTRUCT));


Set the number of segments of the key to = '4'

The first segment of the key is mnJobNumberA

Index->CacheKey[0].nOffset = offsetof(DSD0800030, mnJobnumberA); 

Index->CacheKey[0].nSize = sizeof(dsCacheKey.mnJobnumberA); 

Index->CacheKey[0].idDataType = EVDT_MATH_NUMERIC;


Index->CacheKey[1].nOffset = offsetof(DSD0800030, szPlanId); 

Index->CacheKey[1].nSize = sizeof(dsCacheKey.szPlanId); 

Index->CacheKey[1].idDataType = EVDT_CHAR;


Index->CacheKey[2].nOffset = offsetof(DSD0800030,
szPlanAdditionalOption); 
Index->CacheKey[2].nSize = sizeof(dsCacheKey. 

 szPlanAdditionalOption); 

Index->CacheKey[2].idDataType = EVDT_CHAR;


Index->CacheKey[3].nOffset = offsetof(DSD0800030, 

jdDateEffectiveRates); 
Index->CacheKey[3].nSize = sizeof(dsCacheKey. 

jdDateEffectiveRates); 
Index->CacheKey[3].idDataType = EVDT_JDEDATE;


Set lphCacheHandle = "B0800030", 

If there is an error szErrorID = ERR_INIT_CACHE



Function:  I0800030_CacheGet   

Declare Variables

JDECM_RESULT       jdeCacheCode = JDECM_PASSED;

int   iNumberOfKeys;

    HJDECURSOR     hCursor        =  (HJDECURSOR) NULL;

   DSD0800030dsCacheData;

BOOLbChangedKey;

Main Processing

Initialize output

Set Memory

memset((void *) (lpdsCacheKey),0x00,sizeof(DSD0800030));
memset((void *) (&dsCacheData),0x00,sizeof(DSD0800030));

szErrorID = ""

Initialize Variables  

MathNumericToInt((LPMATH_NUMERIC) &lpDS-
>mnNumberKeys,(LPINT)&iNumberOfKeys);

Open the Cursor if error then szErrorID = "ERR_OPEN_CURSOR"

If no error Reset Cursor 

If iNumberOfKeys = '0' then Fetch the first record

Else fetch the record matching the keys

If there is an error with the fetch then szErrorID = ERR_FETCH_RECORD

if the Cursor does not = NULL then close the cursor



Function:  I0800030_CacheAdd 

Declare Variables

JDECM_RESULT       jdeCacheCode = JDECM_PASSED;
     int iNumberOfKeys;

HJDECURSOR        hCursor      = (HJDECURSOR) NULL;    
ID                idCacheCursor;                       

Main Processing

Initialize output 

SzErrorID = ""

Set the cache with the number or keys = mnNumberKeys

Set the cursor = idCacheCursor

Copy the memory needed the size of DSD0800030


Add the record the size of DSD0800030

If Add fails then szErrorID = ERR_ADD_RECORD



Function:  I0800030_CacheUpdate   

Declare Variables 

int                iNumberOfKeys;
JDECM_RESULT       jdeCacheCode = JDECM_PASSED;

HJDECURSOR        hCursor      = (HJDECURSOR) NULL;  

   DSD0800030dsCacheData;

ID                idCacheCursor;                       
Main Processing

Initialize output

SzErrorID = ""

Set the cache with the number or keys = mnNumberKeys

Set the cursor = idCacheCursor

Set the memory needed the size of DSD0800030


Fetch the record, if record is found Update the record

If there is an error then szErrorID = ERR_UPDATE_RECORD


Close the Cursor



Function:  I0800030_CacheDelete   

Declare Variables

JDECM_RESULT       jdeCacheCode = JDECM_PASSED;

int   iNumberOfKeys;

HJDECURSOR       hCursor       = (HJDECURSOR) NULL;  

Main Processing

Initialize Variables

SzErrorID = ""

Set the cache with the number or keys = mnNumberKeys


If Number Of Keys = 0 Then call internal function I0800030_CacheDeleteAll

else

Initialize the cursor

Set the memory the size of DSD0800030

Fetch the record

If fetch is successful then delete the record

If there is an error deleting then szErrorID = ERR_DELETE_RECORD

If there is an error fetching then szErrorID = ERR_FETCH_RECORD


Close the cursor



Function:  I0800030_CacheDeleteAll   

Declare Variables

JDECM_RESULT       jdeCacheCode = JDECM_PASSED;

int   iNumberOfKeys;

HJDECURSOR       hCursor       = (HJDECURSOR) NULL;  


Main Processing

Initialize input and output

SzErrorID = ""

Copy the memory needed the size of DSD0800030

Set the cache with the number or keys = mnNumberKeys


Open the Cursor

Delete all records

If there is an error on delete then szErrorID = ERR_DELETE_RECORD


 Close Cursor



Function:  I0800030_CacheGetNext   

Notes:Assumption is made this function will be performed until the

Cache Index is no longer equal to the input index. If this function is prematurely ended, the cursor 

will have to be closed using function I0800030_CloseCursor, or memory leaks will result from the 

cursor being left open.

 

Declare Variables

JDECM_RESULTjdeCacheCode = JDECM_PASSED;

intiNumberOfKeys;

BOOLbMatchKey=FALSE;

BOOLbChangedKey;

    HJDECURSOR     hCursor        = (HJDECURSOR) NULL;

    DSD0800030dsCacheData;

    ID                idCacheCursor;                       

Main Processing

Initialize output 

SzErrorID = ""

Set the memory needed the size of DSD0800030

Initialize Variables  

Set the cache with the number or keys = mnNumberKeys


Set cursor for either initial fetch or subsequent fetches

If idCacheCursor = 0L then this is a subsequent search 

Open Cursor

Copy the memory needed the size of DSD0800030
Fetch the Next record

if hCursor does not = NULL then fetch the next record

If idCacheCursor <> 0L fetch the first record

If the fetch was successful 

If iNumberOfKeys > 0 then call I0800030_ChangedKey and check that the keys match
If the keys do not match then szErrorID = ERR_FETCH_RECORD

If hCursor does not = NULL then close the cursor

set idCacheCursor   = 0L



Function:  I0800030_CacheAddUpdate 

DO NOT USE THIS FUNCTION



Function:  I0800030_CloseCursor   

Declare Variables    

HJDECURSOR         hCursor      = (HJDECURSOR) NULL;
Main Processing

If idCacheCursor does not equal 0L then close cursor 

Set idCacheCursor = 0L



Function:  I0800030_ChangedKey   

Test to see if the key has changed

If it has changed then bChangedKey = True

Else

bChangedKey = FALSE;


End of Internal functions







Data Structure

D0800030 - F08330 Edit Line TMBF Cache


^

Parameter NameData ItemData TypeReq/OptI/O/Both
mnJobnumberAJOBSMATH_NUMERICREQINPUT

Special Input Expected
Next Number must be used from X0010

^

szPlanIdPLANcharNONEBOTH


^

jdDateEffectiveRatesEFTJDEDATENONEBOTH

The date that identifies when a date is first valid. The effective date is used generically. It can be a lease effective date, a price or cost 
effective date, a currency effective date, a tax rate effective date, or whatever is appropriate.

jdDateEndingEffectiveEFTEJDEDATENONEBOTH

The date on which the item, transaction, or table becomes inactive, or through which you want transactions to appear. This field is used 
generically throughout the system. It could be a lease effective date, a price or cost effective date, a currency effective date, a tax rate effective 
date, or whatever is appropriate.

szEnrollmentStatusXDFScharNONEBOTH

A code that indicates the status of an employee's enrollment in a plan. It is a user defined code (08/ES), and you must use the following 
restrictions for the definitions:   o  All statuses indicating active participation in a plan must begin with the letter A.   o  All statuses indicating an 
ending status that does not result in a new enrollment (such as a termination) must have the letter X in the first position of Description 2 (data item 
DL02), General User Defined Codes form.   o  A status beginning with the letter X, when used as an ending status, represents a mistaken 
enrollment. No employee DBA instructions are written.   o  An asterisk (*) indicates all statuses not otherwise specified.

szEnrollmentStatusEndingXESTcharNONEBOTH

A code that indicates the ending status of an employee's enrollment in a plan. This status represents the reason for ending the old 
enrollment and is used as the beginning status of any resulting new enrollment. You can define this code using user defined code table 08/ES. See 
data item XDFS (Status - Enrollment) for restrictions on the allowed values. Note: An ending status that begins with the letter X represents a 
mistaken enrollment.

jdDateEligibleDELGJDEDATENONEBOTH

The date on which the employee is eligible to enroll in the benefit plan. This date is not necessarily the date that the employee begins 
participating in the plan. For example: The XYZ Company requires that employees work for the company for six months before they are eligible to 
participate in the 401(k) plan. Employees can enroll in 401(k) two times per year, on January 1 and July 1. Therefore, an employee who 
begins working for XYZ Company on 03/01/05 has an eligibility date of 01/01/06. The eligibility date is the date on which the employee becomes 
eligible, provided that eligibility continues. If the employee changes to a non-eligible status, the eligibility date on the new record is set to 
blank.

jdDateOfParticipationDPTCJDEDATENONEBOTH

The date on which the employee begins participating in the plan for the specified enrollment period. For example: The XYZ Company 
requires that employees work for the company for six months before they are eligible to participate in the 401(k) plan. Employees can enroll in 
401(k) two times per year, on January 1 and July 1. An employee who begins working for XYZ Company on 03/01/05 is eligible to participate in 
the plan on 01/01/06. However, if the employee does not enroll in the plan until 07/01/06, the employee's participation date is 07/01/06. The 
participation date is the first date on which the employee begins participating in the plan, provided that the employee continues to participate. 
When participation stops, the participation date on the new record is set to blank. If the employee has a break in eligibility, the participation 
date is the date that participation began for the latest enrollment period.

jdDateDbaBeginsDTDBJDEDATENONEBOTH

The beginning date on the employee's DBA instruction record (F06106) for this enrollment. In most cases, this is the same as the beginning 
effective date of the enrollment. However, it can be later than the beginning effective date if the enrollment is changed retroactively. Only 
active enrollment records have a value in this field since they are the only enrollment records that result in payroll deductions, benefits, or 
accruals. Active records have a beginning status that starts with A.

jdDateDbaEndsDTDEJDEDATENONEBOTH

The ending date on the employee's DBA instruction record (F06106) for this enrollment. In most cases, this is the same as the ending 
effective date of the enrollment. However, it can be later than the ending effective date if the enrollment is changed retroactively. Only active 
enrollment records have a value in this field since they are the only enrollment records that result in payroll deductions, benefits, or accruals. Active 
records have a beginning status that starts with A.

jdPlanMasterDateEffectiveEFTJDEDATENONEBOTH

The date that identifies when a date is first valid. The effective date is used generically. It can be a lease effective date, a price or cost 
effective date, a currency effective date, a tax rate effective date, or whatever is appropriate.

jdPlanMasterDateEndEffectiveEFTEJDEDATENONEBOTH

The date on which the item, transaction, or table becomes inactive, or through which you want transactions to appear. This field is used 
generically throughout the system. It could be a lease effective date, a price or cost effective date, a currency effective date, a tax rate effective 
date, or whatever is appropriate.

mnDbaEmployerIdSDBAMATH_NUMERICNONEBOTH

The DBA defined in the Payroll Transactions Constants table (F069116) that the system uses to calculate the dollar amount that the 
employer contributes to the employee enrolled in the plan. In most cases, this DBA is defined as a benefit to add pay to the enrolled employee's 
check.

mnEmployeeDbaIdFDBAMATH_NUMERICNONEBOTH

The DBA defined in the Payroll Transactions Constants table (F069116) that is used to calculate the dollar amount that the employee 
contributes by enrolling in the plan. In most cases, this DBA is defined to deduct pay from the enrolled employee's check.

mnPayrollCreditPointsPDCPMATH_NUMERICNONEBOTH

The DBA defined in the Payroll Transactions Constants table (F069116) that will be used to calculate the points amount that the employer 
contributes to an employee enrolled in a flexible spending environment. DBAs used for points in a benefit plan or option must meet two 
requirements: 1.   The DBA must have blanks in the specification for gross effect and net effect (see data items PAYG and PAYN) so that the use of 
(non-dollar) points does not add or subtract dollars from employee pay. 2.   The DBA must have an M in the specification for Journal Entry 
(Y/N/M) (see data item NMTH) so that the use of (non-dollar) points does not affect the G/L system.

mnPayrollDedPointsPDDPMATH_NUMERICNONEBOTH

The DBA defined in the Payroll Transactions Constants file (F069116) that is used to calculate the points amount that the employee 
contributes by enrolling in the plan in a flexible spending environment. DBAs used for points in a benefit plan or option must meet two requirements: 1. 
  The DBA must have blanks in the specification for Gross Effect and Net Effect (see data items PAYG and PAYN) so that the use of 
(non-dollar) points does not add or subtract dollars from employee pay. 2.   The DBA must have an M in the specification for Journal Entry (Y/N/M) 
(see data item NMTH) so that the use of (non-dollar) points does not affect the G/L system.

szPlanAdditionalOptionAOPTcharNONEBOTH

A code that identifies any additional options available for a benefit plan that have been defined in the Plan Additional Options table 
(F083202). Note: Additional options must have the same provider, policy number, and enrollment and eligibility rules as the benefit plan to which they 
are associated.

szCacheActionCodeCACTNcharREQINPUT

Special Input Expected
Records can be Read, Added, Deleted, or Updated to the cache, depending on Cache Action Code, CACTN, 

passed in. The following is a list of the modes used to select cache processing options:


Cache get          1

Cache Add          2

Cache Update       3

Cache Delete       4

Cache Delete all   5

Cache Get Next     6

Cache Add/Update   7 (Do Not Use)

Cache End          8

Cache Close Cursor 9

^

mnNumberKeysNKEYSMATH_NUMERICREQINPUT

Special Input Expected
Use a '4' for a full key fetch while passing in Job Number, Plan ID, Plan Additional Options, and 

Date Effective Rates, Or use a '1', '2', or '3' for a partial key fetch. 

^

cSuppressErrorMessageSUPPScharNONEINPUT

Special Input Expected
'1' Suppresses error messages

^

szErrorMessageIDDTAIcharNONEOUTPUT

Special Output Returned
error ID number

^

idCacheCursorGENLNGIDNONEBOTH

Special Input Expected
initialize to '0' and pass <--> to and from a variable

^

cRecordWrittenToCacheEV01charNONEBOTH

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

cUpdateOrWriteToCacheEV01charNONEBOTH

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

szComputerIDCTIDcharNONEBOTH

cActionCode2ACTNcharNONEBOTH

A code that specifies the action that is performed. Valid values are: A Add C Change

mnAmtDbaEmployerIdRTAMMATH_NUMERICNONEBOTH

A value that is a percentage, a monetary amount, or an hourly rate, depending on where it is used.  Valid values are: 1 For a deduction, 
benefit, or accrual, the meaning of this value depends on the method of calculation.  The method determines whether the deduction is a flat 
monetary amount, a percentage, or a multiplication rate.  Table method DBAs, depending on which table method they use, can either use this 
amount in the calculation or ignore it.  If there are exceptions to the table calculation, you can override the table code in the detail area, set up a 
flat monetary DBA amount, or override the amount with a one-time override for a timecard. 2 For a pay type, amounts entered in this field 
override the hourly rate. 

mnAmtEmployeeDbaIdRTAMMATH_NUMERICNONEBOTH

A value that is a percentage, a monetary amount, or an hourly rate, depending on where it is used.  Valid values are: 1 For a deduction, 
benefit, or accrual, the meaning of this value depends on the method of calculation.  The method determines whether the deduction is a flat 
monetary amount, a percentage, or a multiplication rate.  Table method DBAs, depending on which table method they use, can either use this 
amount in the calculation or ignore it.  If there are exceptions to the table calculation, you can override the table code in the detail area, set up a 
flat monetary DBA amount, or override the amount with a one-time override for a timecard. 2 For a pay type, amounts entered in this field 
override the hourly rate. 

mnAmtPayrollCreditPointsRTAMMATH_NUMERICNONEBOTH

A value that is a percentage, a monetary amount, or an hourly rate, depending on where it is used.  Valid values are: 1 For a deduction, 
benefit, or accrual, the meaning of this value depends on the method of calculation.  The method determines whether the deduction is a flat 
monetary amount, a percentage, or a multiplication rate.  Table method DBAs, depending on which table method they use, can either use this 
amount in the calculation or ignore it.  If there are exceptions to the table calculation, you can override the table code in the detail area, set up a 
flat monetary DBA amount, or override the amount with a one-time override for a timecard. 2 For a pay type, amounts entered in this field 
override the hourly rate. 

mnAmtPayrollDedPointsRTAMMATH_NUMERICNONEBOTH

A value that is a percentage, a monetary amount, or an hourly rate, depending on where it is used.  Valid values are: 1 For a deduction, 
benefit, or accrual, the meaning of this value depends on the method of calculation.  The method determines whether the deduction is a flat 
monetary amount, a percentage, or a multiplication rate.  Table method DBAs, depending on which table method they use, can either use this 
amount in the calculation or ignore it.  If there are exceptions to the table calculation, you can override the table code in the detail area, set up a 
flat monetary DBA amount, or override the amount with a one-time override for a timecard. 2 For a pay type, amounts entered in this field 
override the hourly rate. 

jdDateUserDefinedDUSRJDEDATENONEBOTH

A user defined date that you can use in enrollment for any date tracking need. For example, you can use this field to show the employee's 
hire date as follows: Empl No - 6001, Plan ID 401K     o Ineligible Status, Begin 04/13/97, End 12/31/97, User Date 04/13/98     o Elig/Not Particp 
Status, Begin 01/01/98, End 05/31/98, Eligible 01/01/98, User Date 04/13/98     o Active Status, Begin 06/01/98, End 08/31/99, Eligible 01/01/98, 
Particip 06/01/98, User Date 04/13/98     o Ineligible Status, Begin 09/01/99, End 05/31/99, User Date 04/13/98     o Active Status, Begin 
06/01/99, End 06/01/99, Eligible 06/01/99, User Date 04/13/98   For this example, you would change the column heading User Date to read Hire 
Date.

mnFactorFCTRMATH_NUMERICNONEBOTH

The multiplying factor for the additional option chosen.

mnSequenceNumberViewSEQ#MATH_NUMERICNONEBOTH

A number used to sequence information for review purposes only.

szEnrollmentEventCodeEECDcharOPTBOTH

The user defined code (08/BE) that you use to denote an enrollment event such as marriage.

jdEventDateDATE01JDEDATEOPTBOTH

Event point for JDE Date.

szUserIdUSERcharOPTBOTH

The code that identifies a user profile.

jdDateUpdatedUPMJJDEDATEOPTBOTH

The date that specifies the last update to the file record.

szBenefitGroupCategorySBGRcharOPTBOTH

The category of a benefit group. The category is used to group benefit plans according to the type and/or rule. For 
example: MEDICAL Required Medical Selections   DENTAL Optional Dental Selections   LIFE Required Life Ins Selections Valid categories are set up in the Generic 
Rate and Message table (F00191) for system 08/type SG. Associated text for categories is stored in the General Message Detail table 
(F00192). For more information, see program P00191.

mnAmtEEDBAIdOptionRTAMMATH_NUMERICOPTBOTH

A value that is a percentage, a monetary amount, or an hourly rate, depending on where it is used.  Valid values are: 1 For a deduction, 
benefit, or accrual, the meaning of this value depends on the method of calculation.  The method determines whether the deduction is a flat 
monetary amount, a percentage, or a multiplication rate.  Table method DBAs, depending on which table method they use, can either use this 
amount in the calculation or ignore it.  If there are exceptions to the table calculation, you can override the table code in the detail area, set up a 
flat monetary DBA amount, or override the amount with a one-time override for a timecard. 2 For a pay type, amounts entered in this field 
override the hourly rate. 

mnAmtERDBAIdOptionRTAMMATH_NUMERICOPTBOTH

A value that is a percentage, a monetary amount, or an hourly rate, depending on where it is used.  Valid values are: 1 For a deduction, 
benefit, or accrual, the meaning of this value depends on the method of calculation.  The method determines whether the deduction is a flat 
monetary amount, a percentage, or a multiplication rate.  Table method DBAs, depending on which table method they use, can either use this 
amount in the calculation or ignore it.  If there are exceptions to the table calculation, you can override the table code in the detail area, set up a 
flat monetary DBA amount, or override the amount with a one-time override for a timecard. 2 For a pay type, amounts entered in this field 
override the hourly rate. 

mnAmtEEDedPtsOptionRTAMMATH_NUMERICOPTBOTH

A value that is a percentage, a monetary amount, or an hourly rate, depending on where it is used.  Valid values are: 1 For a deduction, 
benefit, or accrual, the meaning of this value depends on the method of calculation.  The method determines whether the deduction is a flat 
monetary amount, a percentage, or a multiplication rate.  Table method DBAs, depending on which table method they use, can either use this 
amount in the calculation or ignore it.  If there are exceptions to the table calculation, you can override the table code in the detail area, set up a 
flat monetary DBA amount, or override the amount with a one-time override for a timecard. 2 For a pay type, amounts entered in this field 
override the hourly rate. 

mnAmtERCreditPtsOptionRTAMMATH_NUMERICOPTBOTH

A value that is a percentage, a monetary amount, or an hourly rate, depending on where it is used.  Valid values are: 1 For a deduction, 
benefit, or accrual, the meaning of this value depends on the method of calculation.  The method determines whether the deduction is a flat 
monetary amount, a percentage, or a multiplication rate.  Table method DBAs, depending on which table method they use, can either use this 
amount in the calculation or ignore it.  If there are exceptions to the table calculation, you can override the table code in the detail area, set up a 
flat monetary DBA amount, or override the amount with a one-time override for a timecard. 2 For a pay type, amounts entered in this field 
override the hourly rate. 

mnEmployeeDbaIdOptionFDBAMATH_NUMERICOPTBOTH

The DBA defined in the Payroll Transactions Constants table (F069116) that is used to calculate the dollar amount that the employee 
contributes by enrolling in the plan. In most cases, this DBA is defined to deduct pay from the enrolled employee's check.

mnDbaEmployerIdOptionSDBAMATH_NUMERICOPTBOTH

The DBA defined in the Payroll Transactions Constants table (F069116) that the system uses to calculate the dollar amount that the 
employer contributes to the employee enrolled in the plan. In most cases, this DBA is defined as a benefit to add pay to the enrolled employee's 
check.

mnPayrollDedPointsOptionPDDPMATH_NUMERICOPTBOTH

The DBA defined in the Payroll Transactions Constants file (F069116) that is used to calculate the points amount that the employee 
contributes by enrolling in the plan in a flexible spending environment. DBAs used for points in a benefit plan or option must meet two requirements: 1. 
  The DBA must have blanks in the specification for Gross Effect and Net Effect (see data items PAYG and PAYN) so that the use of 
(non-dollar) points does not add or subtract dollars from employee pay. 2.   The DBA must have an M in the specification for Journal Entry (Y/N/M) 
(see data item NMTH) so that the use of (non-dollar) points does not affect the G/L system.

mnPayrollCreditPointsOptionPDCPMATH_NUMERICOPTBOTH

The DBA defined in the Payroll Transactions Constants table (F069116) that will be used to calculate the points amount that the employer 
contributes to an employee enrolled in a flexible spending environment. DBAs used for points in a benefit plan or option must meet two 
requirements: 1.   The DBA must have blanks in the specification for gross effect and net effect (see data items PAYG and PAYN) so that the use of 
(non-dollar) points does not add or subtract dollars from employee pay. 2.   The DBA must have an M in the specification for Journal Entry 
(Y/N/M) (see data item NMTH) so that the use of (non-dollar) points does not affect the G/L system.

Related Functions

None

Related Tables

None
n style="position: absolute; left: 0.500000in"> 7 (Do Not Use)

Cache End  8

Cache Close Cursor 9


Return errors through Error Message ID, DTAI.


The cache Key is as follows:

JobNumberA   (from next number server X0010)

SzPlanId
SzPlanAdditionalOption

jdDateEffectiveRates

The data can be accessed using the full key or a partial key using NumberKeys, NKEYS, to distinguish 

between a full or a partial fetch.  JobNumberA must always be part of the key. 


The Cache Cursor, GENLNG must be past to and from the BSFN.


When adding a record always attempt to Get the record first.  If no error is returned then the record 

already exists and it cannot be added.

Special Logic


Technical Specifications

include the header file b0800030.h

    

Declare Variable     

      IDnJDBReturn;

ID          idReturnValue= ER_SUCCESS;

char        szErrorID[11];          

int         iCacheActionCode;

   

Declare Data Structures

      DSD0800030          dsCacheKey;

DSD0800030          dsSaveData;

  

Declare pointers

      HUSER               hUser                    = (HUSER) NULL;

HCACHE              hCacheHandle             = (HCACHE) NULL;


Check for NULL pointers, if there are null pointers set error '4363'


Begin Main Processing

 

Initialization Of DS Structure and Save of Workfields  


Initialize the Behavior

If an error occurs initializing the behavior and if cSuppressErrorMessage does not = '1' then 

set error.

  

   iCacheActionCode=atoi(lpDS->szCacheActionCode);


Initialize the Cache 

Call internal function I0800030_InitCache

If no error initializing cache then Process Action code


If iCacheActionCode past in = 1 (Get) then call internal function 

I0800030_CacheGet.
If iCacheActionCode past in = 2 (Add) then call internal function 

 I0800030_CacheAdd.

If iCacheActionCode past in = 3 (Update) then call internal function

I0800030_CacheUpdate.
If iCacheActionCode past in = 4 (Delete) then call internal function

I0800030_CacheDelete.
If iCacheActionCode past in = 5 (Delete All) then call internal function

I0800030_CacheDeleteAll.

If iCacheActionCode past in = 6 (Get Next) then call internal functionI0800030_CacheGetNext.

If iCacheActionCode past in = 7 (Add Update) then call internal function

I0800030_CacheAddUpdate.

If iCacheActionCode past in = 8 (End) then call JDE function

 JdeCacheTerminateAll.

If iCacheActionCode past in = 9 (Close Cursor) then call internal 

Function I0800030_CloseCursor.
If iCacheActionCode = anything else then Error.


Return value of saved fields after cache processing is completed

szErrorMessageID = szErrorID

cSuppressErrorMessage = cSuppressErrorMessage
    szCacheActionCode = dsSaveData.szCacheActionCode

    mnNumberKeys = mnNumberKeys);



Function Clean Up

Free the Behavior

If the pointer szErrorMessageID is not blank and cSuppressErrorMessage does not = '1' then set error.


Internal functions

Function:  I0800030_InitCache   

Initialize cache for Plan Amounts

Declare Variables

JDECM_RESULT       jdeCacheCode = JDECM_PASSED;
Declare structures

DSD0800030dsCacheKey;

JDECMINDEXSTRUCTIndex[1]; 

Main Processing

Initialize output

SzErrorID = ""

Initialize the cache

Setup And Initialize Cache-Keys to Create Cache once

Set Memory, memset(Index, 0x00, sizeof(JDECMINDEXSTRUCT));


Set the number of segments of the key to = '4'

The first segment of the key is mnJobNumberA

Index->CacheKey[0].nOffset = offsetof(DSD0800030, mnJobnumberA); 

Index->CacheKey[0].nSize = sizeof(dsCacheKey.mnJobnumberA);