Table of Contents

PTSSUB - Functions for Party handling in contract selection

Module PTSSUB PTSSUB - Functions for Party handling in contract selection

Description

This module contains functions which are used in business transactions, contract selection and Control and Release.


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
PTSPTAMODNAM Name of module for which PTSPTAMOD is filled Text 15 1 Edit Yes Public
PTSPTAMOD List of PTSPTA Modules Stream 1 0 Source Yes Public
ROLNAM Description of role Text 40 1 Edit Yes Public
ROLSELSTM Stream with roles available in transaction Stream 1 0 Source Yes Public
ROLCONSTM Stream with static information about roles in contracts Stream 1 0 Source Yes Public
DYNADRSTM Stream with static information about roles in contracts Stream 1 0 Source Yes Public
ADRCPYFLG Control copying address to contract Text 1 1 Edit Yes Public
STPLEV Stoplevel Text 1 1 Edit Yes Public
TYPFLG use of address types Text 10 1 Edit Yes Public
PTAUSGFLG Allowed Partytypes Text 1 1 Edit Yes Public
TMPFLG use of temporary addresses Text 1 1 Edit Yes Public
PTYFORDELTXT used in CheckPtyForDel for customer's text Block 40 10 Block Yes Public
ROLDYNSTM Stream with static information about dynamic roles Stream 1 0 Source Yes Public

Datafield Description and Properties

Datafield PTSPTAMOD List of PTSPTA Modules

Description

Filled for performance reasons on initialization with the PTSPTA Modules of the most probable group, which is derived from the first two digits of the framename.


Datafield ROLNAM Description of role

Description

This field used in sub PtsModGetAllRolStm and holds the return value of xxxLOD.GetxxdRolNam function.

Needed because of Post call of function.


Datafield ROLSELSTM Stream with roles available in transaction

Description

This stream holds information about the roles available in transaction, i.e. the role code, the path of the PTSPTA and the name for the the role selection combobox.

It is filled in PtsCallAssert from ROLCONSTM and the roles filled in the contracts before calling the user defined PtsAssert functions.

PtsmodGetRolValuesStream can be used to fill a fixed length combobox with the roles available in transaction, which should be executed in PtsChgAssert-functions.

To get information about a role selected, PtsModGetConGrpPathOfRol can be used to retrieve to contract where the role is used.


Datafield ROLCONSTM Stream with static information about roles in contracts

Description

Filled in init with static information about roles in contract and parent contracts.

For each role is a line with a tab delimited list of contracts holding a PTSPTA for that role from main contract in transaction to it parent contracts.

For each role the first role which is set (if any) is moved to ROLSELSTM.


Datafield ADRCPYFLG Control copying address to contract

Description

Flag copied from PTSPTA of original contract to be passed as argument to PTSPTA. Necessary as Setmodulecontent correctly does not copy the argument.


Datafield STPLEV Stoplevel

Description

Flag copied from PTSPTA of original contract to be passed as argument to PTSPTA. Necessary as Setmodulecontent correctly does not copy the argument.


Datafield TYPFLG use of address types

Description

Flag copied from PTSPTA of original contract to be passed as argument to PTSPTA. Necessary as Setmodulecontent correctly does not copy the argument.


Datafield PTAUSGFLG Allowed Partytypes

Description

Flag copied from PTSPTA of original contract to be passed as argument to PTSPTA. Necessary as Setmodulecontent correctly does not copy the argument.


Datafield TMPFLG use of temporary addresses

Description

Flag copied from PTSPTA of original contract to be passed as argument to PTSPTA. Necessary as Setmodulecontent correctly does not copy the argument.


Datafield ROLDYNSTM Stream with static information about dynamic roles

Description

Filled in init with static information about roles in contract and parent contracts.

For each role is a line with a tab delimited list of contracts holding a PTSPTA for that role from main contract in transaction to it parent contracts.

For each role the first role which is set (if any) is moved to ROLSELSTM.


Rules

Rule Name Additional
function CheckPtyForDel text method
function CheckPtyInTable boolean method
function GetAnyRolNam text static
function Is3rdParty boolean static
function IsRolOneGrp boolean method
function IsSanctionedPartyUsed boolean static
function PtsIsPtaAdrRequired boolean global
function PtsIsRolDefined boolean static
function PtsIsRolSet boolean static
function PtsModGetAdrBlk text static
function PtsmodGetAdrLine text static
function PtsmodGetPtsptaPathFromRol text static
function PtsPtaGetRolPathofModule text static
sub ClearPtsCusFlds static
sub ClearPtsPta static
sub ClearPtsPtaRootFields static
sub CpyPTSPTARootFields method
sub GetMethodStream static
sub GetModulesOfTypeStream static
sub GetRolAndGrpModfromPtsPta static
sub InternalGetPtsPtamodnam method
sub PostGetMethodStream static
sub PtsCallAssert static
sub PtsmodFillPtsptaFromPts static
sub PtsmodGetAdrOfPtspta static
sub PtsmodGetAllPtsptaFieldsFromRol static
sub PtsModGetAllRolStm static
sub PtsmodGetPtaOfPtspta static
sub PtsModGetPtsptaForContract static
sub PtsmodGetPtsptaFromPta static
sub PtsmodGetPtyOfPtspta static
sub PtsModGetRolStm static
sub PtsModInternalSetRolSetStm static
sub PtsmodSetConFlds static
sub PtsmodSetPtsAssert static
sub PtsmodSetPtsFromPta static
sub PtsmodSetPtsptaForRol static
sub PtsmodSetPtsPtaFromChilds static
sub PtsSetPTAfromADR static
sub PTSsetPTAfromADRCus static
sub PtsSetPTAfromPTY static
sub PTSsetPTAfromPTYCus static
sub PTSsetPTSPTAfromPTYCus static
sub SetPtsCliBanTyp static

Rules Description and Comments

function CheckPtyForDel( in ArgPtyInr text ) : text method

return message why the party with passed ArgPtyInr cannot be deleted


function CheckPtyInTable( in ArgTbl text, in ArgSql text ) : boolean method

returns TRUE, if there is a fitting row in the passed table
ArgTbl hold the name of the database table to be checked
ArgSql holds the condition to be used when checking the existance of entries


function GetAnyRolNam( in ArgBaseMod module, in ArgObjTyp text, in ArgRol text, in ArgUIL text ) : text static

function to be used to get a role defined in xxxLOD.GetxxdRolNam, if not found then return the value from codetable ROLALL
ArgBaseMod holds the instance where the business sector group instances can be found. Usually, this is either \ or BIMENU
ArgObjTyp identifies the objtyp of the contract
ArgRol holds the 3-digit role code


function Is3rdParty( in Argrol text ) : boolean static

checks, if the given role is a third party.
delivers TRUE for all roles starting with 'TP' or 'T' only followed by numbers.


function IsRolOneGrp( in ArgRol1 text, in Argrol2 text ) : boolean method

Returns true if Argrol1 and Argrol2 are to be handled together for grouped roles (e.g. in LIAALL for multi applicant handling)
Product standard is that roles are in same group if the first two bytes of the code are the same


function IsSanctionedPartyUsed( in ArgGrp module ) : boolean static

This function returns true, if one or more parties are sanctioned parties
A sanctioned party is defined by a non empty content of PTA\SGPFLG


function PtsIsPtaAdrRequired( in Argrol text ) : boolean global

Decides if all contract addresses have to be stored as contract addresses as well
This setting is valid for all contract addresses in installation
The setting may vary depending on the role. Therefore role is passed as well.


function PtsIsRolDefined( in ArgGrp module, in Role text ) : boolean static

checks, if role is holding an address is available in contact group Arggrp. But only structure checked!

Use this function for
- mandatory checks (checkrules in ARGGRP\rol\PTS\EXTKEY or ARGGRP\rol\PTS\ADRBLK)
- deciding, if a document is to be created in registereddocuments
- Default rules depending on the existence of a party
- and anywhere else, where a rule depend on existence of roles in a contract.
refers with PtsIsRolSet


function PtsIsRolSet( in ArgGrp module, in Role text ) : boolean static

checks, if role is holding an address is available in contact group Arggrp.

Use this function for
- mandatory checks (checkrules in ARGGRP\rol\PTS\EXTKEY or ARGGRP\rol\PTS\ADRBLK)
- deciding, if a document is to be created in registereddocuments
- Default rules depending on the existence of a party
- and anywhere else, where a rule depend on existence of roles in a contract.
refers with PtsIsRolDefined


function PtsModGetAdrBlk( in ArgPtsPta PTSPTA, in ArgPrtCty boolean ) : text static

Get 4 line SWIFT-addressblock in ArgPtsPta
similar function in ANTMOD GetAdrBlkStructure must be changed in case default AdrBlk composition is changed here


function PtsmodGetAdrLine( in ARGPTSPTA PTSPTA ) : text static

returns the Addressline of address ARGPTSPTA delimited by “,”


function PtsmodGetPtsptaPathFromRol( in ArgRol text, in ArgGrp module ) : text static

returns path of PTSPTA-module of argrol in arggrp to argptspta
If the PTSPTA for that role is not available, result is empty
Exception is “OWN”. That PTSPTA is located in \TRNMOD\OWNPTS


function PtsPtaGetRolPathofModule( in ArgGrp module, in ArgRole text ) : text static

Returns the correct module path within the transaction for given root path and role


sub ClearPtsCusFlds( in ArgPtsPta PTSPTA ) static

this function used to delete only PTS own fields, i.e. default account
ATTENTION: do not delete technical fields as INR, OBJTYP/OBJINR, ROL etc.
and the fields filled in incoming message


sub ClearPtsPta( in ArgPtsPta PTSPTA ) static

Clears all modules in/under PTSPTA with exception of address block


sub ClearPtsPtaRootFields( in ArgTargetPtsPta module ) static

clears all datafields in PTSPTA but leaves the modules under PTSPTA unchanged


sub CpyPTSPTARootFields( in ArgSourcePath text, in ArgTargetPath text ) method

Copies all PTSPTA datafields from first to second module. Module content of modules under PTSPTA remain unchanged.


sub GetMethodStream( in ArgMetPfx text, inout ArgMetStm stream ) static

Stores methods with prefix ArgMetPfx in ArgMetStm as postable names
Methods in grids are flagged with a special value “*GRID*”
The posting has to be done with PostGetMethodStream which expands these entries with the currently available modules.


sub GetModulesOfTypeStream( inout Strm stream, in Mod module, in Typ text ) static

Adds lines with complete path of modules of type type located in module mod to stream Strm


sub GetRolAndGrpModfromPtsPta( in ArgPtsptapath text, out GrpPath text, out Role text ) static

Function to retrieve path of GRP-Module and the role from PTSPTA module with path ArgPtsptapath
This information is set from the instance name of ArgPtsPta as split after the last \
method as required in TRNREL.PtsBimEleApply


sub InternalGetPtsPtamodnam( in ArgModPath text ) method

Sets PTSPTAMOD to list of PTSPTA of module with path ArgModPath with caching


sub PostGetMethodStream( in ArgStream stream, in ArgPostTim numeric ) static

Post methods in ArgStream as calculated with GetMethodStream, i.e. with special support of grids
ArgStream : Stream with methods as received by GetMethodStream
ArgPostTim : Execution time (second argument of call of Post)

Rules are posted only if not already in post queue in case of async post (ArgPostTim >= 0)


sub PtsCallAssert static

Post all PtsChgAssert-Function ansynchronously (if not already in) to ensure redefaultings depending on PTS-Status.
To be called by each function changing PTSPTA-modules (usually from PTSMOD-functions only)
The stream for role selection boxes is set before. Thus setting comboboxes wit PtsmodGetRolValuesStream should be done in such asserts


sub PtsmodFillPtsptaFromPts( inout ArgPtspta PTSPTA, in ArgPts pts ) static

Sets Argptspta to the address stored in Argpts (the address is copied from PTS, which may be from different contract)
Only this function is safe if addressinformation is copied between contracts as it takes care of addresses which are real temporary addresses without PTA/PTY


sub PtsmodGetAdrOfPtspta( inout ArgPtspta PTSPTA ) static

Reads ADR to PTA in PTSPTA argPtspta to outPty.
(Caution: PTA has to be read first if not available by Select)
If not available the adr is cleared
In case the PTA is not found the errorcode tdOdbcNotFound is returned


sub PtsmodGetAllPtsptaFieldsFromRol( in ArgRol text, in ArgGrp module, inout ArgPtspta PTSPTA ) static

Copy all data of ArgGrp\ArgRol into one PTSPTA module
Call directly if target module is a work copy
Use PtsmodGetPtsptaFromRol to copy PTSPTA data into a different role module
Use PtsmodSetPtsptaForRol to copy PTSPTA data into Arggrp\Argrol


sub PtsModGetAllRolStm( in ArgGrp module, inout ArgRolStm stream, in ArgFlg text ) static

Sets ArgRolStm to Stream with all roles that exist in Arggrp dependent on the ArgFlg.
if the ArgFlg empty it be selected only the roles that are set in Arggrp
otherwise all roles that are defined in ROLLALL-table
To be used to set CodeTabValues for “role of contract Arggrp”-field


sub PtsmodGetPtaOfPtspta( inout ArgPtspta PTSPTA ) static

Reads argPtspta\PTA to argPTSPTA argPtspta from argPTSPTA\PTS
If not available the PtA is cleared
In case the PTA is not found the errorcode tdOdbcNotFound is returned


sub PtsModGetPtsptaForContract( inout ArgGrp module, in ArgInr text ) static

Loads all PTSPTA instances inside Arggrp for ArgInr
PTS is read from database
PTA, ADR and the control fields in PTSPTA are calculated from PTS-Information
For roles where no PTS is available, the PTSPTA-instance is cleared.
Return ErrorText if missing PTA or ADR of found PTS


sub PtsmodGetPtsptaFromPta( inout ArgPtspta PTSPTA ) static

Sets remaining part of Argptspta based on argPtsPta\PTA


sub PtsmodGetPtyOfPtspta( in ArgPtspta PTSPTA, inout OutPty PTY ) static

Reads PTY to PTA in PTSPTA argPtspta to outpty.
(Caution: PTA has to be read first if not available by Select)
If not available the Pty is cleared


sub PtsModGetRolStm( in ArgGrp module, inout ArgRolStm stream ) static

Sets ArgRolStm to Stream with all roles set in Arggrp.
To be used to set CodeTabValues for “role of contract Arggrp”-field


sub PtsModInternalSetRolSetStm static

Set ROLSELSTM from ROLCONSTM and roles set in contracts(s)(posted in PtsCallAssert)


sub PtsmodSetConFlds( inout argPtspta PTSPTA ) static

Sets the following fields in contract if available
xxDGRP\REC\<Rol>PTAINR
xxDGRP\REC\<Rol>PTYINR
xxDGRP\REC\<Rol>NAM
xxDGRP\REC\<Rol>REF
xxDGRP\BLK\<Rol>ADRBLK


sub PtsmodSetPtsAssert( inout ArgPtspta PTSPTA ) static

assert PTS-dependent fields, if key fields (PTS\ADRBLK and INR) have been changed


sub PtsmodSetPtsFromPta( inout argPtspta PTSPTA ) static

Sets PTS-Info from passed PTA and ADR inside argptspta (only used in PTSGET)


sub PtsmodSetPtsptaForRol( in argrol text, in arggrp module, in argptspta PTSPTA ) static

copies ADR,PTA and PTS from argPTSPTA to PTSPTA of argrol in arggrp
To avoid multiple definitions of PTSPTA you may use PTSPTA defined in PTSMOD
If the PTSPTA for that role is not available, nothing happens
Use this function to activate changes in argptspta received with PtsmodGetPtsptaFromRol
Use this function to copy PTSPTA data back into contract data


sub PtsmodSetPtsPtaFromChilds( inout ArgPtspta PTSPTA ) static

Sets Info in root of PTSPTA from passed PTA and ADR inside argptspta


sub PtsSetPTAfromADR( in ARGADR ADR, inout ARGPTA PTA ) static

set PTA fields copied from ADR


sub PTSsetPTAfromADRCus( in ARGADR ADR, inout ARGPTA PTA ) static

set installation specific fields copied from ADR to PTA
Old Name: PTSsetPTAfromADRClient


sub PtsSetPTAfromPTY( in ARGPTY PTY, inout ARGPTA PTA ) static

set PTA fields copied from PTY


sub PTSsetPTAfromPTYCus( in ARGPTY PTY, inout ARGPTA PTA ) static

set installation specific fields copied from PTY to PTA
Old name: PTSsetPTAfromPTYClient


sub PTSsetPTSPTAfromPTYCus( inout ARGPtsPTA PTSPTA, in ArgPty PTY ) static

set installation specific fields copied from PTY to PTSPTA
Old name: PTSsetPTSPTAfromPTYClient


sub SetPtsCliBanTyp( in ArgObjPth text, in ArgCciPth text, in ArgObjTyp text ) static

set Bank/Customer, the rule must be available!


Modules

Module class Instance Comment
PTSPTA PTSPTA
PTY PTY
PTSADD PTSADD