Programme SAP RFTBFF20 - File Interface: Import Statistics Data

Description
Report RFTBFF20 allows you to transfer external market data into the SAPsystem in file form.

Transfer functions
As part of the SAP Banking Release 3.0F the file interface supports thefollowing transfer functions:
Category 01: Transfer of volatilities
Category 02: Transfer of correlations
Category 03: Transfer of beta factors
The market data are further classified according to instrument type ordata class, which indicates which type of volatilities, correlations orbeta factors are to be transferred.
Class 01: Exchange rate
Class 02: Security price (stock, bond)
Class 03: Reference interest rate
Class 04: Index value
Example: CATEGORY 01 CLASS 01 = Transfer of exchange ratevolatilities

File input format
Report program RFTBFF20 requires the input file to be in a specificformat and inserts the data into the operative SAP market data tables.
IMPORTANT:
This format must be adhered to, since incorrect entries can only becorrected by making time-consuming manual amendments (correctingindividual entries in customer-specific ABAP report programs). Beforeyou import your market data to the SAP system using report program RFTB
FF20, you must therefore check that it is in the file format describedbelow. You can do this in a test run by choosing Test run on the programselection screen.

Requirements

Technical Description of Transfer Structures
A generic data structure is used to transfer the market data. Differentversions of this structure are necessary for the different data types.

General Structure of the File for Transferring Market Data to the SAPSystem
Record structure:
Field no. ,,Meaning ,,Cat. ,,Length ,,R/O/E ,,Description
1 ,,Value cat. ,,CHAR ,,2 ,,R ,,Value category
2 ,,Class 1 ,,CHAR ,,2 ,,R ,,Data class for
,, ,, ,, ,, ,,instrument 1
3 ,,Key 1 ,,CHAR ,,20 ,,R ,,Data description 2
,, ,, ,, ,, ,,for instrument 1
4 ,,Key 2 ,,CHAR ,,20 ,,R ,,Data description 2
,, ,, ,, ,, ,,for instrument 1
5 ,,Class 2 ,,CHAR ,,2 ,,R ,,Data class for
,, ,, ,, ,, ,,instrument 2
6 ,,Key 1 ,,CHAR ,,20 ,,R ,,Data description 1
,, ,, ,, ,, ,,for instrument 2
7 ,,Key 2 ,,CHAR ,,20 ,,R/O/E ,,Data description 2
,, ,, ,, ,, ,,for instrument 2
8 ,,Date ,,CHAR ,,8 ,,R ,,Contribution date
9 ,,Value type ,,CHAR ,,10 ,,R ,,Volatility type,
,, ,, ,, ,, ,,correlation type,
,, ,, ,, ,, ,,beta type
10 ,,Ret. period,,CHAR ,,5 ,,R ,,Retention period
11 ,,Rate type 1,,CHAR ,,15 ,,O/E ,,Market data type
,, ,, ,, ,, ,,for instrument 1
12 ,,Rate type 2,,CHAR ,,15 ,,E ,,Market data type
,, ,, ,, ,, ,,for instrument 2
13 ,,Value ,,CHAR ,,20 ,,R ,,Volatility value,
,, ,, ,, ,, ,,correlation value,
,, ,, ,, ,, ,,beta factor value
14 ,,Time ,,CHAR ,,6 ,,O ,,Contribution time
15 ,,Period ,,CHAR ,,4 ,,O ,,Sample size
16 ,,Confid.lvl ,,CHAR ,,6 ,,O/E ,,Confidence level
17 ,,Decay ,,CHAR ,,4 ,,E ,,Decay factor

Authorization
Before you start the program, make sure that you have authorization fortransaction TVMD.

General Notes
Abbreviations:
The record structure uses the abbreviations R (required fields), O(optional fields) and E (empty fields). Required fields (R) must befilled with values. Optional fields (O) can be filled. These optionalfields can be derived from required fields or left out. They are used tocheck the consistency of a data record. Fields for which no entry isrequired (E) must be filled up with spaces. The decision on whether afield is required or optional depends on the value category and the dataclass category.
Whole numbers and decimal places are separated by a period.
Code Conversion:
At present, SAP does not plan to support conversion of external notationinto internal (SAP) notation. Data must be supplied in the formatdefined in the Customizing (if it refers to data defined in the SAPsystem).
Value Category:
The value category specifies which key value for an instrument(volatility, correlation factor or beta factor) is to be transferred.The following fixed values are defined in the SAP system:
01,,Volatilities
02,,Correlations
03,,Beta factors
Instrument Type/Data Class:
The instrument type differentiates between currencies, interest rates,indexes and securities.
When you require values derived from a combination of instruments, youmust define an instrument type for each instrument.
In the following description, the terms instrument type, data class andclass are used synonymously.
The following fixed values for the instrument type are defined in thesystem:
01,,Exchange rate
02,,Security price
03,,Reference interest rate
04,,Index value
Value Type:
This field depends on the VALUE CATEGORY field and is defined asfollows:
Value type = 01,,Volatility type
Value type = 02,,Correlation type
Value category = 03,,Beta factor type

  • Volatility Type: The volatility type has descriptive character.
  • It describes the statistics type and the rate category of the underlyingvolatility. For example, in the foreign exchange area the rate categorytells you whether bid, middle or ask rates were used to calculate thevolatility. You use the statistics type to define other descriptiveparameters, such as the sample size, term or confidence level of thevolatility.
    • Correlation Type: The correlation type also has descriptive
    • character. It describes the rate category and the statistics type of theunderlying correlation between two instruments. There are two ratecategories: the security price category and the exchange rate category.The instrument type of the correlation transferred determines whichrates category applies. As for the volatility type, the statistics typeis used to define other descriptive parameters. Only the sample size orperiod apply to correlations. In addition, there is an extra parameterfor the determination category of the sample elements (not relevant fordata transfer).
      • Beta Factor Type: The beta factor type describes the sample size
      • or period and the retention period.
        If the additional fields mentioned above are transferred via theinterface, the corresponding value type must be cross-checked. If thevalue type is invalid, the field must be taken out. The rate categoryinformation is specified in field RATE TYPE 1. For correlations, therate category information must also be specified in field RATE TYPE 2.
        Retention Period:
        The RETENTION PERIOD field is the key for volatilities and correlations,and must be filled. You enter the period in days. The retention periodspecifies the number of days for which price changes are to bedetermined. In the risk management area, the retention period is thenumber of days required to offset incoming positions. When you run ahistorical simulation, the relative price change is calculated for eachday of the historical period. The price change Kn is the percentagechange in price between day n and day n + retention period.
        Sample Period:
        The sample period or time series is the number of days used to determineprice changes. For historical simulation, the user maintains the timeseries for risk factors in a historical market database. The intervalsused for the price changes always overlap by a day. For example, todetermine price changes for a data set of 200 days with a retentionperiod of 10 days, you would need a time series of 210 days. The sampleperiod is relevant for all three value categories. However, it does nothave to be specified by the user. For volatilities and correlations thesystem derives the sample period via the value type (volatility type orcorrelation type) and the statistics type. For beta factors the sampleperiod is encrypted via the beta factor type. If this field is filled, t
        he system checks the value in the DDIC tables. If the entry is invalid,the system rejects the transfer record.
        Confidence Level:
        The confidence level is used to define the value-at-risk (VaR). VaRstates the minimum change in the value of a position within the sampleperiod up to liquidation or hedging with a certain degree of probability(confidence level). If , for example, you want to determine the VaR witha 95% level of confidence, your result is the change in value belowwhich 95% of value changes would not fall. The confidence level is onlyused for volatilities. If the field is filled, the system cross-checksthe value with the database table, via the value type (here: volatilitytype) and the statistics type. If the entry is invalid, the systemrejects the transfer record.
        Decay Factor:
        At present, the decay factor is an open field that is neithercross-checked nor saved. SAP plans to enhance the program to derive thedecay factor via the value type. The decay factor is not relevant forbeta factors.
        NEW-PAGE

        Required/optional fields for volatilities
        Field Name ,,Cat. ,,Length ,,R/O/E ,,Description
        Value cat. ,,CHAR ,,2 ,,R ,,Fixed value for volatility '01'
        Data class 1 ,,CHAR ,,2 ,,R ,,Data class for instrument 1
        Key 1 ,,CHAR ,,20 ,,R ,,Key 1 for instrument 1
        ,, ,, ,, ,,Exchange rates: FROM currency
        ,, ,, ,, ,,Security prices (sec. ID no.)
        ,, ,, ,, ,,Reference interest rates
        ,, ,, ,, ,,Indexes
        Key 2 ,,CHAR ,,20 ,,O ,,Key 2 for instrument 1
        ,, ,, ,,R ,,Exchange rates: TO currency
        Data class 2 ,,CHAR ,,2 ,,R ,,Data class for instrument 2
        Key 1 ,,CHAR ,,20 ,,E ,,Empty
        Key 2 ,,CHAR ,,20 ,,E ,,Empty
        Date ,,CHAR ,,8 ,,R ,,Contribution date
        ,, ,, ,, ,,Format: DDMMYYYY
        Value type ,,CHAR ,,10 ,,R ,,Volatility type
        Ret. period ,,CHAR ,,5 ,,R ,,No. of days
        Rate type 1 ,,CHAR ,,15 ,,O ,,middle, ask, spot
        Rate type 2 ,,CHAR ,,15 ,,E ,,Empty
        Value ,,CHAR ,,20 ,,R ,,Volatility value
        Time ,,CHAR ,,6 ,,O ,,Contribution time
        ,, ,, ,, ,,Format: HHMMSS
        Period ,,CHAR ,,4 ,,O ,,Sample period in days
        Confid. lvl ,,CHAR ,,6 ,,O ,,Confidence level of volatility
        ,, ,, ,, ,,in % (0.00 to 100.00)
        Decay factor ,,CHAR ,,4 ,,E ,,Value between 0.00 and 1.00

        Notes on Volatility Fields:
        Value Category:
        The value category for volatilities is 01.
        Instrument Type/Data Class:
        The instrument type differentiates between currencies, interest rates,indexes and securities. Volatilities are defined for the followinginstrument types:
        01,,Exchange rates
        02,,Security prices
        03,,Reference interest rates
        04,,Index values
        Key for instrument 1: For instrument types 02 (security price),03 (reference interest rate), and 04 (index), the key for the firstinstrument comprises one field (KEY 1). For instrument type 01(currency), field KEY 2 is used as a second key for the firstinstrument.
        Key for instrument 2: This field is not used for volatilities.
        Date: In the date field you enter the date on which thevolatility was calculated or determined in the format DDMMYYYY.
        Value type: The value type describes the volatility type. Asvolatility types must be specified, you need to define them incustomizing before volatilities are transferred to the SAP system. Thename for the volatility type must be defined by the user, and can bechosen freely. You define the volatility types in table ATV01. Here, youenter the rate category and the statistics type. You need to havedefined the statistics type in customizing before you can definevolatility types. You can define statistics types in table ATVO3. Whendefining the statistics type, the fields for sample size or sample pe
        riod and confidence level are relevant for the transfer structure.
        Retention period: The field RETENTION PERIOD is the key forvolatilities and must be filled.
        Value: Volatility value: The whole numbers and decimal placesmust be separated with a period.
        Sample period: Although the sample period is relevant forvolatilities, it does not have to be specified by the user, as thesystem can derive the value via the volatility type and the statisticstype. If the user enters a value in this field, the system mustcross-check the value with the DDIC tables. If the value is invalid, thesystem rejects the transfer record.
        Confidence level: If the user enters a value in this field, itneeds to be cross-checked with table ATVO3, via the volatility type andstatistics type. If the value is invalid, the system rejects thetransfer record.
        NEW-PAGE

        Required/Optional Fields for Correlations
        Field Name ,,Cat. ,,Length ,,R/O/E ,,Description
        Value cat. ,,CHAR ,,2 ,,R ,,Fixed value for correlations '02'
        Data class 1,,CHAR ,,2 ,,R ,,Data class for instrument 1
        Key 1 ,,CHAR ,,20 ,,R ,,Key 1 for Instrument 1
        ,, ,, ,, ,,Exchange rates: FROM currency
        ,, ,, ,, ,,Security prices (sec. ID number)
        ,, ,, ,, ,,Reference interest rates
        ,, ,, ,, ,,Indexes
        Key 2 ,,CHAR ,,20 ,,R ,,Key 2 for Instrument 1
        ,, ,, ,,R ,,Exchange rates: TO currency
        Data class 2,,CHAR ,,2 ,,R ,,Data class for instrument 2
        Key 1 ,,CHAR ,,20 ,,R ,,Key 1 for instrument 2
        ,, ,, ,,R ,,Exchange rates: FROM currency
        ,, ,, ,,R ,,Security prices (sec. ID number)
        ,, ,, ,,R ,,Reference interest rates
        ,, ,, ,,R ,,Indexes
        Key 2 ,,CHAR ,,20 ,,O ,,Key 2 for instrument 2
        ,, ,, ,,R ,,Exchange rates: TO currency
        Date ,,CHAR ,,8 ,,R ,,Contribution date
        ,, ,, ,, ,,(Format: DDMMYYYY)
        Value type ,,CHAR ,,10 ,,R ,,Correlation type
        Ret. period ,,CHAR ,,5 ,,R ,,No. of days
        Rate type 1 ,,CHAR ,,15 ,,O ,,Rate type of 1st instrument
        ,, ,, ,, ,,(middle, bid, ask, spot)
        Rate type 2 ,,CHAR ,,15 ,,O ,,Rate type of 2nd instrument
        ,, ,, ,, ,,(middle, bid, ask, spot)
        Value ,,CHAR ,,20 ,,R ,,Volatility value
        Time ,,CHAR ,,6 ,,O ,,Contribution time
        ,, ,, ,, ,,Format: HHMMSS
        Period ,,CHAR ,,4 ,,O ,,Sample period in days
        Confid. lvl ,,CHAR ,,6 ,,O ,,Confidence level of volatility
        ,, ,, ,, ,,in % (0.00 to 100.00)
        Decay factor,,CHAR ,,4 ,,E ,,Value between 0.00 and 1.00

        Notes on Correlation Fields:
        Value category: The value category for correlations is 02.
        Instrument Type/Data Class:
        The instrument type differentiates between currencies, interest rates,indexes and securities. Correlations are defined for the followinginstrument types:
        01,,Exchange rates
        02,,Security prices
        03,,Reference interest rates
        04,,Index values
        Key for instrument 1: For instrument types 02 (security price),03 (reference interest rate), and 04 (index), the key for the firstinstrument comprises one field (KEY 1). For instrument type 01(currency), field KEY 2 is used as a second key for the firstinstrument.
        Key instrument 2: The user must specify the key for the secondinstrument. This is the instrument for which correlations are defined.For instrument types 02 (security price), 03 (reference interest rate),and 04 (index), the key for the second instrument comprises one field(KEY 1), as for the first instrument. For instrument type 01 (currency),field KEY 2 is used as a second key for the second instrument.
        Date: In the date field you enter the date on which thevolatility was calculated or determined in the format DDMMYYYY.
        Value: Correlation value: The whole numbers and decimal placesmust be separated with a period.
        Value type: The value type describes the correlation type. Ascorrelation types must be specified, you need to define them inCustomizing before correlations are transferred to the SAP system. Thename for the correlation type must be defined by the user, and can bechosen freely. You define the correlation types in table ATKO1. Here,you enter the rate category (security price category and exchange ratecategory) and the statistics type. You need to have defined thestatistics type in Customizing before you can define the correlationtype. You define the statistics type in table ATVO3. When defining thestatistics type, the field for the sample size or period is relevant forthe transfer structure. The confidence level is not relevant forcorrelations.
        Retention period: The retention period forms the key forcorrelations and must be specified in days.
        Sample period: Although the sample period is relevant forcorrelations, it does not have to be specified by the user, as thesystem can derive the value via the correlation type and the statisticstype. If the user enters a value in this field, the system mustcross-check the value with the DDIC tables. If the value is invalid, thesystem rejects the transfer record.
        In contrast to the DDIC table of volatilities, the correlation tableATXKO contains all the correlation types. Therefore there are noseparate tables for exchange rates, security prices, reference interestrates or indexes.
        NEW-PAGE

        Required/optional fields for beta factors
        Field name ,,Cat. ,,Length ,,R/O/E ,,Description
        Value cat. ,,CHAR ,,2 ,,R ,,Fixed value for beta factors '03'
        Data class 1 ,,CHAR ,,2 ,,R ,,Data class for instrument 1
        ,, ,, ,, ,,usually index (04)
        Key 1 ,,CHAR ,,20 ,,R ,,Key 1 for instrument 1
        ,, ,, ,, ,,Index name
        Key 2 ,,CHAR ,,20 ,,E ,,Key 2 for instrument 1
        Data class 2 ,,CHAR ,,2 ,,R ,,Data class for instrument 2
        ,, ,, ,, ,,usually security
        Key 1 ,,CHAR ,,20 ,,R ,,Key 1 for instrument 2
        ,, ,, ,, ,,Security ID number
        Key 2 ,,CHAR ,,20 ,,E ,,Key 2 for instrument 2
        Date ,,CHAR ,,8 ,,R ,,Contribution date
        ,, ,, ,, ,,(Format: DDMMYYYY)
        Value type ,,CHAR ,,10 ,,R ,,Beta factor type
        Ret. period ,,CHAR ,,5 ,,R ,,Number in days
        Rate type 1 ,,CHAR ,,15 ,,O ,,Rate type of 1st instrument
        ,, ,, ,, ,,(spot, closing)
        Rate type 2 ,,CHAR ,,15 ,,E ,,Rate type of 2nd instrument
        Value ,,CHAR ,,20 ,,R ,,Beta factor
        Time ,,CHAR ,,6 ,,O ,,Contribution time (HHMMSS)
        Period ,,CHAR ,,4 ,,O ,,Sample period in days
        Confid. lvl ,,CHAR ,,6 ,,E ,,Empty
        Decay factor ,,CHAR ,,4 ,,E ,,Empty

        Notes on beta factor fields
        Value category: The value category for beta factors is 03.
        Instrument type / Data class:
        The instrument type differentiates between currencies, interest rates,indexes and securities. Correlations are defined for the followinginstrument types:
        01,,Exchange rates
        02,,Security prices
        03,,Reference interest rates
        04,,Index values
        As a beta factor is a ratio variable of two different instruments -indexes and security or stock ID numbers - the instrument types for theinstruments are predefined in the system.
        Key for instrument 1: The key for the first instrument comprisesone field, and describes the index to which the beta factor relates.
        The second field of the key (KEY 2) is not required and remains empty.
        Key for instrument 2: The user must specify the key for thesecond instrument. It specifies the security ID number for which thebeta factor is calculated. The key comprises one field (KEY 1), whichdescribes the security ID number.
        Date: Date on which the beta factor is calculated or determined.The date must be entered in the format DDMMYYYY.
        Value type: The value type describes the beta factor type. Asbeta factor types must be specified, you need to define them inCustomizing before beta factors are transferred to the SAP system. Thename for the beta factor type must be defined by the user, and can bechosen freely. You define the beta factor types in table JBRBFART. Here,you enter the retention period and the sample size or period upon whichthe beta factor is based.
        Retention period: For beta factors, the retention period playsonly a subordinate role, and the field is optional. The retention periodcan be derived indirectly via the beta factor type. If you do specify aretention period, the system cross-checks the entry with DDIC tables,and rejects the transfer record if the value is invalid.
        Value: Beta factor: The whole number and decimal places must beseparated with a period.
        Sample period: Although the sample period is relevant for betafactors, it does not have to be specified by the user, as the system canderive the value indirectly via the beta factor type. If the user entersa value in this field, the system cross-checks the value with the DDICtables. If the value is invalid, the system rejects the transfer record.

520293RFTBFF20:Volatility data updated into incorrect tables !!!