ITSS - Workshop.Exercise01 PT02

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 12

ITSS Workshop Document

Workshop Name: Programming


Workshop Result Document

Document History:
Date Author Status Comments
04-May-2020 Susmitha Initial Initial Draft
05-MAY-2020 Susmitha Input Added scenarios 2 to 5
ITSS Workshop Document

Scope:
This document will help to understand the various functionality of programing workshop with different business logics
in T24.
Workshop Result:
Scenario1:
Develop a routine to calculate charge for the following condition
Calculate a special charge for CUSTOMER with SECTOR EQ 1001 and CUSTOMER.RATING as AA. Charge 5% if the
customer rating is AAA then WAIVE all his CHARGES while doing a payment transaction in FUNDS.TRANSFER while
doing OT transaction
Case1:
On By writing single thread routine and by running batch and service
Result:
Charge calculation will be takes place for the OT type of FT transaction according to the given condition. i.e If the
customer rating is AA charge is 5 % and If the customer rating is AAA then all the charges will be waived for that
ITSS Workshop Document
customer in FT transaction.
Observation:
As we have to calculate the charges for FT, that we are doing at the time of Input. So at the time of input we will
calculate the charges.
Detail Steps:
Step1: Writing a routine to get the version name and we will default that values to local reference fields in all
applications where we have attached

$PACKAGE EB.PT02SK
SUBROUTINE PT02.CHARGE.CALCULATION
$USING EB.API
$USING EB.SystemTables
$USING EB.DataAccess
$USING ST.Customer
$USING FT.Contract
FN.CUSTOMER= "F.CUSTOMER"
FV.CUSTOMER=""
EB.DataAccess.Opf(FN.CUSTOMER,FV.CUSTOMER)
FN.FT="F.FUNDS.TRANSFER"
FV.FT=""
EB.DataAccess.Opf(FN.FT,FV.FT)
TRANSACTION.TYPE=EB.SystemTables.getRNew(FT.Contract.FundsTransfer.TransactionType)
IF TRANSACTION.TYPE EQ "OT" THEN
Y.DEBIT.CUSTOMER
=EB.SystemTables.getRNew(FT.Contract.FundsTransfer.DebitCustomer)
EB.DataAccess.FRead(FN.CUSTOMER,Y.DEBIT.CUSTOMER,R.CUSTOMER,FV.CUSTOMER,CUS.ERR)
Y.CUS.RATING = R.CUSTOMER<ST.Customer.Customer.EbCusCustomerRating>
Y.CUS.SECTOR = R.CUSTOMER<ST.Customer.Customer.EbCusSector>

IF Y.CUS.RATING EQ "AA" AND Y.CUS.SECTOR EQ "1001" THEN


Y.AMOUNT=
EB.SystemTables.getRNew(FT.Contract.FundsTransfer.DebitAmount)
CHARGE.PERCENT = (Y.AMOUNT)*5/100

EB.SystemTables.setRNew(FT.Contract.FundsTransfer.ChargeAmt,CHARGE.PERCENT)
END
ELSE
IF Y.CUS.RATING EQ "AAA" THEN
EB.SystemTables.setRNew(FT.Contract.FundsTransfer.ChargeAmt,"")
END
END
RETURN
END
Step2: we will create EB.API for the routine.

EB.API………….. PT02.CHARGE.CALCULATION
--------------------------------------------
1.1 GB.DESCRPTION: EB.API for auth routine
ITSS Workshop Document
2.PROTECTION.LEVEL.. NONE
3.SOURCE.TYPE.. BASIC
Step3: Creating VERSION.CONTROL and attaching routine as auth routine.
VERSION.CONTROL, I FUNDS.TRANSFER
Field Name1………………………..
Validation Rtn.1
Input Rtn PT02.CHARGE.CALCULATION
Auth Rtn
Non Version Run Y
Language Code
Bussiness Day
Curr NO
Inputter
Date Time
Authoriser
Co Code
Step4: We have attached the routine as input routine so at the time of each FT transaction, the charge will be
calculated according to given condition.
Step5: As we have attached in version control it will execute all the routines for versions which are having Inc Exc Rtn
as Y and Non Version Run as Y.

Scenario2:
Write a PRE.BATCH.RTN and attach in SPF
This routine should check for all INAU or INA2 transactions across all Transaction applications and create a report in
&SAVEDLISTS&. Also it should check if there are USERS still logged in T24 by checking F.OS.TOKEN and create a report.
Case1:
On By writing single thread routine and attaching that routine in SPF to Pre.Batch.Rount field.
Result:
The report will be created in &SAVEDLISTS& with all INAU or INA2 transactions across all Transaction applications and
also another report will be created if there are USERS still logged in T24 by checking F.OS.TOKEN application.
Observation:
F.OS.TOKEN is an application which will contain all the users list who are logged in T24.This application will remove the
user id from that if the user is logged out or user reaches timeout minutes.
Detail Steps:
Step1: Writing a routine to create reports for all the logged in users before cob, and also for creating report for INAU,
INA2 records of FT.

$PACKAGE EB.PT02SK
SUBROUTINE PT02.PRE.BATCH.RTN
$USING EB.API
$USING EB.SystemTables
$USING EB.DataAccess
$USING EB.Security
$USING FT.Contract
ITSS Workshop Document
GOSUB WRITING.FILES
GOSUB INIT.PARA
GOSUB PROCESS.PARA
RETURN
INIT.PARA:
FN.OS.TOKEN = "F.OS.TOKEN"
FV.OS.TOKEN =""
EB.DataAccess.Opf(FN.OS.TOKEN,FV.OS.TOKEN)
FN.FT="F.FUNDS.TRANSFER"
FV.FT=""
EB.DataAccess.Opf(FN.FT,FV.FT)
Y.DIR = "./PT02.BP"
RETURN
WRITING.FILES:
OPENSEQ Y.DIR,Y.FILENAME TO Y.SEQ ELSE
CREATE Y.SEQ ELSE
CRT"Cannot open file"
STOP
END
END
CRT"File Successfully opened"
WRITESEQ Y.ARRAY APPEND TO Y.SEQ ELSE
CRT "Cannot write file"
END
CLOSESEQ Y.SEQ
RETURN
PROCESS.PARA:
SEL.CMD ="SELECT ": FN.OS.TOKEN
SEL.LIST=""
S.COUNT=""
S.ERR=""
EB.DataAccess.Readlist(SEL.CMD,SEL.LIST,"",S.COUNT,S.ERR)
IF S.COUNT NE "0" THEN
LOOP
REMOVE OS.TOKENID FROM SEL.LIST SETTING POS
WHILE OS.TOKENID : POS DO

EB.DataAccess.FRead(FN.OS.TOKEN,OS.TOKENID,R.OS.TOKEN,FV.OS.TOKEN,OS.TOKEN.ERR)
Y.USERID = R.OS.TOKEN<EB.Security.OsToken.OsTkUserId>
Y.USER.STATUS = R.OS.TOKEN<EB.Security.OsToken.OsTkStatus>
Y.USER.COMPANY = R.OS.TOKEN<EB.Security.OsToken.OsTkCompany>
Y.ARR1<-1> =
OS.TOKENID:",":Y.USERID:",":Y.USER.STATUS:",":Y.USER.COMPANY
Y.ARRAY = Y.ARR1
Y.FILENAME ="&ACTIVEUSERS&"
GOSUB WRITING.FILES
REPEAT
END
SEL.COM ="SELECT ": FN.FT :" WITH RECORD STATUS EQ INAU INA2 "
ITSS Workshop Document
SEL.LIST=""
S.COUNT=""
S.ERR=""
EB.DataAccess.Readlist(SEL.COM,S.LIST,"",S.FT.COUNT,S.FT.ERR)
LOOP
REMOVE FT.ID FROM S.LIST SETTING SEL.POS
WHILE FT.ID : SEL.POS DO
EB.DataAccess.FRead(FN.FT,FT.ID,R.FT,FV.FT,FT.ERR)
Y.AMOUNT = R.FT<FT.Contract.FundsTransfer.DebitAmount>
Y.RECORD.STATUS = R.FT<FT.Contract.FundsTransfer.RecordStatus>
Y.DB.ACCT = R.FT<FT.Contract.FundsTransfer.DebitAcctNo>
Y.CR.ACCT = R.FT<FT.Contract.FundsTransfer.CreditAcctNo>
Y.TRANS.TYPE = R.FT<FT.Contract.FundsTransfer.TransactionType>
Y.DATETIME = R.FT<FT.Contract.FundsTransfer.DateTime>
Y.ARR2= FT.ID:",":Y.AMOUNT:",":Y.DB.ACCT:",":Y.CR.ACCT:",":Y.TRANS.TYPE:
",":Y.DATETIME
Y.ARRAY = Y.ARR2
Y.FILENAME ="&SAVEDLIST&"
GOSUB WRITING.FILES
REPEAT
RETURN
END
Step2:The routine that if we want to attach as pre batch routine in SPF that routine should have entry in PGM.FILE
with S type.
Step3: Create a PGM.FILE records for all the required routine.
PGM.FILE...........PT02.PRE.BATCH.RTN
----------------------------------------------------
1 TYPE.............. S
2. 1 GB SCREEN.TITLE
3 ADDITIONAL.INFO...
4. 1 BATCH.JOB...... @PT02.PRE.BATCH.RTN
5 PRODUCT........... EB

Step4: Attaching the routine to Pre Batch Routine field in SPF record.
SPF……………….. SYSTEM
--------------------------------------------
1.Pre Batch Rout1 PT02.PRE.BATCH.RTN
2.Active User batch
3.No of Retries
4.Password Roll Over Freq

Step5: Pre batch routine field will allow user to add subroutine or enquiry or API call. And that will run or create
reports at pre batch stage.
Step6: Before Cob starts this routine will trigger and the reports for the transaction details of INAU and INA2 status
records and the users logged in t24 will be created according to the given condition.
ITSS Workshop Document
Scenario3:
Need to capture VERSION.NAME by using which a USER has inputted and authorized a record. Create a parameter
table and configure for all the application this routine should trigger at INPUT level and AUTHORISE level. For example
if the user configures FUNDS.TRANSFER, PAYMENT.ORDER, TELLER etc then the routine should capture INPUT version
name and AUTH version name and update in TWO local reference fields in the same application. so create two
LOCAL.REF call INP.VERSION and AUTH.VERSION and attach in all applications which are configured in the parameter
you create above. Note: The routine you develop should not be attached at VERSION level.
Case1:
By using the Parameter table to attach local fields for all applications.
Result:
Two local fields in all applications what we have attached i. e INP.VERSION and AUTH.VERSION Into that fields we will
default the input version name and auth version name by capturing version name.
Observation:
While getting the VERSION names we have to check the used functions on the versions like Input or Authorise
Detail Steps:
Step1: For all the application we have to add 2 local fields called INP.VERSION and AUTH.VERSION.
Step2: Writing a routine to get the version name and we will default that values to local reference fields in all
application where we have attached.

$PACKAGE EB.PT02SK
SUBROUTINE PT02.CAPTURE.INP.AUTH.VERSIONNAME.IN.LF
$USING EB.API
$USING EB.SystemTables
$USING EB.DataAccess
$USING EB.Updates
$USING EB.Display
APP.NAME = EB.SystemTables.getApplication()
VERSION.NAME = EB.SystemTables.getPgmVersion()
V.FUNCTION = EB.SystemTables.getVFunction()
Y.FIELDS = "INP.VERSION" :@VM : "AUTH.VERSION"
EB.Updates.MultiGetLocRef(APP.NAME, Y.FIELDS, FIELDS.POS)
INP.VERSION.POS = FIELDS.POS<1,1>
IF INP.VERSION.POS EQ “” THEN
END
AUTH.VERSION.POS = FIELDS.POS<1,2>
IF V.FUNCTION EQ "I" THEN
R.ARR1<1,INP.VERSION.POS> = VERSION.NAME
END
IF V.FUNCTION EQ "A" THEN
R.ARR1<1,AUTH.VERSION.POS> = VERSION.NAME
END
RETURN
END
Step3: Routine we will attach in version. control application to validation Rtn fields , as we should not attach that into
version level.
Step4:Creating EB.API entry for the required routine
ITSS Workshop Document
EB.API.. PT02.CAPTURE.INP.AUTH.VERSIONNAME.IN.LF
-----------------------------------------------
1.1 GB.DESCRPTION EB.API for auth and validation routine
2.PROTECTION.LEVEL NONE
3.SOURCE.TYPE…… BASIC

Step5: Creating VERSION.CONTROL and attaching routine as validation routine for all applications. Here I am attaching
to Funds Transfer.
VERSION.CONTROL, I FUNDS.TRANSFER
Field Name1………………………..
Validation Rtn.1 PT02.CAPTURE.INP.AUTH.VERSIONNAME.IN.LF
Input Rtn
Auth Rtn PT02.CAPTURE.INP.AUTH.VERSIONNAME.IN.LF
Non Version Run Y
Language Code
Bussiness Day
Curr NO
Inputter
Date Time
Authoriser
Co Code
Step6: All the authorized versions will be updated to the field AUTH.VERSION field and all input version names will be
updated to the field INP.VERSION in all applications

Scenario4:
write a routine for CHECKDIGIT calculation
Account number format should be CUSTOMER.NUMBER+SEQ.NO+CURRENCY.CODE+BRANCH code and in total it
should 16 Digits in len , the routine should validate the format and give error messsages accordingly.
The customer account number should be only in numeric.
SEQ.NO - Should be calculated based on the number of accounts exists for the
CUSTOMER in total and SEQ.NO = TOTAL.NUMBER.ACCOUNTS + 1. max should be 99 accounts per customer allowed
CURRENCY.CODE - Should be a 2 digit numeric code
BRANCH code - should be 3 digits taken from INTERCO.PARAMETER setup or from COMPANY table
Case1:
Writing a routine for checking ID length of account application and conditions for the ID of the account
Result:
Error will rise if the account ID is not in 16 digit length, and all 16 digits should be numeric. And that 16 digits id should
contain customer id , currency code , branch code as given in the scenario.
Observation:
As this routine should trigger for account application we are attaching this in version.control as ID routine.
Detail Steps:
Step1: Writing a routine to give condition for the account application ID and for rising error if it is not satisfying the
required condition.
ITSS Workshop Document
$PACKAGE EB.PT02SK
SUBROUTINE PT02.ID.CONDITION.CHECK
$USING EB.API
$USING EB.SystemTables
$USING ST.Customer
$USING AC.AccountOpening
$USING EB.DataAccess
$USING ST.CurrencyConfig
$USING ST.CompanyCreation
FN.COMPANY="F.COMPANY"
FV.COMPANY=""
EB.DataAccess.Opf(FN.COMPANY,FV.COMPANY)
FN.CUSTOMER = "F.CUSTOMER"
FV.CUSTOMER = ""
EB.DataAccess.Opf(FN.CUSTOMER, FV.CUSTOMER)
FN.ACCOUNT= "F.ACCOUNT"
FV.ACCOUNT = ""
EB.DataAccess.Opf(FN.ACCOUNT,FV.ACCOUNT)
FN.CA= "F.CUSTOMER.ACCOUNT"
FV.CA = ""
EB.DataAccess.Opf(FN.CA,FV.CA)
FN.CCY="F.CURRENCY"
FV.CCY=""
EB.DataAccess.Opf(FN.CCY,FV.CCY)
SEL.LIST=""
SEL.ERR=""
S.COUNT=""
CUSTMER.NO=""
SEL.CMD="SELECT ": FN.CUSTOMER
EB.DataAccess.Readlist(SEL.CMD,SEL.LIST ,"",S.COUNT,SEL.ERR)

LOOP
REMOVE CUSTMER.NO FROM SEL.LIST SETTING SEL.POS
EB.DataAccess.FRead(FN.CUSTOMER,CUSTMER.NO,R.CUSTOMEROMER,FV.CUSTOMER,R.ERR)
EB.DataAccess.FRead(FN.CA,CUSTMER.NO,R.CA,FV.CA,CAC.ERR)
Y.ACCOUNT.COUNT=DCOUNT(R.CA,@FM)
IF Y.ACCOUNT.COUNT LE "99" THEN
SEQ.NO=Y.ACCOUNT.COUNT+ "1"
END
FOR J=1 TO Y.ACCOUNT.COUNT
Y.ACCOUNT.NO=R.CA <J>
R.ACCOUNT=""
ACT.ERR=""
EB.DataAccess.FRead(FN.ACCOUNT,Y.ACCOUNT.NO,R.ACCOUNT,FV.ACCOUNT,ACT.ERR)
Y.CURRENCY=R.ACCOUNT<AC.AccountOpening.Account.Currency>
Y.CO.CODE=R.ACCOUNT<AC.AccountOpening.Account.CoCode>
EB.DataAccess.FRead(FN.CCY,Y.CURRENCY,R.CCY,FV.CCY,CCY.ERR)
Y.CCY.CODE=R.CCY<ST.CurrencyConfig.Currency.EbCurNumericCcyCode>
ITSS Workshop Document
CURRENCY.CODE=Y.CCY.CODE[1,2]

EB.DataAccess.FRead(FN.COMPANY,Y.CO.CODE,R.COMPANY,FV.COMPANY,COMPANY.ERR)

Y.INTERCO.PARA=R.COMPANY<ST.CompanyCreation.IntercoParameter.IcpBranchCode>
Y.DIGIT="00"
Y.BRANCH.CODE=Y.INTERCO.PARA:Y.DIGIT
Y.ACCOUNT.ID=CUSTMER.NO:SEQ.NO:CURRENCY.CODE:Y.BRANCH.CODE
ACCOUNT.ID=EB.SystemTables.getComi()
Y.NUMERIC=ISDIGIT(ACCOUNT.ID)
IF LEN(ACCOUNT.ID) NE "16" AND ACCOUNT.ID NE Y.ACCOUNT.ID AND
Y.NUMERIC NE "0" THEN
EB.SystemTables.setE("Account number should be only in numeric
and it should be
16 digits in length and also should be in
the format")
END
NEXT J
REPEAT
RETURN
END
Step2: This Routine we will attach in version. control application to Id Rtn field, as we should not attach that into
version level. Since it should trigger for bare application.

Step3: Creating EB.API entry for the required routine


EB.API.. PT02.ID.CONDITION.CHECK
-----------------------------------------------
1.1 GB.DESCRPTION EB.API for ID routine
2.PROTECTION.LEVEL NONE
3.SOURCE.TYPE…… BASIC

Step4: Creating VERSION.CONTROL and attaching routine as auth routine.


VERSION.CONTROL, I ACCOUNT
Field Name1………………………..
Validation Rtn.1
Id Rtn PT02.ID.CONDITION.CHECK
Input Rtn
Auth Rtn
Non Version Run Y
Language Code
Bussiness Day
Curr NO
Inputter
Date Time
Authoriser
Co Code
Step5: If the account ID is not satisfying the condition required condition given in the scenario then error will come as
we have given in the above.
ITSS Workshop Document

Scenario5:
Create CHECK.REC.RTN for all ACCOUNT versions and populate the following fields based on the CUSTOMER
since iD of the ACCOUNT will have CUSTOMER number, read CUSTOMER and populate ADDRESSS, NAME,
CUSTOMER.NO and other information available from CUSTOMER to ACCOUNT screen
Case1:
Writing a routine to populate customer data in account screen by taking the customer from the account ID.
Result:
In Account application related customer details will be populate ADDRESSS, NAME, CUSTOMER.NO and other
information available from CUSTOMER to ACCOUNT screen.
Observation:
As we have to populate the fields of customer details to the account application we are attaching this to the Check Rec
Routine field in version control for account application.
Detail Steps:
Step1: we have to create local fields to populate customer details to account application and we have to add that to
account application.
Step2: Writing a routine to populate customer details like Customer NO, Address, Name.

$PACKAGE EB.PT02SK
SUBROUTINE PT02.CHECK.REC.RTN
$USING EB.SystemTables
$USING EB.API
$USING EB.DataAccess
$USING ST.Customer
$USING AC.AccountOpening
$USING EB.Updates
FN.ACCOUNT ='F.ACCOUNT'
FV.ACCOUNT =''
EB.DataAccess.Opf(FN.ACCOUNT,FV.ACCOUNT)
FN.CUSTOMER = "F.CUSTOMER"
FV.CUSTOMER = ""
EB.DataAccess.Opf(FN.CUSTOMER,FV.CUSTOMER)
ACCOUNT.ID = EB.SystemTables.getIdT()
CUSTOMER.ID = EB.SystemTablesgetRNew(AC.AccountOpening.Account.Customer)

EB.DataAccess.FRead(FN.CUSTOMER,CUSTOMER.ID,R.CUSTOMER,FV.CUSTOMER,CUSTOMER.ERR)
CUS.SECTOR = R.CUSTOMER<ST.Customer.Customer.EbCusSector>
CUS.ADDRESS = R.CUSTOMER<ST.Customer.Customer.EbCusAddress>
CUS.LANG.CODE = R.CUSTOMER<ST.Customer.Customer.EbCusLanguage>
CUS.MNEMONIC = R.CUSTOMER<ST.Customer.Customer.EbCusMnemonic>
APP = "ACCOUNT"
LOC.FIELDS = "CUS.ADDRESS":@VM:"CUS.SECTOR":@VM:"CUS.LANG.CODE"
EB.Updates.MultiGetLocRef(APP,LOC.FIELDS,POS)
Y.CUS.ADDDRESS.POS = POS<1,1>
Y.CUS.SECTOR.POS = POS<1,2>
ITSS Workshop Document
Y.CUS.LANG.CODE.POS= POS<1,3>
tmp<1,Y.CUS.SECTOR.POS> =CUS.SECTOR
EB.SystemTables.setRNew(AC.AccountOpening.Account.LocalRef,tmp)
tmp2<1,Y.CUS.LANG.CODE.POS>=CUS.LANG.CODE
EB.SystemTables.setRNew(AC.AccountOpening.Account.LocalRef,tmp2)
tmp3<1,Y.CUS.ADDDRESS.POS>= CUS.ADDRESS
EB.SystemTables.setRNew(AC.AccountOpening.Account.LocalRef,temp3)
EB.SystemTables.setRNew(AC.AccountOpening.Account.Mnemonic,CUS.MNEMONIC)
RETURN
END
Step3: Routine we will attach in version. control application to Check Rec Rtn field, as we should not attach that into
version level. Since it should trigger for bare application.

Step4:Creating EB.API entry for the required routine


EB.API.. PT02.CHECK.REC.RTN
-----------------------------------------------
1.1 GB.DESCRPTION EB.API for Check rec routine
2.PROTECTION.LEVEL NONE
3.SOURCE.TYPE…… BASIC

Step5: Creating VERSION.CONTROL and attaching routine as Check Rec Routine.


VERSION.CONTROL, I ACCOUNT
Field Name1………………………..
Validation Rtn.1
Id Rtn
Input Rtn
Auth Rtn
Chech Rec Routine1 PT02.CHECK.REC.RTN
Non Version Run Y
Language Code
Bussiness Day
Curr NO
Inputter
Date Time
Authoriser
Co Code
Step6: For all the account records the related customer details like NAME, CUSTOMER ADDRESS will be default to the
related fields in accounts what we have attached.

You might also like