Mass Block and Archiving Flag for Inactive Business Partners
Short answer: A custom background program that finds business partners with no accounting posting, sales order or purchase order for a given period and sets a central block or archiving flag on those without open items. It retires old customers and vendors in a controlled way for master data cleanup and before an S/4HANA conversion; test mode only produces the candidate list.
- Estimated effort
- M · 4–6 working days
- System
- ECC and S/4HANA
- Tables
- 9
- Scope
- Global
- Built by
- NeKuDos Teknoloji
- Last updated
Why is the standard not enough?
In BP, the central block and archiving flag are set record by record; XD05 blocks customers one at a time. There is no standard tool that lists "business partners with no activity for 24 months and no open items" and flags them in bulk. This program calculates the last activity date from accounting, sales and purchasing documents and flags those passing the rule with a log.
Who uses it? Master data management, accounting and purchasing master data owners, and S/4HANA conversion and data cleanup project teams.
Closest standard alternatives
Tables used
The tables the program reads and updates. ECC and S/4HANA differences are marked separately.
| Table | Role | Access | System |
|---|---|---|---|
| BUT000Business Partner: General Data | Business partner; central block and archiving flag written through the BAPI | Write | ECC + S/4 |
| CVI_CUST_LINKAssignment Between Customer and Business Partner | Linked customer number | Read | ECC + S/4 |
| CVI_VEND_LINKAssignment Between Vendor and Business Partner | Linked vendor number | Read | ECC + S/4 |
| BSIDCustomer Open Items | Customer open items and last posting date | Read | ECC + S/4 |
| BSADCustomer Cleared Items | Customer cleared items: last posting date | Read | ECC + S/4 |
| BSIKVendor Open Items | Vendor open items and last posting date | Read | ECC + S/4 |
| BSAKVendor Cleared Items | Vendor cleared items: last posting date | Read | ECC + S/4 |
| VBAKSales Document Header | Date of the last sales document | Read | ECC + S/4 |
| EKKOPurchasing Document Header | Date of the last purchasing document | Read | ECC + S/4 |
S/4HANA notes
- BSID → I_OperationalAcctgDocItem: In S/4HANA BSID is no longer filled as a separate index table; reads work through a compatibility view of the same name. For new developments the I_OperationalAcctgDocItem CDS view is recommended.
- BSAD → I_OperationalAcctgDocItem: In S/4HANA BSAD is not filled as a separate table; it is read through a compatibility view of the same name. For new developments the I_OperationalAcctgDocItem CDS view is recommended.
- BSIK: In S/4HANA BSIK is no longer filled as a separate index table; reads work through a compatibility view. For new developments the I_OperationalAcctgDocItem CDS view is recommended.
- BSAK → I_OperationalAcctgDocItem: In S/4HANA BSAK is not filled as a separate table; it is read through a compatibility view of the same name. For new developments the I_OperationalAcctgDocItem CDS view is recommended.
BAPIs and functions used
- BAPI_BUPA_CENTRAL_GETDETAILRead Business Partner Central Data. Reads the current central data of the business partner
- BAPI_BUPA_CENTRAL_CHANGEChange Business Partner Central Data. Sets the central block or the archiving flag
- BAPI_TRANSACTION_COMMITCommit a BAPI transaction. Saves a successful change permanently
- BAPI_TRANSACTION_ROLLBACKRoll Back BAPI Transaction. Rolls back the change on error
Selection screen parameters
| Parameter | Description | Type | Reference field | Required | Example |
|---|---|---|---|---|---|
| S_PARTN | Business partner | Range / multiple | BUT000-PARTNER | No | — |
| S_GROUP | BP grouping | Range / multiple | BUT000-BU_GROUP | No | BP01, BP02 |
| S_BUKRS | Company code (activity check) | Range / multiple | BSID-BUKRS | No | 1000 |
| P_MONTHS | Inactivity period (months) | Single value | — | Yes | 24 |
| P_BLOCK | Set central block | Radio button | — | No | X |
| P_ARCH | Set archiving flag | Radio button | — | No | — |
| P_TEST | Test mode (candidate list only) | Checkbox | — | No | X |
Result list columns
| # | Column | Source |
|---|---|---|
| 1 | Business partner | BUT000-PARTNER |
| 2 | Name | BUT000-NAME_ORG1 |
| 3 | Grouping | BUT000-BU_GROUP |
| 4 | Customer | CVI_CUST_LINK-CUSTOMER |
| 5 | Vendor | CVI_VEND_LINK-VENDOR |
| 6 | Created on | BUT000-CRDAT |
| 7 | Last activity date | Calculated MAX(BSID/BSAD/BSIK/BSAK-BUDAT, VBAK-ERDAT, EKKO-BEDAT) |
| 8 | Months inactive | Calculated Today − last activity date (months) |
| 9 | Open items | Calculated Number of open items in BSID and BSIK |
| 10 | Action | Calculated Block set / Archiving flag set / Skipped |
| 11 | Status | Calculated Success / Test / Warning / Error and BAPI message |
Sample result list
| Business partner | Name | Grouping | Customer | Vendor | Created on | Last activity date | Months inactive | Open items | Action | Status |
|---|---|---|---|---|---|---|---|---|---|---|
| 1000077 | Doğu Tekstil Tic. Ltd. Şti. | BP01 | 100077 | 03/12/2014 | 06/30/2022 | 52 | 0 | Block set | Success | |
| 1000233 | Güney Kimya Pazarlama A.Ş. | BP02 | 300045 | 09/01/2016 | 11/15/2023 | 36 | 0 | Block set | Success | |
| 1000351 | İç Anadolu İnşaat Ltd. Şti. | BP01 | 100351 | 300210 | 05/20/2015 | 01/08/2024 | 34 | 2 | Skipped: open items exist | Warning |
| 1000419 | Karadeniz Fındık Ürünleri A.Ş. | BP01 | 100419 | 02/11/2019 | 09/30/2024 | 25 | 0 | Block set | Success |
How does the program work?
- The selected business partners are read from BUT000; those already blocked or archived, and those created more recently than the inactivity period (CRDAT), are skipped.
- Linked customer and vendor numbers are found through CVI_CUST_LINK and CVI_VEND_LINK.
- Last activity date = the latest of: posting date (BUDAT) in BSID/BSAD and BSIK/BSAK, creation date (ERDAT) in VBAK, document date (BEDAT) in EKKO.
- Months inactive = today − last activity date; if below the threshold, the business partner is skipped. Those with open items in BSID or BSIK are always listed as “skipped”.
- In test mode only the candidate list is produced. In a real run, the current data is read with BAPI_BUPA_CENTRAL_GETDETAIL, the central block or archiving flag is set with BAPI_BUPA_CENTRAL_CHANGE depending on the selection, and BAPI_TRANSACTION_COMMIT is called.
- The result is kept in ALV and in the application log; the changes also appear in the business partner change documents.
Performance notes
Calculate the last activity date per customer and vendor with aggregate queries such as MAX(BUDAT); do not read item tables row by row. In S/4HANA, the BSID/BSAD and BSIK/BSAK compatibility views read from ACDOCA; give account and date filters. With large master data, split the run by grouping and run it at night in the background.
Features
- Test mode (check without posting) Test mode produces the candidate list without changing any business partner.
- ALV list (sort, filter, subtotals)
- Line-by-line result and error log
- Export to Excel The candidate list can be exported to Excel for approval.
- Runs as a background job
Authorization objects
- B_BUPA_GRPChange in the business partner grouping (ACTVT 02)
- B_BUPA_ATTAccess to the field group for central block and archiving flag
Frequently asked questions
Does the archiving flag delete the record?
No. The archiving flag only marks the record as a candidate for archiving; deletion is possible only with the standard archiving object after the linked documents are archived. A central block closes the record to new transactions and can be removed later if needed.
Are posting and sales blocks on the customer and vendor side set as well?
The basic version sets the central block or archiving flag at business partner level. If needed, customer posting and order blocks and vendor posting and purchasing blocks can be set in the same run; this takes about two extra days.
What if some business partners must not be blocked even when inactive?
Business partners to exclude can be given on the selection screen or in an exception list (e.g. group companies, public bodies). The candidate list from test mode can also be sent for approval, and the real run done only for approved ones.
Packages that include this solution
Business Partner Master Data Quality Pack
A four-component pack for keeping customer and vendor master data clean: mass business partner creation from Excel with a duplicate check, duplicate …
Related reports
Customer/Vendor to Business Partner (CVI) Sync Check Report for S/4HANA Conversion
A custom ALV report that lists, before and after an S/4HANA conversion, customers and vendors not linked to a business partner, linked ones missing an …
Duplicate Business Partner Detection Report (Name, Tax Number, Address)
A custom ALV report that finds cases where the same customer or vendor was created under more than one business partner number, using the tax number, …
Let us build this program for your system
Briefly describe your system and expectations. We will clarify the scope and come back with an effort and price quote.