Architecture & Data Flow

System landscape, data flow, responsibilities

System Landscape

The Bilendo SAP Integration operates in three zones:

Zone 1: SAP ERP

The source system. Here master data (KNA1/KNB1), open items (BSID), cleared items (BSAD) and optionally orders (VBAK/VBAP) are read and written as flat TXT files to the SAP application server.

Involved SAP modules: FI-AR (Accounts Receivable), optionally FI-GL and SD (Sales & Distribution).

Zone 2: Middleware / Data Transport

Files are transferred from the SAP application server to Bilendo via SFTP. Typical middleware options:

MiddlewareUsage Context
SAP CPI (Cloud Platform Integration)S/4HANA Cloud, BTP environments
Seeburger BISOn-Premise EDI/EAI
Lobster IntegrationOn-Premise, hybrid scenarios
CLI / Cron-based SFTPMinimal variant, e.g., via sftp or scp

Zone 3: Bilendo

The SaaS platform reads the files from the SFTP server and processes them. Bilendo in turn provides CSV files for reintegration.


Data Flow: Export (SAP → Bilendo)

SAP Tables                     SAP Application Server          Bilendo SFTP            Bilendo
─────────────                  ──────────────────────          ────────────            ───────
KNA1/KNB1   ─┐
             ├─ ZCL_FI_BILENDO_ASSIST_V2
BSID        ─┤     ↓                        
             │  get_kna1()    → kna1_file_to_server()  → CC_Customers_...txt ──→ SFTP ──→ Import
             │  get_bsid()    → bseg_file_to_server()  → CC_open_...txt      ──→ SFTP ──→ Import
BSAD        ─┤  get_bsad()    → bseg_file_to_server()  → CC_cleared_...txt   ──→ SFTP ──→ Import
             │
VBAK/VBAP   ─┘  get_orders()  → orders_file_to_server() → CC_orders_...txt   ──→ SFTP ──→ Import

Detailed Process

  1. SM36 job starts the report ZFI_BILENDO_EXPORT_V2 (typically: daily at 03:00)

  2. Report reads the selection parameters from the variant (e.g., BILENDO_DAILY_DELTA)

  3. Report selects all relevant company codes from T001 (WHERE rcomp <> '')

  4. For each company code (Loop):

    • set_bukrs() – sets the active company code in the class

    • get_kna1() – selects customer master data (KNA1 JOIN KNB1 JOIN ADR6)

    • kna1_file_to_server() – writes TXT file to application server

    • get_bsid() – selects open items (BSID + BSEG additions)

    • get_additional() – adds additional fields (VKORG, BKTXT, VBELN, AUFNR, etc.)

    • bseg_file_to_server() – writes TXT file

    • get_bsad() – selects cleared items (analogous to BSID)

    • get_additional() + bseg_file_to_server() – analogous

    • get_orders() – selects orders (VBAK + VBAP + VBUK + other tables)

    • orders_file_to_server() – writes Orders TXT file

  5. Middleware (CPI/Seeburger/Lobster) transfers the files via SFTP

  6. Bilendo imports the files automatically


Data Flow: Re-Integration (Bilendo → SAP)

Bilendo                    Bilendo SFTP           SAP Application Server           SAP
───────                    ────────────           ──────────────────────           ───
Platform ──→ Export ──→   bilendo_credit_limits       ──→ SFTP ──→ Download
                           bilendo_credit_informations ──→ SFTP ──→ Download
                           bilendo_securities          ──→ SFTP ──→ Download     ┐
                           bilendo_customers           ──→ SFTP ──→ Download     ├─ ZFI_BILENDO_IMPORT_V2
                           bilendo_journal_entries     ──→ SFTP ──→ Download     ┘    → BAPI/BDC

Re-Integration Process

  1. Bilendo places CSV files on the SFTP server (→ Details in 09 - Re-Integration Fields)

  2. Middleware downloads files to the SAP input directory (/usr/sap/<SID>/COMM/Bilendo_IN/)

  3. Report ZFI_BILENDO_IMPORT_V2 is started (manually or via job)

  4. Class reads CSV files (get_files() + read_csv())

  5. Write-back:

    • credit_limit_change() – Credit limit + risk category to KNB5/KNKK

    • customer_change() – Dunning level, dunning block, insured receivable to KNB1/KNKA

    • doc_change() – Dunning level/date at document level (BSEG)

  6. Optional: delete_files() – Clean up processed files


Data Types

The integration transports four core data types. The complete field definition can be found in 06 - Data Specification.

Data TypeSAP SourceSAP TableBilendo TargetFile Type
Master DataCustomer MasterKNA1 + KNB1 + KNB5 + ADR6MasterdataCC_Customers_*.txt
Open ItemsReceivables OPBSID + BSEG + BKPFOpen ItemsCC_open_*.txt
Cleared ItemsCleared ItemsBSAD + BSEG + BKPFCleared ItemsCC_cleared_*.txt
OrdersOrders/SDVBAK + VBAP + VBUK + VBKD + VBPAOrdersCC_orders_*.txt

Delta Strategy

Bilendo does not work with true delta (no change pointer, no IDOC). Instead, an overlapping time period is selected for each run. The integration offers two delta modes:

Simple Delta Selection (v2.1 Standard)

Selection via CPUDT/BUDAT with overlapping time windows (typically: 7 days). Easy to configure, but has weaknesses in detecting clearing events on documents whose creation date is outside the window.

Data TypeSelection FieldRecommendation
Master DataCPUDT (Creation Date)Last 7 days, daily
Open ItemsCPUDT + optionally CPUTMLast 7 days, daily or hourly
Cleared ItemsAUGDT (Clearing Date)Last 7 days, daily
OrdersERDAT (Creation Date)Last 7 days, daily

Two-Stage Delta Selection (recommended)

The improved variant uses two-stage logic: first the relevant document contexts are identified via BKPF or AUGDT, then the associated items are loaded from BSID/BSAD. This method is robust against misconfiguration and reliably captures clearing events on old documents.

Data TypeMethodStage 1Stage 2Recommendation
Open Itemsget_open_delta()BKPF: CPUDT/AEDAT last 6hBSID: FOR ALL ENTRIESEvery 6 hours
Cleared Itemsget_cleared_delta()BSAD: AUGDT last 24hBSAD: FOR ALL ENTRIES via AUGBLEvery 6 hours
Master Dataget_kna1()CPUDT-based (as before)Daily

For details and ABAP code → 04 - Extractor Report#Improved Delta Logic Two-Stage Selection.

The overlap control is done via the selection variant (→ 07 - Variants & Job Planning).


Authorizations

The following authorizations are required for setup and operation:

PhaseAuthorization ObjectRelevance
InstallationS_DEVELOP (ABAP Workbench)Create report, class, structures
InstallationS_TABU_DIS (Table modification)Activate DDIC objects
OperationS_DATASET (File access)Read/write on application server
OperationS_BTCH_JOB (Batch processing)Schedule SM36 job
OperationF_BKPF_BUK (Company code FI)Access to accounting data
Re-IntegrationF_KNA1_BED (Modify customer master)Write back credit limit, dunning level