Skip to main content

ERPL Function Reference

Complete reference for all ERPL functions organized by protocol. This reference covers RFC, BICS, and ODP functions with parameters, return types, and examples.

RFC Functions

Core RFC Functions

sap_read_table()

Read data from SAP tables.

Signature:

sap_read_table(table_name VARCHAR, [COLUMNS LIST(VARCHAR)], [FILTER VARCHAR], [MAX_ROWS UINTEGER], [THREADS UINTEGER], [READ_TABLE_FUNCTION VARCHAR], [READ_TABLE_DELIMITER VARCHAR], [SECRET VARCHAR])

Parameters:

ParameterTypeDescriptionExample
table_nameVARCHAR (positional)SAP table name'KNA1'
COLUMNSLIST(VARCHAR)Restrict to a subset of columnsCOLUMNS => ['KUNNR', 'NAME1']
FILTERVARCHAROpenSQL-style WHERE-fragment passed straight to RFC. Use for filters too complex to push down.FILTER => 'LAND1 = ''DE'''
MAX_ROWSUINTEGERMaximum rows to returnMAX_ROWS => 1000
THREADSUINTEGERNumber of parallel RFC threads to read partitions (default: 5)THREADS => 4
READ_TABLE_FUNCTIONVARCHAROverride the underlying RFC function module (e.g. /SAPDS/RFC_READ_TABLE2 for wide rows)READ_TABLE_FUNCTION => '/SAPDS/RFC_READ_TABLE2'
READ_TABLE_DELIMITERVARCHARDelimiter used by RFC when packing rows. Override for tables whose values may contain whitespace.`READ_TABLE_DELIMITER => '
SECRETVARCHARName of the DuckDB secret to authenticate with (if multiple SAP connections are configured)SECRET => 'erp_prod'
Predicate and projection pushdown

A regular SQL WHERE clause is automatically pushed down to RFC — you don't need the FILTER named parameter for simple predicates:

SELECT KUNNR, NAME1 FROM sap_read_table('KNA1') WHERE LAND1 = 'DE';

COLUMNS is similarly inferred from the SELECT list. Reach for the named parameters when you need precise control over what RFC receives — for example, complex multi-table filters that DuckDB's optimizer can't safely lower.

Ordering

RFC's underlying RFC_READ_TABLE has no server-side sort. Apply ORDER BY in DuckDB after the read; it executes client-side.

Example:

SELECT * FROM sap_read_table('KNA1', MAX_ROWS => 100);

sap_rfc_invoke()

Call SAP function modules and BAPIs.

Signature:

sap_rfc_invoke(function_name VARCHAR, [parameters...], [path VARCHAR], [secret VARCHAR])

Input parameters are passed as positional struct arguments after the function name — one struct per import / changing parameter the BAPI expects. DuckDB struct syntax ({'KEY': value, ...}) lets you express nested structures and tables naturally.

Parameters:

ParameterTypeDescriptionExample
function_nameVARCHAR (positional)SAP function module / BAPI name'BAPI_FLIGHT_GETLIST'
parameters...STRUCT (positional varargs)One struct per RFC import/changing parameter{'AIRLINE': 'LH', 'DESTINATION_FROM': {'AIRPORTID': 'FRA'}}
pathVARCHAR (named)Optional path into the response structure — picks a sub-table of the resultpath => '/FLIGHT_LIST'
secretVARCHAR (named)Name of the DuckDB secret to authenticate withsecret => 'erp_prod'

Example:

-- Simple call with named import parameters
SELECT trim(ECHOTEXT)
FROM sap_rfc_invoke('STFC_CONNECTION', {'REQUTEXT': 'Hello'});

-- BAPI call selecting a nested result table via path
SELECT *
FROM sap_rfc_invoke(
'BAPI_FLIGHT_GETLIST',
{'AIRLINE': 'LH', 'DESTINATION_FROM': {'AIRPORTID': 'FRA'}},
path => '/FLIGHT_LIST'
);

RFC Metadata Functions

sap_rfc_describe_function()

Get detailed information about RFC function parameters.

Signature:

sap_rfc_describe_function(function_name VARCHAR)

Example:

SELECT * FROM sap_rfc_describe_function('BAPI_FLIGHT_GETLIST');

sap_describe_fields()

Get table structure and field information.

Signature:

sap_describe_fields(table_name VARCHAR)

Example:

SELECT * FROM sap_describe_fields('KNA1');

sap_describe_references()

List all referenced tables in the SAP system.

Signature:

sap_describe_references()

Example:

SELECT * FROM sap_describe_references();

sap_rfc_show_function()

List all available RFC functions.

Signature:

sap_rfc_show_function()

Example:

SELECT * FROM sap_rfc_show_function();

sap_rfc_show_groups()

List all RFC function groups.

Signature:

sap_rfc_show_groups()

Example:

SELECT * FROM sap_rfc_show_groups();

sap_show_tables()

List all available SAP tables.

Signature:

sap_show_tables()

Example:

SELECT * FROM sap_show_tables();

BICS Functions

BICS query composition

BICS queries are built compositionally by chaining functions: begincolumns / rows / filterresult. Each step returns a state identifier that the next step consumes. Set return => 'DESCRIBE' (default) to inspect the in-progress query plan, or return => 'RESULT' to short-circuit and execute.

Basic Query Functions

sap_bics_show()

List InfoProviders (default), cubes, queries, or InfoAreas registered on the BW system.

Signature:

sap_bics_show()

Parameters (all named):

ParameterTypeDescriptionExample
obj_typeENUMOne of 'INFOPROVIDER' (default), 'QUERY', 'CUBE', 'INFOAREA'obj_type => 'CUBE'
searchVARCHARGlob pattern to filter resultssearch => '0D_NW*'
search_in_keyBOOLEANMatch against object key (default: true)search_in_key => false
search_in_textBOOLEANMatch against display text (default: true)search_in_text => true
fetch_levelsUINTEGERHierarchy depth to traverse (default: 0)fetch_levels => 2
secretVARCHARDuckDB secret namesecret => 'erp_prod'

Example:

SELECT * FROM sap_bics_show();
SELECT * FROM sap_bics_show(obj_type => 'CUBE', search => '0D_NW*');

sap_bics_show_cubes()

Convenience wrapper — list cubes only. Equivalent to sap_bics_show(obj_type => 'CUBE') with a slightly different result shape tuned for cubes.

Signature:

sap_bics_show_cubes()

Parameters (all named): search, search_in_key, search_in_text, secret (same semantics as sap_bics_show).

Example:

SELECT * FROM sap_bics_show_cubes(search => '0D_NW*');

sap_bics_show_queries()

Convenience wrapper — list BEx queries only.

Signature:

sap_bics_show_queries()

Parameters (all named): search, search_in_key, search_in_text, secret.

Example:

SELECT * FROM sap_bics_show_queries(search => 'ZFI*');

sap_bics_describe()

Describe cube structure or query.

Signature:

sap_bics_describe([cube_name VARCHAR], [query_name VARCHAR])

Example:

SELECT * FROM sap_bics_describe('0BWTESTCUBE');

sap_bics_begin()

Start a BICS query session against an InfoProvider or query. Returns a state identifier consumed by the chain functions below.

Signature:

sap_bics_begin(cube_or_query_name VARCHAR)

Example:

SELECT * FROM sap_bics_begin('0BWTESTCUBE');

sap_bics_columns()

Manipulate the column axis: add, set, or remove characteristics and key figures.

Signature:

sap_bics_columns(state_id VARCHAR, characteristic VARCHAR, [characteristic2 VARCHAR, ...])

Parameters:

ParameterTypeDescriptionExample
state_idVARCHAR (positional)State produced by sap_bics_begin or a prior chain step(chained)
characteristic...VARCHAR (positional varargs)One or more characteristics / key figures to operate on'0CALMONTH', '0SALES_AMOUNT'
idVARCHAR (named)Override the state id passed in (rarely needed)id => 'my_state'
opENUM (named)'SET' (replace, default), 'ADD' (append), 'REMOVE' (drop)op => 'ADD'
returnENUM (named)'DESCRIBE' (return plan, default) or 'RESULT' (execute now)return => 'RESULT'
secretVARCHAR (named)DuckDB secret namesecret => 'erp_prod'

Example:

-- Add two characteristics to the column axis
SELECT * FROM sap_bics_columns(
sap_bics_begin('0BWTESTCUBE'),
'0CALMONTH', '0SALES_AMOUNT',
op => 'ADD'
);

sap_bics_rows()

Manipulate the row axis. Same parameter shape as sap_bics_columns.

Signature:

sap_bics_rows(state_id VARCHAR, characteristic VARCHAR, [characteristic2 VARCHAR, ...])

Parameters (named): id, op ('SET' / 'ADD' / 'REMOVE'), return ('DESCRIBE' / 'RESULT'), secret.

Example:

SELECT * FROM sap_bics_rows(
sap_bics_begin('0BWTESTCUBE'),
'0MATERIAL',
op => 'ADD'
);

sap_bics_filter()

Apply a filter on a specific characteristic.

Signature:

sap_bics_filter(state_id VARCHAR, characteristic VARCHAR, value VARCHAR, [value2 VARCHAR, ...])

Parameters:

ParameterTypeDescriptionExample
state_idVARCHAR (positional)State produced by sap_bics_begin or a prior chain step(chained)
characteristicVARCHAR (positional)Characteristic to filter'0CALMONTH'
value...VARCHAR (positional varargs)One or more filter values'202401', '202402'
opENUM (named)'SET' / 'ADD' / 'REMOVE'op => 'ADD'
returnENUM (named)'DESCRIBE' (default) / 'RESULT'return => 'RESULT'
secretVARCHAR (named)DuckDB secret namesecret => 'erp_prod'

Example:

SELECT * FROM sap_bics_filter(
sap_bics_begin('0BWTESTCUBE'),
'0CALMONTH', '202401'
);

sap_bics_result()

Execute the chained query and return the result rows.

Signature:

sap_bics_result(state_id VARCHAR)

Example:

SELECT * FROM sap_bics_result(
sap_bics_filter(
sap_bics_begin('0BWTESTCUBE'),
'0CALMONTH', '202401'
)
);

Intermediate Query Functions

sap_bics_show_hierarchies()

List available hierarchies.

Signature:

sap_bics_show_hierarchies()

Example:

SELECT * FROM sap_bics_show_hierarchies();

sap_bics_hierarchy()

Query hierarchy data — flat list (default) or as a recursive tree.

Signature:

sap_bics_hierarchy(hierarchy_name VARCHAR)

Parameters (all named):

ParameterTypeDescriptionExample
versionVARCHARHierarchy versionversion => '01'
date_toVARCHARValid-to date (time-dependent hierarchies)date_to => '20261231'
as_treeBOOLEANReturn as nested tree instead of flat list (default: false)as_tree => true
secretVARCHARDuckDB secret namesecret => 'erp_prod'

Example:

SELECT * FROM sap_bics_hierarchy('0MATERIAL_HIER', version => '01');

sap_bics_describe_infoobject()

Get InfoObject details.

Signature:

sap_bics_describe_infoobject(infoobject_name VARCHAR)

Example:

SELECT * FROM sap_bics_describe_infoobject('0MATERIAL');

Lineage Functions

End-to-end lineage from ERP source tables through DataSources, transformations, InfoProviders, and BEx queries. All three functions return system-wide data; filter by query, provider, or source in SQL.

sap_bics_lineage_edges()

Lineage as a flat edge list. Each row is one source-to-target edge across the BW data flow graph.

Signature:

sap_bics_lineage_edges()

Parameters (all named):

ParameterTypeDescriptionExample
scopeVARCHAROptional scoping filter (object pattern) to limit the returned edgesscope => '0D_FC_NW*'
secretVARCHARDuckDB secret namesecret => 'erp_prod'

Example:

-- All lineage edges
SELECT * FROM sap_bics_lineage_edges();

-- Filter edges related to a specific query
SELECT *
FROM sap_bics_lineage_edges()
WHERE target_name = '0D_FC_NW_C01_Q0008' OR source_name = '0D_FC_NW_C01_Q0008';

sap_bics_lineage_trace()

Trace lineage forward from a specific source object/field. Useful for impact analysis ("if this table changes, what downstream BEx queries are affected?").

Signature:

sap_bics_lineage_trace()

Parameters (all named):

ParameterTypeDescriptionExample
source_objectVARCHARSource object name (e.g. ERP table)source_object => 'VBAK'
source_fieldVARCHAROptional source field for field-level tracesource_field => 'NETWR'
secretVARCHARDuckDB secret namesecret => 'erp_prod'

Example:

SELECT * FROM sap_bics_lineage_trace(source_object => 'VBAK');
SELECT * FROM sap_bics_lineage_trace(source_object => 'VBAK', source_field => 'NETWR');

sap_bics_lineage_graph_json()

Returns the full lineage graph as a JSON document. Use for visualization or export to graph tooling.

Signature:

sap_bics_lineage_graph_json()

Parameters (named): secret.

Example:

SELECT * FROM sap_bics_lineage_graph_json();

Metadata Functions

Each returns BW system metadata as a DuckDB table. Most are zero-positional; six take one VARCHAR positional. All accept an optional secret named parameter.

sap_bics_meta_providers()

InfoProvider metadata.

Signature:

sap_bics_meta_providers()

Named parameters:

ParameterTypeDescription
typeVARCHARFilter by provider type (e.g. 'CUBE', 'ODSO', 'MPRO')
secretVARCHARDuckDB secret name

Example:

SELECT * FROM sap_bics_meta_providers();
SELECT * FROM sap_bics_meta_providers(type => 'CUBE');

sap_bics_meta_datasources()

DataSource metadata.

Signature:

sap_bics_meta_datasources()

Named parameters:

ParameterTypeDescription
appcompVARCHARFilter by application component
secretVARCHARDuckDB secret name

Example:

SELECT * FROM sap_bics_meta_datasources(appcomp => 'FI');

sap_bics_meta_transformations()

Transformation metadata.

Signature:

sap_bics_meta_transformations()

Named parameters:

ParameterTypeDescription
active_onlyBOOLEANIf true, only active transformations
secretVARCHARDuckDB secret name

Example:

SELECT * FROM sap_bics_meta_transformations(active_only => true);

sap_bics_meta_queries()

Query metadata.

Signature:

sap_bics_meta_queries()

Named parameters: secret (DuckDB secret name).

Example:

SELECT * FROM sap_bics_meta_queries();

sap_bics_meta_query_elements()

Query-element metadata for a specific query.

Signature:

sap_bics_meta_query_elements(query_name VARCHAR)

Named parameters: secret.

Example:

SELECT * FROM sap_bics_meta_query_elements('0D_FC_NW_C01_Q0008');

sap_bics_meta_query_stats()

Query runtime statistics.

Signature:

sap_bics_meta_query_stats()

Named parameters:

ParameterTypeDescription
query_nameVARCHARFilter to one query
from_dateVARCHARStart of the time window (YYYYMMDD)
to_dateVARCHAREnd of the time window (YYYYMMDD)
secretVARCHARDuckDB secret name

Example:

SELECT * FROM sap_bics_meta_query_stats(
query_name => '0D_FC_NW_C01_Q0008',
from_date => '20260101',
to_date => '20260501'
);

sap_bics_meta_query_usage()

Query usage metadata for a specific query.

Signature:

sap_bics_meta_query_usage(query_name VARCHAR)

Named parameters: secret.

Example:

SELECT * FROM sap_bics_meta_query_usage('0D_FC_NW_C01_Q0008');

sap_bics_meta_provider_fields()

Field metadata for one InfoProvider.

Signature:

sap_bics_meta_provider_fields(provider_name VARCHAR)

Named parameters:

ParameterTypeDescription
provider_typeVARCHAROverride the inferred provider type if needed
secretVARCHARDuckDB secret name

Example:

SELECT * FROM sap_bics_meta_provider_fields('0BWTESTCUBE');

sap_bics_meta_datasource_fields()

Field metadata for one DataSource.

Signature:

sap_bics_meta_datasource_fields(datasource_name VARCHAR)

Named parameters: secret.

Example:

SELECT * FROM sap_bics_meta_datasource_fields('0FI_GL_4');

sap_bics_meta_transform_fields()

Field-level metadata for one transformation.

Signature:

sap_bics_meta_transform_fields(transformation_id VARCHAR)

Named parameters: secret.

Example:

SELECT * FROM sap_bics_meta_transform_fields('TRAN_ID_HERE');

sap_bics_meta_hcpr_components()

Composite provider component metadata.

Signature:

sap_bics_meta_hcpr_components(composite_provider VARCHAR)

Named parameters: secret.

Example:

SELECT * FROM sap_bics_meta_hcpr_components('0COPC1');

sap_bics_meta_hcpr_mapping()

Composite provider field mapping.

Signature:

sap_bics_meta_hcpr_mapping()

Named parameters:

ParameterTypeDescription
composite_providerVARCHARFilter to one composite provider
secretVARCHARDuckDB secret name

Example:

SELECT * FROM sap_bics_meta_hcpr_mapping(composite_provider => '0COPC1');

sap_bics_meta_infoobjects()

InfoObject metadata.

Signature:

sap_bics_meta_infoobjects()

Named parameters:

ParameterTypeDescription
iobjnmVARCHARFilter by InfoObject name
iobjtpVARCHARFilter by InfoObject type ('CHA' characteristic, 'KYF' key figure, etc.)
secretVARCHARDuckDB secret name

Example:

SELECT * FROM sap_bics_meta_infoobjects(iobjtp => 'KYF');

sap_bics_meta_objxref()

Object cross-reference metadata.

Signature:

sap_bics_meta_objxref()

Named parameters:

ParameterTypeDescription
tlogoVARCHARSource object type code
objnmVARCHARSource object name
tlogo_depVARCHARDependent object type code
secretVARCHARDuckDB secret name

Example:

SELECT * FROM sap_bics_meta_objxref(tlogo => 'TRCS', objnm => '0BWTESTCUBE');

ODP Functions

Basic ODP Functions

sap_odp_show_contexts()

List all available ODP contexts.

Signature:

sap_odp_show_contexts()

Example:

SELECT * FROM sap_odp_show_contexts();
How ODP delta works in ERPL

ODP does not take a per-call mode parameter. The replication mode is a property of the cursor on the SAP server:

  • The first call to sap_odp_read_full(context, data_source) for a given source opens a delta cursor and returns a FULL snapshot.
  • Subsequent calls return only the DELTA since the last cursor position.
  • Use PRAGMA sap_odp_drop(...) to reset the cursor server-side. The next read becomes FULL again.

sap_odp_show_cursors exposes the existing cursors and their current mode for inspection.

sap_odp_show()

List data sources in a specific context.

Signature:

sap_odp_show(context_name VARCHAR, [search VARCHAR], [secret VARCHAR])

Parameters:

ParameterTypeDescriptionExample
context_nameVARCHAR (positional)ODP context'BW'
searchVARCHARGlob pattern to filter data source namessearch => '*COST*'
secretVARCHARDuckDB secret namesecret => 'erp_prod'

Example:

SELECT * FROM sap_odp_show('BW', search => '*COST*');

sap_odp_describe()

Describe data source structure.

Signature:

sap_odp_describe(context_name VARCHAR, data_source VARCHAR, [secret VARCHAR])

Example:

SELECT * FROM sap_odp_describe('BW', 'VBAK$F');

sap_odp_preview()

Preview data without opening a delta cursor. Useful for one-off inspection.

Signature:

sap_odp_preview(context_name VARCHAR, data_source VARCHAR, [max_rows UINTEGER], [secret VARCHAR])

Example:

SELECT * FROM sap_odp_preview('BW', 'VBAK$F', max_rows => 100);

sap_odp_read_full()

Read data from an ODP data source. First call returns the full snapshot and opens a delta cursor; subsequent calls return only the delta since the last cursor position. See the cursor-state note at the top of this section.

Signature:

sap_odp_read_full(context_name VARCHAR, data_source VARCHAR, [threads UINTEGER], [columns LIST(VARCHAR)], [filters LIST(STRUCT)], [secret VARCHAR])

Parameters:

ParameterTypeDescriptionExample
context_nameVARCHAR (positional)ODP context name'BW'
data_sourceVARCHAR (positional)Data source name'VBAK$F'
threadsUINTEGERNumber of parallel RFC fetch threads (default: 5)threads => 4
columnsLIST(VARCHAR)Restrict to a subset of columnscolumns => ['BUSINESSPARTNER']
filtersLIST(STRUCT)Server-side select predicates (see ODP_SELECT_SIGN / ODP_SELECT_OP)filters => [{...}]
secretVARCHARDuckDB secret namesecret => 'erp_prod'

Example:

SELECT * FROM sap_odp_read_full('ABAP_CDS', 'Z_MY_CDS_VIEW');

-- Tune parallelism and project columns
SELECT * FROM sap_odp_read_full('BW', 'MY_DATASOURCE', threads => 4);
SELECT * FROM sap_odp_read_full('ABAP_CDS', 'SEPM_IBUPA$P', columns => ['BUSINESSPARTNER']);

Advanced ODP Functions

sap_odp_show_subscriptions()

View active subscriptions (cursors that hold ODP state).

Signature:

sap_odp_show_subscriptions([ERPL_ONLY BOOLEAN], [secret VARCHAR])

Parameters:

ParameterTypeDescriptionExample
ERPL_ONLYBOOLEANWhen true (default), show only subscriptions created by ERPL. When false, show all ODP subscribers.ERPL_ONLY => FALSE
secretVARCHARDuckDB secret namesecret => 'erp_prod'

Example:

SELECT * FROM sap_odp_show_subscriptions();
SELECT * FROM sap_odp_show_subscriptions(ERPL_ONLY => FALSE);

sap_odp_show_cursors()

Inspect ODP cursors — the server-side state that decides whether the next sap_odp_read_full returns FULL or DELTA.

Signature:

sap_odp_show_cursors([erpl_only BOOLEAN], [subscriber_name VARCHAR], [context VARCHAR], [replication_mode ODP_REPLICATION_MODE], [secret VARCHAR])

Parameters:

ParameterTypeDescriptionExample
erpl_onlyBOOLEANFilter to cursors owned by the ERPL subscribererpl_only => TRUE
subscriber_nameVARCHARFilter by subscriber namesubscriber_name => 'ERPL'
contextVARCHARFilter by ODP contextcontext => 'ABAP_CDS'
replication_modeODP_REPLICATION_MODEFilter by cursor modereplication_mode => 'FULL'
secretVARCHARDuckDB secret namesecret => 'erp_prod'

Example:

SELECT * FROM sap_odp_show_cursors();
SELECT * FROM sap_odp_show_cursors(erpl_only => TRUE);
SELECT * FROM sap_odp_show_cursors(context => 'ABAP_CDS', replication_mode => 'FULL');

ODP Pragma Functions

PRAGMA sap_odp_drop()

Reset an ODP cursor server-side. The next call to sap_odp_read_full for the same data source re-creates the subscription and returns a fresh FULL snapshot. Internally invokes RODPS_REPL_ODP_RESET.

Signature:

PRAGMA sap_odp_drop(odp_context, subscriber_name, subscriber_process, odp_name);

Parameters:

ParameterDescriptionExample
odp_contextODP context'ABAP_CDS'
subscriber_nameSubscriber name as stored on SAP (ERPL default: 'ERPL')'ERPL'
subscriber_processSubscriber process identifier'erpl_subs_proc'
odp_nameData source name'Z_MY_CDS_VIEW'

Optionally takes a named secret parameter to select the DuckDB secret.

Example:

PRAGMA sap_odp_drop('ABAP_CDS', 'ERPL', 'erpl_subs_proc', 'Z_MY_CDS_VIEW');

Custom Types

BICS Types

BICS_RETURN

Enum type for BICS return codes.

Values:

  • SUCCESS
  • ERROR
  • WARNING

BICS_OPERATION

Enum type for BICS operations.

Values:

  • BEGIN
  • FILTER
  • COLUMNS
  • RESULT

ODP Types

ODP_REPLICATION_MODE

Enum type for ODP replication modes.

Values:

  • FULL - Complete data load
  • DELTA - Only changed records
  • RECOVER - Recovery mode

ODP_SELECT_SIGN

Enum type for ODP selection signs.

Values:

  • I - Include
  • E - Exclude

ODP_SELECT_OP

Enum type for ODP selection operations.

Values:

  • EQ - Equal
  • NE - Not equal
  • GT - Greater than
  • LT - Less than
  • GE - Greater than or equal
  • LE - Less than or equal

Function Categories

By Complexity Level

Beginner Functions:

  • sap_read_table()
  • sap_rfc_invoke()
  • sap_bics_show()
  • sap_bics_begin()
  • sap_bics_result()
  • sap_odp_show_contexts()
  • sap_odp_read_full()

Intermediate Functions:

  • sap_rfc_describe_function()
  • sap_describe_fields()
  • sap_bics_describe()
  • sap_bics_filter()
  • sap_bics_hierarchy()
  • sap_odp_describe()
  • sap_odp_preview()

Advanced Functions:

  • sap_describe_references()
  • sap_bics_lineage_edges(), sap_bics_lineage_trace(), sap_bics_lineage_graph_json()
  • sap_bics_meta_*() (all metadata functions)
  • sap_odp_show_subscriptions()
  • sap_odp_show_cursors()
  • PRAGMA sap_odp_drop*()

By Protocol

RFC Functions (8):

  • sap_read_table()
  • sap_rfc_invoke()
  • sap_rfc_describe_function()
  • sap_describe_fields()
  • sap_describe_references()
  • sap_rfc_show_function()
  • sap_rfc_show_groups()
  • sap_show_tables()

BICS Functions (25+):

  • Basic query functions (7)
  • Metadata functions (15)
  • Lineage functions (3)

ODP Functions (8):

  • sap_odp_show_contexts()
  • sap_odp_show()
  • sap_odp_describe()
  • sap_odp_preview()
  • sap_odp_read_full()
  • sap_odp_show_subscriptions()
  • sap_odp_show_cursors()
  • PRAGMA sap_odp_drop*()

Common Patterns

Basic Query Pattern (BICS)

-- Standard BICS query pattern
SELECT * FROM sap_bics_result(
sap_bics_filter(
sap_bics_begin('CUBE_NAME'),
'FILTER_FIELD', 'FILTER_VALUE'
)
);

Delta Replication Pattern (ODP)

-- Standard ODP delta pattern
-- 1. Initial full load
SELECT * FROM sap_odp_read_full(
'BW', 'VBAK$F'
);

-- 2. Subsequent delta loads
SELECT * FROM sap_odp_read_full(
'BW', 'VBAK$F'
);

Function Discovery Pattern (RFC)

-- Discover and analyze functions
SELECT * FROM sap_rfc_show_function()
WHERE function_name LIKE '%BAPI%';

SELECT * FROM sap_rfc_describe_function('FUNCTION_NAME');

Error Handling

Common Error Patterns

Function Not Found:

-- Check if function exists
SELECT * FROM sap_rfc_show_function()
WHERE function_name = 'FUNCTION_NAME';

Table Not Found:

-- Check if table exists
SELECT * FROM sap_show_tables()
WHERE table_name = 'TABLE_NAME';

Subscription Errors:

-- Check subscription status
SELECT * FROM sap_odp_show_subscriptions()
WHERE status = 'ERROR';

Performance Tips

Optimization Strategies

Use LIMIT for large datasets:

SELECT * FROM sap_read_table('KNA1', MAX_ROWS => 1000);

Filter early in BICS queries:

SELECT * FROM sap_bics_result(
sap_bics_filter(
sap_bics_begin('CUBE'),
'FILTER_FIELD', 'VALUE'
)
);

Use DELTA mode for ODP:

SELECT * FROM sap_odp_read_full(
'BW', 'VBAK$F'
);

Next Steps

🚀 Ready for More?

🔧 Advanced Topics

💡 Examples


Need help? Check our troubleshooting guide or browse more examples.