Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 156

Version Routines

Days 5-7 – Sessions 1-4


Introductory Session
Dates
DD/MM/YYYY Technical Courses
Venue
xxxx
Version Routines
Objectives

 Why Version Routines


 Various Types of Version Routines
 Steps to create Version Routines & Error Shots

3 Thesys Training Centre


Session Plan – Day 5

 Session 1
• Introduction & Validation Routine
 Session 2
• Workshop

 Session 3
• Input Routine & Authorisation Routine
 Session 4
• Workshop

4 Thesys Training Centre


Session Plan – Day 6

 Session 1
• Check Record Routine
 Session 2
• ID Routine
 Session 3
• Auto Field Routine
 Session 4
• Workshop

5 Thesys Training Centre


Session Plan – Day 7

 Session 1
• Before Auth Routine & After Unauth Routine
 Session 2
• Version Control
 Session 3
• Updating Local reference fields using routines
 Session 4
• Workshop

6 Thesys Training Centre


Why Version Routines?

 For Additional Validations During


• Generation of ID
• Record Level
• Field Level
• Commit level
• Authorization level
 For Defaulting Values

7 Thesys Training Centre


Common Variables

 ID.NEW
 ID.OLD
 ID.NEW.LAST
 R.NEW
 R.OLD
 R.NEW.LAST
• Available in I_COMMON

8 Thesys Training Centre


ID.NEW

 Common variable defined in I_COMMON


 Dynamic array
 Contains the ID of the currently opened record
 When record is closed/committed/authorised value is flushed

9 Thesys Training Centre


R.NEW

 Common variable defined in I_COMMON


 Dimensioned array
 Contains 500 dynamic arrays
 Holds the currently opened record
 ‘R’ in the variable name stands for ‘Record’

10 Thesys Training Centre


R.NEW

 Definition in I_COMMON : DIM R.NEW(C$SYSDIM)


 C$SYSDIM = 500
 No application in T24 has more than 500 fields

11 Thesys Training Centre


ID.NEW.LAST

 Defined in I_COMMON
 Dynamic array
 For unauthorized record - ID of the unauthorized record is
held

12 Thesys Training Centre


R.NEW.LAST

 Defined in I_COMMON
 Dimensioned array
 Consists of 500 dynamic arrays
 Holds the currently opened record (If the record is
unauthorized)
 Definition in I_COMMON
• DIM R.NEW.LAST(C$SYSDIM)

13 Thesys Training Centre


ID.OLD

 Defined in I_COMMON
 Dynamic array
 For authorized record
• Holds the ID of the authorized record
 Enables to check if the current record is authorized

14 Thesys Training Centre


R.OLD

 Defined in I_COMMON
 Dimensioned array
 Consists of 500 dynamic arrays
 Holds the current authorized record (if any)
 Holds the actual live record (If it exists)
 Definition in I_COMMON
• DIM R.OLD(C$SYSDIM)

15 Thesys Training Centre


COMI

 Global variable
 Defined in I_COMMON file
 Contains the last entered value in any application/version

16 Thesys Training Centre


Types of Version Routines

 Validation Routine
 Input Routine
 Authorization Routine
 Auto Field Routine
 Id Routine
 Check Record Routine
 After unauth Routine
 Before Auth Routine

17 Thesys Training Centre


Validation Routine

 Why Validation routine?


 When Validation Routine is called?
 Where do we Attach the routine?
 Mandatory Prerequisites.
 How to Create Version Routines – Scenario.

18 Thesys Training Centre


Why validation routine?

 To perform Field level validations.


 To perform validation as soon as the data entered.

19 Thesys Training Centre


When Validation Routine is called?
 In the version to which we attach the routine
 When the users comes out of the field for which we have
validated

20 Thesys Training Centre


Where do we Attach the routine?

 Attached to the specific field of the version.


 Field to be validated is specified in Validation.Fld
 Routine used to validate is specified in Validation.Rtn

21 Thesys Training Centre


Mandatory - Prerequisites

 Entry in PGM.FILE
 Entry in EB.API

22 Thesys Training Centre


Scenario

 Create a version for Account with the following fields


• Customer name
• Category

• Currency

 Write a Validation Routine to Validate the Currency as USD.

23 Thesys Training Centre


Write the Validation Routine

24 Thesys Training Centre


Compile and Catalogue

25 Thesys Training Centre


PGM.ENTRY

26 Thesys Training Centre


EB.API

27 Thesys Training Centre


Create the Version

28 Thesys Training Centre


Run the Version

 Attribute is not set to Currency


 Validation Routine is called only on validation

29 Thesys Training Centre


Set the Attribute

30 Thesys Training Centre


Run the Application

 Attribute is set to currency as HOT.VALIDATE


 Routine called immediately after exit from Currency
 Thus becomes field level Validation

31 Thesys Training Centre


HOT.FIELDS Vs HOT.VALIDATE

 In browser field level validations are done when field is


• HOT.FIELD

• HOT.VALIDATE

 Hot fields are shown with a next to them.


 Hot Validates are show with a next to them
 Hot fields can be used to default other field values
 Hot validate can be used for validation only
 When Hot validate is given immediately validation is done for
the other fields too

32 Thesys Training Centre


Hot Field Example

 Create a Version for Account with the following fields


• Customer

• Category

• Currency

• Mnemonic

 Make Customer as hot field. On coming out of customer the


Mnemonic field should be updated as
<CUS><Number of Accounts>

33 Thesys Training Centre


Solution

34 Thesys Training Centre


Solution

35 Thesys Training Centre


PGM.FILE

36 Thesys Training Centre


EB.API

37 Thesys Training Centre


Create version

38 Thesys Training Centre


Create version

39 Thesys Training Centre


Create version

40 Thesys Training Centre


Run the Version

41 Thesys Training Centre


Run the Version

42 Thesys Training Centre


Run the Version

43 Thesys Training Centre


Scenario

 Create a version for the FUNDS TRANSFER application with


the following fields
• Transaction Type
• Debit Account Number
• Debit Currency
• Debit Amount
• Debit Value Date
• Credit Account Number
• Credit Currency

44 Thesys Training Centre


Scenario

 As soon as the Debit account number is entered, Validation


Routine should check whether it is a savings account
otherwise it should throw an error “DEBIT ACCOUNT IS
NOT A SAVINGS ACCOUNT’

45 Thesys Training Centre


Routine

46 Thesys Training Centre


Version

47 Thesys Training Centre


Version

48 Thesys Training Centre


Output

49 Thesys Training Centre


Workshop 2

 Create a version in FT with mandatory fields if the debit


amount is greater than working balance then display error
Message.

50 Thesys Training Centre


Input Routines

 Why Input routine?


 When Input Routine is called?
 Where do we Attach the routine?
 Mandatory Prerequisites.
 How to Create Input Routines – Scenario.

51 Thesys Training Centre


Why Input Routines

 Update local files


 Provide additional validation at input stage
 Provide override processing

52 Thesys Training Centre


When do Input Routines Called

 Gets invoked when committing a transaction


 All validations might have been completed

53 Thesys Training Centre


Where do we attach Input Routine

54 Thesys Training Centre


Mandatory - Prerequisites

 Entry in PGM.FILE
 Entry in EB.API

55 Thesys Training Centre


Scenario

 Create a Version for Funds Transfer version with the


mandatory field. Write an Input routine to check if the
CREDIT CURRENCY and the DEBIT CURRENCY match. If
not an error message, “Credit and Debit currency mismatch”
needs to be displayed when the user commits the record.

56 Thesys Training Centre


Routine

57 Thesys Training Centre


Attach routine to the Version

58 Thesys Training Centre


Validate

59 Thesys Training Centre


Commit

60 Thesys Training Centre


Workshop 1

 Create a version for Account with mandatory fields and the


following validations done in input routine
• Account should be savings
• Customer should be an individual

61 Thesys Training Centre


Routine

62 Thesys Training Centre


Version

63 Thesys Training Centre


Output

64 Thesys Training Centre


Authorisation Routine

 Why Authorisation routine?


 When Authorisation Routine is called?
 Where do we Attach the routine?
 Mandatory Prerequisites.
 How to Create Authorisation Routines – Scenario.

65 Thesys Training Centre


Why Authorisation routine
 To update local files
 To provide additional validation at authorization stage
 To provide override processing

66 Thesys Training Centre


When Authorisation Routine is Called

 Time of Authorisation of Transaction


 After Field level validations.
 After standard default processing is done.

67 Thesys Training Centre


Where do we attach the Routine

68 Thesys Training Centre


How to create Authorisation Routines -
Scenario
 Once a record in a version of the FUNDS.TRANSFER application
is authorised, details from the transaction need to be extracted and
written on to a flat file named TRG.FT.DATA for interface
purposes.
 ID of the record in the flat file needs to be the FT id
 Following field’s values need to be stored in the flat file all
delimited with a single space
 Credit Account Number
 Debit Account Number
 Value Date
 Debit Amount
 Debit Currency

69 Thesys Training Centre


Solution

 Creates a Sequential File


 File created for updation

70 Thesys Training Centre


Routine

71 Thesys Training Centre


Compile and Catalogue

72 Thesys Training Centre


Create the Version

73 Thesys Training Centre


Commit the Version

74 Thesys Training Centre


Value in TRG.FT.INTERFACE

75 Thesys Training Centre


Workshop 1

  Create version for Account application and input a record


using the version.
 When the record is authorised using the version it has to
check for
• If the Currency is USD or GBP then Nationality or residence of
the customer should be US
• Else
it should display a error message “WRONG CURRENCY
ENTERED FOR THIS CUSTOMER”

76 Thesys Training Centre


Solution

77 Thesys Training Centre


Attach the routine

78 Thesys Training Centre


Authorise

79 Thesys Training Centre


Scenario

 What happens if no of authorisers is two


• First Authorisation will not call authorisation routine
• Its called during Second authorisation

80 Thesys Training Centre


Second Authorisation

81 Thesys Training Centre


After First Authorisation

82 Thesys Training Centre


Error Handling

 Should include Override-1 field in the Version

83 Thesys Training Centre


Error Handling

84 Thesys Training Centre


Auto Field Routine

 Why Auto field routine?


 When auto field Routine is called?
 Where do we Attach the routine?
 Mandatory Prerequisites.
 How to Create Auto field Routines – Scenario.

85 Thesys Training Centre


Why AutoField Routine

 To perform any special editing to a record.


 To modify the record as soon as id is fetched.

86 Thesys Training Centre


When Autofield Routine is called?

 After id of the record is input.


 After record is fetched
 Before it is displayed.

87 Thesys Training Centre


Mandatory - Prerequisites

 Entry in PGM.FILE
 Entry in EB.API

88 Thesys Training Centre


Where do we Attach the routine

 To the field Auto New Content

89 Thesys Training Centre


How to Attach routines- Scenario

 Create a Version for Account which mandates the account


officer to 1 if the sector is 1001 or else 2

90 Thesys Training Centre


Routine

91 Thesys Training Centre


Attach the Routine

92 Thesys Training Centre


Run the Version

93 Thesys Training Centre


Workshop

 Create an FT version which displays value date to be 1st


January of the current year.

94 Thesys Training Centre


ID Routine

 Why ID routine?
 When ID Routine is called?
 Where do we Attach the routine?
 Mandatory Prerequisites.
 How to Create ID Routines – Scenario.

95 Thesys Training Centre


Why ID Routine?

 To manipulate the id of the record.

96 Thesys Training Centre


When is it called

 As soon as id of the record is entered


 Before fetching the Record

97 Thesys Training Centre


Where do we attach routine

 In the version Application


 Id routine field.

98 Thesys Training Centre


Mandatory Prerequisites

 Entry in PGM.FILE
 Entry in EB.API

99 Thesys Training Centre


How to attach the routine - Scenario

 Create a version for the Enquiry application with all the


mandatory fields
 Create subroutine that will get executed as soon as the id of
an enquiry is entered and prefixes the id of the enquiry with
‘THE.TRG’ provided it is not a %Enquiry or an Enquiry-List.

100 Thesys Training Centre


Routine

101 Thesys Training Centre


Create Version and attach routine

102 Thesys Training Centre


Run the version

103 Thesys Training Centre


WorkShop 1

 Create a version for acct application when a new Account is


created, check if the 3rd and last digit does not have the
same no. if the nos. are same then increment the no. by
one.

104 Thesys Training Centre


Routine

105 Thesys Training Centre


Attach the routine

106 Thesys Training Centre


Output

107 Thesys Training Centre


Workshops

 Write a version routine that will check and not allow ID nos.
less than auto generated FT ID for the new FT.
 Create a version for customer application when a new
customer is created and an ID is given it should be prefixed
with 'CU'.

108 Thesys Training Centre


Check Record Routine

 Why Check Record routine?


 When Check Record Routine is called?
 Where do we Attach the routine?
 Mandatory Prerequisites.
 How to Create Check Record Routines – Scenario

109 Thesys Training Centre


Why Check Record Routine

 To alter field attributes.


 Alteration to be done after validation id.

110 Thesys Training Centre


When Check Record Routine is Called

 After the ID is supplied and validated.


 Get invoked with the following functions being performed
• I(Input)
• D(Delete)
• A(Authorise)
• R(Reverse)

111 Thesys Training Centre


Where do we attach the routines?

 Attached to the field CHECK.REC.RTN

112 Thesys Training Centre


How to attach Routine

 Write a subroutine that will restrict any user trying to open a


Live Customer Record which was not input and authorised
by him and will display an error message “Access
Restricted”

113 Thesys Training Centre


Routine

114 Thesys Training Centre


Routine

115 Thesys Training Centre


Attach the routine

116 Thesys Training Centre


Run the Version

117 Thesys Training Centre


Workshop

 Write a version routine for the Account to decrease amount


by 5 if account is not opened by inputter or authoriser.

118 Thesys Training Centre


AfterUnauth routine

 Why AfterUnauth routine?


 When AfterUnauth Routine is called?
 Where do we Attach the routine?
 Mandatory Prerequisites.
 How to Create AfterUnauth Routines – Scenario

119 Thesys Training Centre


Why AfterUnauth

 To perform any operation after Input Routine


 After Committing the record.
 Without affecting the existing record

120 Thesys Training Centre


When is it called?

 While Committing a new/existing record


 After the record been written into the $NAU file.

121 Thesys Training Centre


Where do we attach routine

122 Thesys Training Centre


How do we attach- Scenario

 When a transaction is committed using a version of the FT


application, the user should be taken to another version in
order to input the charges (if any).

123 Thesys Training Centre


Mandatory Prerequisites

 Entry in PGM.FILE
 Entry in EB.API

124 Thesys Training Centre


PGM.VERSION

 Common variable
 Defined in I_COMMON
 Contains the name of the currently opened version.
• Example : CUSTOMER,INPUT

– APPLICATION : CUSTOMER
– PGM.VERSION :,INPUT

125 Thesys Training Centre


INPUT.BUFFER

 Common variable.
 Defined in I_COMMON
 Any input that a user wishes to execute from the command
line.
• Example

– INPUT.BUFFER = C.U:”CUSTOMER I” : C.F


– C.U : Ctrl U Enter -> will go to the command line
– C.F : Ctrl F Enter(F3) -> Used to obtain a new id

126 Thesys Training Centre


V$FUNCTION

 Common variable.
 Defined in I_COMMON
 Contains the function that is being currently chosen by the
user.

127 Thesys Training Centre


Routine – Reflection Mode

128 Thesys Training Centre


Attach the Routine

129 Thesys Training Centre


Execute the version – Reflection Mode

130 Thesys Training Centre


After Commit – Reflection Mode

131 Thesys Training Centre


Routine – Browser Mode

132 Thesys Training Centre


Attach the Routine

133 Thesys Training Centre


Execute the version

134 Thesys Training Centre


Commit

135 Thesys Training Centre


Workshop

 Create a version for Account as soon as a new Account is


created a teller version is called to deposit LCY amount

136 Thesys Training Centre


BeforeAuth Routine

 Why BeforeAuth routine?


 When BeforeAuth Routine is called?
 Where do we Attach the routine?
 Mandatory Prerequisites.
 How to Create BeforeAuth Routines – Scenario

137 Thesys Training Centre


Why Before Auth

 To Perform Any operation after Commit


 To perform Operation before Authorise

138 Thesys Training Centre


When BeforeAuth is called?

 During authorization of an INAU record.


 Called before Version Auth routine is executed.
 Before.Auth – Before F.WRITE.
 Changes made to R.NEW will reflect in the record written
AUTH routine – After F.WRITE

139 Thesys Training Centre


Where to Attach the Routine?

 BeforeAuth Rtn.1 field of the Version

140 Thesys Training Centre


Mandatory Prerequisites

 Entry in PGM.FILE
 Entry in EB.API

141 Thesys Training Centre


How to Attach Routines - Scenario

 While authorizing a customer record, the user should be


given the option to fill in any special comments with the
customer record like “Special Customer”.
 Write a routine that will prompt the user to enter free text
while authorizing a customer record.
 Once the text is entered by the user, the data needs to be
updated in the field TEXT in the Customer application.
 If no text is entered by the user then the message “No text
entered. Proceeding with other processing” should be
displayed and the record should get authorized.

142 Thesys Training Centre


Routine

143 Thesys Training Centre


Attach the routine

144 Thesys Training Centre


Attach the routine

145 Thesys Training Centre


Workshop

 Write a routine for an FT version such that


• if
the debit Currency is a foreign currency then debit amount is
converted to local currency equivalent
• and currency should be changed to local currency.

146 Thesys Training Centre


Version Control

 Why Version Control?


 Features of VERSION.CONTROL.
 Fields in VERSION.CONTROL.
 Fields that would be affected by VERSION.CONTROL

147 Thesys Training Centre


Why VERSION.CONTROL?

 To make a subroutine available to set of Versions


 To make a subroutine available to the Application

148 Thesys Training Centre


Features of the VERSION.CONTROL

 Can attach subroutines to application level.


 To execute these subroutine
• EXC.INC.RTN is yes for Versions
 Id of the VERSION.CONTROL
• APPLICATION NAME
• APPLICATION NAME,VERSIONTYPE
 Subroutine at version level have higher priority over
VERSION.CONTROL level

149 Thesys Training Centre


Fields in VERSION.CONTROL

150 Thesys Training Centre


Fields that have impact in Version

 EXC.INC.RTN
• ‘Yes’
– Routines specified in VERSION.CONTRL will be
invoked.
• ‘No’ or ‘Blank’ – Routines wont be invoked.
 VERSION.TYPE
• Id of the VERSION.CONTROL application

151 Thesys Training Centre


Example

 Create a record in the VERSION CONTROL to update the


currency field in the Account application with type TRG to
local currency

152 Thesys Training Centre


Routine

153 Thesys Training Centre


Attach to ACCOUNT,TRG of
Version.control

154 Thesys Training Centre


Version linked with Version.control

155 Thesys Training Centre


All product names and other company names used herein are for identification purposes only and may be
trademarks or registered trademarks of their respective owners. Errors and omissions excepted,
all specifications are subject to change without notice.

© 2009 Thesys Technologies Incorporated. All rights reserved.

FOR MORE INFORMATION


Visit : www.thesys.co.in
email : marketing@thesys.co.in

You might also like