Professional Documents
Culture Documents
Enquiry Routines
Objectives After completing this learning unit, you will be able to:
•Identify the stages where the enquiry routines would get executed
Enquiry is an in-built
Reporting
It Is used to design reports that enable
users to drill down and filter information, in
accordance with their needs
Internally it is a query that is executed to fetch data from the database and display
the results in a user defined format
Created using the ENQUIRY application
Reports are a crucial aspect of any banks business for analysis and
future business predictions
Database
• Read Record
Display the
for ID
required fields
1.The ENQUIRY.SELECT utility that is used to execute an enquiry in T24, picks up the
application name from the field FILE.NAME
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.
Provides additional
functionality to Apply a Fixed
Selection filter
Display an
additional
enquiries. based on the column with
Dynamic Selection calculated
values
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.
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.
ENQUIRY ROUTINES
BUILD CONVERSION
ROUTINES ROUTINES
Slide 6
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.
Rebuild ID
List
Invoke Build
Routine • Read record
• Apply Fixed
Selection • Apply for ID’s
Criteria Dynamic selected
Selection
List of ID’s Database
The Build Routine is attached to the field BUILD.ROUTINE in the ENQUIRY record
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.
Enquiry Name
ENQ.DATA<1>
Field Name
ENQ.DATA<2>
Operator
ENQ.DATA<3>
Actual Value
ENQ.DATA<4>
• 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
Create an enquiry to display Customer Id, Account Id and the respective working
balance after accepting category from the user.
Based on category an additional filtering has to be done
For category 1001 - Balance should be in the range 0 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
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
Set the
Build
Routine
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.
As per the requirement write the subroutine to manipulate the selection criteria box
The operator (RG) and the values (based on CATG) are appended similarly to their
respective positions, as shown in the code.
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.
I_ENQUIRY.COMMON
• Holds common variables specific to
enquiries
O.DATA
• Common variable that holds the last
extracted value
R.RECORD
• Holds the record pertaining to the
current ID that has been extracted
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.
Invoke
Conversion
Routines
Database
• Apply • Display
Dynamic • Read record configured
Selection for ID’s fields
selected
Invoke Build
Enquiry Output
Routine
Rebuild ID List
1. Conversion routines are used to manipulate the data in a field prior to display
Create an enquiry that will list the LD contract numbers, the loan amount and
Account officer (name) of the contract.
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
Set the
Conversion
routine
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).
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>
Conversion
routine
executed
The officer name is picked from DEPT.ACCT.OFFICER table and displayed in this
enquiry.
Workshop
application
Workshop
enquiry routine
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.
Quiz
1. Build routine is used to manipulate the selection criteria
box.
In this learning unit/course, you learnt about the enquiry routines in T24