Quantcast
Channel: SCN : Blog List - SAP ERP Financials - Treasury Applications
Viewing all 77 articles
Browse latest View live

How the system determines planned interest rates for variable interest reference

$
0
0

In the customizing “Define Company Code Additional Data”, “Settings for variable interest rates”, it is possible to decide “Planned record update”.

customizing 1.PNG

update rule.PNG

Here I would like to introduce how system updates the planned variable interest rates, with the option “04 Update with current interest rates”. Here is the F1 help for this option:

The values of flows whose interest rates have not yet been adjusted are calculated on the basis of the most up-to-date interest rates, irrespective of whether these were determined by automatic or manual interest rate adjustment.

 

This means we use the latest interest rates, no matter where they are coming from. First, the automatic interest rate will be checked from table T056P, for e.g. reference interest rate EONIA :    

T056P.PNG


Second, manual interest rate can be found in table TRIAT with Trigger (IRA_TRIGGER) = MN, and the reference interest rate, entries are listed for all related business transactions.

TRIAT.PNG

Now if you create a new interest rate instrument transaction with variable interest EONIA like below:

create deal.PNG

Let us check the Cash flow:

cash flow.PNG


E.g. for the first interest period, interest fixing date 2010/01/01, most latest interest rate is from automatic interest rate table T056P, “EONIA  2010/01/01   0,5500000”.

For the fourth interest period, interest fixing date 2011/07/01, the interest rate from table TRIAT: “2011/03/21      EONIA 0,6000000” is most up-to-date.

For the last interest flow, interest fixing date 2012/07/01, rate from entry of table TRIAT “2012/02/28 EONIA  8,0000000” will be selected.

For other options, please refer to the online help:

online help.PNG

Related program:

 

SAPLTRIA_COREMETHODINTEREST_RATE_AUTO / interest_rate_man
SAPLTRIA_COREMETHODIF_IRA_BEARER~INTEREST_VALUES_GET
SAPLTB06FUNCTIONTB_CASHFLOW_CONSTRUCT_VAR_CORE

Interview with Zalando: From Startup to Grown-Up

$
0
0

Read the interview with Marco Arosio, Head of Treasury, Zalando SE, talking about the company's cash and risk management, financing, SAP solution implemented and the benefits of these, as well as about the biggest challenges encountered during the implementation of the solution.

 

Brief abstract:

Question:  Could you tell us a little more about the company and, in particular, your treasury function?

 

Answer:  "Zalando is Europe's leading online fashion platform for women, men and children with presence in 15 European markets. We provide our customers with a convenient one-stop shopping experience, offering an extensive selection of fashion items including shoes, apparel, and accessories, with free delivery and returns. Our assortment of more than 1,500 international brands - ranging from popular global brands to local brands - is complemented by its private label products.

 

Zalando’s websites attract more than 138 million visits per month. In the fourth quarter of 2015, roughly 60% of traffic came from mobile devices, and we had more than 17.9 million active customers by the end of the year (...)"

Continue to the interview page >

New product Type 'Trade Finance' with product cat. 'Letter of Credit' in TRM

$
0
0

A new product Type Trade Finance is delivered with the new product category Letter of Credit .

Now this functionality is available in EhP 8 and downported to EhP7 SP10 .

you can find the detailed information in release note 2297926 .

2297926Release Note: Trade Finance Enhancements (EHP8 SP02)

 

You can also refer to the notes as below:

2280260TF Downport: Analyzer
2281306TF Downport: Application Framework
2291872TF Downport: Business Function FIN_TRM_TRADE_FIN_2
2276121TF Downport: Coding Changes for Switches
2279551TF Downport: Coding Package FTR_TRADE_FINANCE
2281361TF Downport: Common Code for BAPI
2284810TF Downport: Correspondence
2268295TF Downport: Customer Usage for LC
2281334TF Downport: DDIC Object Common Code for BAPI
2280045TF Downport: DDIC Objects Analyzer
2281271TF Downport: DDIC Objects Application Framework
2282960TF Downport: DDIC Objects Correspondence
2283648TF Downport: DDIC Objects for LC and BG BAPI
2281276TF Downport: DDIC Objects for Logical Database
2279500TF Downport: DDIC Objects for Package FTR_TRADE_FINANCE
2275569TF Downport: DDIC Objects for Switches
2283650TF Downport: LC and BG BAPI
2281327TF Downport: Logical Database
2202897TF Downport: Logical Database FTI_TR_DEALS
2285425TF Downport: PDF forms
2276123TF Downport: Switch BC Sets for Application Framework
2200823TF Preparation: Coding Changes for Switches
2201312TF Preparation: DDIC Objects for Application Framework
2202578TF Preparation: DDIC Objects for Application Framework - Subsequent Work
2202858TF Preparation: DDIC Objects for Correspondence
2202853TF Preparation: DDIC Objects for Logical Database FTI_TR_DEALS
2200829TF Preparation: DDIC Objects for Package FTR_TRADE_FINANCE
2200671TF Preparation: DDIC Objects for Switches
2201039TF Preparation: Switch BC Sets
2202658TF Preparation: Table Content for Application Framework


Establishing a Single Finance Platform for All Treasury Operations with Vattenfall

$
0
0

Read the interview with a Senior SAP Treasury Consultant from Vattenfall Europe Information Services GmbH: “Establishing a Single Finance Platform for All Treasury Operations with Vattenfall”.

 

Find out what prompted the decision to establish a single finance platform for all treasury operations, what are the main benefits of the solution and what are the biggest challenges that the Vattenfall team has encountered.

 

 

Abstract:

"Could you give us a brief outline about the company and describe the role of your treasury function?

 

Vattenfall is one of Europe’s largest generators of electricity and heat. The company is 100% owned by Kingdom of Sweden and operates mainly in Denmark, Finland, Germany, The Netherlands, Sweden and the UK. The main products are electricity, heat, gas and energy services. Due to strong energy markets Vattenfall is currently being transformed from a traditional utility to a customer-focused, lean and responsive organisation.

 

I work as a Senior SAP Treasury consultant in the German IT company of Vattenfall and I’m responsible for all treasury related processes, mainly on our SAP treasury system as well as on the connected SAP ERP and non-SAP systems. I provide solutions in this area and also have a role in implementing projects related to treasury and maintaining our treasury system (...)" Read the full interview >

Exposure Management 2.0

$
0
0

This article is to provide basic process of how exposure management work in SAP- Treasury. For configuration please refer help.sap.com articles.


The new Exposure Management 2.0 enables you to manage exposure items for open commodity items and open currency items. In the Hedge Accounting for  Exposures, you can map the hedging of commodity price risks using the corresponding hedging transactions in the Transaction Manager.


1.FTREX1:Create Raw exposure


  In the below example I have created raw exposure for brass. In many cases, a commodity comprises several other commodities that bear the actual price risk. This is the case with brass for example. (FTREX7) to map such a scenario in the system.

RAW-1.JPG


RAW-2.JPG


2. FTREX2: select the ID and Initial release

RAW-3.JPG

Once released, the Position created based on split of the brass item.

RAW-4.JPG


3. FTREX12: Please check the unhedged item.

RAW-5.JPG

4. THMEX: Create hedge plan

RAW-6.JPG

5. FTR_CREATE Create forward contract/deal for USD for hedging relationship

RAW-7.JPG

 

 

6. THMEX: Assigned hedging relationship

RAW-8.JPG

7 FTREX12, Please transfer the un hedge item from exposure to hedge Management.

RAW-9.JPG

Once transferred successfully, the amount will be reflect in Hedge item field. Please refer hedged and unhedge field.

RAW-10.JPG

8. Please check OB08 setting for USD to EUR

RAW-11.JPG

9. THM80: Effective measurement calculation.

RAW-12.JPG

RAW-13.JPG

9. TBB1

RAW-14.JPG

 

Tips: Exposure Activity Type The exposure activity type is a required entry when you create a raw exposure. Sub-raw exposures created for a raw exposure take the value of the exposure values in line with what you enter here. The exposure activity type specifies a number of key settings that determine how raw exposures behave and how their data is stored.

 

Raw exposure

In exposure management, only the basic data relating to your operative business transactions is stored in a raw format known in the system as a raw exposure. A raw exposure is a simple mapping of an operative business transaction.

 

Sub raw exposure

All information relating to financial risks is stored in sub raw exposures. Here, a distinction is made between foreign currency risks and commodity price risks. Sub raw exposures form part of a raw exposure. A raw exposure can contain several sub raw exposures.

 

Exposure position

Raw exposures, as a total, represent the financial risk associated with your operative transaction. The total risk position is known as an exposureposition, which comprises several sub raw exposures.

 

Differentiation and exposure transactions

Differentiation enables you to define how risks are divided. Here, the sub raw exposures are initially converted into a temporary intermediate format. They then become exposure transactions and are used to create exposure positions.

 

Exposure position flow

Exposure transactions are used to create exposure position flows, which, in turn, create the exposure position. An exposure position generally contains several exposure position flows.

 

Exposure position value

The exposure position value is the total value of the exposure position.flows for one exposure position on a particular key date.


PS:above example was created in IDES system for this post.  Coming soon 2nd post in Exposure Management 2.0

Effectiveness Test-THM80

$
0
0

This article is to provide technical difference between Perform assessment  and perform measurement SAP- Treasury. For configuration please refer help.sap.com articles

 

The accounting principle IAS 39 and FAS 133 require effectiveness tests to be carried out for the hedging relationship.

 

HM-1.JPG

We may wonder what the difference between the two effectiveness because they are very similar in context of meaning. If you closely look both calculate effectiveness using same method.

 

HG-2.JPG

 

Perform assessment (above screenshot) provides  just a information on the whether a hedging relationship is effective or not, on the other hand perform measurement (below screenshot) provide information on the posting specific effectiveness result whether test is effective or not.

HG-3.JPG


The system does not save the detail logs of the retrospective effectiveness assessment and the effectiveness measurement when you use the key date valuation and generate derived business transactions. Please implement this SAP note: 1014939

Runtime Errors LOAD_PROGRAM_NOT_FOUND in TRM

$
0
0

After upgraded the system, you  get this dump  LOAD_PROGRAM_NOT_FOUND  when running  the FTR_CREATE/FTR_EDIT transactions.

Dump details:

Runtime Errors      LOAD_PROGRAM_NOT_FOUND

Except               CX_SY_PROGRAM_NOT_FOUND

Short text

Program "/1TRIS/40XXX9999 " not found.

*XXX is Capital English letter

9999 is number , usually it is 0000, 0001 or 0002.

 

This issue can be resolved by MR note 787523:

The environment for your analysis structure must be generated. You can find the step in Customizing in the definition of the analysis structure using menu 'Goto -> Generate Environment'. As an alternative you can also execute Transaction JBRGE. Select all settings there and execute the generation.
This action should always be carried out if changes have been made in the analysis structure or if an upgrade was carried out. This action is not critical. If problems occur concerning the analysis parameters (e.g. in a CFM transaction), execute the generation of the environment for the analysis structure.

Release notes for TRM


only ‘Exchange Rate Risk’ displayed in field 'Risk Category' in THMEX

$
0
0

When you want to create a hedge plan in THMEX, you will found only 'Exchange Rate Risk' shown in listbox of field 'Risk Category'.

thmex.JPG

The reason is that one of business functions as below is activated in SFW5:

SIMPLIFY_ON_PREMISE

SIMPLIFY_PUBLIC_CLOUD

SIMPLIFY_MANAGED_CLOUD

 

New update on 19th Aug:

As commodity is not available in S/4, this is correct .

After discussion, interest rate risk also not available now, and will not released recently.

Market Data Management (index)

$
0
0

In this series of articles, I would like to tell you how to manage Market data: how to create it, how to upload it and how to use it.

 

TRM Market Data Management: Datafeed: Configuration.

$
0
0

Using Datafeed we can upload Market data into SAP automatically from different Market data providers.

 

I want to show you an example how you can use Datafeed.

 

Input data

I have a web site of National Bank of the Republic of Belarus ( Exchange Rates, Refinancing Rate, News | National Bank of the Republic of Belarus) from where i can get information about:

 

Each of mentioned Market data has API which can retrieve information. API is the URL with parameters. API returns a string with information.

22.jpg

47.jpg

48.jpg

As a result we need to get information into SAP and parse it into the special table "Answer".

 

Before we can use Datafeed, we need to configure the system.

 

Configuration

 

Create Market Data Provider

IMG -> Financial Supply Chain Management -> Treasury and Risk Management -> Basic Functions -> Market Data Management -> Datafeed -> Technical Settings -> Define Datafeed Name  (tr. S_ALR_87007834)

 

Here we create Market Data provider in order to separate the different sources of information:

  • Data provider - name of data provider.
  • Usage log - If you need to log all data retrievals. SAP Menu -> Accounting -> Financial Supply Chain Management -> Treasury and Risk Management -> Basic Functions -> Market Data Management -> Datafeed -> Usage Log -> ...
  • Feed active? - distinguish active and inactive feeds.
  • Quotation source - Quotation source for commodity.

01.jpg

 

 

RFC Settings for External Partner Program

 

We can contact external partners in two different ways:

  • Using RFC (remote function call) and calling external funciton.
  • Web Access (URL or Web Services).

Let's start with Web Access.

 

In my case i will use Web Acces.

 

IMG -> Financial Supply Chain Management -> Treasury and Risk Management -> Basic Functions -> Market Data Management -> Datafeed -> Technical Settings -> RFC Settings for External Partner Program -> Assign Datafeed RFC Destination (tr. SM30 -> V_VTB_DFD)

 

  • Datafeed operating mode:
    • •'1' synchronous:  SAP waits until the external partner program has delivered all the data.
    • •'2' asynchronous: SAP does not wait until the external partner program has delivered all the data but immediately switches control back to the calling program. The data is delivered from the external partner program at a later date (possibly in separate blocks).

          For Web Access we choose Synchronous operation mode.

  • Function: There is a standard SAP function module TB_DATAFEED_INTERNET_ACCESS to get information from web. But as i described earlier my data provider has special API - so i need to modify standard FM. So i created ZTB_DATAFEED_INTERNET_ACCESS
  • RFC destination, Back-up RFC destination: For Web Access in my case i do not need RFC connection.

02.jpg

 

 

FUNCTION ztb_datafeed_internet_access.
*"----------------------------------------------------------------------
*"*"Локальный интерфейс:
*"  IMPORTING
*"     VALUE(FEEDNAME) LIKE  VTB_DFDEST-RFEEDNAME
*"     VALUE(HISTORY) LIKE  VTB_DFCU-RUPDHIST
*"     VALUE(UPDATE) LIKE  VTB_DFCU-RUPDHIST
*"     VALUE(BLANKSTOCRLF) TYPE  VTB_DFDEST-BLANKSTOCRLF DEFAULT 'X'
*"     VALUE(CLEAR_REQUEST_ENTITY_BODY) TYPE  BOOLEAN DEFAULT 'X'
*"  EXPORTING
*"     VALUE(E_MESSAGE_BUFFER) LIKE  VTB_MARKET-ERROR
*"  TABLES
*"      ANSWER STRUCTURE  VTB_DFANS
*"      REQUEST STRUCTURE  VTB_DFREQ
*"  EXCEPTIONS
*"      DATAFEED_FAILURE
*"----------------------------------------------------------------------
************************************************************************
* Declarations   CONSTANTS: rworkmodus LIKE vtb_dfdest-rworkmodus VALUE '1'.   DATA: zresponse_body             TYPE TABLE OF zchar9000 WITH HEADER LINE, " STRING TYPE         zstr                       TYPE zchar9000,         zsplit                     TYPE STANDARD TABLE OF char200 WITH HEADER LINE,         zresponse_headers          TYPE TABLE OF char50 WITH HEADER LINE,         text_to_be_scanned         TYPE char200,      " String of market data         regular_expression_pattern TYPE char200,      " REGEXP to find data in String of market data         res                        TYPE match_result, " Found result in String of market data         text                       TYPE char200,      " Temporary variable to pass market data into answer table         zuri                       TYPE tb_dfuri,     " URL from VTB_DFDEST table. We will modify URL to match requests.         zmetal                     TYPE char15,         zcur                       TYPE tb_key1_ex,   " External data provider currency code         zmet                       TYPE tb_prpty.     " External data provider metal code   TABLES: vtb_dfdest.
* Temp answer table   DATA: BEGIN OF temp_answer OCCURS 100.       INCLUDE STRUCTURE vtb_dfans.   DATA: END OF temp_answer.   DATA: hlp_message_buffer(50) TYPE c.
* Request tables   DATA: BEGIN OF request_headers OCCURS 100,           line LIKE tline-tdline.   DATA: END OF request_headers.   DATA: BEGIN OF request_entity_body OCCURS 100,           line LIKE vtbdfin-line.   DATA: END OF request_entity_body.
* Response tables   DATA: BEGIN OF response_headers OCCURS 10,           line LIKE tline-tdline.   DATA: END OF response_headers.   DATA: BEGIN OF response_entity_body OCCURS 10,           line           LIKE vtb_dfans,           newlinechar(2) TYPE c,         END   OF response_entity_body.
* status code RFC1945   DATA: status_code(3) TYPE c.
* length of response body   DATA: response_entity_body_length TYPE i.   DATA: request_entity_body_length  TYPE i.
************************************************************************
* Initialization   CLEAR: e_message_buffer, hlp_message_buffer.   REFRESH: request_headers, response_headers, request_entity_body,            response_entity_body, temp_answer.
* read table vtb_dfdest for URI and PROXY Information.   SELECT SINGLE * FROM  vtb_dfdest CLIENT SPECIFIED          WHERE  mandt       = sy-mandt          AND    rfeedname   = feedname          AND    rworkmodus  = rworkmodus.
* fill HTTP request page header   request_headers-line =               "/ HTML version 3.2      'content-type: text/plain'.                            "#EC *   APPEND request_headers.   IF clear_request_entity_body IS NOT INITIAL.     CLEAR   request_entity_body.     REFRESH request_entity_body.   ENDIF.
************************************************************************
* Retrieving market data from Data Provider   " Save the initial URL. We will modify vtb_dfdest-uri for different market data classes.   zuri = vtb_dfdest-uri.   " Loop at 'Data source' to get data   LOOP AT request.     CASE request-rinid2. "'Data source'         " Refinance rate       WHEN 'REFINANCE'.         " Create the right API URL for Refinance rate.         " If we have From (zreq-dfromdate) and To (zreq-dtodate) fields initial - then we request data on curren date (tr. TBD4).         " If we have From (zreq-dfromdate) and To (zreq-dtodate) fields NOT initial - then we requst history data (tr. TBDJ).         CLEAR vtb_dfdest-uri.         IF request-dfromdate IS INITIAL OR request-dtodate IS INITIAL.           CONCATENATE  zuri '/RefinancingRate?onDate=' sy-datum+0(4) '-' sy-datum+4(2) '-' sy-datum+6(2) INTO vtb_dfdest-uri.         ELSE.           CONCATENATE  zuri '/RefinancingRate' INTO vtb_dfdest-uri.         ENDIF.         CLEAR zresponse_body.         REFRESH zresponse_body.         CLEAR zresponse_headers.         REFRESH zresponse_headers.         CLEAR zstr.         CLEAR zsplit.         REFRESH zsplit.         CLEAR text_to_be_scanned.         WAIT UP TO 2 SECONDS.         " Requesting information.         CALL FUNCTION 'HTTP_GET'           EXPORTING             absolute_uri                = vtb_dfdest-uri             user                        = vtb_dfdest-foreign_user             password                    = vtb_dfdest-foreign_passwd             blankstocrlf                = blankstocrlf  "VTB_DFDEST-BLANKSTOCRLF           IMPORTING             status_code                 = status_code             response_entity_body_length = response_entity_body_length           TABLES             request_entity_body         = request_entity_body             request_headers             = request_headers             response_entity_body        = zresponse_body[]             response_headers            = zresponse_headers[]           EXCEPTIONS             connect_failed              = 1             timeout                     = 2             internal_error              = 3             tcpip_error                 = 4             OTHERS                      = 5.         " error handling!!!         IF sy-subrc <> 0. "/ no connection           CASE sy-subrc.             WHEN '1'.               e_message_buffer =                            'Сonnect_failed'(890).
             WHEN '2'.               e_message_buffer =                            'Timeout'(891).             WHEN '3'.               e_message_buffer =                            'Internal_error'(892).             WHEN '4'.               e_message_buffer =                            'TCP/IP error'(893).             WHEN OTHERS.               e_message_buffer =                            'HTTP-GET error'(894).           ENDCASE.           EXIT.           " error handling!!!         ELSEIF  status_code <> '200'.        "/ connection ok, other problems           LOOP AT response_headers.             hlp_message_buffer = response_headers-line.             "/ first line contains error             EXIT.           ENDLOOP.           " concatenate 'Fehler: '(910) status_code hlp_message_buffer           MOVE hlp_message_buffer TO e_message_buffer.           CONDENSE e_message_buffer.           EXIT.         ELSE.           " everything was fine...           CLEAR answer.           LOOP AT zresponse_body INTO zstr.             " All data is diveded by '},{'. Let's split it into 1 string - 1 market data.             SPLIT zstr AT '},{' INTO TABLE zsplit IN CHARACTER MODE.             " Loop through and retrieve data that we need.             LOOP AT zsplit INTO text_to_be_scanned.               " Searching for date.               regular_expression_pattern = '\d{4}-\d{2}-\d{2}'.               FIND REGEX regular_expression_pattern IN text_to_be_scanned RESULTS res.               IF sy-subrc = 0.                 CLEAR text.                 text = text_to_be_scanned+res-offset(res-length).                 CONCATENATE text+0(4) text+5(2) text+8(2) INTO answer-ddate.               ENDIF.               " Searching for time.               regular_expression_pattern = '\d{2}:\d{2}:\d{2}'.               FIND REGEX regular_expression_pattern IN text_to_be_scanned RESULTS res.               IF sy-subrc = 0.                 CLEAR text.                 text = text_to_be_scanned+res-offset(res-length).                 CONCATENATE text+0(2) text+3(2) text+6(2) INTO answer-ttime.               ENDIF.               " Searching for value.               regular_expression_pattern = '\d{1,}\.\d{1,5}'.               FIND REGEX regular_expression_pattern IN text_to_be_scanned RESULTS res.               IF sy-subrc = 0.                 answer-value = text_to_be_scanned+res-offset(res-length).               ENDIF.               " Other parameters (tr. SM30 -> V_DFCU03)               answer-rinid1 = 'REFINANCE'. "Instrument               answer-rinid2 = 'REFINANCE'. "Data Source               answer-sprpty = 'REFINANCE'. "Instrument property               answer-uname = sy-uname.               " Save market data into Answer table.               APPEND answer.             ENDLOOP.           ENDLOOP.         ENDIF.         " Exchange rate       WHEN 'CURRENCY'.         CLEAR vtb_dfdest-uri.         " Get external codes for currency codes.         SELECT SINGLE rkey1 FROM mducr INTO zcur WHERE vendor = 'NBRB.by' AND source = 'F' AND waers = request-rinid1+3(3).         IF sy-subrc <> 0.           CONCATENATE 'Error: Convert Codes for Currency Names: ' request-rinid1+3(3) 'SM30 -> V_MDUDFCR' INTO e_message_buffer.           EXIT.         ENDIF.         " Create the right API URL for Exchange rates.         " If we have From (zreq-dfromdate) initial or ( From (zreq-dfromdate) and To (zreq-dtodate) fields initial - then we request data on curren date (tr. TBD4).         " Otherwise - we requst history data on zreq-dfromdate (tr. TBDJ).         IF request-dfromdate IS INITIAL OR ( request-dtodate IS INITIAL AND request-dfromdate IS INITIAL ). " tr. TBD4           CONCATENATE zuri " http://www.nbrb.by/API                     '/ExRates/Rates/Dynamics/'                     zcur                     '?startDate='                     sy-datum+0(4) '-'                     sy-datum+4(2) '-'                     sy-datum+6(2)                     '&endDate='                     sy-datum+0(4) '-'                     sy-datum+4(2) '-'                     sy-datum+6(2)                     INTO vtb_dfdest-uri.           sy-tcode = 'TBD4'.         ELSE. " tr. TBDJ           CONCATENATE zuri " http://www.nbrb.by/API                               '/ExRates/Rates/Dynamics/'                               zcur                               '?startDate='                               request-dfromdate+0(4) '-'                               request-dfromdate+4(2) '-'                               request-dfromdate+6(2)                               '&endDate='                               request-dtodate+0(4) '-'                               request-dtodate+4(2) '-'                               request-dtodate+6(2)                               INTO vtb_dfdest-uri.           sy-tcode = 'TBDJ'.         ENDIF.         CLEAR zresponse_body.         REFRESH zresponse_body.         CLEAR zresponse_headers.         REFRESH zresponse_headers.         CLEAR zstr.         CLEAR zsplit.         REFRESH zsplit.         CLEAR text_to_be_scanned.         WAIT UP TO 2 SECONDS.         " Requesting information.         CALL FUNCTION 'HTTP_GET'           EXPORTING             absolute_uri                = vtb_dfdest-uri             user                        = vtb_dfdest-foreign_user             password                    = vtb_dfdest-foreign_passwd             blankstocrlf                = blankstocrlf  "VTB_DFDEST-BLANKSTOCRLF           IMPORTING             status_code                 = status_code             response_entity_body_length = response_entity_body_length           TABLES             request_entity_body         = request_entity_body             request_headers             = request_headers             response_entity_body        = zresponse_body[]             response_headers            = zresponse_headers[]           EXCEPTIONS             connect_failed              = 1             timeout                     = 2             internal_error              = 3             tcpip_error                 = 4             OTHERS                      = 5.         " error handling!!!         IF sy-subrc <> 0. "/ no connection           CASE sy-subrc.             WHEN '1'.               e_message_buffer =                            'Сonnect_failed'(890).
             WHEN '2'.               e_message_buffer =                            'Timeout'(891).             WHEN '3'.               e_message_buffer =                            'Internal_error'(892).             WHEN '4'.               e_message_buffer =                            'TCP/IP error'(893).             WHEN OTHERS.               e_message_buffer =                            'HTTP-GET error'(894).           ENDCASE.           EXIT.         ELSEIF  status_code <> '200'.        "/ connection ok, other problems           " error handling!!!           LOOP AT response_headers.             hlp_message_buffer = response_headers-line.             "/ first line contains error             EXIT.           ENDLOOP.           "     concatenate 'Fehler: '(910) status_code hlp_message_buffer           MOVE hlp_message_buffer TO e_message_buffer.           CONDENSE e_message_buffer.           EXIT.         ELSE.           " everything was fine...           CLEAR answer.           READ TABLE zresponse_body INTO zstr INDEX 1.           " All data is diveded by '},{'. Let's split it into 1 string - 1 market data.           SPLIT zstr AT '},{' INTO TABLE zsplit IN CHARACTER MODE.           " Loop through and retrieve data that we need.           LOOP AT zsplit INTO text_to_be_scanned.             " Searching for date.             regular_expression_pattern = '\d{4}-\d{2}-\d{2}'.             FIND REGEX regular_expression_pattern IN text_to_be_scanned RESULTS res.             IF sy-subrc = 0.               CLEAR text.               text = text_to_be_scanned+res-offset(res-length).               CONCATENATE text+0(4) text+5(2) text+8(2) INTO answer-ddate.             ENDIF.             " Searching for time.             regular_expression_pattern = '\d{2}:\d{2}:\d{2}'.             FIND REGEX regular_expression_pattern IN text_to_be_scanned RESULTS res.             IF sy-subrc = 0.               CLEAR text.               text = text_to_be_scanned+res-offset(res-length).               CONCATENATE text+0(2) text+3(2) text+6(2) INTO answer-ttime.             ENDIF.             " Searching for echange rate.             regular_expression_pattern = '\d{1,}\.\d{1,5}'.             FIND REGEX regular_expression_pattern IN text_to_be_scanned RESULTS res.             IF sy-subrc = 0.               answer-value = text_to_be_scanned+res-offset(res-length).             ENDIF.             " Other parameters             answer-currency = request-rinid1+3(3).             answer-rinid1 = request-rinid1.             answer-rinid2 = 'CURRENCY'.             answer-sprpty = 'M'.             answer-uname = sy-uname.             " Save market data into Answer table.             APPEND answer.           ENDLOOP.         ENDIF.       WHEN 'METALS'.         CLEAR vtb_dfdest-uri.         " Get external codes for commodities.         SELECT SINGLE sprpty FROM mducmv INTO zmet WHERE vendor = 'NBRB.by' AND source = 'F' AND quotyp = request-rinid1.         IF sy-subrc <> 0.           CONCATENATE 'Error: Convert Codes for Metal: ' request-rinid1+3(3) 'SM30 -> V_MDUCMV' INTO e_message_buffer.           EXIT.         ENDIF.         " URL for tr. TBD4         IF request-dfromdate IS INITIAL OR ( request-dtodate IS INITIAL AND request-dfromdate IS INITIAL ).           CONCATENATE zuri "http://www.nbrb.by/API                       '/BankIngots/Prices/'                       zmet                       '?startDate='                       sy-datum+0(4) '-' sy-datum+4(2) '-' sy-datum+6(2)                       '&endDate='                       sy-datum+0(4) '-' sy-datum+4(2) '-' sy-datum+6(2)                       INTO vtb_dfdest-uri.           " URL for tr. TBDJ         ELSEIF request-dfromdate IS NOT INITIAL AND request-dtodate IS INITIAL.           CONCATENATE zuri "http://www.nbrb.by/API                       '/BankIngots/Prices/'                       zmet                       '?startDate='                       request-dfromdate+0(4) '-' request-dfromdate+4(2) '-' request-dfromdate+6(2)                       '&endDate='                       request-dfromdate+0(4) '-' request-dfromdate+4(2) '-' request-dfromdate+6(2)                       INTO vtb_dfdest-uri.           " URL for tr. TBDJ         ELSE.           CONCATENATE zuri "http://www.nbrb.by/API                       '/BankIngots/Prices/'                       zmet                       '?startDate='                       request-dfromdate+0(4) '-'                       request-dfromdate+4(2) '-'                       request-dfromdate+6(2)                       '&endDate='                       request-dtodate+0(4) '-'                       request-dtodate+4(2) '-'                       request-dtodate+6(2)                       INTO vtb_dfdest-uri.         ENDIF.         CLEAR zresponse_body.         REFRESH zresponse_body.         CLEAR zresponse_headers.         REFRESH zresponse_headers.         CLEAR zstr.         CLEAR zsplit.         REFRESH zsplit.         CLEAR text_to_be_scanned.         WAIT UP TO 2 SECONDS.         " Requesting information.         CALL FUNCTION 'HTTP_GET'           EXPORTING             absolute_uri                = vtb_dfdest-uri             user                        = vtb_dfdest-foreign_user             password                    = vtb_dfdest-foreign_passwd             blankstocrlf                = blankstocrlf  "VTB_DFDEST-BLANKSTOCRLF           IMPORTING             status_code                 = status_code             response_entity_body_length = response_entity_body_length           TABLES             request_entity_body         = request_entity_body             request_headers             = request_headers             response_entity_body        = zresponse_body[]             response_headers            = zresponse_headers[]           EXCEPTIONS             connect_failed              = 1             timeout                     = 2             internal_error              = 3             tcpip_error                 = 4             OTHERS                      = 5.         " error handling!!!         IF sy-subrc <> 0.                    "/ no connection           CASE sy-subrc.             WHEN '1'.               e_message_buffer =                            'Сonnect_failed'(890).
             WHEN '2'.               e_message_buffer =                            'Timeout'(891).             WHEN '3'.               e_message_buffer =                            'Internal_error'(892).             WHEN '4'.               e_message_buffer =                            'TCP/IP error'(893).             WHEN OTHERS.               e_message_buffer =                            'HTTP-GET error'(894).           ENDCASE.           EXIT.         ELSEIF  status_code <> '200'.        "/ connection ok, other problems           " error handling!!!           LOOP AT response_headers.             hlp_message_buffer = response_headers-line.             "/ first line contains error             EXIT.           ENDLOOP.           "     concatenate 'Fehler: '(910) status_code hlp_message_buffer           MOVE hlp_message_buffer TO e_message_buffer.           CONDENSE e_message_buffer.           EXIT.         ELSE.           " everything was fine...           CLEAR answer.           READ TABLE zresponse_body INTO zstr INDEX 1.           " All data is diveded by '},{'. Let's split it into 1 string - 1 market data.           SPLIT zstr AT '},{' INTO TABLE zsplit IN CHARACTER MODE.           " Loop through and retrieve data that we need.           LOOP AT zsplit INTO text_to_be_scanned. "response_entity_body.             " Search for date             regular_expression_pattern = '\d{4}-\d{2}-\d{2}'.             FIND REGEX regular_expression_pattern IN text_to_be_scanned RESULTS res.             IF sy-subrc = 0.               CLEAR text.               text = text_to_be_scanned+res-offset(res-length).               CONCATENATE text+0(4) text+5(2) text+8(2) INTO answer-ddate.             ENDIF.             " Search for time             regular_expression_pattern = '\d{2}:\d{2}:\d{2}'.             FIND REGEX regular_expression_pattern IN text_to_be_scanned RESULTS res.             IF sy-subrc = 0.               CLEAR text.               text = text_to_be_scanned+res-offset(res-length).               CONCATENATE text+0(2) text+3(2) text+6(2) INTO answer-ttime.             ENDIF.             " Search for commodity rate             regular_expression_pattern = '\d{1,}\.\d{1,5}'.             FIND REGEX regular_expression_pattern IN text_to_be_scanned RESULTS res.             IF sy-subrc = 0.               answer-value = text_to_be_scanned+res-offset(res-length).             ENDIF.             " Search for external commodity code             regular_expression_pattern = '"MetalId":[0-9]{1}'.             FIND REGEX regular_expression_pattern IN text_to_be_scanned RESULTS res.             IF sy-subrc = 0.               zmetal = text_to_be_scanned+res-offset(res-length).             ENDIF.             " Other parameters             CASE zmetal+10(1).               WHEN '0'.                 answer-rinid1 = 'GOLD'.               WHEN '1'.                 answer-rinid1 = 'SILVER'.               WHEN '2'.                 answer-rinid1 = 'PLATINUM'.               WHEN '3'.                 answer-rinid1 = 'PALADIUM'.             ENDCASE.             answer-rinid2 = 'METALS'.             answer-sprpty = 'METALS'.             answer-uname = sy-uname.             " Save market data into Answer table.             APPEND answer.           ENDLOOP.         ENDIF.       WHEN OTHERS.     ENDCASE.   ENDLOOP.   " Delete empty lines   LOOP AT answer WHERE rinid1 IS INITIAL                    AND rinid2 IS INITIAL                    AND sprpty IS INITIAL.     DELETE answer.   ENDLOOP.   " Find missing requests and build up error answer   LOOP AT request.     LOOP AT answer WHERE rinid1 = request-rinid1                      AND rinid2 = request-rinid2                      AND sprpty = request-sprpty.     ENDLOOP.     IF sy-subrc NE 0.                  "/ no answer for reques       MOVE-CORRESPONDING request TO temp_answer.       temp_answer-sstats = '99'.       CONCATENATE 'There is no answer from DataFeed: ' e_message_buffer INTO temp_answer-error .       APPEND temp_answer.     ENDIF.   ENDLOOP.   " add missing entries to answer   LOOP AT temp_answer.     MOVE-CORRESPONDING temp_answer TO answer.     APPEND answer.   ENDLOOP.   " that´s it
ENDFUNCTION.

The code also attached to this article in TXT file.

 

Using RFC

For RFC we need to Enter our RFC destionation (tr. SM59, RFC with type T (TCP/IP) ) and indicate partner's function. For example, with RFC we connect to Data Provider and the SAP calls special partners function in order to get Market data. Usually, you can get description of RFC configuration and list of function from your partner (Reuters, Blumberg, Teletrade, etc). Using RFC we can retrieve information in Real-time if your provider allows it.

 

 

Internet settings for WEB Server Access

IMG -> Financial Supply Chain Management -> Treasury and Risk Management -> Basic Functions -> Market Data Management -> Datafeed -> Technical Settings -> Internet Settings for External Partner Program -> Define Internet Settings for WEB Server Access (tr. SM30 -> V_VTB_DFD2)

 

Here we define URL (required) and User name and Password (optional) if your Data Provider requeres it.

As you can see earlier in URL we have constant part (http://www.nbrb.by/API/) and variable part depending on market data class.

So in this configuration i will put constant part. Variable part is added inside of FM ZTB_DATAFEED_INTERNET_ACCESS.

03.jpg

 

Proxy Configuration

 

IMG -> Financial Supply Chain Management -> Treasury and Risk Management -> Basic Functions -> Market Data Management -> Datafeed -> Technical Settings -> Internet Settings for External Partner Program -> HTTP Proxy Configuration -> Define Proxy Configuration (SM30 -> THTTP)


If according to your companie's policy you use Proxy to enter to internet, then you can configure your proxy with Proxy user and Proxy password.


 

Define Data Sources for Datafeed

 

IMG -> Financial Supply Chain Management -> Treasury and Risk Management -> Basic Functions -> Market Data Management -> Datafeed -> Translation Table -> Define Data Sources for Datafeed (tr. S_ALR_87007888)

 

Here we define different Data Sources of our Data Provider.

49.jpg

 

Translation Table

 

Translation tables can be filled in two ways:

  1. Automatically. You need to configure Datafeed Conversion Codes
  2. Manually.

 

Translation Table: automatically

 

Create Tables for Code Conversion

 

This operation fills Converstion tables with SAP data: Exchange rate types, Currency names, etc.

 

IMG -> Financial Supply Chain Management -> Treasury and Risk Management -> Basic Functions -> Market Data Management -> Datafeed -> Translation Table -> Define Datafeed Conversion Codes -> Create Tables for Code Conversion (tr. TBDK)

 

60.jpg

Convert Codes for Exchange Rate Types

 

IMG -> Financial Supply Chain Management -> Treasury and Risk Management -> Basic Functions -> Market Data Management -> Datafeed -> Translation Table -> Define Datafeed Conversion Codes -> Convert Codes for Exchange Rate Types (tr. SM30 -> V_MDUDFCV)


Before creating tables for Code Conversion, the table was empty. After creating tables - it will be filled with SAP data. All you need to map SAP Data with External Providers' data.

61.jpg

In our case SAP data is equal to External data.

62.jpg

 

Adjust converstion tables to your need: IMG -> Financial Supply Chain Management -> Treasury and Risk Management -> Basic Functions -> Market Data Management -> Datafeed -> Translation Table -> Define Datafeed Conversion Codes -> ...


For my purpse i created the following talbes:


Convert Codes for Currency Names: tr. SM30 -> V_MDUDFCR

45.jpg

Convert Commodity Price Types: tr. SM30 -> V_MDUCMV

 

46.jpg

I will use these tables to get external codes for currencies and commodities.

 

Import R/3 Master Data

 

Now it's turn to create Translation tables Automatically.

 

  • First select Master data: for example Currency.
  • Then select Quantity. If you leave these fields empty then all combination of currency 1, currency 2 and rate type will be uploaded into translation tables. I will use combination of BYN-USD, BYN-EUR, BYN-RUB with rate type M. So, field "1 key definition" is filled with BYN, field "2 key definition" if filled with USD, EUR, RUB. Rate type is M. For mentioned field there is a help, data inside these fields depends on Master data: currency, security, etc.
  • Datafeed: "Name" is NBRB.by, "Data source" is Currency.
  • Test run - to test if transaction works perfect.
  • Save market data - if you want to save data into Translation tables.

64.jpg

Start transaction.

65.jpg

Now we see, that SAP selected what we requested on selection screen. If you uncheck Test field, SAP will fill translation table for Currency. Let's see this translation talbe.

 

Translation Table: Currency

 

IMG -> Financial Supply Chain Management -> Treasury and Risk Management -> Basic Functions -> Market Data Management -> Datafeed -> Translation Table -> Define Currencies (tr. S_ALR_87007920)

 

Select you data provider.

10.jpg

SAP created translation tables for currency. Make a double click on any parameters in the table.

11.jpg

 

Most of fields are entered by SAP, selected fields with red box - you have to enter yourself.

  • Save markter data permanently in system: tell your system to save data into SAP tables. For example, Exhange rates - tr. OB08, Reference Interest rates - tr. JBIRM, etc.
  • Instrument - ask you data provider about this data or create your own. I created my own Instrument - combination of currencies.
  • External data feed currency settings: according to external data.

12.jpg

 

If you didn't use Automatic creation of Translation tables then you have to fill these tables manually.

 

Translation Table: Interse rates

 

IMG -> Financial Supply Chain Management -> Treasury and Risk Management -> Basic Functions -> Market Data Management -> Datafeed -> Translation Table -> Define Reference Interest Rates (tr. S_ALR_87007812)

 

Translation table for Refinance rate.

20.jpg

 

21.jpg

 

 

Translation Table: Commodity

 

IMG -> Financial Supply Chain Management -> Treasury and Risk Management -> Basic Functions -> Market Data Management -> Datafeed -> Translation Table -> Define Commodities (tr. S_ALR_87007868)

 

Translation table for Commodity.

30.jpg

 

31.jpg

 

32.jpg

That's all. For configuration.

 

Conclusion

 

If your provider is Reuters (or Bloombers, or Teletrade, or similar services) - it's very good. Reuters, for example, is licensed with SAP to provide market data. All you need is to configure RFC connection, list of Reuters functions to call and translation tables.

If your data provider has Web-Services or APIs - it's also not a problem to get data. You have to retrieve simple data structures and parse them into the SAP tables.

Even if you have access to data which is presented as a web page - you can get this information also (as HTML), but you have to find out how to parse this information.

 

Now it's time to process datafeed market data: TRM Market Data Management: Datafeed: Processing market data.

 

------------------------------------------------------------------------------------

More information about Market data management - Index.

TRM Market Data Management: Datafeed: Processing market data.

$
0
0

Now when we made configuration for Data feed (TRM Market Data Management: Datafeed: Configuration.), we can process market data.

 

We can process market data in two ways:

  1. Manually.
  2. Automatic.

 

Manual.

 

All transaction we can find by following this menu path: SAP Menu -> Accounting -> Financial Supply Chain Management -> Treasury and Risk Management -> Basic Functions -> Market Data Management -> Datafeed -> ...


I will describe transactions that i use.



TBD3 - Display Market Data:

 

Using this transaction we can display values from table VTB_MARKET where market data is saved.

Display1.jpg

Selection screen description:

  • Market data class: we need to choose what market data class we would like to see. Values from "Market data selection" depens on "Market data class".
  • Market data selection:
    • 1st Key Definition: you can read F1 help (screenshot is below) to know what you can enter in this field. But values depends on "Market data class".

key1.jpg

    • 2nd Key Definition: you can read F1 help (screenshot is below) to know what you can enter in this field. But values depends on "Market data class".

key2.jpg

    • Instrument Property: you can read F1 help (screenshot is below) to know what you can enter in this field. But values depends on "Market data class".

key3.jpg

 

  • DataFeed
    • Name: name of datafeed.
  • Output controll:
    • Output Volume: all data or only real-time

    • Output List of Results: distinguish between all results, only errors, only correct results

    • Error Status: if you choose in "Output list of results" all or only errors, you can distinguish between 'W' - Warning, 'E' - Error, 'I' - Information, ' ' - all errors. Also you can enter Dara provider's error. Consult the documentation/support team of your datafeed provider. These errors occur outside the SAP system, in other words, in the external partner program.

    • Layout - layout of result screen.

 

On the selection screen we chose only market data class: currency and interest rate. SAP will display all three currencies we configured and one reference interest rate.

Display.jpg

You can limit result by using "Market data selection" set of fields. For example, let's choose Currency class and 2nd key definition - EUR. You can see the results - only EUR exchange rate displayed.

display2.jpg

 

 

TBD4 - Request Current Market Data

 

Selection screen is very similar to tr. TBD3 Display market data.

Difference is:

  • Datafeed:
    • Request mode: in my case i only use Synchronous.
  • Save market data in System Permanently if defined in customizing: i hope it is clear everything from description. I my configuration i indicated everywhere to save data.

 

Saving process is the following:

  1. Market data is saved in VTB_MARKET table. 1 configuration parameter - 1 line in the table. For example, i configured currency pair BYN - EUR. In table you will find only one line for BYN - EUR pair with the lates result. There is no several lines on several dates.
  2. Then market data is saved in other tables: currencies in table TCURR, reference interest rate in T056P table, etc.

request1.jpg

According to selectioin screen above, we will have the following results below.

request.jpg

You can use "Market data selection" fields to narrow the result list.

 

TBDJ - Request Historical Market Data

 

The difference betwee TBD4 and TBDJ transactions is:

TBD4 - is use to upload current market date.

TBDJ - historical market data

Everything else is the same.

req5.jpg

Results according to selection screen.

req6.jpg

 

Logs

 

SAP Menu -> Accounting -> Financial Supply Chain Management -> Treasury and Risk Management -> Basic Functions -> Market Data Management -> Datafeed -> Usage Log

 

You can take a look at log files if something wrong, or you need to check where request was made, etc.

 

 

Automatically: Planned task

 

You can plan a task for tr. TBD4 - Request Current Market Data to get market data, for examlpe, daily.

 

Variants

IMG -> Financial Supply Chain Management -> Treasury and Risk Management -> Basic Functions -> Market Data Management -> Datafeed -> Market Data Retrieval -> Define Variants (tr. TBC1)

 

First of all we need to make Variants for our transaction.

Select parameters you need and save variant.

90.jpg


Schedule a Jobs.

IMG -> Financial Supply Chain Management -> Treasury and Risk Management -> Basic Functions -> Market Data Management -> Datafeed -> Market Data Retrieval -> Schedule Jobs (tr. SM36)

 

Now let's Schedule a Jobs.

 

Type a Job name, for example, Refinance. Then press "Step" button.

100.jpg

 

Type programm name: for transaction TBD4 - programm is RFTDBF07

Variant  - /REFINANCE

Press Save button.

101.jpg

 

The step wa created, return back.

 

102.jpg

 

Press "Start condition" button.

 

103.jpg

 

Press "Date/Time" button.

Enter data and time.

Check "Periodit job" checkbox.

Press "Period values" button.

Press "Daily" button.

Press Save botton two times.

 

104.jpg

 

Press Save button.

Press "Job selection" button.

 

105.jpg

 

Now you are in tr. SM37.

Check "Sched." button,

Change "To date".

Press "Execute" button.

 

106.jpg

 

Now you can see scheduled job to get reference interest rate values dayily at 01:00:00.

 

107.jpg

 

TIPS for Market data management:

 

1. There is a user-exit for market data management:SAP Enchancement TRTMDF01:

    • Function module: EXIT_RFTBFF01_001 "Market Data: Modification of Request List in RFTBFF01"
    • Function module: EXIT_SAPLTBDF_001 "Market Data: Interface for Reading Saved Rates"
    • Function module: EXIT_SAPLTBDF_002 "Market Data: Rate/Price Interface to Market Data Buffer VTB_MARKET"

 

2. To check errors in tr. TBD4/TBDJ: you can check function module TB_DATAFEED_R3TABLES_UPDATE for different Instrument Classes:

    • CASE sap_answer-sclass. (apprxmtl - 544 line)
      • WHEN '01'.
      • WHEN '02'.
      • ...
      • WHEN '34'.

     There you can find some code which can tell you what is the problem.


-------------------------------------------------------------------------------

More about Jobs:

How to maintain and monitor background jobs via SAP - Basis Corner - SCN Wiki

Re: Job Schedulling and activate for Maintenance Plans

-------------------------------------------------------------------------------

 

More information about Market data management - Index.

TRM Market Data Management: File Interfaces

$
0
0

File interface is similar to Datafeed, but here we will use files instead of connection to internet.

 

All cutomizing will be done following this path:

SAP Customizing Implementation Guide -> Financial Supply Chain Management -> Treasury and Risk Management -> Basic Functions -> Market Data Management -> File Interface -> ...


All Data Processing will be done following this path:

SAP Menu -> Accounting -> Financial Supply Chain Management -> Treasury and Risk Management -> Basic Functions -> Market Data Management -> File Interfaces -> ...

 

 

Configuration.

 

But now let's make some configuration in order file interface to work.

 

Define Source of Market Data and Conversion Codes

 

SAP Customizing Implementation Guide -> Financial Supply Chain Management -> Treasury and Risk Management -> Basic Functions -> Market Data Management -> File Interface -> Define Source of Market Data and Conversion Codes (tr. SM30 -> V_VTBFFFT)

 

First of all we create Data Provider ID for the file interface.

01.jpg

TIP: if you use the same data provider for File Interface and for Datafeed - then you have to configure both of them similar to each other, otherwise you can get error like this "No data source defined for datafeed name". In our case we have the same 4 fields: Data Provider, Description, Quotation source/Comm(05), Quotation Source/Comm(06).

 

 

Create Tables for Code Conversion

SAP Customizing Implementation Guide -> Financial Supply Chain Management -> Treasury and Risk Management -> Basic Functions -> Market Data Management -> File Interface -> Create Tables for Code Conversion (tr. SM30 -> V_MDUCV)

 

Creation of Tables for code conversion is similar to the same operation in Datafeed configuration TRM Market Data Management: Datafeed: Configuration.

Before creating tables for Code Conversion, the tables are empty. After creating tables - it will be filled with SAP data. All you need is to map SAP Data with External Providers' data.


Start transaction. Select required conversions. Execute operation.

02.jpg

Press "Yes" button.

04.jpg

The information dialog appears.

05.jpg

 

Convert Codes for Exchange Rate Types

SAP Customizing Implementation Guide -> Financial Supply Chain Management -> Treasury and Risk Management -> Basic Functions -> Market Data Management -> File Interface -> Currencies -> Convert Codes for Exchange Rate Types (tr. SM30 -> V_MDUCV)


Now we can check conversion table and map SAP data with external data.

03.jpg

 

If you need you create conversion table for other data, do it!

That's all with configuration.

 

 

Processing market data

 

SAP Menu -> Accounting -> Financial Supply Chain Management -> Treasury and Risk Management -> Basic Functions -> Market Data Management -> File Interfaces -> ...

 

TBDN - Generate Request List

 

Befor entering market data we need to prepare files. In this case tr. TBDN can help us.

 

Indicate file name where structure of file will be created.

Put a checkmark in checkbox field "PC download".

Indicate data provide name.

Select Instrument class to fill our file.

If you use Selection fields, you can limit SAP data to be passed into file.

 

In our case i want to create file for entering Refinance rate only.

Execute transaction.

10.jpg

Select is done.

Select data and press "Save" button.

11.jpg

Press "Yes" button.

12.jpg

If you didn't create Converstion tables you'll get this information dialog.

13.jpg

File is created

14.jpg

The structure is the following:

## - comments.

90 tag - is for data provider id.

01 tag - line for currencies' data.

02 tag - line for securities' data.

03 tag - line for interest rates' data.

04 tag - line for indices' data.

05 tag - line for commodities' data.

06 tag - line for CPE commodities' data.

07 tag - line for Commodity Forward Rate data.

08 tag - line for Derivative Contract Specification data.

09 tag - line for basis spreads' data.

10 tag - line for credit spreads' data.

21 tag - line for swap forwards' data.

30 tag - line for universal volatility item's data.

31 tag - line for currency volatilities' data.

32 tag - line for security volatilities' data.

33 tag - line for interest volatilities' data.

 

But actually the file is not full.

 

The full structure is the following:

For tags starting from 01 to 33 the line consists of the following data. Data is represented like a strings without any separators. The seprarotr is the length of field.

FIeld num.Field nameSize in charsStructure and fieldDescriptionRequired field (R) / Empty (E)
1SCLASS2VTB_MARKET-SCLASSDatafeed: Instrument Class (tag id)R
2RKEY120VTB_DFANS-RKEY1Datafeed: Key 1R
3RKEY220VTB_DFANS-RKEY2Datafeed: Key 2

R (Cat. 01)

R (Cat. 02)

E (Cat. 03)

E (Cat. 04)

E (Cat. 07)

4SINSTRUMNT15VTB_DFANS-SPRPTYDatafeed: Market data: Instrument property

R (Cat. 01) Rate Type

R (Cat. 02) Volatility Type

E (Cat. 03)

R (Cat. 04)

R (Cat. 05) Commodity Quotation Type

R (Cat. 06) Commodity quotation type

R (Cat. 07) Commodity Quotation Type

5DDATE8VTB_DFANS-DDATEDatafeed: Value date in SAP format

R Value Date (Format: DDMMYYYY)

R (Cat. 05 - 07) Quotation Date (Format: DDMMYYYY)

6TTIME6VTB_DFANS-TTIMEDatafeed: Time of value (SAP format)E Time of Value Data (Format: HHMMSS)
7VALUE20VTB_DFANS-VALUEDatafeed: Value of requested propertyR
8CURRENCY20VTB_DFANS-CURRENCYDatafeed: Currency key

E (Cat. 01) Currency D

R (Cat. 02)  Data description

E (Cat. 03)

E (Cat. 04)

E (Cat. 05)  Notation Currency Unit

E (Cat. 06) Notation Currency Unit

E (Cat. 07) Notation Currency Unit

9FFACT7VTB_DFANS-CFFACTDatafeed: Factor for units of from-currency

R (Cat. 01) Ratio for Units of

E (Cat. 02) FROM currency

E (Cat. 03)

E (Cat. 04)

10TFACT7VTB_DFANS-CTFACTDatafeed: Factor for units of to-currency

R (Cat. 01) Ratio for Units of

E (Cat. 02) FROM currency

E (Cat. 03)

E (Cat. 04)

11MKIND5VTB_DFANS-MKINDDatafeed: Price notation for security pricesE
12SSTATS2VTB_MARKET-SSTATSDatafeed: Status of market dateE
13ERROR80VTB_MARKET-ERRORDatafeed: Error messageE

 

Example of complete file with information. You can also find this file in attachment to this article.

15.jpg

 

TBDM - Import

 

Now we can import market data.

17.jpg

  • Input:
    • Upload: Tell transaction you want to upload file from PC, or from server.
    • File name: file with market data. For PC you can use search help to enter file name. For server you can use transaction AL11 to copy path of file. File path is similar to /usr/sap/trans/log/log.txt
    • Exchange rates: indicate whether you will upload direct or indirect quatation.
  • Data provider:
    • Manual entry:
      • Data provider: Indicate data provider if you use manual entry.
    • Generate automatically from file: if you use this option then data provider is take from file using 90 tag.
  • Error file
    • Download: Tell transaction you want to download error file to PC, or to the Server.
    • Generate error file
      • File name: indication file where errors will be saved.
  • Output control:
    • Test run
    • Output list of results: save all data, only errors, only correct results.
    • Layout: layout of data.

 

Fill selection screen and execute transaction.

 

16.jpg

That's how you can upload market data into SAP using FIle interface.

 

 

More information about Market data management - Index.

Presentation Highlights - SAP Conference for Treasury Management 2016

$
0
0

Have you registered your place yet for this year’s SAP Conference for Treasury Management, taking place on September 21-23 in Chicago? Tickets are going fast now, so register today at http://goo.gl/eHcyu6.

 

Attend this conference and hear how the SAP solutions for Treasury Management can enable better decision making for organizations across all industry sectors and business scenarios. You will learn first-hand how international organizations utilize the power of technology to manage the complexities of monitoring cash and payment processes, ensuring liquidity, handling financial transactions, and managing financial risks.

 

Highlights of the presentations on offer will include:

 

1.     Sun Chemical - Leveraging SAP software to build a Treasury Center of Excellence

2.     United Technologies Corporation - Optimizing cash position and improving liquidity management using SAP technology for treasury

3.     Zurich Insurance - A best practice model for implementation of SAP Financial Asset Management

4.     Lubrizol - SAP Treasury and Risk Management versus other treasury workstations

5.     Biotest AG - Making treasury processes more efficient, and financial statements produced faster with SAP Treasury Management suite

6.     Microsoft Corporation - A review of Microsoft's implementation of SAP Bank Communication Manager

 

If you have any questions about the event, please feel free to contact the event team at 919-510-8142, info-us@tacook.com.

Example for note 783081 - FWKB: BAdI for (manual) adjustment of quantities

$
0
0

Here is the description of the note:

 

With the posting of corporate actions sometimes the situation occurs that calculated quantities deviate, for example, from the specifications of the bank (roundings).

With this note a BAdI enhancement is made available which allows it to still adjust quantities before the update per company code and corporate action. In an example implementation, a list is proposed for this purpose for the manual adjustment.

The BAdI enhancement has the name TPM_CORPORATE_ACTION.

 

With the own implementation (per SE19) you can transfer the example code if required (in the menu under Goto).

 

For details, please refer to the below steps:

 

SE19

SE19_1.PNG

 

enter implementation name with Z* or Y*.

SE19_2.PNG

copy the sample code:

SE19_3.PNG

 

SE19_4.PNG

in method ADJUST_CA_FLOWS, the coding will be copied, save and activate the implementation.

SE19_5.PNG

 

TPM13 cash flow, number of units 100.

 

TPM13.PNG

 

FWK0, create corporate action, e.g. capital reduction, activate it:

 

fwk0.PNG

 

FWKB, you can see that the Units is changeable:

FWKB.PNG

change the units to 95 and post it:

FWKB_CHANGE.PNG

FWKB_POST.PNG

After that, check the cash flow in TPM13:

TPM13_2.PNG


Eurofinance 2016: Treasury at the tipping point

$
0
0

At typical finance trade shows, everybody seems to talk about capitalizing on market trends, pioneering technologies, challenges and opportunities that should fundamentally change your business. And often you simply don’t see a clear path on how to turn these new insights into benefits for your daily business, given all the time and resource constraints you are facing.

Does all this sound familiar to you as a finance professional in today’s business environment? Maybe. Does it need to be this way? Definitely not. On October 12th, the Eurofinance International Treasury & Cash Management opens its gates in Vienna, Austria. Together with almost 2,000 delegates at the most senior-level, international treasury event in the world, you will have the chance to find out which technologies really matter for you and your job in treasury. And – not to forget - how to phase these new trends into your own, real business role and industry.

SAP will be on site with a team of treasury solution and implementation experts to shape that dialogue on trending topics with a clear focus on existing technology and today’s options.

Visit us at booth L047 or schedule a meeting with our experts in Vienna. Just send us an email with your contact details and we’ll come back to you.

Want to learn more about Eurofinance Vienna before you decide? No problem, just click on the banner below or download the brochure with tons of details around the event.

Looking forward seeing you in Vienna!

 

EF_Banner.jpg

Foreign Currency Valuation

$
0
0

The foreign currency valuation is arguably the easiest ledger position valuation to understand. It is always relevant if the position currency differs from the valuation currency. The foreign currency valuation adjusts the value of the position in the valuation currency to the current exchange rate between the position and valuation currency in accordance with the accounting principle.

This step determines the gains and losses resulting from changes in the exchange rate. Determining the write-up / write-down amount in a foreign currency:

The purchase value (= acquisition value) and the book value of the position are determined in position and valuation currency.

The new book exchange rate is determined by comparing the following exchange rates in accordance with the rules defined in the position management procedure.

Current market exchange rate

Old book exchange rate

Acquisition exchange rate

The foreign currency write-up / write-down amount in valuation currency is determined as follows:

(Book value of the position in position currency x New book exchange rate) - (Book value of the position in position currency x Old book exchange rate) = Foreign exchange write-up/write-down amount in valuation currency.

The related configuration

  1. The Type of step should be 005.

1.png

    2. Procedure for a Step

The procedure is a user-assigned four-character name for a valuation step that is defined in the context of a key date valuation. The name is only unique within a valuation category. This means that, for example, an amortization procedure and a rate valuation procedure may both have the same name.

 

    3. Price/Rate Type

You use the Exchange Rate Type field to define which exchange rate is relevant for the valuation: for example, the middle rate, bid rate, or similar rates.


4. Component for Valuation

For the component for valuation, you almost always select the Book Value option. You can select the Amortized Acquisition Value option if you perform an amortization for the position. You can also choose whether this valuation is supposed to be carried out for the key date valuation or for the calculation of derived business transactions or only for the key date valuation (Amortized Acquisition Value; Only at Valuation option)

2.png

You separately define how write-ups and write-downs are to occur: here, the Write Up/Down to Market Value, Write Up/Down to Purchase Value, and No Write Up/Down options are available. Based on these parameters, we can already understand what the system calculates with a foreign currency valuation. The basis, which is the book value in most cases, is translated from the position currency into the valuation currency using the key date rate. This value is compared to the present book value in the valuation currency. In accordance with the rules for the write-up or write-down, the system generates a flow of the difference and posts this with the update types of the (V202) and (V203) fields.

 

    5. Gain/loss handling

In terms of the possible Gain/Loss Handling settings, according to IFRS, although financial instruments in the Available for Sale holding category are shown with their market price in the balance sheet, changes to the market price must not be entered in the P/L. They are, in fact, posted in the shareholder's equity/other comprehensive income. The provisions in the equity capital are dissolved into P/L only when the financial instrument expires or is sold. You achieve this behavior using the Do Not Realize Gains/Losses setting mentioned. In addition to the Foreign Exchange Valuation component, the system manages a second component, Foreign Exchange Valuation Not Affecting P/L. The system also uses update types of fields (V202) and (V203) from Figure 5.46. Naturally, you must assign another account determination.

Viewing all 77 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>