0% found this document useful (0 votes)
27 views23 pages

Day19 11.enquiry Routines-R14

This document outlines the learning unit on creating enquiry routines in T24, focusing on Build and Conversion routines. It explains the purpose and functionality of enquiries, detailing how to manipulate selection criteria and data display through subroutines. Upon completion, learners will be able to explain different types of enquiry routines, identify their execution stages, and create both Build and Conversion routines.

Uploaded by

rubeenarasack123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views23 pages

Day19 11.enquiry Routines-R14

This document outlines the learning unit on creating enquiry routines in T24, focusing on Build and Conversion routines. It explains the purpose and functionality of enquiries, detailing how to manipulate selection criteria and data display through subroutines. Upon completion, learners will be able to explain different types of enquiry routines, identify their execution stages, and create both Build and Conversion routines.

Uploaded by

rubeenarasack123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

1. Welcome to the “Enquiry Routines” learning unit.

This learning unit


will enable you to understand the concept of creating enquiry routines in
T24. You will learn how to create and use Build and Conversion
routines.

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

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

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.

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.

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.

6
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.

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

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

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.

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.

11
Add a debug statement to your routine to understand when the routine
is triggered and how the values in ENQ.DATA get populated. Initially
ENQ.DATA contains only the selection field CATEGORY, its operator
and value entered by the user in ENQ.DATA. Once the routine is run,
you will see that ENQ.DATA is also populated with the selection field
WORKING.BALANCE , the operate RG and the corresponding working
balance range according to the category entered by the user,

12
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.

13
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.

14
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

15
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

16
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).

17
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>

18
As seen in the snapshot, the variable O.DATA, initially holds the officer ID, which is
replaced with the officers Name after execution of the line O.DATA =
R.OFFICER<EB.DAO.NAME>

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

20
Look up the CUSTOMER table for the customer name.

21
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

22
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

23

You might also like