Table of Contents

PTSMOD - Functions for Address Handling

Module PTSMOD PTSMOD - Functions for Address Handling

Description

This module contains the core functions needed for address and party
handling in business transactions.

The other modules for party handling are linked into this module.


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
ROLSTM Stream of roles Stream 1 0 Source Yes Public
PTYFLG Flag if party is required as settlement/booking has to be possible Text 1 1 Edit Yes Public
PTSGETADDSUB Name of GETADDSUB function Text 80 1 Edit Yes Public
BUTCLS Close Control 10 1 Button Yes Public
STATLAB Status Label Text 80 1 Edit Yes Public
SELPTSPTAPATH Path of PTSPTA-module to which temporary address is entered Text 80 1 Edit Yes Public
SELTMPFLG use of temporary addresses Text 1 1 Edit Yes Public
SELTYPFLG use of address types Text 10 1 Edit Yes Public
SELPTAUSGFLG Allowed Partytypes Text 1 1 Edit Yes Public
SELSTPLEV Stoplevel Text 1 1 Edit Yes Public
SELADRCPYFLG Control copying address to contract Text 1 1 Edit Yes Public
BUTCLSINF Close Info Panel Control 10 1 Button Yes Public
SELSQL Selection SQL Stream 40 1 Source Yes Public
STPLEV Stoplevel Text 1 1 Edit Yes Public
TMPFLG use of temporary addresses Text 1 1 Edit Yes Public
ADRCPYFLG Control copying address to contract Text 1 1 Edit Yes Public
PTAUSGFLG Allowed Partytypes Text 1 1 Edit Yes Public
TYPFLG use of address types Text 10 1 Edit Yes Public

Datafield Description and Properties

Datafield ROLSTM Stream of roles

Description

Stream of allowed roles used by PtsRemoveFromRol and PtsRemoveRoles.

First line is identification of the object the roles are searched for.


Datafield PTYFLG Flag if party is required as settlement/booking has to be possible

Description

Flag copied from PTSPTA of original contract to be passed as argument to PTSPTA.

Necessary as Setmodulecontent correctly does not copy the argument.

As this flag has same name as in PTSADDG it is automatically copied in PtsmodGetPtsptaFromRol.


Datafield SELPTSPTAPATH Path of PTSPTA-module to which temporary address is entered

Description

As only one instance of address entry is used, this field is necessary to store the PTSPTA-instance to which the current entry is executed.


Datafield SELTMPFLG 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.

As this flag has same name as in PTSADDG it is automatically copied in PtsmodGetPtsptaFromRol.


Datafield SELTYPFLG 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.

As this flag has same name as in PTSADDG it is automatically copied in PtsmodGetPtsptaFromRol.


Datafield SELPTAUSGFLG 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.

As this flag has same name as in PTSADDG it is automatically copied in PtsmodGetPtsptaFromRol.


Datafield SELSTPLEV 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.

As this flag has same name as in PTSADDG it is automatically copied in PtsmodGetPtsptaFromRol.


Datafield SELADRCPYFLG 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.

As this flag has same name as in PTSADDG it is automatically copied in PtsmodGetPtsptaFromRol.


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.

As this flag has same name as in PTSADDG it is automatically copied in PtsmodGetPtsptaFromRol.


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.

As this flag has same name as in PTSADDG it is automatically copied in PtsmodGetPtsptaFromRol.


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.

As this flag has same name as in PTSADDG it is automatically copied in PtsmodGetPtsptaFromRol.


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.

As this flag has same name as in PTSADDG it is automatically copied in PtsmodGetPtsptaFromRol.


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.

As this flag has same name as in PTSADDG it is automatically copied in PtsmodGetPtsptaFromRol.


Rules

Rule Name Additional
function PtsGetAdrDifRolLst text static
function PtsGetCompressedAddress text static
function PtsGetPtytypSql text static
function PtsModGetConGrpPathforRol text static
function PtsModGetConGrpPathfromRol text static
function PtsModGetRolValues text static
function PtsPtaGetPathofRole text static
sub CacheDbRead2 static
sub CheckPTSPTAStopAndInfo static
sub CopyPTSFromParent2Child static
sub PtsLoadAddPtsPtaData static
sub PtsmodGetPtsptaFromOriRol static
sub PtsmodGetPtsptaFromPtaINR static
sub PtsmodGetPtsptaFromPts static
sub PtsmodGetPtsptaFromPtyINR static
sub PtsmodGetPtsptaFromRol static
sub PtsModGetRolPty static
sub PtsModSetEditFlag static
sub PtsmodSetPtsptaFromFreRol static
sub PtsModSyncRoles static
sub PtsptaSetConForContract static
sub PtsRemoveRol static
sub PtsRolesAdjust static
sub PtsSetRolChgFlg static

Rules Description and Comments

function PtsGetAdrDifRolLst( in ArgGrp module ) : text static

calculate where database address differs from contract address.
May be used in installation specific checks


function PtsGetCompressedAddress( in AdrBlk text ) : text static

returns address lines without empty lines


function PtsGetPtytypSql( in ArgPtspta PTSPTA, in ArgTblIns text ) : text static

gets where-clause for selection in ArgTblIns for TYPFLG matching ArgtyptypPat
ArgTblIns contains (optional) name ob table instance (i.e. “PTA” or “PTY”)
Format of Pattern:
empty : No restriction - empty string returned
=x : Exactly the listed types are to be set (more than one: One option has to match, maximum two types can be checked in each part)
Otherwise <list of allowed types>[-<list of not allowed types>]

Examples:
“B” : only banks
“B-A” : Banks, but no own addresses
“-B” : everything but banks
“=C” : Parties that are clients only


function PtsModGetConGrpPathforRol( in ArgRol text ) : text static

Returns the Path of the contract, in which ArgRol (a selection from PtsModGetRolValues) is set.

If an additional role defined with PtsModAddRolToStream has been selected an empty path is returned


function PtsModGetConGrpPathfromRol( in ArgRol text ) : text static

Returns the Path of the contract, in which ArgRol (a selection from PtsModGetRolValues) is set.

If an additional role defined with PtsModAddRolToStream has been selected an empty path is returned


function PtsModGetRolValues( in ArgValOnl boolean, in ArgPtytypOnl text, in ArgPtyOnlFlg boolean ) : text static

Returns the roles avalialble in a contract and its parent to allow the selection from only

If ArgValOnl is set, only the values are returned for use in Setvalues (as in FREMSG)
If ArgValOnl is not set, the values and names are returned for use in SetCodeValues

If ArgPtytypOnl is set, only parties holding that party type are made available
If ArgPtyOnlFlg is set, only roles with party set are returned (for settlement parties)

Example usages in PtsChgAssert:

1. Selection of all parties available in contract (usual for addressee selection of documents)
Streamset($valstm,PtsModGetRolValues(FALSE,“”,FALSE))
SetCodeValues (<fld>, $valstm)

2. Selection of one of the banks in contract as in FREMSG (with Setvalues):
Setvalues(<fld>,PtsModGetRolValues(TRUE,“B”,TRUE))

By default the stream holds the involved party available in MTABUT\REC and the parent contract.
When a role has been selected the contract in which the role is defined can be retrieved with PtsmodGetCongrpPathOfRol for the default values
Additional roles may be defined with PtsModAddRolToStream


function PtsPtaGetPathofRole( in ArgRol text ) : text static

Returns the Path of the contract, in which ArgRol (a selection from PtsModGetRolValues) is set.

If an additional role defined with PtsModAddRolToStream has been selected an empty path is returned


sub CacheDbRead2( inout Rec module, in ArgValue text, in ArgField text, in ArgValue2 text, in ArgField2 text ) static

This procedure performs a CACHED read on a table via two search fields.
Used in PTSMOD to find main address of a party.
Via EXIT the return to caller takes place with the errorcode of the DBRead


sub CheckPTSPTAStopAndInfo( in ArgPtsPta PTSPTA ) static

Checks info status and stop code


sub CopyPTSFromParent2Child( in ArgPntPtspta PTSPTA, inout ArgCldPtspta PTSPTA ) static

copy PTS from parent contract to child contract, but leave fields changed in child PTS as is


sub PtsLoadAddPtsPtaData( inout ArgPtsPta PTSPTA, in ArgPtsp module ) static

read infotexts (OIT) of loaded address
and try to call LoadAddDataCust in the module above
ArgPtsPta holds the PTSPTA to be handled
ArgPtsP holds the owning PTSP the PTSPTA is associated to.
This module or the module above is the module where the customization rule LoadAddDataCust might be implemented
If there is no owning PTSP module the root module might be passed.


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

Copy ptspta from ArgRol to ArgPtspta


sub PtsmodGetPtsptaFromPtaINR( inout ArgPtspta PTSPTA, in ArgPtaInr text ) static

Sets Argptspta based on ArgptaInr


sub PtsmodGetPtsptaFromPts( 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 PtsmodGetPtsptaFromPtyINR( inout ArgPtspta PTSPTA, in ArgPtyInr text ) static

Sets Argptspta based on ArgptyInr
that means the main address of party ARGPTYINR is read and based on this PTA argPtspta is filled completely


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

copies ADR,PTA and PTS from PTSPTA of argrol in arggrp to argptspta
To be used to copy role data into one PTSPTA of a contract group
To avoid multiple definitions of PTSPTA you may use PTSPTA defined in PTSMOD
If the PTSPTA for that role is not available, argptspta is cleared
otherwise following this call the other Ptsmod-functions may be used with argptspta
If changes are made to that PTSPTA received, they have to be activated using PtsmodSetPtsptaForRol


sub PtsModGetRolPty( out ResStm stream ) static

Returns list parties and their roles in a contract and its parent

each line contains PTYINR, ROL, PTS\NAM, and PTSPTAPATH, separated by tab


sub PtsModSetEditFlag( in argrolfld field, inout argptsp ptsp ) static

enable/disable party panel


sub PtsmodSetPtsptaFromFreRol( in ArgRol text, inout ArgPts PTS ) static

Copy modified PTS fields from ArgRol role to main role and set modification status for fields


sub PtsModSyncRoles( in ArgRolFld field, inout ArgPtsP ptsp, in ArgGrp module ) static

handle defaulting and modification of ArgPtsP\PtsPta and restore original address if necessary

This rule should be called from PtsChgAssert-Rules in contract panel modules. Once for each transient role.
ArgRolFld: Field, which contains role pointer for ArgPtsP. I.e. BEDGRP\REC\DOCPRBROL
ArgPtsP: Panel module which contains the transient role (i.e. PRBP)
ArgGrp: relevant contract group (i.e. BEDGRP)


sub PtsptaSetConForContract( inout ArgGrp module ) static

makes sure that the con field are set in all PTSPTA of contract by calling PtsmodSetConFlds for each
(called in TrnStoreContract before saving contract)


sub PtsRemoveRol( in ArgMod module, in Rol text ) static

Call this function in PtsAdjust if the role Rol should not be available for contract Argmod.
Roles shown by PTSP outside PTSADD are removed automatically.
Additional removes may be necessary in xxDGRP-Modules, if roles are not allowed under certain circumstances of contract data
By default all roles defined in xxDGRP as PTSPTA are allowed


sub PtsRolesAdjust( in ArgMod module, inout Stm stream ) static

adjusts availiable role by calling PtsAdjust-functions in application
These may remove roles not allowed for contract Argmod using PtsRemoveRol
Or disallow changes of roles using PtsSetRolChgFlg


sub PtsSetRolChgFlg( in ArgRol text, in ArgGrp module, in ArgRolChgFlg text, in ArgRolChgMsg text ) static

set RolChgflg in PTSPTA of argrol in arggrp to ArgRolChgFlg
RolChgMsg is set to ArgMsg
may be used in PtsAdjust-Functions to restrict access to parties


Modules

Module class Instance Comment
PTSSUB PTSSUB
PTSSHW PTSSHW
PTSEDT PTSEDT
PTSNEW PTSNEW
PTSPTA PTSPTA
PTSPTA WRKPTSPTA
PTY PTY A static PTY available everywhere for interim calculations.
Has to be set and used in a rule as it may be used elsewhere otherwise.
As PTSPTA has no own PTY, it is often used to get the party information to an PTSPTA by using PtsmodGetPtyOfPtspta.
PTYGRP PTYGRP
PTMMOD PTMMOD