Sunteți pe pagina 1din 27

ENQUIRY ROUTINES

TEMENOS EDUCATION CENTRE

Warning: This document, is protected by copyright law and international treaties. No part of this
document may be reproduced or transmitted in any form or by any means, electronic or mechanical,
for any purpose, without the express written permission of TEMENOS Holdings NV Unauthorized
reproduction or distribution of this presentation or any portion of it, may result in severe civil and
criminal penalties, and will be prosecuted to the maximum Copyright © 2004under
extent possible TEMENOS HOLDINGS
applicable law.” NV
Information in this document is subject to change without notice.

Copyright © 2005 TEMENOS HOLDINGS NV


Objectives

‰ To understand the different types of routines that can be


attached to an enquiry

‰ To understand the stage where the enquiry routines would


get executed in an enquiry

‰ To understand the steps to attach a routine to an enquiry in


T24

T3ATT – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 2


Introduction

‰ Subroutines are programs that enable users to read / write


onto a single or multiple files.

‰ When attached to ‘Enquiries’, Subroutines add more


functionality to ‘Enquiries’

T3ATT – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 3


Enquiry Routines

ENQUIRY SUBROUTINES

CONVERSION
BUILD SUBROUTINES SUBROUTINES

T3ATT – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 4


Working Of The Enquiry Subsystem

Picks up the file name from the ENQUIRY (Field Number 2)

Refers the Standard Selection and creates a list of IDs


which satisfy the fixed selection

Applies the Dynamic Selection and builds a list of IDs that


satisfy the conditions

Picks up each ID from the ID list and for each ID picks up


the fields specified in the Enquiry(field by filed)

Finally displays the data(field by field)

T3ATT – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 5


I_ENQUIRY.COMMON

‰ An enquiry specific insert file.

‰ Similar to I_COMMON and I_EQUATE

‰ Contains common variables specific to enquiries

Example - O.DATA

T3ATT – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 6


O.DATA

‰ Defined in I_ENQUIRY.COMMON

‰ Contains the last extracted value

T3ATT – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 7


R.RECORD

‰ Defined in I_ENQUIRY.COMMON

‰ Contains the record pertaining to the current ID that has been


extracted

T3ATT – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 8


BUILD Routine
Used to manipulate the
‘Selection Criteria Box’

Gets invoked :
after
The fixed selection has been executed
before
The dynamic conditions specified in the Selection Criteria Box get
executed

Attached & Specified in


Field No.8.1. ‘BUILD ROUTINE’ in the ENQUIRY application

T3ATT – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 9


BUILD Routine

Build Routines must have one passed argument(dynamic array) which contains:

Selection
Field Names
Operands
Actual Value

ENQ.DATA<1,1> = NAME OF ENQUIRY


ENQ.DATA<2,1> = SELECTION FIELD NAMES (USER INPUT)
ENQ.DATA<3,1> = ASSOCIATED OPERANDS (EQ, LK, etc,.)
ENQ.DATA<4,1> = DATA LIST
Note : - The dynamic array is usually referred with the name ENQ.DATA

T3ATT – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 10


Example 1

Create an enquiry that will display Customer Id, the Account


Id and the respective working balance after accepting the
category from the user.

For category 1001 - Balance should be in the range 10


and 50000
For category 6001 - Balance should be in the range 50000
and 100000
For categories greater than 7000 - Balance should be in the
range 100000 500000

T3ATT – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 11


Solution 1

Create an enquiry that will display the Customer Id,


Account Id and the Working Balance from the Account
File.

T3ATT – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 12


Solution1

T3ATT – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 13


Solution 1 - Algorithm

‰ Pick up the Category from the selection criteria box

‰ Check to see in what range the extracted category


values falls in

‰ Depending on the category value dynamically add the


WORKING.BALANCE condition to the selection criteria box

T3ATT – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 14


Solution 1

SUBROUTINE E.TRG.BUILD.RTN(ENQ.DATA)
$INSERT I_COMMON
$INSERT I_EQUATE
$INSERT I_ENQUIRY.COMMON

LOCATE ‘CATEGORY’ IN ENQ.DATA<2,1> SETTING Y.CAT.POS ELSE NULL


Y.CATEGORY = ENQ.DATA<4,Y.CAT.POS>

LOCATE ‘WORKING.BALANCE’ IN ENQ.DATA<2,1> SETTING Y.WBAL ELSE NULL


ENQ.DATA<3,Y.WBAL> = 'RG'

IF Y.CATEGORY = 1001 THEN ENQ.DATA<4,Y.WBAL> = ‘10 50000'


IF Y.CATEGORY = 6001 THEN ENQ.DATA<4,Y.WBAL> = ‘50000 100000'
IF Y.CATEGORY > 7000 THEN ENQ.DATA<4,Y.WBAL> = ‘100000 500000'

RETURN
END

T3ATT – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 15


Solution 1

‰ Compile and catalog the subroutine.


‰ Attach it to the enquiry in the field Build Routine

Include WORKING.BALANCE
also in the selection fields

T3ATT – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 16


Workshop 1

T3ATT – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 17


Conversion Routines

CONVERSION ROUTINES help us to


manipulate data in a field
prior to display

Attached to the “CONVERSION” field

T24 gives the flexibility of using :


any pre-defined conversion routine
or
user-defined routines

T3ATT – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 18


Example 2

Create an enquiry that will list the LD contract numbers, and


their respective loan amounts. In case the loan amounts are
in foreign currency, they have to be converted to local
currency and then displayed. (Hint: Multiply the LD loan
amount with the ‘MID.REVAL.RATE’ in the CURRENCY file for that
particular currency to convert the foreign currency loan
amount to local currency amount)

Format of output required:

LD Contract Number Amount In Local Currency

T3ATT – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 19


Solution 2

Create an enquiry that will list all the LD contract numbers and the
loan amounts.

T3ATT – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 20


Which field do we attach this routine to?

Field : AMOUNT

How will you extract the currency of the contract?

T3ATT – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 21


Solution 2 - Algorithm

‰ Extract the currency of the contract from R.RECORD

‰ Check if the currency is equal to the local currency.

‰ Extract the MID.REVAL.RATE of the contract currency from


the CURRENCY file and multiply with the loan amount.

‰ Return the value using O.DATA.

T3ATT – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 22


Solution 2

SUBROUTINE E.TRG.CONV.RTN
$INSERT I_COMMON
$INSERT I_EQUATE
$INSERT I_ENQUIRY.COMMON
$INSERT I_F.LD.LOANS.AND.DEPOSITS
$INSERT I_F.CURRENCY
GOSUB INIT
GOSUB PROCESS
RETURN

T3ATT – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 23


Solution 2

INIT:
FN.CUR = 'F.CURRENCY'
F.CUR = ''
Y.LD.CURR = R.RECORD<LD.CURRENCY>
R.CUR.REC = ‘’
CALL OPF(FN.CUR,F.CUR)
RETURN
PROCESS:
IF Y.LD.CURR NE LCCY THEN
CALL F.READ(FN.CUR,Y.LD.CURR,R.CUR.REC,F.CUR,LD.ERR1)
O.DATA = R.CUR.REC<EB.CUR.MID.REVAL.RATE,1> * O.DATA
END
RETURN
END

T3ATT – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 24


Solution 2

A conversion routine needs to


be prefixed with an @ followed
by a single space.

T3ATT – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 25


Workshop 2

T3ATT – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 26


Summary

‰ The enquiry subsystem extracts and displays field by field.


‰ Build routine and Conversion routine are the two types of enquiry routines
‰ Build routine gets executed after the actual selection of data from the file
but before the execution of the conditions specified in the Selection
Criteria Box
‰ Build routines take one parameter (ENQ.DATA) that will hold the
conditions specified in the Selection Criteria Box
‰ The common variable O.DATA defined in the file I_ENQUIY.COMMON
will always contain the last extracted value in an enquiry
‰ The common variable LCCY contains the local currency of the company.
‰ The common variable R.RECORD defined in I_ENQUIRY.COMMON
contains the record of the currently extracted ID.

T3ATT – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 27

S-ar putea să vă placă și