You are on page 1of 27

ETP- Enquiry Routines – R17 K-1

After completing this learning unit, you will be able to:

•Explain different types of enquiry routines that can be attached to an enquiry

•Identify the stages where the enquiry routines would get executed

•Create Build and Conversion Routines

ETP- Enquiry Routines – R17 K-2


Reports are a crucial aspect of any banks business for analysis and
future business predictions

ENQUIRY is a T24 application which allows you to create user defined


reports that fetch and display data as per the requirements of the user.

An enquiry is a query that is executed to fetch data from the database


and display the results in a user defined format

In technical terms, an enquiry is a ‘SELECT’ executed in order to fetch


data from T24 and the results displayed in a user defined format

ETP- Enquiry Routines – R17 K-3


1.The ENQUIRY.SELECT utility that is used to execute an enquiry in T24, picks up the
application name from the field FILE.NAME

2.STANDARD.SELECTION record of the application is read to locate the fields


specified in FIELD.NAME in ENQUIRY.

3.Creates a list of IDs which satisfy the fixed selection, if any.

4.Applies dynamic conditions specified in the selection criteria box to the selected list
of IDs and rebuilds the list.

5.For each ID in the list, the corresponding record from the application is read.
Depending on the fields defined in the enquiry, the data is picked up and displayed
from left to right.

ETP- Enquiry Routines – R17 K-4


1. Subroutines are similar to programs that enable users to read or write onto single
or multiple files.

2. Subroutines are executed from T24 by an internal call from an application, version
or from the command line.

3 ENQUIRY application allows user defined subroutines to be attached at different


stages to display the data based on users Requirement. Write enquiry routines to
cater to the desired customisation and attach it to the ENQUIRY record. For eg –
Apply a filter on the dynamic selection, Display calculated fields in the enquiry
report etc.

Subroutines that are attached to the ENQUIRY application are called as Enquiry
Routines. They are used to provide additional functionality to enquiries and to
manipulate data before display in report.

ETP- Enquiry Routines – R17 K-5


There are two types of enquiry routines namely BUILD ROUTINES and
CONVERSION ROUTINES.
1. Build Routines are used to manipulate the selection criteria box. Why do you need
a routine to be attached to an enquiry, when you can directly specify fixed and
dynamic selection to extract required data?
To understand the use of a build routine, consider this requirement. The bank wants to
create an enquiry on the ACCOUNT application with fixed selection set to
‘CATEGORY EQ 1001’. The SECTOR field is a mandatory dynamic selection criteria.
For a SECTOR input of 6001, only those records with WORKING.BALANCE not in the
range 50000 to 100000 should be displayed. In other words, an additional selection
criteria is required at run-time, but without user input. This can be achieved by using a
build routine attached to the ENQUIRY record. As its name suggests, it can build an
additional selection criteria.
3. Conversion Routines are used to manipulate data in a field of a selected record,
prior to display. The routine is executed after dynamic selection condition is
applied and records selected, but before the record is displayed to the user.
For example, for LD application, an enquiry is written to display the currency and the
amount. But before the output is displayed, if the loan amount is in foreign currency,
you want another column which will hold the loan amount in local currency. The
enquiry application cannot cater to this requirement. You need to write an enquiry
routine and attach it to the particular field in the enquiry record.
This routine is termed as conversion routine. Conversion routine is specific to a field in
the enquiry record. Every field in the enquiry can have a conversion routine
defined for it in the field CONVERSION.

ETP- Enquiry Routines – R17 K-66


1. Now you know what a build routine is and where it gets triggered. After the fixed
selection is executed in the enquiry, a build routine can be used to manipulate the
conditions specified in the selection criteria box before the output is displayed.

2. The build routine is attached to the field BUILD.ROUTINE in the ENQUIRY record.

ETP- Enquiry Routines – R17 K-7


• Build routine takes a dynamic array as an argument. This array stores, the
information entered in the selection criteria box at runtime.

• The dynamic array can be any user defined name. The syntax is
ArrayName<FM.VM>. ENQ.DATA is not a common variable but a user defined
variable that has to be passed to the build routine.

The screen shot is the selection criteria screen for an enquiry named ACCOUNT.TRG
based on the ACCOUNT application.

As shown

ENQ.DATA<1> stores the Enquiry Name

ENQ.DATA<2> - Field Names against which selection values are specified

ENQ.DATA<3> - Operator against the above fields

ENQ.DATA<4> - Value entered against the field

ETP- Enquiry Routines – R17 K-8


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 zero and 49999

For category 6001 - Balance should be in the range 50000 and 100000

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

ETP- Enquiry Routines – R17 K-9


The first step is to create an enquiry on the ACCOUNT application with the required
fields and attach the “build” subroutine in the field BUILD.ROUTINE. T24 does not
throw an error while committing the record even if you enter any wrong name.
Therefore you may write the subroutine after the ENQUIRY record is created.

ETP- Enquiry Routines – R17 K-10


As per the requirement write the subroutine to manipulate the selection criteria box

LOCATE command finds the position of an element within a specified dimension of a


dynamic array. For example, ENQ.DATA<2,1> searches the string in the information
stored after the 2nd FM, i.e., the selection fields for which user has entered values at
runtime.

In the example at runtime, ENQ.DATA<2> contains the selection field CATEGORY.


ENQ.DATA<3> contains the operand entered against CATEGORY by the user and
ENQ.DATA<4> contains the value entered for CATEGORY

Since the enquiry requirement is to add another selection criteria i.e.,


WORKING.BALANCE based on category at runtime, we must append this field to
ENQ.DATA<2>.

LOCATE ‘WORKING.BALANCE’ IN ENQ.DATA<2,1> SETTING BPOS, will set


BPOS = 2. Thereby,

ENQ.DATA<2,BPOS> = ‘WORKING.BALANCE’ appends the field after CATEGORY.

The operator (RG) and the values (based on CATG) are appended similarly to their
respective positions, as shown in the code.

ETP- Enquiry Routines – R17 K-11


The output of the enquiry should be a combination of the condition specified in the
selection criteria box and the condition specified in the subroutine.

Note that all the Working Balances are within the range 50000 to 100000, which is the
range set for CATEGORY EQ 6001.

ETP- Enquiry Routines – R17 K-12


1. There are some common variables that are exclusively used for enquiries.
I_ENQUIRY.COMMON is the insert file that holds the common variables specific
to enquiries. This file is similar to I_COMMON and I_EQUATE. Some of the
common variables are O.DATA, R.RECORD.

2. O.DATA is a common variable that holds the last extracted value in the enquiry.
This is similar to the variable COMI in I_COMMON which holds the last entered
value.

3. R.RECORD is another common variable defined in I_ENQUIRY.COMMON which


contains the record pertaining to the current ID that has been extracted. These
variables are used in a conversion routine.

ETP- Enquiry Routines – R17 K-13


1. Conversion routines are used to manipulate the data in a field prior to display

2. Conversion routine is attached to the field CONVERSION for a particular field in


the ENQUIRY record

ETP- Enquiry Routines – R17 K-14


Create an enquiry that will list the LD contract numbers, and their respective loan
amounts and Account officer of the contract.

[Note – LD.LOANS.AND.DEPOSITS only stores the Account officer ID. To display the
officer name, do a look up on the DEPT.ACCT.OFFICER table

ETP- Enquiry Routines – R17 K-15


The first step is to create an ENQUIRY record with all the required fields in the output
and attach the routine in the field CONVERSION for a field whose value has to be
manipulated before display. The routine name should be prefixed with ‘@ ‘ in this field
(@<space>Routine name).

ETP- Enquiry Routines – R17 K-16


The first step is to write a subroutine to manipulate the contents of the field before it is
displayed.

Extract the account officer ID for the current record being processed, using the
common variable R.RECORD.

O.DATA contains the value of the last field extracted in the current record. In our
example it’s the MIS Dept officer ID. This field is replaced with the name by the code
O.DATA = R.OFFICER<EB.DAO.NAME>

ETP- Enquiry Routines – R17 K-17


The officer name is picked from DEPT.ACCT.OFFICER table and displayed in this
enquiry.

ETP- Enquiry Routines – R17 K-18


Look up the CUSTOMER table for the customer name.

ETP- Enquiry Routines – R17 K-19


ETP- Enquiry Routines – R17 K-20
Look up the CUSTOMER table for the customer name.

ETP- Enquiry Routines – R17 K-21


The steps to create a TESTCASE are
1. We must first define the target. The subroutine/function being tested
2. Define the parameters for the target routine
3. All the common variables, records, etc. that are required by the
target routine must be defined explicitly. The test will never touch the
database. For e.g. if the target routine requires a record, the record
must be made available when defining the context.
4. Once the parameters are specified and the context is defined, the
test can be run. The target routine is executed.
5. As a final step we do the assertions to check if the target routine has
created/updated the required records or set the variables with
expected values.

ETP- Enquiry Routines – R17 K-22


If the test requires a record, the record is added using the above
method. This does NOT create the record in the database. Also, we can
populate only the required fields. All fields need not be set.

ETP- Enquiry Routines – R17 K-23


The steps to create a TESTCASE are
1. We must first define the target. The subroutine/function being tested
2. Define the parameters for the target routine
3. All the common variables, records, etc. that are required by the
target routine must be defined explicitly. The test will never touch the
database. For e.g. if the target routine requires a record, the record
must be made available when defining the context.
4. Once the parameters are specified and the context is defined, the
test can be run. The target routine is executed.
5. As a final step we do the assertions to check if the target routine has
created/updated the required records or set the variables with
expected values.

ETP- Enquiry Routines – R17 K-24


ETP- Enquiry Routines – R17 K-25
1. QUESTION : Build routine is used to manipulate the selection criteria box.
TRUE
FALSE
2. QUESTION : O.DATA is the common variable that holds the last extracted value
TRUE
FALSE
3. QUESTION : R.RECORD holds the record pertaining to the current ID
TRUE
FALSE
4. QUESTION : I_ENQUIRY.COMMON is the insert file specific to a COMPANY
TRUE
FALSE – ENQUIRY application
5. QUESTION : Build routine need not have any argument
TRUE
FALSE – One argument required
6. QUESTION : Conversion routine is used to manipulate the data in a field before
display
TRUE
FALSE

ETP- Enquiry Routines – R17 K-26


In this learning unit/course, you learnt about the enquiry routines in T24

You will now be able to:


•Explain different types of enquiry routines that can be attached to an enquiry
•Identify the stages where the enquiry routines would get executed
•Create Build and Conversion Routines

ETP- Enquiry Routines – R17 K-27

You might also like