Table of Contents

Limits System Module

Module LSCMOD Limits System Module

Description

The module provides all functions and rules to maintain the limit utilization. The customization layer is provided on security level 5. This module holds the logic of the original LSIMOD of initial DOKA 5 implementations now on security level 5.


Properties

Property YES/NO
Single page frame No
Show toolbar No
Show menu No
Show statusbar No
Show hint No
Fit panel size No

Datafields

Name Description Data Type Len Dec. View lines View type Inst. Visible Codetable
LSBSTK Stream of Released LSB Amounts Stream 1 0 Source Yes Public
LSBINRSTM holds INRs of found limits to be locked Stream 1 0 Source Yes Public

Datafield Description and Properties

Datafield LSBSTK Stream of Released LSB Amounts

Description

This stream is used to collect amounts released in the course of a transaction to reuse inbookings without the need to get another approval within a different limit utilization up to the originally released amount.


Rules

Rule Name Additional
function GetCbtRelevantFactor numeric static
function GetEarmarkInNode numeric
function GetFreeAmountfromStk numeric
function GetFunctionForCbe text
function GetSqlFromLSB text
function IsCbeRelevantForLimit boolean static
function LscCheckTrnAccepted text static
function LsiGetCBEStatus text static
function LsiGetLSMStatusText text static
function LsiGetTrnStatus text static
function MapCbt2Lst text static
function XrtCurrentLimit numeric global
function XrtCurrentLimitSysCur numeric global
function XrtLimit numeric global
sub AddFreeAmountToStk
sub AddLse
sub AddNewLink
sub GetObjInf
sub InternFreeLsa
sub InternLockLsaOfLsb
sub LscAddLink static
sub LscAddLinkByINR static
sub LscAddMandatoryLink static
sub LscCreateLsmForLsr static
sub LscDeleteLsm static
sub LscDeleteObj static
sub LscGetAllLsbForLsr static
sub LscGetAllLsmForLsr global
sub LscGetAllLsrForObj global
sub LscGetLsiOfNode global
sub LscGetNodeInrs global
sub LscHandleLssFlg static
sub LscInitializeModule static
sub LscReadLSMByCbe global
sub LscReadLsrForCbe global
sub LscReevaluateLsbBalance static
sub LscUpdateLsmCommit global
sub LsiCheckRelStatus
sub LsiCreateLslForLsr
sub LsiDeleteCbeEntry static
sub LsiDeleteLse static
sub LsiDeleteObject global
sub LsiInitAutocreatedLsb
sub LsiInitializeModule static
sub LsiLockLsaCbeEntry static
sub LsiProcessCbeEntry static
sub LsmQueUpdate static
sub UpdateEarmarkInNode
sub UpdateSingleNode

Rules Description and Comments

function GetCbtRelevantFactor( in Cbt text ) : numeric static

determines the factor for limit entries of the passed CBT
normally 1, but cash cover is the other way round
Only the first three characters are evaluated.
Thus the function may be called with the prefix or the complete booking type


function GetEarmarkInNode( in ArgLsb LSB, in ArgLsm LSM ) : numeric

ArgLsb holds a normal (not CCV) limit record
return earmarking amount of defined CCV limit


function GetFreeAmountfromStk( in ArgLsbInr text ) : numeric

Function to retrieve the released amount of a certain LSB
ArgLsbInr holds INR of the LSB


function GetSqlFromLSB( in ArgLsb LSB ) : text

local function to create the SQL-command according the passed LSB


function IsCbeRelevantForLimit( in ArgCbe CBE, in ArgObj module ) : boolean static

Determines if the passed CBT is relevant for limits and is used to skip long
lasting routines for not limit relevant CBS entries.
ArgCbe holds the CBE to be checked
ArgObj holds the owning contractgroup (xxDGRP or PTEGRP)
Only the first three characters of the CBT are evaluated.
Thus the function may be called with the prefix or the complete booking type


function LscCheckTrnAccepted( in ArgTrnInr text ) : text static

Function to check whether all LSM of a TRN are accepted or there is at least one not accepted LSM
ArgTrnInr gets the INR of the Transaction to be checked
Function searches the modifications issued by the passed transaction and returns
- “A” (LscAccepted) when there is no more pending modification
- “N” (LscPending) when there is at least one pending modification
- “R” (LscRejected) when there is at least one rejected modification
an empty value if there are no modifications issued


function LsiGetCBEStatus( inout ArgCbe CBE, out ArgTxt text ) : text static

Function to determine and return the limitstatus of a single LSM request
ArgCbe specifies the CBE-Entry of the owning contract for which the status is requested


function LsiGetLSMStatusText( in ArgLsmInr text ) : text static

Function to determine a textblock with a list of not accepted links
Structure should be a line per link with decoded type and used decoded objects and status


function LsiGetTrnStatus( in ArgTrnInr text ) : text static

Function to check the status for all LSM`s created by a single transaction
ArgTrnInr specifies the INR of the owning transaction for which the status is requested
The function returns an “A” when there are no associated LSM pending or rejected


function MapCbt2Lst( in CbeArg Cbe, in ArgObj module ) : text static

Function to determine the LST used in the limit system based on the
passed CBE and the passed contract group (which might be a PTEGRP).


function XrtLimit( in ArgCur text, in ArgAmt numeric, in NewCur text, in ArgDat datetype ) : numeric global

Central function to calculate the countervalue of a limit amount.
ArgCur Currency of the amount to be converted
ArgAmt the amount to be converted
NewCur target currency
ArgDat Value date to determine the correct exchange rate


sub AddFreeAmountToStk( in ArgLsbInr text, in Amt numeric )

LSBSTK handling routine to add a released amount into the stack
ArgLsbInr holds INR of the LSB where the amount is released from
Amt holds the released amount


sub AddLse( in Argcbe cbe, in ArgObj module )

create earmarking entry


create link entry in the LSL table
ArgLsr holds the relevant LSR
ArgLsb holds the relevant LSB


sub GetObjInf( in ArgObj module, out BusSec text, out PtyInr text, out CtyCod text, out HeqInr text, out ArgEngTyp text )

gets limit relevant information for the passed contractgroup
ArgObj: Contract group (XXDGRP or PTEGRP)
Bussec: Business sector, of CBS-record
changed for PT to real sector in this rule
PtyInr: INR of relevant party
Cty: Code of relevant country
HeqInr: INR or relevant Headquarter


Adds a new node to the passed request into the limit system database
ArgLsr Passed LSR has to be the newly created LSR after LscRequestInsert
ArgLsb description of the selector data to select the fitting limit node.


Adds a new node to the passed request into the limit system database
ArgLsr Passed LSR has to be the newly created LSR after LscRequestInsert
LsiArg description of the selector data to select the fitting limit node.


sub LscDeleteLsm( inout ArgLsm LSM ) static

Used to delete a LSM. This includes to invert all accepted nodes


sub LscDeleteObj( in ArgObjTyp text, in ArgObjInr text ) static

Rule to delete all limit information associated to a contract.
ArgObjTyp identifies the contract type to be deleted
ArgObjInr identifies the contract


sub LscGetAllLsbForLsr( inout ArgStm stream, in ArgLsrInr text ) static

Method to retrieve the list of INR`s of the statically linked LSB for a given LSR


sub LscGetAllLsmForLsr( out ArgStm stream, in ArgLsrInr text ) global

Procedure to return a stream with a list of all INR`s of LSM`s owned by the specified LSR
ArgStm Outputstream of the routine
ArgLsrInr specifies the LSR by it`s INR


sub LscGetAllLsrForObj( out ArgStm stream, in ArgObjTyp text, in ArgObjInr text ) global

Procedure to return a stream with a list of all INR`s of LSR`s owned by the specified contract
ArgStm Outputstream of the routine
ArgObjTyp specifies the table of the owning contract
ArgObjInr specifies the contract by it`s INR


sub LscHandleLssFlg( in ArgLsm LSM, in ArgLsbInr text, inout ArgSta text, in ArgFlg text ) static

The purpose is to handle (determine or set) the LSS status and reflect this in the
balance in the LSB.
ArgLsm hold the modification
ArgLsbInr hold the INR of the checked LSB and thus describing the LSS to be handled
ArgSta holds the target status or blank if the limit system should determine the target status depending on the limit data and returns the resulting LSSFLG of the LSS
ArgFlg processing Flag. A=Auto, M=Manuell, D=Delete


sub LscInitializeModule static

Initialize the local memory of the module


sub LscReadLSMByCbe( inout ArgLSM LSM, in ArgCbe cbe ) global

routine to search for the LSM associated to the contract and type described by the passed CBE
ArgLSM gets the loaded entry or an initialized entry
ArgCbe holds the CBE


sub LscReadLsrForCbe( inout ArgLsr LSR, in ArgCbe cbe, in ArgLst text ) global

routine to search for the LSr associated to the contract and type described by the passed CBE
ArgLsr gets the loaded entry or an initialized entry
ArgCbe holds the CBE with the links to the contract etc.
ArgLst holds the Limit System Type as extracted from the CBE and Contract


sub LscReevaluateLsbBalance( in LsbInr text, in ArgDat datetype ) static

The identified LSB is reevaluated based on todays exchange rates.
The necessary informations are taken from LSC entries.
RDBMS errors on access to the LSB entry are exported to the caller.
The calling Routine has to take care for DbCommit.


sub LsiCheckRelStatus( in ArgLsm LSM, in ArgLSR LSR, in ArgCbe CBE )

This function is part of the LsiProcessCbeEntry process and is responsible to determine the release status.


sub LsiCreateLslForLsr( in ArgLsr LSR, in ArgObj module )

This function is part of the LsiProcessCbeEntry process and is responsible to create all LSL-Links for a given LSR
ArgLsr the fresh created LSR
ArgObj the owning contract to be able to access data


sub LsiDeleteCbeEntry( inout CbeArg CBE ) static

The purpose of the rule is to reflect the deletion of a CBE entry into the
Limit System of the customer.
Used by CBSMOD by CbsDeleteTRN below correction and rejection of a TRN


sub LsiDeleteObject( in ArgObjTyp text, in ArgObjInr text ) global

Rule to delete all limit information associated to a contract.
ArgObjTyp identifies the contract type to be deleted
ArgObjInr identifies the contract


sub LsiInitializeModule static

Initialize the local memory of the LSCMOD module


sub LsiLockLsaCbeEntry( inout ArgCbe CBE, inout ArgGrp module ) static

try to get and to hold all relevant LSA records


sub LsiProcessCbeEntry( inout ArgCbe CBE, in ArgGrp module ) static

central rule called from within CBSMOD when a CBE is written to allow to determine
a) whether to book a limit utilization
b) maintain the necessary limit structures
c) do the necessary limit booking

ArgCbe holds the CBE entry to be written
ArgGrp holds the contract group (might be a PTEGRP) of the originating contract to allow to determine the limit relevant data


sub UpdateSingleNode( inout ArgLsm LSM, inout ArgLss LSS, in ArgNewFlg text )

Update a single LSB - Entry
ArgLsm LSM holds the loaded (and held) LSM
ArgLss LSS holds the loaded (and held) LSS if any exists
ArgNewFlg text optionally holds the target LSSFLG. If this flag is empty the current status determind based on the current limit informations and is returned within LSS.

The associated LSC per currency and LSB is maintained automatically

Outbookings are marked via Arglsm\lsmflg.is ( “O” )


Modules

Module class Instance Comment
LSR LSR
LSB LSB
LSA LSA
LSC LSC
LSL LSL
LSE LSE
LSS LSS
LSM LSM
PTY PTY
CTY CTY