CA Program Custom development Background program

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

  • BP Maintain Business Partner. Sets the central block and archiving flag record by record; no inactivity analysis.
  • XD05 Block Customer (Centrally). Blocks customers one at a time; no bulk processing at vendor or business partner level.

Tables used

The tables the program reads and updates. ECC and S/4HANA differences are marked separately.

TableRoleAccessSystem
BUT000Business Partner: General DataBusiness partner; central block and archiving flag written through the BAPIWriteECC + S/4
CVI_CUST_LINKAssignment Between Customer and Business PartnerLinked customer numberReadECC + S/4
CVI_VEND_LINKAssignment Between Vendor and Business PartnerLinked vendor numberReadECC + S/4
BSIDCustomer Open ItemsCustomer open items and last posting dateReadECC + S/4
BSADCustomer Cleared ItemsCustomer cleared items: last posting dateReadECC + S/4
BSIKVendor Open ItemsVendor open items and last posting dateReadECC + S/4
BSAKVendor Cleared ItemsVendor cleared items: last posting dateReadECC + S/4
VBAKSales Document HeaderDate of the last sales documentReadECC + S/4
EKKOPurchasing Document HeaderDate of the last purchasing documentReadECC + 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

ParameterDescriptionTypeReference fieldRequiredExample
S_PARTNBusiness partnerRange / multipleBUT000-PARTNERNo—
S_GROUPBP groupingRange / multipleBUT000-BU_GROUPNoBP01, BP02
S_BUKRSCompany code (activity check)Range / multipleBSID-BUKRSNo1000
P_MONTHSInactivity period (months)Single value—Yes24
P_BLOCKSet central blockRadio button—NoX
P_ARCHSet archiving flagRadio button—No—
P_TESTTest mode (candidate list only)Checkbox—NoX

Result list columns

#ColumnSource
1Business partnerBUT000-PARTNER
2NameBUT000-NAME_ORG1
3GroupingBUT000-BU_GROUP
4CustomerCVI_CUST_LINK-CUSTOMER
5VendorCVI_VEND_LINK-VENDOR
6Created onBUT000-CRDAT
7Last activity dateCalculated MAX(BSID/BSAD/BSIK/BSAK-BUDAT, VBAK-ERDAT, EKKO-BEDAT)
8Months inactiveCalculated Today − last activity date (months)
9Open itemsCalculated Number of open items in BSID and BSIK
10ActionCalculated Block set / Archiving flag set / Skipped
11StatusCalculated Success / Test / Warning / Error and BAPI message

Sample result list

Business partnerNameGroupingCustomerVendorCreated onLast activity dateMonths inactiveOpen itemsActionStatus
1000077Doğu Tekstil Tic. Ltd. Şti.BP0110007703/12/201406/30/2022520Block setSuccess
1000233Güney Kimya Pazarlama A.Ş.BP0230004509/01/201611/15/2023360Block setSuccess
1000351İç Anadolu İnşaat Ltd. Şti.BP0110035130021005/20/201501/08/2024342Skipped: open items existWarning
1000419Karadeniz Fındık Ürünleri A.Ş.BP0110041902/11/201909/30/2024250Block setSuccess
A view built with fictional sample data; not real system data.

How does the program work?

  1. 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.
  2. Linked customer and vendor numbers are found through CVI_CUST_LINK and CVI_VEND_LINK.
  3. 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.
  4. 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”.
  5. 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.
  6. 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

CA Package Custom

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 …

4 components · v1.0

Related reports

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.

Related report: Mass Block and Archiving Flag for Inactive Business Partners