SAP Application Log (BAL) and SLG1
SAP Application Log (BAL) is the standard framework for structured operational messages that must survive beyond one dialog screen. Applications create a log with object/subobject/external number, add messages or exceptions, and persist it to BALHDR/BALDAT; users search/display logs in SLG1. An in-memory BAL log is not durable until saved, and logs are not a substitute for field-level change documents.
High-value SAP technical guide to SAP Application Log (BAL) and SLG1: architecture, troubleshooting position, a concrete scenario, decision rules, common production failures, S/4HANA direction, ownership and related evidence.
Reviewed by an ERPClimb SAP consultant on 20 Sept 2026· 761 words
What it is
BAL separates log header identity from message content. The header classifies a run/business object using an application log object, subobject, external number, user/time and retention context. Messages can be SAP message-class entries, free text or exceptions with context. BAL_LOG_CREATE creates an in-memory handle; BAL_LOG_MSG_ADD/BAL_LOG_EXCEPTION_ADD populate it; BAL_DB_SAVE persists selected logs; BAL_DB_SEARCH/LOAD retrieve them; BAL_DSP_LOG_DISPLAY renders them. Persistent data is stored through BAL tables such as BALHDR/BALDAT, but application code should use the framework rather than direct inserts/updates.
When to use it
Use BAL for batch/interface/mass-processing/application events where multiple messages must be correlated to one execution and support needs durable searchable evidence. It is ideal for 'processed 1,000 objects: 980 success, 20 errors' scenarios, background jobs, integrations and custom applications. Use ordinary MESSAGE for immediate dialog feedback and change documents for before/after field audit. Decide retention/object/subobject design before production so SLG1 searches remain useful.
How it fits the stack
SLG0/configuration defines application-log objects/subobjects; SLG1 searches/displays persisted logs. BAL can store technical exception detail while business reports show summarized status. Background jobs often write both job log and BAL—the job log proves scheduler execution, while BAL provides application object-level messages. Integration monitoring can correlate external request IDs through EXTNUMBER. Logs may later be archived/deleted according to retention policy.
A worked example
A nightly customer synchronization processes 50,000 records. Writing only WRITE statements to the job log makes it impossible to search one customer a week later. The program creates a BAL log per run with external request/batch ID, adds structured messages per failed customer and persists the log. Support searches SLG1 by object/subobject/external number, finds the exact BAPI error and reprocesses only failed records. Sensitive payload fields are deliberately excluded.
How to choose
- Use a stable application-log object/subobject taxonomy before coding.
- Put a business/run correlation ID in EXTNUMBER or documented context.
- Persist only useful support/audit information; do not dump entire sensitive payloads.
- Save logs at deliberate checkpoints/end of run and handle BAL save errors.
- Define retention/cleanup for high-volume logs.
Common pitfalls
- Creating BAL_LOG_CREATE/MSG_ADD entries but never calling BAL_DB_SAVE.
- Using one generic log object for every custom application, making SLG1 unusable.
- Logging secrets, passwords, bank data or full payloads unnecessarily.
- Treating BAL as immutable legal audit without confirming retention/security requirements.
- Writing directly to BALHDR/BALDAT.
ECC, S/4HANA and clean core
BAL remains a standard on-stack logging framework in S/4HANA and is still used by many applications. Cloud-native side-by-side applications also need centralized observability, but may use BTP logging services rather than BAL. Clean-core custom code can use released logging facilities appropriate to its environment; classic private/on-premise custom apps can continue using BAL where supported.
Whose problem this is
Application developers define log events/context and message quality; support/operations consume SLG1; security/compliance define sensitive-data/retention policy; Basis assists with volume management/archiving when logs grow large.
Related SAP objects
Reviewed pages this object connects to in the ERPClimb knowledge graph.
Source: ERPClimb — https://erpclimb.com/sap-technical-topics/sap-application-log-bal-slg1ERPClimb is an independent platform and is not affiliated with SAP SE. Reference pages are written and reviewed by SAP consultants for learning and troubleshooting.