Härzlig willkome zue minere Bocksnip Code-Gallerie um alli Arte vo Code z'teile.

Solvency - screen report

Avaloq · September 23, 2016 3:57 pm

0 0 382

en screen report, wo duet csv reports darstelle

[Report 2.0]

report rbsc$task_pos_list_solvency.solvency_exp

/*
-------------------------------------------------------------------------------------------------------------
Bank:
Business Area:
Description: Used for solvency II reporting
-------------------------------------------------------------------------------------------------------------
ID Date Name, Company Issue Affected BUs, Description
-------------------------------------------------------------------------------------------------------------
001
-------------------------------------------------------------------------------------------------------------
*/

naming
dfltlang 'Export Solvency Data'

user_id 'SOLVENCY_EXP'

----------------------------------------------------------------------------
-- DATAMART
----------------------------------------------------------------------------
datamart hira_dtm

----------------------------------------------------------------------------
-- LAYOUT
----------------------------------------------------------------------------
screen layout

----------------------------------------------------------------------------
-- LAYOUT SETTINGS
----------------------------------------------------------------------------
title 'Solvency files'

----------------------------------------------------------------------------
-- IMPORTS
----------------------------------------------------------------------------
import file;
import util;
import format;

--------------------------------------------------------------------------
on column head
column provider
label 'Known Provider'
column file
label 'File'

--------------------------------------------------------------------------
on report head

if top.seq_nr is null then
column provider session.text('LABEL.NODATA_FOUND');
end if;

--------------------------------------------------------------------------
on k_prov head

top.file := file.new(top.file_type,i_file_name => k_prov.file_name);

file.write_char(top.file, 'REF' || top.fld_sep || 'POLICY NUMBER' || top.fld_sep || 'BP REF NBR' || top.fld_sep ||
'BOND CCY' || top.fld_sep || 'DEPOSIT REF' || top.fld_sep ||
'DEPOSIT PROVIDER' || top.fld_sep || 'ISIN' || top.fld_sep || 'SEDOL' || top.fld_sep || 'FUND MGR NAME' || top.fld_sep ||
'FUND NAME' || top.fld_sep || 'FUND CCY' || top.fld_sep || 'UNITS' || top.fld_sep || 'PRICE' || top.fld_sep ||
'NOMINAL VALUE' || top.fld_sep || 'AVERAGE PURCHASE PRICE' || top.fld_sep || 'FX' || top.fld_sep || 'VALUE IN GBP' || top.fld_sep ||
'MATURITY DATE' || top.fld_sep || 'ACCRUED INTEREST' || top.fld_sep || 'CASH ASSET' || top.fld_sep ||
'VALUATION DATE', i_newline => true);

--------------------------------------------------------------------------
on k_prov foot
declare
l_file_idx id file_idx;
begin
file.write_file(top.file, i_append=>true);
l_file_idx := file.file_idx(top.file);
top.file := file.close(top.file);
style 'none'
column provider k_prov.prov_name
column file ctx 'file' l_file_idx
k_prov.file_name
end;

--------------------------------------------------------------------------
on asset head
file.write_char(top.file, asset.qua_fund || top.fld_sep);
file.write_char(top.file, asset.policy_nr || top.fld_sep);
file.write_char(top.file, asset.bp_nr_key || top.fld_sep);
file.write_char(top.file, asset.curry || top.fld_sep);
if asset.type_id in (4980, 1649, 1521, 4916, 4915, 1522, 1524, 1523) then
file.write_char(top.file, asset.dep_ref || top.fld_sep);
file.write_char(top.file, asset.dep_prov || top.fld_sep);
else
file.write_char(top.file, top.fld_sep || top.fld_sep);
end if;
file.write_char(top.file, asset.isin || top.fld_sep);
file.write_char(top.file, asset.sedol || top.fld_sep);
file.write_char(top.file, asset.fund_mgr || top.fld_sep);
file.write_char(top.file, asset.name || top.fld_sep);
file.write_char(top.file, asset.fund_curry || top.fld_sep);
if asset.type_id not in (4980, 1649, 1521, 4916, 4915, 1522, 1524, 1523) then
file.write_char(top.file, format.amount(asset.units) || top.fld_sep);
else
file.write_char(top.file, top.fld_sep);
end if;
file.write_char(top.file, format.price(asset.price) || top.fld_sep);
file.write_char(top.file, format.amount(asset.nom_value) || top.fld_sep);
if asset.type_id not in (4980, 1649, 1521, 4916, 4915, 1522, 1524, 1523) then
file.write_char(top.file, format.price(asset.cost_price) || top.fld_sep);
else
file.write_char(top.file, top.fld_sep);
end if;
file.write_char(top.file, lookup.xrate_pretty(asset.curry_id, asset.fund_curry_id, asset.val_date) || top.fld_sep);
file.write_char(top.file, format.amount(asset.curr_val) || top.fld_sep);
if asset.type_id in (4980, 1649, 1521, 4916, 4915, 1522, 1524, 1523) then
file.write_char(top.file, asset.mat_date || top.fld_sep);
file.write_char(top.file, asset.accr_intr || top.fld_sep);
else
file.write_char(top.file, top.fld_sep || asset.accr_intr || top.fld_sep);
end if;
file.write_char(top.file, asset.cash_asset || top.fld_sep);
file.write_char(top.file, asset.val_date || top.fld_sep);
file.write_char(top.file, util.rtn);

end layout

end report

Besprich das Bocksnip
    Kei Kommentar zur Diskussion gfunde

    Du muesch igloggt si, um über das Bocksnip z'diskutiere
boecki

boecki

Nimmt teil
August 13, 2016

  • 64 Bocksnipa
    gschriebe
  • 0 Likes
    verteilt
  • 1 Kommentär gmacht
Bocksnip Tags
Teil din Code

Organisier und teil all dini Code Snips a eim Platz.