Dynamic Variant To Remove Logs With SBAL - DELETE: Symptom
Dynamic Variant To Remove Logs With SBAL - DELETE: Symptom
Dynamic Variant To Remove Logs With SBAL - DELETE: Symptom
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
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.
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
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
3039724 BALHDR and BALDAT: Application Log tables size increases [FAQ]