# Mass Asset Retirement Upload from Excel (Scrapping and Sale)

> A custom program that retires fixed assets in bulk from an Excel list, either by scrapping or with sales revenue. It supports full and partial retirement, checks everything in test mode first, then lists the document number and message for every row.

- Type: Program, Custom development, Mass upload
- Module: FI
- Estimated effort: M (4–6 working days)
- Last updated: 2026-11-17
- URL: https://nekuhub.com/en/programs/mass-asset-retirement-upload-from-excel/


## Why is the standard not enough?

ABAVN (scrapping) and F-92 (sale to customer) work on one asset at a time. After a physical inventory or a plant closure, hundreds of assets are entered screen by screen. The standard mass scrapping function offers limited selection and does not take sales revenue or a partial percentage from a file.

### Closest standard alternatives

- ABAVN: Scraps one asset at a time on screen.
- F-92: Posts a retirement with sale to a customer for one asset at a time.

## Tables used

| Table | Role | Access | Join | System |
|---|---|---|---|---|
| ANLA | Asset existence, capitalization and deactivation check | Read | ANLA-BUKRS, ANLA-ANLN1, ANLA-ANLN2 = dosyadaki varlık | ECC + S/4 |
| ANLC | Current cost for the partial retirement check | Read | ANLC-BUKRS = ANLA-BUKRS AND ANLC-ANLN1 = ANLA-ANLN1 AND ANLC-ANLN2 = ANLA-ANLN2 AND ANLC-AFABE = '01' | ECC + S/4 |
| ANEP | Retirement transactions (written through the BAPI) | Write | ANEP-BUKRS = ANLA-BUKRS AND ANEP-ANLN1 = ANLA-ANLN1 AND ANEP-ANLN2 = ANLA-ANLN2 | ECC + S/4 |

## BAPIs and functions used

- BAPI_ASSET_RETIREMENT_POST: Posts the asset retirement by scrapping or sale for each row
- BAPI_TRANSACTION_COMMIT: Saves successful rows permanently
- BAPI_TRANSACTION_ROLLBACK: Rolls back the change in test mode and for failed rows

## Selection screen parameters

| Parameter | Description | Type | Reference field | Required |
|---|---|---|---|---|
| P_FILE | Upload file (XLSX or CSV) | Single value | - | Yes |
| P_BUDAT | Posting date | Single value | BKPF-BUDAT | Yes |
| P_TEST | Test mode (check without posting) | Checkbox | - | No |

## Input file columns

| Column | Target field | Required |
|---|---|---|
| Company code | ANLA-BUKRS | Yes |
| Asset | ANLA-ANLN1 | Yes |
| Sub-number | ANLA-ANLN2 | No |
| Asset value date | ANEP-BZDAT | Yes |
| Transaction type | ANEP-BWASL | Yes |
| Partial retirement amount | ANEP-ANBTR | No |
| Partial retirement percentage | When the amount is blank, this percentage of the current cost is retired; full retirement when both are blank | No |
| Sales revenue | Passed to the BAPI as a retirement with revenue when filled, as scrapping when blank | No |
| Text | BSEG-SGTXT | No |

## Result list columns

| Column | Source |
|---|---|
| Row | Calculated: Row number in the file |
| Company code | ANLA-BUKRS |
| Asset | ANLA-ANLN1 |
| Sub-number | ANLA-ANLN2 |
| Asset description | ANLA-TXT50 |
| Retired cost | Calculated: Current cost from ANLC for a full retirement; by amount or percentage for a partial one |
| Status | Calculated: From the BAPI return messages: posted, test OK or error |
| Document | Calculated: Accounting document number returned by the BAPI |
| Message | Calculated: First error or success message from the BAPI return table |

## How does the program work?

1. The file is read; company code, asset, sub-number, value date and transaction type are mandatory on every row.
2. The asset is checked in ANLA: it must exist, be capitalized (AKTIV filled) and not already be fully retired (DEAKT blank).
3. For a partial retirement the amount or percentage is compared with the current cost in ANLC; a row above the cost is rejected.
4. The row is mapped to the BAPI_ASSET_RETIREMENT_POST structure: retirement with revenue when revenue is given, scrapping otherwise. In test mode the BAPI is called and rolled back with BAPI_TRANSACTION_ROLLBACK.
5. In a real run BAPI_TRANSACTION_COMMIT is called after each successful row; the asset transactions are written to ANEP, and the document number and messages are listed per row.

## Authorization objects

- A_B_ANLKL: Asset posting authorization by company code and asset class
- A_B_BWART: Posting authorization by transaction type group
- F_BKPF_BUK: Accounting document authorization by company code

## Frequently asked questions

### How is depreciation handled on retirement?

The program posts the retirement with the standard BAPI; the pro-rata depreciation for the year of retirement and the gain or loss are generated automatically by SAP asset accounting rules.

### Can sales invoiced to a customer be uploaded as well?

The program covers retirement with revenue posted to a clearing account. If the customer invoice is issued separately, or the sale must go through a customer account as in F-92, that flow is designed as additional scope.

### Can a retirement uploaded by mistake be reversed?

Yes, the resulting document is reversed with AB08. Because the program lists the document number, the reversal is easy to find.

---
Let us build this program for your system: https://nekuhub.com/en/request-a-quote/?report=fi-asset-retirement-upload
