Financial Management Blog Posts by SAP
cancel
Showing results for 
Search instead for 
Did you mean: 
Hörb
Product and Topic Expert
Product and Topic Expert
798

A legal entity that prepares its financial statements in accordance with International Financial Reporting Standards (IFRS) must adhere to IAS 21 IAS 21 — The Effects of Changes in Foreign Exchange Rates and IAS 29 IAS 29 — Financial Reporting in Hyperinflationary Economies. These standards mandate the use of a functional and/or reporting currency for financial statements. In SAP, ISO - ISO 4217 — Currency codes are available by default and can be utilized as functional and/or reporting currencies. But cryptocurrencies like Bitcoin are not listed yet!

The following configuration allows Bitcoin to be used as a currency in SAP:

  1. Transaction OY03 - Configure BTC as a currency.
    Hrb_0-1743682752143.png
  2. Settings for translating from local currency (EUR) to BTC.
    1. Transaction OBBS - Configure translation ratios.
      Hrb_1-1743683003661.png
    2. Transaction OB08 - Maintain exchange rate
      Hrb_2-1743683155416.png
  3. Company Code settings
    1. Transaction OX15 - Define internal trading partner and assign BTC as the currency.
      Hrb_2-1743692945380.png
    2. Transaction FINSC_LEDGER

Currency Conversion Settings for Company Codes
Hrb_1-1743692796409.png
Company Code Settings for the Ledger 0L
Hrb_3-1743693168144.png

Bitcoin (BTC) is now configured in Accounting and can be used as both a functional and reporting currency. To report balance sheet accounts, vendor accounts, and customer accounts in BTC, the currency type representing BTC must be assigned to the appropriate valuation area using Transaction S_AL0_19000080.

To report fixed assets in BTC, the currency type representing BTC values must be assigned to the depreciation area using Transaction OAYH.

DM&LT offers a currency conversion service to convert systems to new currency target setup. See blog  Data Management and Landscape Transformations - Cu... - SAP Community and Data Unification & Harmonization

With these basic configuration, an entity can report its financial statements in Bitcoin (BTC). However, fully integrating Bitcoin into SAP requires process redesign and enhancements. Consider the following areas:

Purchase-to-Pay

  • Payments to external vendors and affiliated companies in Bitcoin

Hire-to-Retire

  • Employees can be compensated in Bitcoin.
  • Taxes can be paid in Bitcoin.

Order-to-Cash

Record-to-Report
With Bitcoin as an asset in the financial statement, auditors and investors can easily validate Bitcoin balances (UTXO) via their own Bitcoin node or through third-party APIs, such as the mempool.space API. 

To prove ownership of a Bitcoin address, the directors of an legal entity should be able to sign a message. Here are the steps:

  1. Generate a Message: Create a unique message, such as "I own this address [timestamp]".
  2. Sign the Message: Use the private key associated with the Bitcoin address to sign the message. This can be done using wallets like Bitcoin Core, Electrum, or hardware wallets like Ledger and Trezor.
  3. Verify the Signature: Provide the signed message, the signature, and the Bitcoin address to the interested party. They can use the public key to verify the signature and confirm ownership without exposing your private key.

SAP Landscape Transformation SAP Business Data Cloud

Example code for checking a Bitcoin wallet balance via API access:

DATA: lv_url TYPE string,
      lv_address TYPE string VALUE '1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa',
      lv_response TYPE string,
      lo_http_client TYPE REF TO if_http_client,
      lo_rest_client TYPE REF TO cl_rest_http_client,
      lt_utxos TYPE TABLE OF string,
      lv_utxo TYPE string.

" Define the API endpoint
lv_url = |https://mempool.space/api/address/{ lv_address }/utxo|.

" Create HTTP client instance
CALL METHOD cl_http_client=>create_by_url
  EXPORTING
    url                = lv_url
  IMPORTING
    client             = lo_http_client
  EXCEPTIONS
    argument_not_found = 1
    plugin_not_active  = 2
    internal_error     = 3
    OTHERS             = 4.

IF sy-subrc <> 0.
  WRITE: / 'Error creating HTTP client'.
  RETURN.
ENDIF.

" Send the request
CALL METHOD lo_http_client->send
  EXCEPTIONS
    http_communication_failure = 1
    http_invalid_state         = 2
    http_processing_failed     = 3
    OTHERS                     = 4.

IF sy-subrc <> 0.
  WRITE: / 'Error sending HTTP request'.
  RETURN.
ENDIF.

" Receive the response
CALL METHOD lo_http_client->receive
  IMPORTING
    data = lv_response
  EXCEPTIONS
    http_communication_failure = 1
    http_invalid_state         = 2
    http_processing_failed     = 3
    OTHERS                     = 4.

IF sy-subrc <> 0.
  WRITE: / 'Error receiving HTTP response'.
  RETURN.
ENDIF.

" Parse the JSON response
CALL FUNCTION 'SCMS_JSON_TO_TABLE'
  EXPORTING
    json = lv_response
  TABLES
    json_table = lt_utxos.

" Output the UTXO details
LOOP AT lt_utxos INTO lv_utxo.
  WRITE: / lv_utxo.
ENDLOOP.

" Free the HTTP client
CALL METHOD lo_http_client->close.