No slash command · from erpl
Runs SAP BW queries and InfoCubes via DuckDB using the BICS protocol. Covers session lifecycle, variable binding, drill-down, filtering, hierarchy navigation, and troubleshooting empty or oversized results.
Ships in erpl. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
BICS executes a BW query the way Analysis for Office does: variables, restricted and calculated key figures, conditions, hierarchies and BW authorizations all apply. erpl keeps the navigation state of each query session in DuckDB and returns BW's result as a table.
sap_bics_begin(…, id => 'q1') opens it; every later call names
'q1'; sap_bics_end('q1') releases it. Each call stores a new version of the state (100–300 KB) in the
table erpl_bics.bics_state of the main database — clean up (sap_bics_end, sap_bics_gc).sap_bics_begin, not on a later call: variables => [{'NAME': …, 'LOW': …}]. A
mandatory variable left empty makes sap_bics_result fail with BW's message. List them first with
sap_bics_variables.sap_bics_show('QUERY') does not bind — write
sap_bics_show(obj_type => 'QUERY', search => '*SALES*'), or use sap_bics_show_queries.YYYYMMDD,
compounded keys with the parent first ('DE 11'). erpl converts typed values like RSRT does
('1001' → '0000001001', '09.2004' → '200409' for 0CALMONTH).erpl_bics_max_result_memory; usually the right fix is a narrower query (sap_bics_filter, fewer
characteristics on the rows).sap_bics_result_stats('q1'): it shows BW's state,
messages, authorization flag and where every cell went — and contains no business data, so it can go into
a ticket.op => 'set'); an unknown one is an
error listing the valid ones — read it.SELECT technical_name, text, cube_name FROM sap_bics_show_queries(search => '*SALES*');
SELECT technical_name, text FROM sap_bics_show_cubes(search => '0D_NW*');
SELECT technical_name, text, cube_name FROM sap_bics_show(obj_type => 'QUERY', search => '0D_FC_NW*');
-- Characteristics, key figures, variables of a query
SELECT technical_name, text, len(characteristics) AS chars, len(keyfigures) AS kfs
FROM sap_bics_describe('0D_NW_C01', '0D_FC_NW_C01_Q0007');
SELECT name, text, mandatory, var_type, selection_type, reference_char
FROM sap_bics_variables('0D_FC_NW_C01_Q0007');
-- 1. open (a query or a cube); rows/columns can be set right here
SELECT * FROM sap_bics_begin('0D_NW_C01', id => 'q1', rows => ['0D_NW_CNTRY']);
-- 2. navigate
SELECT * FROM sap_bics_rows('q1', '0D_NW_PROD', op => 'ADD');
SELECT * FROM sap_bics_filter('q1', '0D_NW_CNTRY', 'DE', 'US', op => 'SET');
SELECT * FROM sap_bics_set_char_prop('q1', '0D_NW_CNTRY', 'DISPLAY', 'TEXT');
-- 3. read
SELECT * FROM sap_bics_result('q1');
-- 4. release
SELECT * FROM sap_bics_end('q1');
Every navigation call returns the session description (return => 'DESCRIBE', default) or directly the
result (return => 'RESULT').
| Call | Does |
|---|---|
sap_bics_rows(id, char…, op) / sap_bics_columns(id, char…, op) | Put characteristics on an axis. op: ADD (default), SET (replace), REMOVE (make free) |
sap_bics_filter(id, char, member…, op) | Keep only / add / exclude members. op => 'SET' without members clears the filter |
sap_bics_set_char_prop(id, char, 'DISPLAY', 'KEY'|'TEXT'|'BOTH') | Key, text or both in the row labels |
sap_bics_set_char_prop(id, char, 'SORT', 'ASC'|'DESC'|'NONE') | Sort members |
sap_bics_set_char_prop(id, char, 'TOTALS', 'SHOW'|'HIDE') | Show/hide (sub)totals; on the outermost row char it removes the overall result row |
sap_bics_attributes(id, char, attr…, op) | Display attributes as extra <char>__<attr> columns (row axis only) |
sap_bics_hidden_members(id, structure, 'SHOW'|'HIDE') | Members the query hides with "Hide (can be shown)" |
sap_bics_filter(id, structure, element_uid…) | Select key-figure structure members (uids from sap_bics_structure_members) |
-- 0D_FC_AE_VAR_Q02 has two mandatory single-value variables (year, product hierarchy level 2)
SELECT name, mandatory, selection_type, reference_char FROM sap_bics_variables('0D_FC_AE_VAR_Q02');
SELECT * FROM sap_bics_begin('0D_FC_AE_VAR_Q02', id => 'q2',
variables => [{'NAME': '0D_FC_P02', 'LOW': '2005'}, {'NAME': '0D_FC_P21', 'LOW': 'FC001'}]);
SELECT * FROM sap_bics_result('q2');
SELECT * FROM sap_bics_end('q2');
Interval: {'NAME': 'ZVAR_DATE', 'OP': 'BT', 'LOW': '20260101', 'HIGH': '20260131'}
Multiple values: {'NAME': 'ZVAR_CNTRY', 'LOW': 'DE'}, {'NAME': 'ZVAR_CNTRY', 'LOW': 'FR'} -- repeat NAME
Exclusion: {'NAME': 'ZVAR_CNTRY', 'SIGN': 'E', 'LOW': 'US'}
Saved BEx variant: sap_bics_begin('MY_QUERY', id => 'q3', variant => 'MY_VARIANT')
SIGN defaults to I, OP to EQ (or BT when HIGH is set). Only input-ready variables are accepted;
exit variables fill themselves. Hierarchy variables go in hierarchy_variables — see
references/variables.md for every variable type and its rules.
sap_bics_result returns, left to right: one VARCHAR column per row-axis characteristic (label per
DISPLAY), one INTEGER <char>_HIER_LEVEL per row characteristic, one VARCHAR <char>__<attr> per active
display attribute, then one DOUBLE column per column-axis tuple (0D_NW_NETV, or joined for a cross-tab:
0D_NW_NETV_2010). With every structure on the rows there is one data column VALUE. Totals arrive as rows
whose label is BW's result text (e.g. Overall Result); filter them out or keep them deliberately.
The result is long-ish and ready for SQL. Pivoting, unpivoting and rendering recipes (terminal crosstab,
charts, export) are in references/result-rendering.md.
SELECT hierarchy_name, description, date_to, version FROM sap_bics_show_hierarchies(info_object => '0D_NW_PROD');
-- a time-dependent hierarchy: pick the version valid at date_to
SELECT node_id, parent_id, node_name, node_value, level, path
FROM sap_bics_hierarchy('0D_NW_PROD_HIER', date_to => '20201231') ORDER BY node_id;
SELECT state_id, latest_version, versions, query, stored_bytes, last_saved FROM sap_bics_sessions();
SELECT * FROM sap_bics_gc(keep_versions => 1); -- drop history, keep sessions
SELECT * FROM sap_bics_gc(older_than => INTERVAL '7 days'); -- drop stale sessions
Sessions live in the main database (a file database keeps them across restarts) or in the database named by
SET erpl_bics_state_database = '<attached db>'. A read-only main database falls back to an in-memory store.
sap_bics_begin with an existing id starts that session afresh.
| Situation | Do |
|---|---|
| Numbers exactly as users see them in BW | BICS (this skill) |
| Raw provider records, incremental | ODP BW context (erpl-odp-replication) |
| Don't know the characteristic names | sap_bics_describe(cube, query) → characteristics |
| Mandatory variable error | sap_bics_variables, then pass variables on sap_bics_begin |
| Result too large | Filter / fewer row characteristics; raise erpl_bics_max_result_memory only if needed |
| Empty or strange result | sap_bics_result_stats('id'); then erpl-operate |
| Many sessions accumulating | sap_bics_end per session, sap_bics_gc periodically |
SELECT * FROM sap_bics_begin('0D_NW_C01', id => 'sales_by_country', rows => ['0D_NW_CNTRY']);
SELECT * FROM sap_bics_set_char_prop('sales_by_country', '0D_NW_CNTRY', 'DISPLAY', 'BOTH');
CREATE OR REPLACE TABLE sales_by_country AS SELECT * FROM sap_bics_result('sales_by_country');
SELECT * FROM sap_bics_end('sales_by_country');
SELECT * FROM sales_by_country;
The /erpl:bics-find, /erpl:bics-run, /erpl:bics-navigate and /erpl:bics-sessions commands drive
this workflow interactively.
See also: erpl-bics-metadata (BW models, lineage), erpl-operate (traces, sap_bics_result_stats
fields), erpl-performance (cell budget), erpl-choose-interface (BICS vs ODP).
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub datazoode/erpl --plugin erpl12 skills in this plugin
/erpl-ape-cdsExtracting SAP CDS views and entities with erpl_ape through SAP's ABAP Pipeline Engine: discovery with sap_ape_show, sap_ape_describe and sap_ape_preview; full snapshots with sap_ape_read_full (columns, chunk_size, wireformat; server-side filters are refused); delta reads with deletes via sap_ape_read_delta(cds, subscriber_process) and the /1DH/OPERATION column (U after-image, D delete); recovering an interrupted delta from the local erpl_ape.delta_spill with recover => true; subscriptions (sap_ape_show_subscriptions, PRAGMA sap_ape_drop, the ERPL_ prefix); readiness checks with PRAGMA sap_ape_ping, sap_ape_system_info and sap_ape_check_authorizations (read verdict); erpl_ape_allow_unreleased and erpl_ape_prepare_timeout. Use when extracting a CDS view (I_*, C_*, Z*), building an incremental CDS load that must see deletes, or when an APE read is slow to start, refused or unauthorised.
/erpl-bics-metadataExploring SAP BW models, data flows and lineage with erpl_bics metadata functions: InfoProviders and their fields (sap_bics_meta_providers, sap_bics_meta_provider_fields), DataSources (sap_bics_meta_datasources, sap_bics_meta_datasource_fields), transformations and rules (sap_bics_meta_transformations, sap_bics_meta_transform_fields), CompositeProviders (sap_bics_meta_hcpr_components, sap_bics_meta_hcpr_mapping), queries, their elements, usage and runtime statistics (sap_bics_meta_queries, sap_bics_meta_query_elements, sap_bics_meta_query_usage, sap_bics_meta_query_stats), InfoObjects (sap_bics_meta_infoobjects, sap_bics_describe_infoobject), the cross reference sap_bics_meta_objxref, and lineage / impact analysis (sap_bics_lineage_edges, sap_bics_lineage_graph_json, sap_bics_lineage_trace, sap_bics_query_lineage). Use when documenting or auditing a BW system, answering "where does this key figure come from" or "what breaks if I change this InfoObject/DataSource", finding unused queries, or preparing a BW migration.
Other plugins' skills for the same job