ITSS - Workshop.Exercise01 PT12
ITSS - Workshop.Exercise01 PT12
Document History:
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:
Write a routine to set theCalculate 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
Result:
The charges are applied to the customer during the payment transaction in FT through OT.
Observation:
If the sector is 1001 and the customer rating is AA the special charges are applied and if the customer rating is AAA
5% of charges are applied for the payment transaction in FT through FT.
Detail Steps:
Step1: Write a routine to set theCalculate 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
$PACKAGE EB.PT12SINDHU
SUBROUTINE PT12.CUS.PAYMENT.CHARGES
*--------------------------------------------------------------------------
--
$USING EB.SystemTables
$USING EB.API
$USING EB.DataAccess
$USING FT.Contract
$USING ST.Customer
*--------------------------------------------------------------------------
--
FN.FT ="F.FUNDS.TRANSFER"
FV.FT =""
EB.DataAccess.Opf(FN.FT,FV.FT)
FN.CUSTOMER="F.CUSTOMER"
FV.CUSTOMER=""
EB.DataAccess.Opf(FN.CUSTOMER,FV.CUSTOMER)
*--------------------------------------------------------------------------
--
TRANSACTIONTYPE=EB.SystemTables.getRNew(FT.Contract.FundsTransfer.Transacti
onType)
IF TRANSACTIONTYPE EQ "OT" THEN
DEBIT.CUSTOMER=EB.SystemTables.getRNew(FT.Contract.FundsTransfer.DebitCusto
mer)
ITSS WORKSHOP DOCUMENT
DEBIT.AMOUNT=EB.SystemTables.getRNew(FT.Contract.FundsTransfer.DebitAmount)
EB.DataAccess.FRead(FN.CUSTOMER,DEBIT.CUSTOMER,R.CUSTOMER,FV.CUSTOMER,R.ERR
)
CUS.RATING=R.CUSTOMER<ST.Customer.Customer.EbCusCustomerRating>
CUS.SECTOR=R.CUSTOMER<ST.Customer.Customer.EbCusSector>
IF CUS.SECTOR EQ "1001" AND CUS.RATING EQ "AA" THEN
EB.SystemTables.setRNew(FT.Contract.FundsTransfer.ChargeAmt,"")
END
IF CUS.SECTOR EQ "1001" AND CUS.RATING EQ "AAA" THEN
CHARGES.RATE = (DEBIT.AMOUNT)*(5/100)
EB.SystemTables.setRNew(FT.Contract.FundsTransfer.ChargeAmt,CHARGES.RATE)
END
END
*--------------------------------------------------------------------------
--
RETURN
END
EB.API........... PT12.CUS.PAYMENT.CHARGES
---------------------------------------------------------------------------
--
1. 1 GB DESCRIPTION.
2 PROTECTION.LEVEL.. NONE
3SOURCE.TYPE....... BASIC
Step3: Create a version for the FT application with all the mandatory fields and local reference field.
VERSION........... FT,PT12.CUS.CHARGE
---------------------------------------------------------------------------
--
1 PRINT.ONLY........
2 RECORDS.PER.PAGE.. 1
3 FIELDS.PER.LINE... 1
4. 1 LANGUAGE.CODE.. TRANSACTION.TYPE
13. 1 FIELD.NO....... 1
14. 1 COLUMN......... 1
15. 1 EXPANSION......
16. 1 TEXT.CHAR.MAX.. 15
17. 1. 1 TEXT........ TransType
4. 2 LANGUAGE.CODE.. DEBIT.ACCT.NO
13. 2 FIELD.NO....... 1
14. 2 COLUMN......... 1
15. 2 EXPANSION......
16. 2 TEXT.CHAR.MAX.. 15
17. 1. 2 TEXT........ DebitAcc
4. 3 LANGUAGE.CODE.. DEBIT.CURRENCY
13. 3 FIELD.NO....... 1
14. 3 COLUMN......... 1
15. 3 EXPANSION......
16. 3 TEXT.CHAR.MAX.. 15
17. 1. 3 TEXT........ DebitCcy
4. 4 LANGUAGE.CODE..CREDIT.ACCT.NO
13. 4 FIELD.NO....... 1
14. 4 COLUMN......... 1
15. 4 EXPANSION......
16. 4 TEXT.CHAR.MAX.. 15
17. 1. 4 TEXT........CreditAcc
52. 1 INPUT.RTN @PT12.CUS.PAYMENT.CHARGES
ITSS WORKSHOP DOCUMENT
Scenario2:
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:
Write a routine to capture INPUT version name and AUTH version name and update in two local reference fields in
the same application.
Result:
The two local reference fields INP.VERSION and AUTH.VERSION are updated with the version name through which
it as authorized and input.
Observation:
The local reference fields are fetched by using ‘MultiGetLocRef’ API , the version name is fetched by the function
getPgmVersion() and getVFunction is used to get input and authorize functions. Finally the input and authorized
version names are defaulted to fields INP.VERSION and AUTH.VERSION
Detail Steps:
Step1: Write a routine to capture INPUT version name and AUTH version name and update in two local reference
fields in the same application.
$PACKAGE EB.PT12SINDHU
SUBROUTINE PT12.UPDATE.I.AND.A.VERSIONNAME.IN.LOCALFIELD
*--------------------------------------------------------------------------
--
$USING EB.API
$USING EB.SystemTables
$USING EB.DataAccess
$USING EB.Updates
$USING EB.Display
*--------------------------------------------------------------------------
--
LOC.FIELDS = "INP.VERSION" :@VM : "AUTH.VERSION"
APP.NAME = EB.SystemTables.getApplication()
EB.Updates.MultiGetLocRef(APP.NAME,LOC.FIELDS,LOC.FIELD.POS)
INP.VERSION.POS = LOC.FIELD.POS<1,1>
AUTH.VERSION.POS = LOC.FIELD.POS<1,2>
*--------------------------------------------------------------------------
--
VERSION.NAME = EB.SystemTables.getPgmVersion()
TMP.FUNCTION = EB.SystemTables.getVFunction()
IF TMP.FUNCTION EQ "I" THEN
R.ARR1<1,INP.VERSION.POS> = VERSION.NAME
END
IF TMP.FUNCTION EQ "A" THEN
R.ARR1<1,AUTH.VERSION.POS> = VERSION.NAME
ITSS WORKSHOP DOCUMENT
END
EB.Display.RebuildScreen()
*--------------------------------------------------------------------------
--
RETURN
END
EB.API........... PT12.UPDATE.I.AND.A.VERSIONNAME.IN.LOCALFIELD
---------------------------------------------------------------------------
--
1. 1 GB DESCRIPTION.
2 PROTECTION.LEVEL.. NONE
3SOURCE.TYPE....... BASIC
VERSION.CONTROL............FUNDS.TRANSFER
---------------------------------------------------------------------------
--
Field Name.1
Validation Rtn.1 PT12.UPDATE.I.AND.A.VERSIONNAME.IN.LOCALFIELD
Input Rtn.1
Auth Rtn.1 PT12.UPDATE.I.AND.A.VERSIONNAME.IN.LOCALFIELD
Id Rtn.1
Check Rec Rtn.1
After Unau Rtn.1
Before Auth Rtn.1
Non Version Run Y
Scenario3:
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 USER´s still logged
in T24 by checking F.OS.TOKEN and create a report
Case1:
Write a pre batch routine to check for all the INAU OR INA2 transactions and create a report in the &SAVEDLISTS&
and also check if there are still logged in T24 by checking F.OS.TOKEN and create a report
Result:
The report is created in the &SAVEDLISTS& for INAU or INA2 transactions across Transaction applications and for
the USER´s loggedin.
Observation:
The logged in user information is fetched by using the F.OS.TOKEN the ID for the user will be created in the
F.OS.TOKEN once the user sign on.
Detail Steps:
Step1: Write a CHECK.REC.RTN for all ACCOUNT versions to populate the available customer information in the
ITSS WORKSHOP DOCUMENT
account application.
$PACKAGE EB.PT12SINDHU
SUBROUTINE PT12.REPORT.OF.INAUORINA2.TRANS
*--------------------------------------------------------------------------
--
$USING EB.API
$USING EB.SystemTables
$USING EB.DataAccess
$USING EB.Security
$USING FT.Contract
*--------------------------------------------------------------------------
--
GOSUB OPEN.FILE
GOSUB PROCESS.PARA
GOSUB WRITING.FILES
RETURN
*--------------------------------------------------------------------------
--
OPEN.FILE:
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)
RETURN
*--------------------------------------------------------------------------
--
PROCESS.PARA:
SEL.CMD ="SELECT ": FN.OS.TOKEN
S.LIST=""
S.COUNT=""
S.ERR=""
EB.DataAccess.Readlist(SEL.CMD,S.LIST,"",S.COUNT,S.ERR)
IF S.COUNT NE "0" THEN
LOOP
REMOVE OS.TOKEN.ID FROM S.LIST SETTING POS
WHILE OS.TOKEN.ID : POS DO
EB.DataAccess.FRead(FN.OS.TOKEN,OS.TOKEN.ID,R.OS.TOKEN,FV.OS.TOKEN,OS.TOKEN
.ERR)
USER.ID = R.OS.TOKEN<EB.Security.OsToken.OsTkUserId>
USER.STATUS = R.OS.TOKEN<EB.Security.OsToken.OsTkStatus>
USER.COMPANY = R.OS.TOKEN<EB.Security.OsToken.OsTkCompany>
ARR1<-1> = OS.TOKEN.ID:",":USERID:",":USER.STATUS:",":USER.COMPANY
ARRAY = OS.ARR1
Y.FILENAME ="&ACTIVEUSERS&"
GOSUB WRITING.FILES
REPEAT
END
SEL.FT ="SELECT ": FN.FT :" WITH RECORD STATUS EQ INAU INA2 "
S.FT.LIST="" ; S.FT.COUNT="" ; S.ERR=""
EB.DataAccess.Readlist(SEL.FT,S.FT.LIST,"",S.FT.COUNT,S.FT.ERR)
LOOP
REMOVE FT.ID FROM S.FT.LIST SETTING SEL.FT.POS
WHILE FT.ID : SEL.FT.POS DO
EB.DataAccess.FRead(FN.FT,FT.ID,R.FT,FV.FT,FT.ERR)
FT.AMOUNT = R.FT<FT.Contract.FundsTransfer.DebitAmount>
FT.RECORD.STATUS = R.FT<FT.Contract.FundsTransfer.RecordStatus>
FT.DB.ACCT = R.FT<FT.Contract.FundsTransfer.DebitAcctNo>
FT.CR.ACCT = R.FT<FT.Contract.FundsTransfer.CreditAcctNo>
FT.TRANS.TYPE = R.FT<FT.Contract.FundsTransfer.TransactionType>
FT.DATETIME = R.FT<FT.Contract.FundsTransfer.DateTime>
FT.ARR2=
ITSS WORKSHOP DOCUMENT
FT.ID:",":FT.AMOUNT:",":FT.DB.ACCT:",":FT.CR.ACCT:",":FT.TRANS.TYPE :",":FT
.DATETIME
ARRAY = FT.ARR2
Y.FILENAME ="&SAVEDLIST&"
GOSUB WRITING.FILES
REPEAT
RETURN
*--------------------------------------------------------------------------
--
WRITING.FILES:
FOLDER.DIR = "./PT12.BP"
OPENSEQ FOLDER.DIR,Y.FILENAME TO Y.SEQ ELSE
CREATE Y.SEQ ELSE
CRT"Cannot open file"
STOP
END
END
CRT"File Successfully opened"
WRITESEQ ARRAY APPEND TO Y.SEQ ELSE
CRT "Cannot write file"
END
CLOSESEQ Y.SEQ
RETURN
*--------------------------------------------------------------------------
--
END
Step2:Create a PGM.file entry for the routine with the ‘S’ type.
PGM.FILE........... PT12.REPORT.OF.INAUORINA2.TRANS
---------------------------------------------------------------------------
--
1 TYPE.............. S
2. 1 GB SCREEN.TITLE Single thread to create a report.
3 ADDITIONAL.INFO...
4. 1 BATCH.JOB...... @PT12.REPORT.OF.INAUORINA2.TRANS
5 PRODUCT........... EB
SPF.............SYSTEM
---------------------------------------------------------------------------
--
Pre Batch Rout1 @PT12.REPORT.OF.INAUORINA2.TRANS
Scenario4:
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:
Write a CHECK.REC.RTN for all ACCOUNT versions to populate the available customer information in the account
application.
ITSS WORKSHOP DOCUMENT
Result:
Observation:
Detail Steps:
Step1: Write a CHECK.REC.RTN for all ACCOUNT versions to populate the available customer information in the
account application.
$PACKAGE EB.PT12SINDHU
SUBROUTINE PT12.POPULATE.CUSINFO.TO.ACCOUNT
*--------------------------------------------------------------------------
--
$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.getIdNew()
CUSTOMER.ID =
EB.SystemTables.getRNew(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.ADD = R.CUSTOMER<ST.Customer.Customer.EbAddress>
CUS.LANG.CODE = R.CUSTOMER<ST.Customer.Customer.EbCusLanguage>
CUS.MNEMONIC = R.CUSTOMER<ST.Customer.Customer.EbCusMnemonic>
APP = "ACCOUNT"
LOC.FIELD=
"CUSTOMER.ADD" :@VM :"CUSTOMER.SECTOR":@VM :"CUSTOMER.LANG.CODE"
LRF.POS = ""
EB.Updates.MultiGetLocRef(APP,LOC.FIELD,LRF.POS)
CUS.ADD.POS = LRF.POS<1,1>
CUS.SECTOR.POS = LRF.POS<1,2>
CUS.LANG.CODE.POS = LRF.POS<1,3>
R.ARR<AC.AccountOpening.Account.LocalRef,CUS.ADD.POS> = CUS.ADD
R.ARR<AC.AccountOpening.Account.LocalRef, CUS.SECTOR.POS> = CUS.SECTOR
R.ARR<AC.AccountOpening.Account.LocalRef, CUS.LANG.CODE.POS> =
CUS.LANG.CODE
EB.SystemTables.setRNew(AC.AccountOpening.Account.LocalRef) = R.ARR
EB.SystemTables.setRNew(AC.AccountOpening.Account.Mnemonic)= CUS.MNEMONIC
*--------------------------------------------------------------------------
--
RETURN
END
EB.API........... PT12.POPULATE.CUSINFO.TO.ACCOUNT
---------------------------------------------------------------------------
--
1. 1 GB DESCRIPTION.
2 PROTECTION.LEVEL.. NONE
3SOURCE.TYPE....... BASIC
VERSION.CONTROL............ACCOUNT
---------------------------------------------------------------------------
Check Rec Rtn.1 PT12.POPULATE.CUSINFO.TOACCOUNT
After Unau Rtn.1
Before Auth Rtn.1
Non Version Run Y
Scenario5:
Case1:
Result:
Observation:
Detail Steps:
Step1: Write a CHECK.REC.RTN for all ACCOUNT versions to populate the available customer information in the
account application.
$PACKAGE EB.PT12SINDHU
SUBROUTINE PT12.16DIGIT.ACCOUNT.ID.FORMAT
*--------------------------------------------------------------------------
--
$USING AC.AccountOpening
$USING EB.DataAccess
$USING ST.CurrencyConfig
$USING ST.CompanyCreation
*--------------------------------------------------------------------------
--
FN.ACCOUNT ='F.ACCOUNT'
FV.ACCOUNT =''
ITSS WORKSHOP DOCUMENT
EB.DataAccess.Opf(FN.ACCOUNT,FV.ACCOUNT)
FN.CUSTOMER = "F.CUSTOMER"
FV.CUSTOMER = ""
EB.DataAccess.Opf(FN.CUSTOMER,FV.CUSTOMER)
FN.COMPANY="F.COMPANY"
FV.COMPANY=""
EB.DataAccess.Opf(FN.COMPANY,FV.COMPANY)
FN.CUSTOMER.ACCOUNT = "F.CUSTOMER.ACCOUNT"
FV.CUSTOMER.ACCOUNT = ""
EB.DataAccess.Opf(FN.CUSTOMER.ACCOUNT,FV.CUSTOMER.ACCOUNT)
FN.CCY="F.CURRENCY"
FV.CCY=""
EB.DataAccess.Opf(FN.CCY,FV.CCY)
*--------------------------------------------------------------------------
--
SEL.LIST = "" ; S.ERR = "" ; S.COUNT = "" ; CUSTMER.ID =""
SEL.CMD="SELECT ": FN.CUSTOMER
EB.DataAccess.Readlist(SEL.CMD,S.LIST ,"",S.COUNT,S.ERR)
LOOP
REMOVE CUSTMER.ID FROM S.LIST SETTING S.POS
WHILE CUSTOMER.ID : S.POS DO
EB.DataAccess.FRead(FN.CUSTOMER,CUSTOMER.ID,R.CUSTOMER,FV.CUSTOMER,CUSTOMER
.ERR)
EB.DataAccess.FRead(FN.CUSTOMER.ACCOUNT,CUSTMER.ID,R.CUSTOMER.ACCOUNT,FV.CU
STOMER.ACCOUNT,CUSTOMER.ACCOUNT.ERR)
ACCOUNT.COUNT=DCOUNT(R.CUSTOMER.ACCOUNT,@FM)
IF ACCOUNT.COUNT LE "99" THEN
SEQ.NO=ACCOUNT.COUNT+1
END
FOR I=1 TO ACCOUNT.COUNT
ACCOUNT.NO =R.CUSTOMER.ACCOUNT<I>
R.ACCOUNT = "" ;
ACCOUNT.ERR=""EB.DataAccess.FRead(FN.ACCOUNT,ACCOUNT.NO,R.ACCOUNT,FV.ACCOUN
T,ACCOUNT.ERR)
ACCT.CURRENCY=R.ACCOUNT<AC.AccountOpening.Account.Currency>
ACCT.CO.CODE=R.ACCOUNT<AC.AccountOpening.Account.CoCode>
EB.DataAccess.FRead(FN.CCY,ACCT.CURRENCY,R.CCY,FV.CCY,CCY.ERR)
CCY.CODE=R.CCY<ST.CurrencyConfig.Currency.EbCurNumericCcyCode>
CURRENCY.CODE = CCY.CODE[1,2]
EB.DataAccess.FRead(FN.COMPANY,ACCT.CO.CODE,R.COMPANY,FV.COMPANY,COMPANY.ER
R)
INTERCO.PARA=R.COMPANY<ST.CompanyCreation.IntercoParameter.IcpBranchCode>
DIGIT="00"
BRANCH.CODE= INTERCO.PARA:DIGIT
ACCOUNT.ID.FRMT =CUSTMER.ID:SEQ.NO:CURRENCY.CODE:BRANCH.CODE
ACCOUNT.ID=EB.SystemTables.getComi()
Y.NUMERIC=ISDIGIT(ACCOUNT.ID)
IF LEN(ACCOUNT.ID) NE "16" AND ACCOUNT.ID.FRMT NE ACCOUNT.ID
AND Y.NUMERIC NE "0" THEN
EB.SystemTables.setE("Account ID should contain only 16 digit numbers")
END
NEXT I
REPEAT
*--------------------------------------------------------------------------
--
RETURN
END
EB.API........... PT12.16DIGIT.ACCOUNT.ID.FORMAT
---------------------------------------------------------------------------
ITSS WORKSHOP DOCUMENT
--
1. 1 GB DESCRIPTION.
2 PROTECTION.LEVEL.. NONE
3SOURCE.TYPE....... BASIC
VERSION.CONTROL............ACCOUNT
---------------------------------------------------------------------------
Id Rtn.1 PT12.16DIGIT.ACCOUNT.ID.FORMAT
After Unau Rtn.1
Before Auth Rtn.1
Non Version Run Y