Dynamic Variant To Remove Logs With SBAL - DELETE: Symptom

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

SAP Knowledge Base Article

2936391 - Dynamic variant to remove logs with SBAL_DELETE


Component: BC-SRV-BAL (Basis Application Log), Version: 5, Released On: 09.10.2023

Symptom
Dynamic variant is needed in order to remove Application Logs.
The variant is maintained based on the time retention period.
For logs deletion, see more details on SAP Note 195157 - Application log: Deletion of logs
As mentioned, it’s strongly recommended to regularly execute SBAL_DELETE report in a background job with suitable
variant, to prevent Application Log tables to become too big.
Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is
purely coincidental.

Environment
SAP NetWeaver

Reproducing the Issue


Run SBAL_DELETE report on SE38.

Cause
Dynamic variant is needed in order to remove Application Logs as a housekeeping task.

Resolution
1. Enter SBAL_DELETE report on SE38 transaction, and Navigate to Menu Goto > Variants.

2. Enter a Variant name to be created.


For this particular example, we will remove logs older than 6months; therefore, variant name will be
‘TEST_6MONTHS’:

3. Click on Create. Enter a description in field Description:

4. Selection criteria can be defined here.


- Only logs can be removed, that have reached expiration date, or logs can be also included, which have not yet reached
expiration date but can be removed before this date has been reached.
- The variant can be also defined for SBAL_DELETE based on the basis of the object, subobject, or program, or user…
Details on 3039724 - BALHDR and BALDAT: Application Log tables size increases [FAQ]

5. To configure a variant that remove old logs (based on creation period, older than a certain date), select field ‘to
(date/time)’ and press Attributes (via 'Menu'>Attributes; or also pressing F6).
In this particular example, we want to remove logs older than 6months; but any criteria can be used.

6. In row with Field name ‘Creation Date: to’, select field ‘Selection variable’ and Display Variant Attributes (F4).
Chose Type D: Dynamic Date Calculation (Local Date).

7. In same row with Field name ‘Creation Date: to’, select field ‘Name of variable’ and Display Variant Attributes
(F4).
Here time period can be defined dynamically based on current date.
For this particular example, we will add current date minus 6 months (-180 days):

8. Fill the rest of fields of the variant, based on needs. Save 'TEST_6MONTHS' variant.

9. Now SBAL_DELETE can be scheduled with that dynamic variant to be executed periodically.
See also KBA 2507213 - SBAL_DELETE runs too long
Note:
When SBAL_DELETE report is started from SE38 (menu ‘Program > Execute in background’) a temporary variant is created
(temporary variant named like &0000000000XXX is created).
In that case, the date gets a fixed value that will be used always, even if program is scheduled to be executed during
consecutive days.
To avoid that, job needs to be scheduled with transaction SM36, using created dynamic variant 'TEST_6MONTHS'.

See Also
KBA 2707974 - Variant <Variant_name> of program SBAL_DELETE is not the current version
SAP Note 2153288 - SLG2 still running due to unsufficient authorization

Keywords
variant, SBAL_DELETE, BALHDR, BALDAT, BALDATE, BALTIME,
Dynamic Date Calculation, current date, SLG2

Products
Products

SAP NetWeaver all versions

This document refers to


SAP Note/KBA Component Title

3039724 BC-SRV-BAL BALHDR and BALDAT: Application Log tables size increases [FAQ]

2707974 BC-SRV-BAL Variant <Variant_name> of program SBAL_DELETE is not the current version

2507213 BC-SRV-BAL SBAL_DELETE runs too long

2153288 BC-SRV-BAL SLG2 still running due to unsufficient authorization

195157 BC-SRV-BAL Application log: Deletion of logs

This document is referenced by


SAP Note/KBA Component Title

3039724 BALHDR and BALDAT: Application Log tables size increases [FAQ]

2507213 BC-SRV-BAL SBAL_DELETE runs too long

You might also like