Offene & Ausgeglichene Posten
Buchungsdaten, offene Posten und Clearing-Informationen via OData.
S/4HANA Architectural Change
In SAP S/4HANA, the physical tables BSID (customer open items) and BSAD (customer cleared items) no longer exist as independent entities. Instead, they function as compatibility views layered over the unified ACDOCA (Accounting Documents) table.
SAP has migrated away from the dual-table architecture to a single source of truth. SAP provides CDS views and OData APIs that expose this data through standardized interfaces, eliminating the need for direct table access or custom compatibility views.
S/4HANA Standard APIs
Primary OData Service
API_OPLACCTGDOCITEMCUBE_SRV (OData v2)
Entity Type:
A_OperationalAcctgDocItemCubeContains both open and cleared items in a single result set
Discrimination via flags and filtering
Key Fields & Mapping
| SAP Field | ABAP Field | Type | Description |
|---|---|---|---|
CompanyCode | BUKRS | String(4) | Company code (e.g., '0001') |
Customer | KUNNR | String(10) | Customer number |
Vendor | LIFNR | String(10) | Vendor number |
AccountingDocument | BELNR | String(10) | Document number |
FiscalYear | GJAHR | String(4) | Fiscal year |
PostingDate | BUDAT | Date | Document posting date |
DocumentDate | BLDAT | Date | Document date |
AmountInCompanyCodeCurrency | DMBTR | Decimal(23,2) | Amount in company code currency |
ClearingDocument | AUGBL | String(10) | Clearing document number |
ClearingJournalEntry | AUGBL + timestamp | String(10) | Identifier for clearing transaction |
ClearingDate | AUGDT | Date | Date of clearing |
DunningLevel | MANST | String(1) | Dunning level (0=no dunning) |
IsCleared | Calculated | Boolean | Logical flag (true if ClearingDate is populated) |
DueDate | FÄLLIGKEIT | Date | Payment due date (if applicable) |
Query Examples
Open Items Only
GET /sap/opu/odata/sap/API_OPLACCTGDOCITEMCUBE_SRV/A_OperationalAcctgDocItemCube
?$filter=CompanyCode eq '0001'
and PostingDate ge datetime'2026-01-01T00:00:00'
and IsCleared eq false
&$top=1000
&$skip=0Cleared Items (Recent Clearings)
GET /sap/opu/odata/sap/API_OPLACCTGDOCITEMCUBE_SRV/A_OperationalAcctgDocItemCube
?$filter=CompanyCode eq '0001'
and ClearingDate ge datetime'2026-03-01T00:00:00'
and ClearingDate le datetime'2026-03-31T23:59:59'
&$top=1000Specific Customer Open Items
GET /sap/opu/odata/sap/API_OPLACCTGDOCITEMCUBE_SRV/A_OperationalAcctgDocItemCube
?$filter=CompanyCode eq '0001'
and Customer eq '0000001234'
and IsCleared eq false
&$orderby=PostingDate desc
&$select=Customer,AccountingDocument,FiscalYear,AmountInCompanyCodeCurrency,DueDateECC: Custom SEGW Implementation
In SAP ECC environments without S/4HANA, Bilendo implements custom OData services using the SEGW (Service Engineering Workbench) framework.
Entity Type Definition
Two separate entity types maintain architectural clarity:
ZBilendoOpenItem (BSID)
Source: FM-CS-IP-BSID (customer open items)
Writeable: No (read-only for reconciliation)
ZBilendoClearedItem (BSAD)
Source: FM-CS-IP-BSAD (customer cleared items)
Writeable: No (historical reference only)
DPC Implementation
METHOD GET_ENTITYSET.
" Entity: ZBilendoOpenItem (Open Customer Items)
CASE i_entityset_name.
WHEN 'ZBilendoOpenItems'.
DATA: lt_open_items TYPE TABLE OF zbilendo_open_item,
ls_filter TYPE LINE OF if_sadl_cds_range_list=>tt_range,
lv_bukrs TYPE bukrs VALUE '',
lv_budat_from TYPE budat,
lv_budat_to TYPE budat,
lv_umskz TYPE umskz VALUE ''.
" Extract filter parameters from i_filter
LOOP AT i_filter->get_ranges( ) INTO ls_filter.
CASE ls_filter-name.
WHEN 'CompanyCode'.
READ TABLE ls_filter-ranges INTO DATA(ls_range) INDEX 1.
lv_bukrs = ls_range-low.
WHEN 'PostingDateFrom'.
READ TABLE ls_filter-ranges INTO ls_range INDEX 1.
lv_budat_from = ls_range-low.
WHEN 'PostingDateTo'.
READ TABLE ls_filter-ranges INTO ls_range INDEX 1.
lv_budat_to = ls_range-low.
WHEN 'TransactionCode'.
READ TABLE ls_filter-ranges INTO ls_range INDEX 1.
lv_umskz = ls_range-low.
ENDCASE.
ENDLOOP.
" Query BSID with filters
SELECT bukrs, kunnr, belnr, gjahr, budat, dmbtr, augbl, augdt, manst
FROM bsid
INTO CORRESPONDING FIELDS OF TABLE lt_open_items
WHERE bukrs EQ lv_bukrs
AND budat GE lv_budat_from
AND budat LE lv_budat_to
AND ( lv_umskz IS INITIAL OR umskz EQ lv_umskz )
ORDER BY budat DESCENDING
OFFSET i_skip ROWS
FETCH NEXT i_top ROWS ONLY.
et_entityset = CORRESPONDING #( lt_open_items ).
ENDCASE.
ENDMETHOD.Supported $Options
| Option | Example | Behavior |
|---|---|---|
$filter | CompanyCode eq '0001' and PostingDate ge datetime'2026-01-01T00:00:00' | Server-side filtering on CompanyCode, PostingDate, TransactionCode, Customer |
$top | $top=500 | Limits result rows (default: 500, max: 10000) |
$skip | $skip=1000 | Paging offset |
$orderby | $orderby=PostingDate desc | Ordering by PostingDate, DueDate, or AmountInCompanyCodeCurrency |
$select | $select=Customer,AccountingDocument,AmountInCompanyCodeCurrency | Field projection |
Ausgleichslogik (Clearing Logic)
Nullsummenausgleich (Zero-Sum Clearing)
When documents are cleared in SAP, a clearing journal entry (AUGBL/AUGDT) is recorded. The logical clearing status is determined by the presence of a non-null ClearingJournalEntry:
Open Item:
ClearingJournalEntry IS NULLandIsCleared = falseCleared Item:
ClearingJournalEntry IS NOT NULLandIsCleared = true
The ClearingDate field represents the posting date of the clearing transaction and is the basis for reconciliation reporting.
Innensaldoausgleich (Internal Offset) – Limitation
The OPAMT (open amount) field used for advanced internal offset calculations is not available in S/4HANA standard APIs or ECC custom services. The standard APIs provide the initial document amount (AmountInCompanyCodeCurrency) and clearing status only.
For innensaldoausgleich requirements, additional custom logic must be implemented via ABAP modules or journal entry detail querying.
Performance-Hinweise (Performance Guidelines)
Query Optimization
Always Filter on CompanyCode + Date Range
Do NOT query without a CompanyCode filter; results are unpredictable across environments
Always include a PostingDate filter (e.g., last 12 months minimum)
Example:
?$filter=CompanyCode eq '0001' and PostingDate ge datetime'2025-01-01T00:00:00'
Use Server-Driven Paging
Always include
$topand$skipparametersRecommended:
$top=1000per requestTotal result sets exceeding 50,000 rows require batching across multiple requests
Select Only Required Fields
Use
$selectto reduce payload sizeOmitting large text fields (e.g., DocumentReference) can improve response time by 15–20%
Index Strategy
| System | Table | Index | Comments |
|---|---|---|---|
| S/4HANA | ACDOCA | (BUKRS, BUDAT, LIFNR/KUNNR) | Optimized for date-range queries |
| ECC | BSID | (BUKRS, KUNNR, BUDAT) | Primary index for open items |
| ECC | BSAD | (BUKRS, BUDAT) | Clearing date index on AUGDT |
Typical Response Times (ECC 6.0, 1M+ documents)
| Query Type | Filter Scope | Response Time |
|---|---|---|
| Open items (single company, 90 days) | 10K rows | 200–400 ms |
| Cleared items (single company, 30 days) | 5K rows | 100–200 ms |
| Specific customer (all time) | <500 rows | 50–100 ms |
**