+ All Categories
Home > Documents > Template Programming.ppt

Template Programming.ppt

Date post: 02-Jun-2018
Category:
Upload: mabderhakim1075
View: 226 times
Download: 0 times
Share this document with a friend

of 80

Transcript
  • 8/11/2019 Template Programming.ppt

    1/80

    Slide 1

    What Is An Application In T24?

    T24 Applications Allows input of data

    Stores data in database

    Performs a business functionality

    Example: Funds Transfer, Money Market

    T24 Tables

    Allows input of data

    Stores data in database

    Holds static data used by other applications

    Performs no business functionality on its own

    Example: Category, Currency

  • 8/11/2019 Template Programming.ppt

    2/80

  • 8/11/2019 Template Programming.ppt

    3/80

    Slide 3

    Functions in T24

    There are different functions that can be used with these applications I Input

    A Authorise

    S See

    L List

    V Verify

    C Copy D Delete

    R Reverse

    H History Restore

    2 Second Authoriser

    P Print

  • 8/11/2019 Template Programming.ppt

    4/80

    Slide 4

    Application Classification

    Applications can be either CUS

    FIN

    INT

    Other classifications available too, but have properties of one of the above

    Naming conventions for database files

    CUSF.{$

  • 8/11/2019 Template Programming.ppt

    5/80

    Slide 5

    Definitions from T24

    What is an Application in T24? An application in T24 allows input of data and performs some business

    processing too.

    What is a Table in T24

    A table too stores data, static data that can be used by one or more

    applications

    What is a Product?

    One or more applications and tables that work together to perform abusiness functionality

  • 8/11/2019 Template Programming.ppt

    6/80

    Slide 6

    Before Creating An Application

    We must decide a name for our application

    What type of application (H, U, L, T, W)

    What classification (CUS, FIN, INT)

    We must decide what functions are going to be permitted

    We must decide fields

    Data types

    Max, Min Characters

    Field Names

    Extra validations of data

    Other related file updates

    What is the business functionality to be built in

  • 8/11/2019 Template Programming.ppt

    7/80Slide 7

    Application flow in T24Always the same

    1. Enter Application Name

    T24 checks if a VALID Application is entered.

    2. Enter Function and ID

    When data is entered and we hit enter, T24 validates it as a function.

    When we enter data and hit the edit button, the function is taken as I and the

    data is validated as an ID of the application

    3. Open record

    Checks if record exists with same ID, if yes read from file and load into cache

    If record does not exist, open new record for user.

    4. Enter Data and Commit

    Validates data, raises errors or overrides and saves record in database

    5. Authorise Record

    If everything is OK, save changes in the database, update other applications if

    required

    Send advices to customer (if any)

  • 8/11/2019 Template Programming.ppt

    8/80

    We have decided

    Slide 8

    Business Functionality

    When and What we must do

    Other Features-Functions

    -Product Information-Type of Application H, U. L etc.,-Classification FIN, CUS, INT etc.,

    T24 Application Flow

    My new

    Application

  • 8/11/2019 Template Programming.ppt

    9/80Slide 9

    Code

    If we want to develop an application in T24, do we have to start writingcode from scratch?

    NO NO NO

    There are two core subroutines called TEMPLATE andTHE.TEMPLATE that we must use to create an application

    Thats why this course is called TEMPLATE PROGRAMMING

  • 8/11/2019 Template Programming.ppt

    10/80

    What now

    Slide 10

    Business Functionality

    When and What we must doMETHODS

    Other Features-Functions

    -Product Information-Type of Application H, U. L etc.,-Classification FIN, CUS, INT etc.,

    Properties defined in TEMPLATE

    T24 Application Flow

    THE.TEMPLATE

    My new

    Application

  • 8/11/2019 Template Programming.ppt

    11/80Slide 11

    Common Variables

    Variables in T24 Global

    Local

    Most variables used in TEMPLATE programming can be found inI_COMMON

    Application / Product specific common variables also available

    I_ENQUIRY.COMMON

    I_GTS.COMMON etc

    Must include I_ file in all code

    $INSERT I_File - will look for I_ file in current directory, GLOBUS.BPand bnk.run

    $INCLUDE I_Filemust specify the directory in which file ispresent

  • 8/11/2019 Template Programming.ppt

    12/80Slide 12

    A Must Know

    Following common variables need to be understood before we attempt tocreate version routines

    ID.NEW

    ID.OLD

    ID.NEW.LAST R.NEW()

    R.OLD()

    R.NEW.LAST()

    All the above mentioned variables are common variables defined inI_COMMON.

  • 8/11/2019 Template Programming.ppt

    13/80Slide 13

    What Happens When A New Record Is Created In T24?

    ID.NEW : 123456

    R.NEWMnemonic : TRG

    Name.1 : TRG

    Street : RANGA ROAD

    Sector : 1100

    Target : 999

    Customer Status : 1Nationality : IN

    Residence : IN

    Language : 1

    Record Status :

    ID.NEW.LAST - NOT USED

    R.NEW.LAST

    NOT USED

    ID.OLD - NOT USED

    R.OLD

    NOT USED

    User creates new CUSTOMER record using CUSTOMER I F3

    When record is committed

  • 8/11/2019 Template Programming.ppt

    14/80Slide 14

    ID.NEW

    Common variable defined in I_COMMON

    Contains the ID of the currently opened record in any application

    When the record is closed or committed or authorised the value in thisvariable gets flushed.

  • 8/11/2019 Template Programming.ppt

    15/80Slide 15

    R.NEW

    Common variable defined in I_COMMON

    Dimensioned array which comprises of 500 dynamic arrays

    Holds the currently opened record in any application

    ID.NEW holds the ID of the currently opened record, while R.NEW holds theactual record. R in the variable name stands for Record

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

    Where C$SYSDIM = 500

    Inference: Since the size of R.NEW is now restricted to 500 it implies thatno application in T24 has more than 500 fields. The day it exceeds 500,C$SYSDIMs value will be increased

  • 8/11/2019 Template Programming.ppt

    16/80Slide 16

    When Happens When A Record Is Authorized?

    ID.NEW : 123456

    R.NEWMnemonic : TRG

    Name.1 : TRG

    Street : RANGA ROAD

    Sector : 1100

    Target : 999

    Customer Status : 1Nationality : IN

    Residence : IN

    Language : 1

    Record Status : INAU

    ID.NEW.LAST 123456

    R.NEW.LASTMnemonic : TRG

    Name.1 : TRG

    Street : RANGA ROAD

    Sector : 1100

    Target : 999

    Customer Status : 1Nationality : IN

    Residence : IN

    Language : 1

    Record Status :INAU

    ID.OLDNot Used

    R.OLD

    Not Used

    Values from R.NEW only are written into the database when record is COMMITTED/AUTHORISED

    User opens INAU record to authorise it

  • 8/11/2019 Template Programming.ppt

    17/80Slide 17

    ID.NEW.LAST

    Common variable defined in I_COMMON

    If an unauthorized record exists for the currently opened record in anyapplication, this variable will hold the ID of the unauthorized record

    You may ask, Will the ID of a live record and a unauthorized recordever be different?

    No. This variable enables us to know, programmatically whether anunuathorised record exists for the currently opened record

  • 8/11/2019 Template Programming.ppt

    18/80Slide 18

    R.NEW.LAST

    Common variable defined in I_COMMON

    Dimensioned array which comprises of 500 dynamic arrays

    Holds the currently opened record in any application

    ID.NEW.LAST holds the ID of the currently opened records unuathorisedrecord (if it exists), while R.NEW.LAST holds the actual unauthorized record(If it exists). R in the variable name stands for Record

    Definition as seen in I_COMMON : DIM R.NEW.LAST(C$SYSDIM)

    Where C$SYSDIM = 500

  • 8/11/2019 Template Programming.ppt

    19/80Slide 19

    What Happens When An Authorized Record Is Amended?

    ID.NEW : 123456

    R.NEWMnemonic : TRG

    Name.1 : TRG

    Street : RANGA ROAD

    Sector : 11001200

    Target : 999

    Customer Status : 1

    Nationality : IN

    Residence : IN

    Language : 1

    Record Status :

    ID.NEW.LAST NOT USED

    R.NEW.LAST

    NOT USED

    ID.OLD - 123456

    R.OLDMnemonic : TRG

    Name.1 : TRG

    Street : RANGA ROAD

    Sector : 1100

    Target : 999

    Customer Status : 1

    Nationality : IN

    Residence : IN

    Language : 1

    Record Status :

    Values from R.NEW only are written into the database when record is COMMITTED/AUTHORISED

  • 8/11/2019 Template Programming.ppt

    20/80Slide 20

    ID.OLD

    Common variable defined in I_COMMON

    If an authorized record exists for the currently opened record in anyapplication, this variable will hold the ID of the authorized record

    This variable enables us to check programmatically whether thecurrently opened record has a previously authorized record

  • 8/11/2019 Template Programming.ppt

    21/80Slide 21

    R.OLD

    Common variable defined in I_COMMON

    Dimensioned array which comprises of 500 dynamic arrays

    Holds the currently opened records previously authorized record (ifany) in any application

    ID.OLD holds the ID of the currently opened records authorised record(if it exists), while R.OLD holds the actual live record (If it exists). R inthe variable name stands for Record

    Definition as seen in I_COMMON : DIM R.OLD(C$SYSDIM)

    Where C$SYSDIM = 500

  • 8/11/2019 Template Programming.ppt

    22/80Slide 22

    What Happens When A Change On An Authorized Record Is Authorized?

    ID.NEW : 123456

    R.NEWMnemonic : TRG

    Name.1 : TRG

    Street : RANGA ROAD

    Sector : 1200

    Target : 999

    Customer Status : 1

    Nationality : IN

    Residence : IN

    Language : 1

    Record Status : INAU

    ID.NEW.LAST - 123456

    R.NEW.LASTMnemonic : TRG

    Name.1 : TRG

    Street : RANGA ROAD

    Sector : 1200

    Target : 999

    Customer Status : 1

    Nationality : IN

    Residence : IN

    Language : 1

    Record Status : INAU

    ID.OLD - 123456

    R.OLDMnemonic : TRG

    Name.1 : TRG

    Street : RANGA ROAD

    Sector : 1100

    Target : 999

    Customer Status : 1

    Nationality : IN

    Residence : IN

    Language : 1

    Record Status :

    The old authorized record (With Sector 1100) goes to history (FBNK.SECTOR$HIS)

    ID of the record in the history file will be 123456;1

    Contents of R.NEW is written to the LIVE file

  • 8/11/2019 Template Programming.ppt

    23/80Slide 23

    Common VariablesI_COMMON

    We must learn the use of these common variables before we continue

    V$FUNCTIONHolds the T24 function entered by the user

    MESSAGEAllows inter routine or inter para communication bysetting process state in this variable

    AF, AV, ASHolds the field position, multi value position and subvalue position respectively

    E and ETEXTVariables used to store error message to be displayed.E is used by THE.TEMPLATE itself to display errors if any

    ID.COMPANY and R.COMPANYVariable that holds the ID of thecompany we are currently logged into and the COMPANY record isloaded into R.COMPANY

  • 8/11/2019 Template Programming.ppt

    24/80Slide 24

    Some more Common Variables

    R.USER - Loaded as soon as the user logs in, holds the USER profile

    OPERATORID of the User currently logged in

    APPLICATION - Holds the name of the application currently in use. InT24 only one application can be active at a given point in time

    LCCY, LNGG Holds Local Currency as defined in company

    Holds the language from the USER profile

    TODAY - Holds T24s today (date)

    C$SYSDIMCommon variable equated to 500 in I_COMMON, used todefine the size of all dimensioned array common variables

  • 8/11/2019 Template Programming.ppt

    25/80Slide 25

    The TEMPLATE Subroutine

    Static Information or Properties of our application

    Use core subroutine TEMPLATE (GLOBUS.BP)

    We must decide a name for our application

    What type of application (H, U, L, T, W)

    What classification (CUS, FIN, INT)

    We must decide what functions are going to be permitted

    Why do we need to mention all this?

    To create additional components of an application

  • 8/11/2019 Template Programming.ppt

    26/80Slide 26

    Other Component of an Application

    What does T24 do with all the properties of the application we define inthe TEMPLATE subroutine?

    There are other components of an application other than code

    PGM.FILE Entry

    Type of application

    Special properties (additional info)

    FILE.CONTROL Entry

    File suffixes available

    Classification

  • 8/11/2019 Template Programming.ppt

    27/80

    Slide 27

    Other Component of an Application

    STANDARD.SELECTION Entry

    Actual field names

    Field properties

    Insert File - I_ File

    For programming

    Files at database level to store data

    To store data

  • 8/11/2019 Template Programming.ppt

    28/80

    Slide 28

    Getting Started

    DO NOT MODIFY the TEMPLATE subroutine in GLOBUS.BP

    Each application that we create, must have its own copy of theTEMPLATE

    The above line must be modified to reflect as thename of the subroutine

    Properties of an application are defined here

    jsh-->COPY FROM GLOBUS.BP TEMPLATE TO DBCARD.BP

    jsh-->COPY FROM DBCARD.BP TEMPLATE,

  • 8/11/2019 Template Programming.ppt

    29/80

    Table Objects

    Slide 29

    Table.name = 'XX.TABLE.NAME' ;* Full application nameTable.title = 'XX TABLE.NAME' ;* Screen title

    Table.stereotype = 'H' ;* H, U, L, W or T

    Table.product = 'XX' ;* Must be on EB.PRODUCT

    Table.subProduct = ' ;* Must be on EB.SUB.PRODUCT

    Table.classification = 'INT' ;* As per FILE.CONTROL

    Table.systemClearFile = 'Y' ;* As per FILE.CONTROL

    Table.relatedFiles = '' ;* As per FILE.CONTROL

    Table.isPostClosingFile = '' ;* As per FILE.CONTROL

    Table.equatePrefix = 'XX.YY' ;* Use to create I_F.EB.LOG.PARAMETER

    Table.idPrefix = '' ;* Used by EB.FORMAT.ID if set

    Table.blockedFunctions = '' ;* Space delimited list of blocked

    functions

    Table.trigger = '' ;* Trigger field used for OPERATION style

  • 8/11/2019 Template Programming.ppt

    30/80

    How are the properties used?

    The ID of the FILE.CONTROL ,PGM.FILE and SS entry - Table.name

    The TYPE for the PGM.FILE recordTable.stereotype

    The SCREEN.TITLE in PGM.FILE record(Description)Table.title

    The PRODUCT field in FILE.CONTROL and PGM.FILETable.product

    The CLASSIFICATION field in FILE.CONTROLTable.classification

    The prefix for all fields in the I_ filesTable.equatePrefix

    Functions that are not allowed for the applicationTable.blockedFunctions

    Slide 30

  • 8/11/2019 Template Programming.ppt

    31/80

    I_Table

    Contains all common variables used in table object

    Slide 31

    COMMON/OBJECT.TEMPLATE/Table.fieldNeighbourArray(C$SYSDIM),Table.name,

    Table.title,

    Table.stereotype,

    Table.product,

    Table.subProduct,

    Table.idPrefix,

    Table.blockedFunctions,Table.systemClearFile,

    Table.relatedFiles,

    Table.isPostClosingFile,

    Table.equatePrefix,

    Table.triggerField,

    Table.classification,

    Table.noInputFields,

    Table.inputtableFields,

    Table.lastApplication,Table.idPrefix,Table.blockedFunctions,

    Table.systemClearFile,

    Table.relatedFiles,

    Table.isPostClosingFile,

    Table.equatePrefix,

    Table.triggerField,

    Table.lastCompany,

  • 8/11/2019 Template Programming.ppt

    32/80

    Slide 32

    How is TEMPLATE and THE.TEMPLATE related?

    To launch an application, we type its name in the command prompt

    It is validatedVALIDATE.APPLICATION subroutine

    Checks PGM.FILE

    Calls RUN.APPLICATION which in turn callsEB.EXECUTE.APPLICATION Calls subroutine with

    Subroutine APPLICATION name is nothing but a copy of TEMPLATEwith static properties, and the list of methods to be called

    EB.EXECUTE.APPLICATION also invokes THE.TEMPLATE

    EB EXECUTE APPLICATION

  • 8/11/2019 Template Programming.ppt

    33/80

    EB.EXECUTE.APPLICATION

    Slide 33

    SUBROUTINE EB.EXECUTE.APPLICATION(APPLICATION.NAME)

    Table.name = ''CALL @APPLICATION.NAME

    IF Table.name THEN

    CALL THE.TEMPLATE ;* We need to call the central template routine

    END ELSE

    Table.lastApplication = "" ;* We've called a non central template

    END

    Note: In releases before R9, EB.EXECUTE.APPLICATION called the Subroutine which in turn called THE.TEMPLATE

    THE TEMPLATE S b ti

  • 8/11/2019 Template Programming.ppt

    34/80

    THE.TEMPLATE Subroutine

    The core subroutine used by every application in T24 since it contains

    the execution flow

    An applications business logic is broken up into individual subroutines,called method.

    THE.TEMPLATE contains code to call or invoke these methods at theright time

    Slide 34

    M th d i T l t P i

  • 8/11/2019 Template Programming.ppt

    35/80

    Slide 35

    Methods in Template Programming

    The business logic of an application is not part of TEMPLATE or

    THE.TEMPLATE

    It is split up into methods

    There are 11 methods available for use

    THE.TEMPLATE determines the order of execution

    Methods are nothing but individual subroutines called fromTHE.TEMPLATE

    Must follow naming convention APPNAME.METHODNAME

    M th d

  • 8/11/2019 Template Programming.ppt

    36/80

    Methods

    Where are method names defined?

    Are they hard coded?

    Slide 36

    I METHODS AND PROPERTIES

  • 8/11/2019 Template Programming.ppt

    37/80

    Slide 37

    I_METHODS.AND.PROPERTIES

    Common variable to define method names

    Methods with different names ignored

    I METHODS AND PROPERTIES

  • 8/11/2019 Template Programming.ppt

    38/80

    Slide 38

    I_METHODS.AND.PROPERTIES

    T24s convention is to represent each position C_ROUTINES array by

    a name not a number

    Methods in Template Programming

  • 8/11/2019 Template Programming.ppt

    39/80

    Slide 39

    Methods in Template Programming

    INITIALISE

    FIELDS

    FUNCTION

    ID

    RECORD

    VALIDATE

    PREVIEW

    OVERRIDES

    PROCESS

    AUTHORISE

    RUN

    This is also the order in which they are executed by THE.TEMPLATE

    THE TEMPLATE

  • 8/11/2019 Template Programming.ppt

    40/80

    Slide 40

    THE.TEMPLATE

    Pattern of Execution of an application

    MUST NOT BE MODIFIED

    Advantage of having THE.TEMPLATE

    We can maintain code consistency and code standard

    Enables rapid code development, no need to start from scratch

    Behind the Scenes THE TEMPLATE

  • 8/11/2019 Template Programming.ppt

    41/80

    Slide 41

    Behind the ScenesTHE.TEMPLATE

    Launch Application from Command Prompt

    Initialise The first method to be executed when an application is launched

    Fields

    The next method to be executed

    Input Record ID and press Enter (Function defaulted to I)

    Function

    This is executed after a function is entered by the user. If no function is

    entered, the default is Input.

    ID

    Executed after the function entered is validated. Validated ID, can modify IDif required

    Behind the Scenes THE TEMPLATE

  • 8/11/2019 Template Programming.ppt

    42/80

    Slide 42

    Behind the ScenesTHE.TEMPLATE

    Record Executed before the record requested (existing or new) is displayed to the

    user

    Record requested is displayed (existing or new)

    Data is input / modified, then Commit

    Validate

    After values are defaulted (if any) all data is validated

    Preview After data is validated, a delivery preview is available

    Overrides Overrides if any are generated now

    Behind the Scenes THE TEMPLATE

  • 8/11/2019 Template Programming.ppt

    43/80

    Slide 43

    Behind the ScenesTHE.TEMPLATE

    Process

    If all overrides are accepted, then this method is called before the record is

    written to the $NAU file

    Record is written to $NAU NOW

    Authorise button is clicked

    Validate

    All data is validated twice, once during commit and once during authorise

    Authorise

    This is executed after the Authorise button is clicked

    Record is written to LIVE NOW

    Run

    This is executed if the function used is Verify

    Using the Template Methods Common Variables Available

  • 8/11/2019 Template Programming.ppt

    44/80

    Slide 44

    Using the Template MethodsCommon Variables Available

    INITIALISE Anything that needs to be done as soon as an application is launched can

    be done here. It is not a mandatory method

    FIELDS This is the method in which an applications fields are defined. This is a

    mandatory method as an application must have at least one field

    FUNCTION Code that need to be executed depending on the function entered,manipulation of the function itself can be done here (V$FUNCTION)

    ID Special editing to the ID entered, special validations to the ID (ID.NEW)

    RECORD Editing of the requested record before display to the user (R.NEW,

    R.NEW.LAST,R.OLD)

  • 8/11/2019 Template Programming.ppt

    45/80

    Using the Template Methods

  • 8/11/2019 Template Programming.ppt

    46/80

    Slide 46

    Using the Template Methods

    The methods listed here are executed after Authorise is clicked

    AUTHORISE

    Processing to be done before record is written into LIVE file

    Accounting

    Delivery

    Updating associated applications

    RUN

    This method is called only for W type applications that use the Verifyfunction

    T Array

  • 8/11/2019 Template Programming.ppt

    47/80

    Slide 47

    T Array

    Dimensioned array that holds information about

    Data type

    List of possible values

    NOINPUT / NOCHANGE characteristics

    Justification

    HOT.FIELD, HOT.VALIDATE properties

    Has 10 sub fields to specify all field properties

    T(Field position) - Data type to call IN2 routine

    T(FieldPosition) = A will call IN2A routine to validate the data entered

    T(Field position) - List of input options if predefined

    T(FieldPosition) = Yes_No_Maybe

    T(FieldPosition) = 10015000 will display all numbers from 1001 to5000

    T Array

  • 8/11/2019 Template Programming.ppt

    48/80

    Slide 48

    T Array

    T(FieldPosition) - NOINPUT/NOCHANGE/EXTERN

    NOINPUTField never available for input

    NOCHANGEField not inputtable after record is authorised

    EXTERNField is cleared if record is copied

    T(FieldPosition) - Format Mask

    Data can be displayed differently, irrespective of how it is stored in thedatabase. The Mask character used is #

    T(FieldPosition) - Justification

    Default Left justified, no need to specify T(FieldPosition)

    Right justified (R) and center justified (C ) are the other 2 options

    T Array

  • 8/11/2019 Template Programming.ppt

    49/80

    Slide 49

    T Array

    T(FieldPosition) - MACHINE to default to machine date instead of

    T24 date Used in the USER application

    T(FieldPosition) - TEXT to display a text box in the browser

    T(FieldPosition) - NOMODIFY/NODELETE/NOEXPAND No Modification or changes allowed to multi valueset after first

    authorisation

    Multi valueset cannot be deleted after record is authorised

    Multi valueset cannot be expanded further after authorisation

    T(FieldPosition) - HOT.FIELD/HOT.VALIDATE/WEB.VALIDATE

    HOT.FIELD causes field to be validated immediately

    HOT.VALIDATE causes all fields to be validated

    WEB.VALIDATE triggers validation at web server level

    Built-in Data Types

  • 8/11/2019 Template Programming.ppt

    50/80

    Built in Data Types

    T24 supports a lot of built-in standard data types

    Built-in data types are equated to standard names in an Insert filecalled I_Datatypes

    Slide 50

    I Datatypes

  • 8/11/2019 Template Programming.ppt

    51/80

    I_Datatypes

    Slide 51

    EQU T24_String TO 'T24.STRING'

    EQU T24_BigString TO 'T24.BIG.STRING'

    EQU T24_Text TO 'T24.TEXT'

    EQU T24_TextWide TO 'T24.TEXT.WIDE'

    EQU T24_Numeric TO 'T24.NUMERIC'

    EQU T24_Date TO 'T24.DATE'

    EQU T24_Portfolio TO 'T24.PORTFOLIO'

    EQU T24_Account TO 'T24.ACCOUNT'

    EQU T24_InternalAccount TO 'T24.INTERNAL.ACCOUNT'

    EQU T24_Customer TO 'T24.CUSTOMER'

    EQU T24_Frequency TO 'T24.FREQUENCY

    EQU Field_Mandatory TO ',mandatory'

    EQU Field_NoInput TO ',NOINPUT'

    EQU Field_NoChange TO ',NOCHANGE'

    EQU Field_Unique TO ',UNIQUE'

    EQU Field_NoNulls TO ',NONULLS'

    EQU Field_AllowNegative TO ',ALLOW.NEGATIVE'

    COMMON/DataTypeCommon/DataType.list,

    DataType.nArrays,

    DataType.tArrays,

    DataType.checkFiles

  • 8/11/2019 Template Programming.ppt

    52/80

    TableUtil.loadFieldTypes

  • 8/11/2019 Template Programming.ppt

    53/80

    yp

    Loads each of the basic data types as given below

    Slide 53

    SUBROUTINE TableUtil.loadFieldTypes

    id = "T24.STRING"

    length = 35

    type = "A"

    file = ''GOSUB addBasicType

    addBasicType:

    typePos +=1

    DataType.list = id

    DataType.nArrays = length

    DataType.tArrays = LOWER(type)

    DataType.checkFiles = file

    RETURN

    Field Definitions

  • 8/11/2019 Template Programming.ppt

    54/80

    Field Definitions

    Slide 54

    Defining FieldsAPIs

  • 8/11/2019 Template Programming.ppt

    55/80

    Slide 55

    g

    T24 supports a number of APIs are used to define fields.

    These APIs internally update the F, N and T arrays.

    Table.defineId

  • 8/11/2019 Template Programming.ppt

    56/80

    Slide 56

    Defines the ID field

    ID.F, ID.N and ID.T are assigned

    Table.defineId(idName, dataType)

    It takes 2 parameters, the id name (ID.F item) and the data type of the

    key

    The data type of the key can either be

    A standard data type defined in I_Datatypes in DataType.list

    Populate data type with values corresponding to N and T arrays

    Table.defineIdProperties

  • 8/11/2019 Template Programming.ppt

    57/80

    Slide 57

    Defines the ID field

    ID.F, ID.N and ID.T are assigned

    Table.defineIdProperties(idName, dataType)

    Table.defineId invokes this API to define the fields.

    SUBROUTINE EB.DEBIT.CARD.PARAMETER.FIELDS

    dataType = ''

    dataType = 16.1

    dataType = ''

    dataType = 'SYSTEM'

    CALL Table.defineId("DB.PARAMETER.ID",dataType)

    Table.addField

  • 8/11/2019 Template Programming.ppt

    58/80

    Slide 58

    Adds a field with standard data types

    Table.addField(fieldName, fieldType, args, neighbour)

    It takes 4 parameters, where,

    fieldName - The name of the field to add. The "F" array item fieldType - The standard T24 data type of the field args - Any arguments (mandatory, no input, etc.) neighbour - Reserved for future use.

    The various arguments possible are : Field_NoChange, Field_NoInput,

    Field_Mandatory, Field_AllowNegative, Field_unique, Field_NoNulls

    CALL Table.addField("XX.LL.DESCRIPTION",T24_String,,)

    Table.addFieldDefinition

  • 8/11/2019 Template Programming.ppt

    59/80

    Slide 59

    Adds a field using the F, N and T definitions

    Table.addFieldDefinition(fieldName, fieldLength, fieldType, neighbour)

    It takes 4 parameters, where,

    fieldName - The name of the field to add. The "F" array item fieldLength - The length of the field. N array item

    fieldType - The type of the field. T array item neighbour - Reserved for future use

    CALL Table.addFieldDefinition("XX.LL.DESCRIPTION",35,A,)

    Table.processArgs

  • 8/11/2019 Template Programming.ppt

    60/80

    Slide 60

    Processes the arguments passed to Table.addField API

    Assigns the N array and T array positions according to the arguments.

    Table.processArgs(args, nArrayItem, tArrayItem)

    It takes 3 parameters, where,

    argsthe list of arguments passed to Table.addField. nArrayItem - The N array item to process tArrayItem - The T array item to process

    Field.setAttributes

  • 8/11/2019 Template Programming.ppt

    61/80

    Slide 61

    Sets the N and T array

    Field.setAttributes(fieldLength, fieldType, neighbour)

    It takes 3 parameters, where,

    fieldLength : The N array item fieldType : The T array item neighbour : Reserved for future use

    Table.addField and Table.addFieldDefinition use this API to set the N

    and T arrays based on the parameters passed on to them

    Table.addFieldWithEbLookup

  • 8/11/2019 Template Programming.ppt

    62/80

    Slide 62

    Add a field with a virtual table

    Used to create a field with a finite set of predefined options

    Table.addFieldWithEbLookup(fieldName, tableName, neighbour)

    It takes 3 parameters, where,

    fieldName - The name of the field to add. The "F" array item tableNameThe virtual table name used to access values in EB.LOOKUP

    Application.

    neighbour - Reserved for future use

    Table.addVirtualTableField

  • 8/11/2019 Template Programming.ppt

    63/80

    Slide 63

    Adds a field with a virtual table.

    Performs the same functionality as Table.addFieldWithebLookup,

    except that the list of options are configurable.

    Table.addVirtualTableField(fieldName, tableName, args, neighbour)

    It takes 4 parameters, where,

    fieldName - The name of the field to add. The "F" array item tableNameThe virtual table name used to access values in EB.LOOKUP

    Application.

    args - (optional) Any additional arguments (mandatory, no input, etc.)

    neighbour - Reserved for future use

    Field.setDefault

  • 8/11/2019 Template Programming.ppt

    64/80

    Slide 64

    Sets the default value for the current field

    CALL Table.addField("START.DATE",T24_Date,Field_NoInput,'')

    CALL Field.setDefault(TODAY) ;* Assign default value

    CHECKFILES

  • 8/11/2019 Template Programming.ppt

    65/80

    Slide 65

    Variable used to store Application Vet details for a field

    Only ID of record from CHECKFILE Application is defaulted into field

    Enrichment can be any field from the CHECKFILE Application

    CHECKFILE(currentFieldPosition) = tableName : FM : enrichmenentField

    Field.setCheckFile

  • 8/11/2019 Template Programming.ppt

    66/80

    Slide 66

    Adds a check file to a field

    Turns tableName(argument to Field.setCheckFile) into a checkfileargument using the default enrichment field (DEFAULT.ENRICH field)set on standard selection or the 1stfield.

    For the field Customer, whatever is entered in validated against theCUSTOMER application.

    This routine internally assigns.CHECKFILE(currentFieldPosition) = tableName : FM :enrichmenentField

    CALL Table.addField("CUSTOMER",T24_Customer,Field_Mandatory,'')

    CALL Field.setCheckFile("CUSTOMER")

    Table.addAmountField

  • 8/11/2019 Template Programming.ppt

    67/80

    Slide 67

    Adds amount field to the application

    Table.addAmountField(fieldName, currencyFieldName,args, neighbour)

    It takes 4 parameters, where,

    fieldName - The name of the field to add. The "F" array item

    currencyFieldNameName of the field that holds the currency the field is heldin.

    argsAny additional arguments (mandatory, no input, etc.)

    neighbourReserved for future use

    CALL Table.addAmountField("MAX.WITHDRAWAL.AMT",'CURRENCY','',' ')

    Table.addOptionsField

  • 8/11/2019 Template Programming.ppt

    68/80

    Slide 68

    Adds a field with pre-defined set of options

    Table.addOptionsField(fieldName, options, args, neighbour)

    It takes 4 parameters, where,

    fieldName - The name of the field to add. The "F" array item

    optionsThe list of options separated by an _. The T(fieldposition) item.

    argsAny additional arguments (mandatory, no input, etc.)

    neighbourReserved for future use.

    CALL Table.addOptionsField("WITHDRAW.SWIPE","S_W",'','')

    Table.addYesNoField

  • 8/11/2019 Template Programming.ppt

    69/80

    Slide 69

    Adds a simple field that holds the value YES or blank

    Table.addYesNoField(fieldName, args, neighbour)

    It takes 3 parameters, where,

    fieldName - The name of the field to add. The "F" array item

    argsAny additional arguments (mandatory, no input, etc.)

    neighbourreserved for future use

    Table.setAttributeOnFields

  • 8/11/2019 Template Programming.ppt

    70/80

    Slide 70

    API to set a number of fields to be NOINPUT, NOCHANGE orinputtable

    Table.setAttributeOnFields(attribute, fieldList)

    It takes 2 parameters, where,

    attribute - The attribute to set. One of NOINPUT, NOCHANGE or

    fieldList - The list of fields to set the attribute on. These are field numbers

    Loops through each field in fieldList and sets the atribute in the thirdfield of the T array. Loops through each field in fieldList and sets theatribute in the third field of the T array

    More than one field can be set to one specified attribute.

    Table.addReservedField

  • 8/11/2019 Template Programming.ppt

    71/80

    Slide 71

    All new applications must define a set of reserved fields that can beused to add extra fields to the application without the need to change

    the layout of the data

    The name of the reserved fields must be of the form RESERVED.1etc.,

    Reserved fields can be added in 2 ways

    CALL Table.addField("RESERVED.1", T24_String, Field_NoInput,"")

    CALL Table.addReservedField(RESERVED.1)

    Table.addDeliveryReferenceField

  • 8/11/2019 Template Programming.ppt

    72/80

    Slide 72

    Applications that raise delivery events must define a field to hold thedelivery references

    The name of this field should be DELIVERY.REF

    Delivery Reference fields can be added in 2 ways

    It can be multi valued to hold delivery references for multiple partiesinvolved

    CALL Table.addField(XX.DELIVERY.REF", T24_String, Field_NoInput,"")

    CALL Table.addDeliveryReferenceField(neighbour)

    Table.addLocalReferenceField

  • 8/11/2019 Template Programming.ppt

    73/80

    Slide 73

    Local reference fields allows T24 clients to add user definable fields tothe application.

    The name of this field should be LOCAL.REF

    Local reference fields can be added in 2 ways

    CALL Table.addField(XX.LOCAL.REF", T24_String, Field_NoInput,"")

    CALL Table.addLocalReferenceField(neighbour)

    Table.addStatementNumbersField

  • 8/11/2019 Template Programming.ppt

    74/80

    Slide 74

    Applications that raise accounting entries must define a field to hold theentry ids that have been raised

    The name of this field should be STMT.NOS

    Statement Numbers field can be added in 2 ways

    CALL Table.addField(XX.STMT.NOS", T24_String, Field_NoInput,"")

    CALL Table.addStatementNumbersField(neighbour)

    Table.addOverrideField

  • 8/11/2019 Template Programming.ppt

    75/80

    Slide 75

    All applications MUST have a field to store overrides

    Override fields can be added in 2 ways

    CALL Table.addField(XX.OVERRIDE", T24_String, Field_NoInput,"")

    CALL Table.addOverrideField

    How to create additional components?

  • 8/11/2019 Template Programming.ppt

    76/80

    We have created the fields for our application

    Do we have to manually create all the necessary additionalcomponents to make our application work?

    Slide 76

  • 8/11/2019 Template Programming.ppt

    77/80

    EB.DEV.HELPER

  • 8/11/2019 Template Programming.ppt

    78/80

    Slide 78

    Workfile Application to create

    PGM.FILE entry FILE.CONTROL entry

    I_ File(insert file in BP)

    STANDARD.SELECTION

    Create files at Database level

    Create DAS routinesdiscussed later on

    Record ID is Application Name

    Verify record

    Say Y to all questions asked

    When to create which additional component?

  • 8/11/2019 Template Programming.ppt

    79/80

    If static properties have changed

    Rebuild PGM.FILE, FILE.CONTROL, DATABASE FILES if required

    If the field name has been changed

    Update I_File and SS

    If the field properties have been changed Update SS

    If a new field has been added

    Update I_File and SS

    If the application name has to be changed

    Update all components

    Slide 79

    Workshop

  • 8/11/2019 Template Programming.ppt

    80/80

    Run EB.DEV.HELPER and create additional components for all the

    applications created relating to DEBIT CARD


Recommended