SAP Router tips and tricks

This blog will give tips and tricks on SAP Router.

SAP router versions and maintenance can be found in this OSS note: 1897597 – SAProuter: Release rollout.

OSS note 1895350 – Secure configuration of SAProuter covers the security aspects of SAP router. To store encrypted passwords in SAP Router, follow the instructions of OSS note 2046942 – Support encrypted passwords in saprouttab.

SAP router documentation is listed in OSS note 30289 – SAProuter documentation. Public documentation of SAProuter. Help link on help.sap.com on SAP router.

For trouble shooting network issues, follow the instructions in OSS note 1227116 – Creating network traces.

In case you need reverse invoke of the SAP router follow the instructions from this help.sap.com link.

Support backbone configuration

The support backbone configuration is explained in OSS note 2827658 – Automated Configuration of new Support Backbone Communication – Update 02. STC01 task list SAP_BASIS_CONFIG_OSS_COMM can be used to speed up the setup:

OSS notes:

HANA Cleaner Monitoring Setup in FRUN

Introduction

Maintaining SAP HANA systems requires regular housekeeping activities, and one of the critical components is the HANA Cleaner. Monitoring its activity ensures that log cleanup and housekeeping jobs are running as expected.

In this blog, it is explained how we implemented HANA Cleaner monitoring in SAP Focused Run (FRUN) using custom metrics via template maintenance, without requiring custom scripts. This approach leverages standard FRUN capabilities and provides a scalable and maintainable monitoring solution.

Solution Overview

The objective of this monitoring setup is:

  • Track the execution of HANA Cleaner jobs
  • Detect inactivity or failure scenarios
  • Alert operations teams proactively

We achieved this using:

  • Custom Metric based on File Monitoring
  • FRUN Template Maintenance
  • Diagnostic Agent (push) data collection

How It Works

The monitoring logic is simple but effective:

  1. The system monitors the last modified timestamp of HANA Cleaner log files
  2. A custom metric evaluates this timestamp continuously
  3. If no update is detected beyond a defined threshold (e.g., 2 days), an alert is triggered

This ensures immediate visibility into any issues with the HANA Cleaner process.

Implementation Details

Step 1: Create Custom Metric in FRUN

Navigate to:

Advanced System Management → System Monitoring → Template Maintenance

Create or enhance a metric such as:

HANA Cleaner Run Status

Category:

Exceptions

Step 2: Configure Data Collection

From the screenshot setup, the following configuration is used:

Data Collector Type

Diagnostic Agent (push)

Data Collector Name

File Information

Collection Interval

5 Minutes

Step 3: Maintain Collector Input Parameters

Here are the key parameters used:

Parameter IDDescription
DATEPATTERNDate format used (yyyy-MM-dd)
FILEPATTERNHANA Cleaner log file pattern
FOLDERPath to log directory
KEY_FIGMetric to evaluate
RECURSIVEEnable/disable recursive search

Actual Values Used

Plain Text

DATEPATTERN = yyyy-MM-dd

FILEPATTERN = hanacleanerlog_*

FOLDER = /usr/sap/${SAP_HDBSystemID}/${SAPSystemName}/hanacleaner/output

KEY_FIG = Last Modified age in seconds

RECURSIVE = False
Show more lines

✅ This configuration ensures the system monitors the latest file modification time in the HANA Cleaner output directory.

Step 4: Define Metric Logic

The key figure:

Last Modified Age in Seconds

This indicates how long it has been since the log file was updated.

Step 5: Threshold Configuration

Define thresholds based on your operational requirements.

Example:

ConditionThreshold
Green< 24 hours
Yellow24–48 hours
Red> 48 hours

This ensures alerts are triggered if HANA Cleaner hasn’t executed in expected time.

Step 6: Assign Metric to Template

Assign the custom metric to:

  • Relevant HANA systems
  • Both Production and Non-Production landscapes

This ensures full coverage across your environment.

Monitoring Output

Once configured, FRUN displays:

  • Historical trend of HANA Cleaner activity
  • Status indicators (Green/Yellow/Red)
  • Alerts in case of inactivity

From your reference screenshot:

  • The metric appears under Exceptions
  • A graph shows activity progression
  • Alerts are triggered if thresholds are breached
  • System Monitoring
  • (Optional) Root Cause Analysis

Coverage

This setup can be implemented:

  • Across the entire HANA landscape
  • For all S/4HANA or standalone HANA systems
  • In both:
    • Production
    • Non-Production environments

Advantages of This Approach

No Custom Coding Required
Uses standard FRUN capabilities
Can be applied across multiple systems via templates
Frequent monitoring (every 5 minutes)
Detects failures before business impact
Simple file-based monitoring logic

Key Learnings & Best Practices

  • Always ensure correct file path and pattern
  • Validate that Diagnostic Agent has access to directory
  • Fine-tune thresholds based on:
    • HANA Cleaner job frequency
    • Business requirements
  • Use template-based rollout for consistency

Conclusion

Monitoring housekeeping activities like HANA Cleaner is critical for maintaining system health. By leveraging FRUN custom metrics and file monitoring, we can implement an efficient, scalable, and proactive monitoring solution.

This approach eliminates the need for custom scripts while fully utilizing standard SAP monitoring capabilities.

Transport RC-8 errors, reasons and solutions

This blog will list several RC-8 transport errors, explanation of the reason, and solution to solve the RC-8.

Import options

The transport import has a tab for options:

In the below solutions there is reference to the use of these options.

Adding transport again to the import queue

To re-import transport again, go to transaction STMS, go to the import queue, select the menu Extra, Other Requests, Add. Enter the transport request and tick the box Import Again:

Local repair

For some reason the ABAP code was changed locally in the target system.

The text looks like “was repaired in this system”:

Solution: re-import with the overwrite originals flag, and set the flag overwrite objects in unconfirmed repairs.

Component version mismatch

A very frequent cause of transport errors can be component version mismatch. This means that the system detects a difference in components between the source and target (more on components in this blog). That can be a component (like add on) that is already installed on the source , but not yet on target. Or that in the source the ST-PI or ST-A/PI is already patched, but not on the target.

In most cases this version mismatch can be ignored and you can set the “Ignore Invalid Component Version” flag.

When not to set this flag:

  1. Transports related to newly installed addon like customizing/workbench needing the new component
  2. Transports with OSS notes related to this component (for example OSS notes on top of ST-PI)

Missing ABAP object references

A very common cause of RC-8 is that an ABAP program needs an object, which the developer stored in a different transport. To fix the RC-8: import first the transport with the object, then the ABAP program transport. Or import them both at the same time.

To avoid such RC-8’s always run the transport sequence check tool, as explained in this blog.

Table analysis tool

In some cases transaction SE16 might not be allowed to be used in a productive system. But as basis you need to analysis a table (for example to count amount of entries).

As alternative you can use the table analysis tool.

Start transaction ST13, and choose tool TABLE_ANALYSIS:

The output:

As alternative, you can also use SA38 to run program /SSA/CAG.

Bug fix OSS notes:

Top 20 tables per system in SAP Focused Run

The me.sap.com data volume management function was terminated. This blog will explain how you can use SAP Focused Run to get an overview of the top 20 tables on HANA based system. There data volume really matters for both cost of the infrastructure and HANA database license costs.

Set up

The setup is part of SAP Focused Run System Analysis. Select the System Analysis tile:

Then select the HANA system for which you want to perform the analysis. Select the tool HANA Tables:

Depending on your SSI settings data might be shown already. If not, select the configuration item to open the configuration screen:

Click the Configure Aggregation and Capabilities button. In the next screen make sure the switch for SAP HANA Table Size is green:

If it is not green yet, click on the grey diamond to activate it:

Hit the Activate button to confirm activation.

After activation wait 1 day for data collection.

Top 20 results

Now you can see the results. On the left hand side the current top 20 tables, and on the right hand side the growth:

SAP background

Background material can be found on the SAP Focused Run Expert portal.

Optionally you can set the function default as active in the SSI by going to table RCA_SSI_CONF with SM30 and add the entry HANA_TABLE_SIZE with activation X.

Mass clean up program for non production database size reduction

For production systems you need to be very careful running clean up programs. When you want to clean up data there, it does take time to do proper analysis and do it carefully.

When you have a sandbox, development or test system, launching and planning all the diverse clean up programs can take quite some time. Even more time than the storage gain.

Solution: install below Z mass clean up program.

Install and run this program at your own risk! 

The program will trigger several clean up programs. If you want to change anything: you can do so at your own risk.

There are 2 built-in failsafes:

  1. Authorization check for NADM (basis admin)
  2. Check not to run in production system (based on SCC4 client settings)

After the initial clean up program in batch, the next run is scheduled automatically.

Objects, Programs, job frequency and references:

ObjectProgram(s)Job frequencyReference
Table loggingRSTBPDELDailyTable logging
IdocsRSETESTD
RSRLDREL
RSRLDREL2
Hourly
Daily
Daily
Idocs
Application logsSBAL_DELETEDailyGeneral technical clean up
WorkflowsRSWWWIDEDailyGeneral technical clean up
SAP OfficeRSBCS_REORG
RSBCS_ADRVP
RSBCS_SREQ_EXPIRE
RSBCS_SREQ_INITIAL_RELEASE
RSBCS_DELETE_QUEUE
RSSODFRE
RSSO_DELETE_PRIVATE
RSGOSRE02
Daily
Daily
Daily
Daily
Daily
Daily
Daily
Daily
Deleting SAP office documents
Old RFC dataRSARFCER
RSTRFCES
Daily
Daily
General technical clean up
Change documentsRSCDOK99DailyGeneral technical clean up
Change pointersRBDCPCLR2DailyChange pointers
ABAP where usedRS_DEL_WBCROSSGT
SAPRSEUB
Only onceGeneral technical clean up and ABAP where used index
Old batch jobsRSBTCDEL2DailyGeneral technical clean up
Saved listsRSAQQLRE_MASSDailyTable AQLDB clean up
BW loggingRSDDSTAT_DATA_DELETE
RSBATCH_DEL_MSG_PARM_DTPTEMP
RSPM_HOUSEKEEPING
RSBKCLEANUPBUFFER
ODQ_CLEANUP
Daily
Daily
Daily
Daily
Technical clean up for BI

*&---------------------------------------------------------------------*
*& Report ZMASSCLEANUP
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
REPORT zmasscleanup.

DATA(zlv_fcode) = 'NADM'. "authorization check object
DATA: zls_t000 TYPE t000.

DATA:
zlt_params TYPE TABLE OF rsparams,
zls_param TYPE rsparams.
DATA zlv_variant_text TYPE varid.
DATA zls_vari_text TYPE varit.
DATA zlt_vari_text TYPE TABLE OF varit.

PARAMETERS: p_cl TYPE char1 DEFAULT ' ' AS CHECKBOX .
PARAMETERS: p_cld TYPE i DEFAULT '365'.
PARAMETERS: p_id TYPE char1 DEFAULT ' ' AS CHECKBOX .
PARAMETERS: p_idd TYPE i DEFAULT '365'.
PARAMETERS: p_al TYPE char1 DEFAULT ' ' AS CHECKBOX .
PARAMETERS: p_ald TYPE i DEFAULT '365'.
PARAMETERS: p_wi TYPE char1 DEFAULT ' ' AS CHECKBOX .
PARAMETERS: p_wid TYPE i DEFAULT '365'.
PARAMETERS: p_so TYPE char1 DEFAULT ' ' AS CHECKBOX .
PARAMETERS: p_sod TYPE i DEFAULT '365'.
PARAMETERS: p_rf TYPE char1 DEFAULT ' ' AS CHECKBOX .
PARAMETERS: p_rfd TYPE i DEFAULT '7'.
PARAMETERS: p_cd TYPE char1 DEFAULT ' ' AS CHECKBOX .
PARAMETERS: p_cdd TYPE i DEFAULT '365'.
PARAMETERS: p_cp TYPE char1 DEFAULT ' ' AS CHECKBOX .
PARAMETERS: p_cpd TYPE i DEFAULT '365'.
PARAMETERS: p_sl TYPE char1 DEFAULT ' ' AS CHECKBOX .
PARAMETERS: p_sld TYPE i DEFAULT '365'.
PARAMETERS: p_bj TYPE char1 DEFAULT ' ' AS CHECKBOX .
PARAMETERS: p_bwd TYPE i DEFAULT '30'.
PARAMETERS: p_bw TYPE char1 DEFAULT ' ' AS CHECKBOX .
PARAMETERS: p_bjd TYPE i DEFAULT '7'.
PARAMETERS: p_vh TYPE char1 DEFAULT ' ' AS CHECKBOX .

INITIALIZATION.
%_p_cl_%_app_%-text = 'Delete table change logging'.
%_p_cld_%_app_%-text = 'Days to keep table change logging'.
%_p_id_%_app_%-text = 'Delete Idocs'.
%_p_idd_%_app_%-text = 'Days to keep idocs'.
%_p_al_%_app_%-text = 'Delete application logs'.
%_p_ald_%_app_%-text = 'Days to keep application'.
%_p_wi_%_app_%-text = 'Delete Workflow items'.
%_p_wid_%_app_%-text = 'Days to keep Workflows'.
%_p_so_%_app_%-text = 'Delete SAP office items'.
%_p_sod_%_app_%-text = 'Days to keep SAP office items'.
%_p_rf_%_app_%-text = 'Delete old RFC data'.
%_p_rfd_%_app_%-text = 'Days to keep old RFC data'.
%_p_cd_%_app_%-text = 'Delete old Change Documents'.
%_p_cdd_%_app_%-text = 'Days to keep old Change Documents'.
%_p_cp_%_app_%-text = 'Delete old Change Pointers'.
%_p_cpd_%_app_%-text = 'Days to keep old Change Pointers'.
%_p_sl_%_app_%-text = 'Delete old Saved lists'.
%_p_sld_%_app_%-text = 'Days to keep old Saved lists'.
%_p_bj_%_app_%-text = 'Delete old batch jobs'.
%_p_bjd_%_app_%-text = 'Days to keep old batch jobs'.
%_p_bw_%_app_%-text = 'Delete old BW jobs'.
%_p_bwd_%_app_%-text = 'Days to keep old BW jobs'.
%_p_vh_%_app_%-text = 'WBCROSSGT table clean up'.

START-OF-SELECTION.

* check for basis adminstration access
AUTHORITY-CHECK OBJECT 'S_ADMI_FCD'
ID 'S_ADMI_FCD' FIELD zlv_fcode.

IF sy-subrc = 0.
"User has administration authorization for that function

* Fetch the client properties
SELECT SINGLE * FROM t000 INTO zls_t000 WHERE mandt = sy-mandt.
IF zls_t000-cccategory = 'P'.
* Forbid to run on productive client
WRITE: / 'Do not run on productive client: Productive (Production client)'.
ELSE.
IF p_cl EQ 'X'.
PERFORM cleanup_table_change_log USING p_cld.
ENDIF.
IF p_id EQ 'X'.
PERFORM cleanup_idocs USING p_idd.
ENDIF.
IF p_al EQ 'X'.
PERFORM cleanup_application_logs USING p_ald.
ENDIF.
IF p_wi EQ 'X'.
PERFORM cleanup_workflows USING p_wid.
ENDIF.
IF p_so EQ 'X'.
PERFORM cleanup_sapoffice USING p_sod.
ENDIF.
IF p_rf EQ 'X'.
PERFORM cleanup_rfcdata USING p_rfd.
ENDIF.
IF p_cd EQ 'X'.
PERFORM cleanup_changedocuments USING p_cdd.
ENDIF.
IF p_cp EQ 'X'.
PERFORM cleanup_changepointers USING p_cpd.
ENDIF.
IF p_bj EQ 'X'.
PERFORM cleanup_batchjobs USING p_bjd.
ENDIF.
IF p_sl EQ 'X'.
PERFORM cleanup_savedlists USING p_sld.
ENDIF.
IF p_bw EQ 'X'.
PERFORM cleanup_bwlogs USING p_bwd.
ENDIF.
IF p_vh EQ 'X'.
PERFORM cleanup_wbcrossgt USING p_cdd.
ENDIF.
ENDIF.

ELSE.
"No authorization
MESSAGE e398(00) WITH |No admin authorization (S_ADMI_FCD={ zlv_fcode })|.
ENDIF.
*&---------------------------------------------------------------------*
*& Form start_job
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& --> p1 text
*& <-- p2 text
*&---------------------------------------------------------------------*
FORM start_job
USING
ziv_progname TYPE progname
ziv_variant TYPE raldb_vari
ziv_timing TYPE char1.

DATA: ziv_jobname TYPE tbtcjob-jobname.
DATA: zcv_jobcount TYPE tbtcjob-jobcount.
DATA: zlv_prddays TYPE tbtcjob-prddays.
DATA: zlv_prdhours TYPE tbtcjob-prdhours.

ziv_jobname = ziv_progname+0(32).

"-------------------------------
" 1) Open job
"-------------------------------
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = ziv_jobname
IMPORTING
jobcount = zcv_jobcount
EXCEPTIONS
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
OTHERS = 4.

IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE 'E' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
EXIT.
ENDIF.

"-------------------------------
" 2) Add step (program + variant)
"-------------------------------
CALL FUNCTION 'JOB_SUBMIT'
EXPORTING
jobname = ziv_jobname
jobcount = zcv_jobcount
authcknam = sy-uname
report = ziv_progname
variant = ziv_variant
language = sy-langu
EXCEPTIONS
bad_priparams = 1
bad_xpgflags = 2
invalid_jobdata = 3
jobname_missing = 4
job_notex = 5
job_submit_failed = 6
lock_failed = 7
program_missing = 8
prog_abap_and_extpg = 9
OTHERS = 10.

IF sy-subrc <> 0.
"Best-effort cleanup: close job without releasing it

CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobname = ziv_jobname
jobcount = zcv_jobcount
strtimmed = space
EXCEPTIONS
OTHERS = 1.

MESSAGE ID sy-msgid TYPE 'E' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
EXIT.
ENDIF.

"-------------------------------
" 3) Close job and start immediately
"-------------------------------

IF ziv_timing EQ 'D'.
zlv_prddays = 1.
zlv_prdhours = 0.

ELSEIF ziv_timing EQ 'H'.
zlv_prddays = 0.
zlv_prdhours = 1.
ELSEIF ziv_timing EQ 'X'. "run only once
zlv_prddays = 0.
zlv_prdhours = 0.
ENDIF.

CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobname = ziv_jobname
jobcount = zcv_jobcount
prddays = zlv_prddays
prdhours = zlv_prdhours
strtimmed = 'X'
EXCEPTIONS
cant_start_immediate = 1
invalid_startdate = 2
jobname_missing = 3
job_close_failed = 4
job_nosteps = 5
job_notex = 6
lock_failed = 7
OTHERS = 8.

IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE 'E' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
EXIT.
ENDIF.

WRITE: / 'Job',ziv_jobname, zcv_jobcount,' scheduled:', ziv_progname, ziv_variant, 'immediate'.

ENDFORM.
*&---------------------------------------------------------------------*
*& Form create_variant
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& --> p1 text
*& <-- p2 text
*&---------------------------------------------------------------------*
FORM create_variant
TABLES zit_params
USING
ziv_report TYPE progname
ziv_variant TYPE raldb_vari.

REFRESH zlt_vari_text.

zlv_variant_text-report = ziv_report.
zlv_variant_text-variant = ziv_variant.
zlv_variant_text-environmnt = 'A'.
zls_vari_text-vtext = zlv_variant_text.
zls_vari_text-report = ziv_report.
zls_vari_text-variant = ziv_variant.
APPEND zls_vari_text TO zlt_vari_text.

CALL FUNCTION 'RS_CREATE_VARIANT'
EXPORTING
curr_report = ziv_report
curr_variant = ziv_variant
vari_desc = zlv_variant_text
TABLES
vari_contents = zit_params
vari_text = zlt_vari_text
EXCEPTIONS
illegal_report_or_variant = 1
illegal_variantname = 2
not_authorized = 3
not_executed = 4
report_not_existent = 5
report_not_supplied = 6
variant_exists = 7
variant_locked = 8
OTHERS = 9.

IF sy-subrc = 0.
WRITE: / 'Variant created:', ziv_report, ziv_variant.
ELSE.
WRITE: / 'Variant creation failed. SY-SUBRC=', sy-subrc.
ENDIF.

ENDFORM.

*&---------------------------------------------------------------------*
*& Form cleanup_table_change_log
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& --> p1 text
*& <-- p2 text
*&---------------------------------------------------------------------*
FORM cleanup_table_change_log USING ziv_days.

DATA: zlv_variant TYPE raldb_vari.

CLEAR zls_param.
REFRESH zlt_params.
zls_param-selname = 'P_DAYS'. " amount of days to keep
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = ziv_days.
APPEND zls_param TO zlt_params.

zlv_variant = |ZCL{ ziv_days }|.

PERFORM create_variant TABLES zlt_params USING 'RSTBPDEL' zlv_variant.
PERFORM start_job USING 'RSTBPDEL' zlv_variant 'D'.

ENDFORM.

*&---------------------------------------------------------------------*
*& Form cleanup_idocs
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& --> P_IDD
*&---------------------------------------------------------------------*
FORM cleanup_idocs USING ziv_days.

DATA: zlv_variant TYPE raldb_vari.
DATA: zlv_date TYPE sy-datum.

CLEAR zls_param.
REFRESH zlt_params.
zls_param-selname = 'GP_TEST'. " test flag to be removed
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = ' '.
APPEND zls_param TO zlt_params.

zls_param-selname = 'P_COM'. " commit counter
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = '100'.
APPEND zls_param TO zlt_params.

zls_param-selname = 'GP_MAXCT'. " max amount of idocs
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = '1000000'.
APPEND zls_param TO zlt_params.


zls_param-selname = 'GS_CREDA'. " creation date
zls_param-kind = 'S'.
zls_param-sign = 'I'.
zls_param-option = 'BT'.
zlv_date = sy-datum - 9999.
zls_param-low = zlv_date.
zlv_date = sy-datum - ziv_days.
zls_param-high = zlv_date.
APPEND zls_param TO zlt_params.

zlv_variant = |ZCL{ ziv_days }|.


PERFORM create_variant TABLES zlt_params USING 'RSETESTD' zlv_variant.
PERFORM start_job USING 'RSETESTD' zlv_variant 'H'.

CLEAR zls_param.
REFRESH zlt_params.

zlv_date = sy-datum - 9999.
zls_param-selname = 'G_DSINCE'. " start date
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = zlv_date.
APPEND zls_param TO zlt_params.

zlv_date = sy-datum - ziv_days.
zls_param-selname = 'G_DUNTIL'. " to date
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = zlv_date.
APPEND zls_param TO zlt_params.

zls_param-selname = 'G_TABLE'. " table
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = 'IDOCREL'.
APPEND zls_param TO zlt_params.


PERFORM create_variant TABLES zlt_params USING 'RSRLDREL2' zlv_variant.
PERFORM start_job USING 'RSRLDREL2' zlv_variant 'D'.

CLEAR zls_param.
REFRESH zlt_params.

zlv_date = sy-datum - 9999.
zls_param-selname = 'G_DSINCE'. " start date
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = zlv_date.
APPEND zls_param TO zlt_params.

zlv_date = sy-datum - ziv_days.
zls_param-selname = 'G_DUNTIL'. " to date
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = zlv_date.
APPEND zls_param TO zlt_params.

zls_param-selname = 'G_OBJTYP'. " table
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = 'IDOC'.
APPEND zls_param TO zlt_params.

zls_param-selname = 'G_NONE'. " no existance check
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = 'X'.
APPEND zls_param TO zlt_params.

zls_param-selname = 'G_PKSZ'. " package size
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = 250.
APPEND zls_param TO zlt_params.

zls_param-selname = 'G_CTSZ'. " package size
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = 250.
APPEND zls_param TO zlt_params.

PERFORM create_variant TABLES zlt_params USING 'RSRLDREL' zlv_variant.
PERFORM start_job USING 'RSRLDREL' zlv_variant 'D'.

ENDFORM.
*&---------------------------------------------------------------------*
*& Form cleanup_application_logs
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& --> P_ALD
*&---------------------------------------------------------------------*
FORM cleanup_application_logs USING ziv_days.

DATA: zlv_variant TYPE raldb_vari.
DATA: zlv_date TYPE sy-datum.

CLEAR zls_param.
REFRESH zlt_params.
zls_param-selname = 'P_BEF_OK'. " delete all logs
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = 'X'.
APPEND zls_param TO zlt_params.

zls_param-selname = 'P_BCK'. " schedule background jobs
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = 'X'.
APPEND zls_param TO zlt_params.

zlv_date = sy-datum - 9999.
zls_param-selname = 'P_BEGDAT'. " start date
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = zlv_date.
APPEND zls_param TO zlt_params.

zlv_date = sy-datum - ziv_days.
zls_param-selname = 'P_ENDDAT'. " end date
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = zlv_date.
APPEND zls_param TO zlt_params.

zlv_variant = |ZCL{ ziv_days }|.

PERFORM create_variant TABLES zlt_params USING 'SBAL_DELETE' zlv_variant.
PERFORM start_job USING 'SBAL_DELETE' zlv_variant 'D'.

ENDFORM.
*&---------------------------------------------------------------------*
*& Form cleanup_workflows
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& --> P_WID
*&---------------------------------------------------------------------*
FORM cleanup_workflows USING ziv_days.

DATA: zlv_variant TYPE raldb_vari.
DATA: zlv_date TYPE sy-datum.

CLEAR zls_param.
REFRESH zlt_params.
zls_param-selname = 'I_DISPLY'. " delete immediately
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = 'X'.
APPEND zls_param TO zlt_params.

zls_param-selname = 'I_DELERR'. " delete errors as well
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = 'X'.
APPEND zls_param TO zlt_params.

zls_param-selname = 'I_DELLOG'. " delete log as well
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = 'X'.
APPEND zls_param TO zlt_params.

zls_param-selname = 'I_TOPLVL'. " top level only
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = 'X'.
APPEND zls_param TO zlt_params.

zls_param-selname = 'IT_CD'. " creation date
zls_param-kind = 'S'.
zls_param-sign = 'I'.
zls_param-option = 'BT'.
zlv_date = sy-datum - 9999.
zls_param-low = zlv_date.
zlv_date = sy-datum - ziv_days.
zls_param-high = zlv_date.
APPEND zls_param TO zlt_params.

zlv_variant = |ZCL{ ziv_days }|.

PERFORM create_variant TABLES zlt_params USING 'RSWWWIDE' zlv_variant.
PERFORM start_job USING 'RSWWWIDE' zlv_variant 'D'.

ENDFORM.
*&---------------------------------------------------------------------*
*& Form cleanup_sapoffice
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& --> P_SOD
*&---------------------------------------------------------------------*
FORM cleanup_sapoffice USING ziv_days.

DATA: zlv_variant TYPE raldb_vari.
DATA: zlv_date TYPE sy-datum.

CLEAR zls_param.
REFRESH zlt_params.

zls_param-selname = 'TESTMODE'. " remove test mode
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = ' '.
APPEND zls_param TO zlt_params.

zls_param-selname = 'PACKSIZE'. " package size
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = 500.
APPEND zls_param TO zlt_params.


zls_param-selname = 'SRDEL'. " send docs
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = 'X'.
APPEND zls_param TO zlt_params.

zls_param-selname = 'DOCDEL'. " not send docs
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = 'X'.
APPEND zls_param TO zlt_params.


zls_param-selname = 'CREATED'. " creation date
zls_param-kind = 'S'.
zls_param-sign = 'I'.
zls_param-option = 'BT'.
zlv_date = sy-datum - 9999.
zls_param-low = zlv_date.
zlv_date = sy-datum - ziv_days.
zls_param-high = zlv_date.
APPEND zls_param TO zlt_params.

zlv_variant = |ZCL{ ziv_days }|.

PERFORM create_variant TABLES zlt_params USING 'RSBCS_REORG' zlv_variant.
PERFORM start_job USING 'RSBCS_REORG' zlv_variant 'D'.

CLEAR zls_param.
REFRESH zlt_params.

zls_param-selname = 'TESTMODE'. " remove test mode
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = ' '.
APPEND zls_param TO zlt_params.

zls_param-selname = 'ADRVP'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = 'X'.
APPEND zls_param TO zlt_params.

zls_param-selname = 'ADRV'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = 'X'.
APPEND zls_param TO zlt_params.

zls_param-selname = 'PACKSIZE'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = 5000.
APPEND zls_param TO zlt_params.

PERFORM create_variant TABLES zlt_params USING 'RSBCS_ADRVP' zlv_variant.
PERFORM start_job USING 'RSBCS_ADRVP' zlv_variant 'D'.

CLEAR zls_param.
REFRESH zlt_params.

zls_param-selname = 'TESTMODE'. " remove test mode
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = ' '.
APPEND zls_param TO zlt_params.

zls_param-selname = 'FULL_LOG'. " detailled log
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = ' '.
APPEND zls_param TO zlt_params.

zls_param-selname = 'CR_DAT'. " creation date
zls_param-kind = 'S'.
zls_param-sign = 'I'.
zls_param-option = 'BT'.
zlv_date = sy-datum - 9999.
zls_param-low = zlv_date.
zlv_date = sy-datum - ziv_days.
zls_param-high = zlv_date.
APPEND zls_param TO zlt_params.

zlv_variant = |ZCL{ ziv_days }|.

PERFORM create_variant TABLES zlt_params USING 'RSBCS_SREQ_EXPIRE' zlv_variant.
PERFORM start_job USING 'RSBCS_SREQ_EXPIRE' zlv_variant 'D'.

CLEAR zls_param.
REFRESH zlt_params.

zls_param-selname = 'TESTMODE'. " remove test mode
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = ' '.
APPEND zls_param TO zlt_params.

zls_param-selname = 'CRDAT'. " creation date
zls_param-kind = 'S'.
zls_param-sign = 'I'.
zls_param-option = 'BT'.
zlv_date = sy-datum - 9999.
zls_param-low = zlv_date.
zlv_date = sy-datum - ziv_days.
zls_param-high = zlv_date.
APPEND zls_param TO zlt_params.

zlv_variant = |ZCL{ ziv_days }|.

PERFORM create_variant TABLES zlt_params USING 'RSBCS_SREQ_INITIAL_RELEASE' zlv_variant.
PERFORM start_job USING 'RSBCS_SREQ_INITIAL_RELEASE' zlv_variant 'D'.

CLEAR zls_param.
REFRESH zlt_params.

zls_param-selname = 'TESTMODE'. " remove test mode
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = ' '.
APPEND zls_param TO zlt_params.

zls_param-selname = 'SNDDAT'. " creation date
zls_param-kind = 'S'.
zls_param-sign = 'I'.
zls_param-option = 'BT'.
zlv_date = sy-datum - 9999.
zls_param-low = zlv_date.
zlv_date = sy-datum - ziv_days.
zls_param-high = zlv_date.
APPEND zls_param TO zlt_params.

zlv_variant = |ZCL{ ziv_days }|.

PERFORM create_variant TABLES zlt_params USING 'RSBCS_DELETE_QUEUE' zlv_variant.
PERFORM start_job USING 'RSBCS_DELETE_QUEUE' zlv_variant 'D'.

zls_param-selname = 'P_AGE'. " amount of days to keep
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = ziv_days.
APPEND zls_param TO zlt_params.

zls_param-selname = 'TESTMODE'. " remove test mode
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = ' '.
APPEND zls_param TO zlt_params.

zls_param-selname = 'DELETE'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = 'X'.
APPEND zls_param TO zlt_params.

zls_param-selname = 'NOT_SENT'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = 'X'.
APPEND zls_param TO zlt_params.

zls_param-selname = 'SENDER'.
zls_param-kind = 'S'.
zls_param-sign = 'I'.
zls_param-option = 'CP'.
zls_param-low = '*'.
APPEND zls_param TO zlt_params.

zlv_variant = |ZCL{ ziv_days }|.

PERFORM create_variant TABLES zlt_params USING 'RSSODFRE' zlv_variant.
PERFORM start_job USING 'RSSODFRE' zlv_variant 'D'.

zls_param-selname = 'USER'.
zls_param-kind = 'S'.
zls_param-sign = 'I'.
zls_param-option = 'CP'.
zls_param-low = '*'.
APPEND zls_param TO zlt_params.

zls_param-selname = 'INBOX'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = 'X'.
APPEND zls_param TO zlt_params.

zls_param-selname = 'ALL'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = 'X'.
APPEND zls_param TO zlt_params.

zls_param-selname = 'READONLY'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = ' '.
APPEND zls_param TO zlt_params.

zls_param-selname = 'RESUB'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = ' '.
APPEND zls_param TO zlt_params.

zls_param-selname = 'PRIVDOC'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = ' '.
APPEND zls_param TO zlt_params.

zls_param-selname = 'TRASH'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = ' '.
APPEND zls_param TO zlt_params.

zls_param-selname = 'REPLY'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = ' '.
APPEND zls_param TO zlt_params.

zls_param-selname = 'P_AGE'. " amount of days to keep
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = ziv_days.
APPEND zls_param TO zlt_params.

zls_param-selname = 'TEST'. " remove test mode
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = ' '.
APPEND zls_param TO zlt_params.

zls_param-selname = 'OUTDOCS'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = ' '.
APPEND zls_param TO zlt_params.

zls_param-selname = 'PACKSIZE'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = 100.
APPEND zls_param TO zlt_params.

zlv_variant = |ZCL{ ziv_days }|.

PERFORM create_variant TABLES zlt_params USING 'RSSO_DELETE_PRIVATE' zlv_variant.
PERFORM start_job USING 'RSSO_DELETE_PRIVATE' zlv_variant 'D'.

zls_param-selname = 'PPSIZE'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = 500.
APPEND zls_param TO zlt_params.

zls_param-selname = 'PTEST'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = 'X'.
APPEND zls_param TO zlt_params.

zlv_date = sy-datum - ziv_days.
zls_param-selname = 'P_UNTIL'. " end date
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = zlv_date.
APPEND zls_param TO zlt_params.

zlv_date = sy-datum - 9999.
zls_param-selname = 'PDDSINCE'. " start date
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = zlv_date.
APPEND zls_param TO zlt_params.

zlv_variant = |ZCL{ ziv_days }|.

PERFORM create_variant TABLES zlt_params USING 'RSGOSRE02' zlv_variant.
PERFORM start_job USING 'RSGOSRE02' zlv_variant 'D'.

ENDFORM.
*&---------------------------------------------------------------------*
*& Form cleanup_rfcdata
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& --> P_RFD
*&---------------------------------------------------------------------*
FORM cleanup_rfcdata USING ziv_days.

DATA: zlv_variant TYPE raldb_vari.
DATA: zlv_date TYPE sy-datum.

CLEAR zls_param.
REFRESH zlt_params.

zls_param-selname = 'PAKET'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = '10000'.
APPEND zls_param TO zlt_params.

zls_param-selname = 'CPIC'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = 'X'.
APPEND zls_param TO zlt_params.

zls_param-selname = 'REC'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = 'X'.
APPEND zls_param TO zlt_params.

zls_param-selname = 'FAIL'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = 'X'.
APPEND zls_param TO zlt_params.

zls_param-selname = 'SENT'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = 'X'.
APPEND zls_param TO zlt_params.

zls_param-selname = 'EXEC'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = 'X'.
APPEND zls_param TO zlt_params.

zls_param-selname = 'LOAD'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = 'X'.
APPEND zls_param TO zlt_params.

zls_param-selname = 'RETRY'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = 'X'.
APPEND zls_param TO zlt_params.

zls_param-selname = 'NORETRY'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = 'X'.
APPEND zls_param TO zlt_params.

zls_param-selname = 'PCLNT'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = sy-mandt.
APPEND zls_param TO zlt_params.

zls_param-selname = 'DAY'. " creation date
zls_param-kind = 'S'.
zls_param-sign = 'I'.
zls_param-option = 'BT'.
zlv_date = sy-datum - 9999.
zls_param-low = zlv_date.
zlv_date = sy-datum - ziv_days.
zls_param-high = zlv_date.
APPEND zls_param TO zlt_params.

zlv_variant = |ZCL{ ziv_days }|.

PERFORM create_variant TABLES zlt_params USING 'RSARFCER' zlv_variant.
PERFORM start_job USING 'RSARFCER' zlv_variant 'D'.

CLEAR zls_param.
REFRESH zlt_params.

zls_param-selname = 'NRDAYS'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = ziv_days.
APPEND zls_param TO zlt_params.

zls_param-selname = 'BLK_SIZE'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = 5000.
APPEND zls_param TO zlt_params.

zls_param-selname = 'DELSTATE'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = 'SYSFAIL'.
APPEND zls_param TO zlt_params.

PERFORM create_variant TABLES zlt_params USING 'RSTRFCES' zlv_variant.
PERFORM start_job USING 'RSTRFCES' zlv_variant 'D'.

ENDFORM.
*&---------------------------------------------------------------------*
*& Form cleanup_changedocuments
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& --> P_CDD
*&---------------------------------------------------------------------*
FORM cleanup_changedocuments USING ziv_days.



DATA: zlv_variant TYPE raldb_vari.
DATA: zlv_date TYPE sy-datum.

CLEAR zls_param.
REFRESH zlt_params.

zls_param-selname = 'OBJECT'.
zls_param-kind = 'S'.
zls_param-sign = 'I'.
zls_param-option = 'CP'.
zls_param-low = '*'.
APPEND zls_param TO zlt_params.

zlv_date = sy-datum - ziv_days.

zls_param-selname = 'TO_DATE'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = zlv_date.
APPEND zls_param TO zlt_params.

zls_param-selname = 'TESTRUN'. "testrun
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = ' '.
APPEND zls_param TO zlt_params.

zls_param-selname = 'P_ALV'. "display
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = ' '.
APPEND zls_param TO zlt_params.

zls_param-selname = 'P_STAT'. "counting
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = ' '.
APPEND zls_param TO zlt_params.

zls_param-selname = 'P_SIZE'. "package size
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = 1500.
APPEND zls_param TO zlt_params.

zls_param-selname = 'P_LINSHW'. "package size
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = 1500.
APPEND zls_param TO zlt_params.

zls_param-selname = 'AUD_DATE'. " creation date
zls_param-kind = 'S'.
zls_param-sign = 'I'.
zls_param-option = 'BT'.
zlv_date = sy-datum - 9999.
zls_param-low = zlv_date.
zlv_date = sy-datum - ziv_days.
zls_param-high = zlv_date.
APPEND zls_param TO zlt_params.

zlv_variant = |ZCL{ ziv_days }|.

PERFORM create_variant TABLES zlt_params USING 'RSCDOK99' zlv_variant.
PERFORM start_job USING 'RSCDOK99' zlv_variant 'D'.

ENDFORM.
*&---------------------------------------------------------------------*
*& Form cleanup_WBCROSSGT
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& --> P_CDD
*&---------------------------------------------------------------------*
FORM cleanup_wbcrossgt USING p_p_cdd.
DATA: zlv_variant TYPE raldb_vari.
CLEAR zlv_variant.
PERFORM start_job USING 'RS_DEL_WBCROSSGT' zlv_variant 'X'.
PERFORM start_job USING 'SAPRSEUB' zlv_variant 'X'.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form cleanup_batchjobs
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& --> P_BJD
*&---------------------------------------------------------------------*
FORM cleanup_batchjobs USING ziv_days.

DATA: zlv_variant TYPE raldb_vari.
DATA: zlv_date TYPE sy-datum.

CLEAR zls_param.
REFRESH zlt_params.

zls_param-selname = 'PRELIM'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = 'X'.
APPEND zls_param TO zlt_params.

zls_param-selname = 'SCHED'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = 'X'.
APPEND zls_param TO zlt_params.

zls_param-selname = 'FIN'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = 'X'.
APPEND zls_param TO zlt_params.

zls_param-selname = 'ABORT'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = 'X'.
APPEND zls_param TO zlt_params.

zls_param-selname = 'PORTION'. "commit counter
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = 1000.
APPEND zls_param TO zlt_params.

zls_param-selname = 'TESTRUN'. "testrun
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = ' '.
APPEND zls_param TO zlt_params.

zls_param-selname = 'APREDAYS'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = ziv_days.
APPEND zls_param TO zlt_params.

zls_param-selname = 'BPREDAYS'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = ziv_days.
APPEND zls_param TO zlt_params.

zls_param-selname = 'CPREDAYS'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = ziv_days.
APPEND zls_param TO zlt_params.

zls_param-selname = 'ASCHDAYS'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = ziv_days.
APPEND zls_param TO zlt_params.

zls_param-selname = 'BSCHDAYS'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = ziv_days.
APPEND zls_param TO zlt_params.

zls_param-selname = 'CSCHDAYS'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = ziv_days.
APPEND zls_param TO zlt_params.

zls_param-selname = 'AFINDAYS'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = ziv_days.
APPEND zls_param TO zlt_params.

zls_param-selname = 'BFINDAYS'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = ziv_days.
APPEND zls_param TO zlt_params.

zls_param-selname = 'CFINDAYS'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = ziv_days.
APPEND zls_param TO zlt_params.

zls_param-selname = 'AABODAYS'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = ziv_days.
APPEND zls_param TO zlt_params.

zls_param-selname = 'BABODAYS'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = ziv_days.
APPEND zls_param TO zlt_params.

zls_param-selname = 'CABODAYS'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = ziv_days.
APPEND zls_param TO zlt_params.

zlv_variant = |ZCL{ ziv_days }|.

PERFORM create_variant TABLES zlt_params USING 'RSBTCDEL2' zlv_variant.
PERFORM start_job USING 'RSBTCDEL2' zlv_variant 'D'.

ENDFORM.
*&---------------------------------------------------------------------*
*& Form cleanup_savedlists
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& --> P_SLD
*&---------------------------------------------------------------------*
FORM cleanup_savedlists USING ziv_days.


DATA: zlv_variant TYPE raldb_vari.
DATA: zlv_date TYPE sy-datum.

CLEAR zls_param.
REFRESH zlt_params.

zls_param-selname = 'P_DATE'. " up to date
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zlv_date = sy-datum - ziv_days.
zls_param-low = zlv_date.
APPEND zls_param TO zlt_params.

zls_param-selname = 'P_TEST'. "testrun
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = ' '.
APPEND zls_param TO zlt_params.

zls_param-selname = 'P_WSID'. "local
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = ' '.
APPEND zls_param TO zlt_params.

zlv_variant = |ZCL{ ziv_days }|.

PERFORM create_variant TABLES zlt_params USING 'RSAQQLRE_MASS' zlv_variant.
PERFORM start_job USING 'RSAQQLRE_MASS' zlv_variant 'D'.

CLEAR zls_param.
REFRESH zlt_params.

zls_param-selname = 'P_DATE'. " up to date
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zlv_date = sy-datum - ziv_days.
zls_param-low = zlv_date.
APPEND zls_param TO zlt_params.

zls_param-selname = 'P_TEST'. "testrun
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = ' '.
APPEND zls_param TO zlt_params.

zls_param-selname = 'P_WSID'. "global
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = 'X'.
APPEND zls_param TO zlt_params.

zlv_variant = |ZCL{ ziv_days }2|.

PERFORM create_variant TABLES zlt_params USING 'RSAQQLRE_MASS' zlv_variant.
PERFORM start_job USING 'RSAQQLRE_MASS' zlv_variant 'D'.

ENDFORM.
*&---------------------------------------------------------------------*
*& Form cleanup_bwlogs
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& --> P_BWD
*&---------------------------------------------------------------------*
FORM cleanup_bwlogs USING ziv_days.

DATA: zlv_variant TYPE raldb_vari.
DATA: zlv_date TYPE sy-datum.

CLEAR zls_param.
REFRESH zlt_params.

zls_param-selname = 'P_DATE'. " up to date
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zlv_date = sy-datum - ziv_days.
zls_param-low = zlv_date.
APPEND zls_param TO zlt_params.

zls_param-selname = 'P_OWN'. "
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = 'X'.
APPEND zls_param TO zlt_params.

zls_param-selname = 'P_QUERY'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = 'X'.
APPEND zls_param TO zlt_params.
zls_param-selname = 'P_LOGG'.
APPEND zls_param TO zlt_params.
zls_param-selname = 'P_AGHPA'.
APPEND zls_param TO zlt_params.
zls_param-selname = 'P_DELE'.
APPEND zls_param TO zlt_params.
zls_param-selname = 'P_BIA'.
APPEND zls_param TO zlt_params.
zls_param-selname = 'P_DTP'.
APPEND zls_param TO zlt_params.
zls_param-selname = 'P_WHM'.
APPEND zls_param TO zlt_params.
zls_param-selname = 'P_WSP'.
APPEND zls_param TO zlt_params.
zls_param-selname = 'P_AP'.
APPEND zls_param TO zlt_params.
zls_param-selname = 'P_SL'.
APPEND zls_param TO zlt_params.

zlv_variant = |ZCL{ ziv_days }|.

PERFORM create_variant TABLES zlt_params USING 'RSDDSTAT_DATA_DELETE' zlv_variant.
PERFORM start_job USING 'RSDDSTAT_DATA_DELETE' zlv_variant 'D'.

CLEAR zls_param.
REFRESH zlt_params.

zls_param-selname = 'DEL_MSG'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = ziv_days.
APPEND zls_param TO zlt_params.
zls_param-selname = 'DEL_PAR'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = ziv_days.
APPEND zls_param TO zlt_params.
zls_param-selname = 'DEL_DTP'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = 'X'.
APPEND zls_param TO zlt_params.

zlv_variant = |ZCL{ ziv_days }|.

PERFORM create_variant TABLES zlt_params USING 'RSBATCH_DEL_MSG_PARM_DTPTEMP' zlv_variant.
PERFORM start_job USING 'RSBATCH_DEL_MSG_PARM_DTPTEMP' zlv_variant 'D'.

CLEAR zls_param.
REFRESH zlt_params.

zls_param-selname = 'P_DAYS'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = ziv_days.
APPEND zls_param TO zlt_params.
zls_param-selname = 'P_SIMU3'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = 'X'.
APPEND zls_param TO zlt_params.
zls_param-selname = 'P_REORG'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = 'X'.
APPEND zls_param TO zlt_params.
zls_param-selname = 'P_PKG'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = 10000.
APPEND zls_param TO zlt_params.

zlv_variant = |ZCL{ ziv_days }|.

PERFORM create_variant TABLES zlt_params USING 'RSPM_HOUSEKEEPING' zlv_variant.
PERFORM start_job USING 'RSPM_HOUSEKEEPING' zlv_variant 'D'.

CLEAR zls_param.
REFRESH zlt_params.

zls_param-selname = 'DATE_S'. " from date
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zlv_date = sy-datum - 9999.
zls_param-low = zlv_date.
APPEND zls_param TO zlt_params.

zls_param-selname = 'DATE_E'. " to date
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zlv_date = sy-datum - ziv_days.
zls_param-low = zlv_date.
APPEND zls_param TO zlt_params.
zls_param-selname = 'CROSS'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = 'X'.
APPEND zls_param TO zlt_params.

zlv_variant = |ZCL{ ziv_days }|.

PERFORM create_variant TABLES zlt_params USING 'RSBKCLEANUPBUFFER' zlv_variant.
PERFORM start_job USING 'RSBKCLEANUPBUFFER' zlv_variant 'D'.

CLEAR zls_param.
REFRESH zlt_params.

zls_param-selname = 'P_CL0RT'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = ziv_days.
APPEND zls_param TO zlt_params.
zls_param-selname = 'P_CL1RT'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = ziv_days.
APPEND zls_param TO zlt_params.
zls_param-selname = 'P_SIMU'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = ' '.
zls_param-low = ziv_days.
APPEND zls_param TO zlt_params.
zls_param-selname = 'P_RECRT'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = 24.
APPEND zls_param TO zlt_params.

zlv_variant = |ZCL{ ziv_days }|.

PERFORM create_variant TABLES zlt_params USING 'ODQ_CLEANUP' zlv_variant.
PERFORM start_job USING 'ODQ_CLEANUP' zlv_variant 'D'.

ENDFORM.
*&---------------------------------------------------------------------*
*& Form cleanup_changepointers
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& --> P_CPD
*&---------------------------------------------------------------------*
FORM cleanup_changepointers USING ziv_days.

DATA: zlv_variant TYPE raldb_vari.
DATA: zlv_date TYPE sy-datum.

CLEAR zls_param.
REFRESH zlt_params.

zls_param-selname = 'P2_DATE'. " creation date
zls_param-kind = 'S'.
zls_param-sign = 'I'.
zls_param-option = 'BT'.
zlv_date = sy-datum - 9999.
zls_param-low = zlv_date.
zlv_date = sy-datum - ziv_days.
zls_param-high = zlv_date.
APPEND zls_param TO zlt_params.


zls_param-selname = 'P_TEST'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = ' '.
APPEND zls_param TO zlt_params.

zls_param-selname = 'P1_OLD'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = 'X'.
APPEND zls_param TO zlt_params.

zls_param-selname = 'P_PACK'.
zls_param-kind = 'P'.
zls_param-sign = 'I'.
zls_param-option = 'EQ'.
zls_param-low = 'X'.
APPEND zls_param TO zlt_params.

zlv_variant = |ZCL{ ziv_days }|.

PERFORM create_variant TABLES zlt_params USING 'RBDCPCLR2' zlv_variant.
PERFORM start_job USING 'RBDCPCLR2' zlv_variant 'D'.

ENDFORM.

SE16T central access to search functions

There are quite some SE16 data browser tools and search tools. SE16T collects them all.

Reference to SE16 blogs:

Background OSS notes on SE16T:

SICF services to be disabled

Some SICF services might be activated from the past. For security they might pose a risk. The best action is to pro-actively disable them.

/sap/bc/bsp/sap/bsp_veri
/sap/bc/bsp/sap/certmap
/sap/bc/gui/sap/its/CERTMAP
/sap/bc/bsp/sap/certreq
/sap/bc/gui/sap/its/CERTREQ
/sap/bc/echo
/sap/bc/error
/sap/bc/FormToRfc
/sap/bc/bsp/sap/icf
/sap/bc/srt/IDoc
/sap/bc/idoc_xml
/sap/bc/report
/sap/bc/soap/rfc
/sap/bc/webrfc
/sap/bc/xrfc
/sap/bc/xrfc_test
1422273
*1417568
1417568
*1417568
1417568
626073
626073
626073
1422273
*1487606
1487606
626073
1394100
979467
626073
626073
Remarks on the (*): these services still might have a business need, double check these before de-activating.

Critical services according to note 887164:
/sap/bc/bsp/sap/bsp_model
/sap/bc/bsp/sap/htmlb_samples
/sap/bc/bsp/sap/it00
/sap/bc/bsp/sap/it01
/sap/bc/bsp/sap/it02
/sap/bc/bsp/sap/it03
/sap/bc/bsp/sap/it04
/sap/bc/bsp/sap/it05
/sap/bc/bsp/sap/itmvc2
/sap/bc/bsp/sap/itsm
/sap/bc/bsp/sap/sbspext_htmlb
/sap/bc/bsp/sap/sbspext_phtmlb
/sap/bc/bsp/sap/sbspext_table (see note 2948239)
/sap/bc/bsp/sap/sbspext_xhtmlb
/sap/bc/bsp/sap/system_private
/sap/bc/bsp/sap/system_public

Source: SAP security baseline.

RAL: read access logging

The SAP audit log records transactions, program executions and much more. But it cannot answer questions that are more sensitive. For example, how can you proof that your employee did or did not see a bank account number, or a basic salary pay? Here is where the RAL read access logging function will help. It will record if a user did have display access to a sensitive field (and the value shown to the user). It can be used to proof a user did see. Or when there is no logging (and the logging is setup correctly), help the employee to proof he/she did not see any sensitive data.

This blog will explain the technical setup. Please do check carefully any privacy, legal, HR and other implications of switching on this functionality. 
The product is in most cases part of the Netweaver license. Do check with your SAP account manager.

Questions that will be answered in this blog:

  • How to setup up RAL from the basis technology side?
  • How to create a RAL recording?
  • How to activate RAL?
  • How to use RAL monitoring?

RAL technical setup

Activate in SICF transaction the following services:

  • SRALCONFIG
  • SRALMANAGER
  • SRALMONITOR
  • SRALUTIL

If needed set in RZ11 the parameter sec/ral_enabled_for_rfc to 1.

Now start transaction SRALMANAGER:

Choose the option Enabling in Client:

Press change, enable, and Save.

You can run program SRAL_CHECK_PREREQUISITES to see if all activations are done correctly (oss note 2158630 – RAL: Program to check prerequisites).

Create a RAL recording

A recording is needed to indicate which fields need to be added to the read access log. In transaction SRALMANAGER, choose recordings and then create a new one:

We use the example ZTESTBP for business partner.

In the line for the recorder there are 3 buttons:

First one is to display.
Second one to start the recording.

Third one is to add the recording user.

Start the recording:

Now important: keep the web session open.

Go to the SAP GUI and execute your transaction. When you want to add a field to the RAL logging, select the field, press CTRL, right click and select the option “RAL: record field” or use the CTRL+L shortcut.

If you do not add fields the recording is empty!

When completed go back to the RAL admin web screen and press the icon to Stop the recording.

Now you can display the recorded fields:

Create a RAL configuration

We can now use the recording to create a configuration. In the transaction SRALMANAGER choose configurations and create a new one:

In the new complex screen, create a new log group. Then drag and drop from the field list on the bottom left to the target fields:

Then first Check the consistency and when ok, activate the configuration:

Using the RAL logging database

In the administration use the second tab for monitoring, or use transaction RALMONITOR to jump directly to the monitoring database. Important here: select the RAW database first! Then select your criteria:

In the search results you can select the details. In the Field Value at the bottom, you can see the actual value that the user has seen on its screen.

RAL and performance

In the help file there is this warning:

Using RAL requires system resources. This can have a strong impact on your system performance, depending on the number and type of logs.

So activate only what is required.

SAP background and references

RAL help file: Read Access Logging | SAP Help Portal.

Background on recording function: Read access logging(Recording functionality) – SAP Community.

Background on dynpro: Read Access Logging – Dynpro Configuration Step-by… – SAP Community.

Background OSS notes:

Bug fixes:

SAP GUI 64 bit

SAP GUI comes with a 32 and 64 bit version. The advantage of the 64bit version is the performance. The setback is its dependency on, and its compatibility with, the 64bit Microsoft Office products.

A user cannot have both versions installed on a single machine. It is either the 32bit or 64 bit version.

Download location: 3398259 – Where to download 64-bit patches for SAP GUI for Windows 800. – SAP for Me.

Keep track of the SAP GUI build in this blog. With the upcoming SAP GUI 8.10 the information below (which is valid for 8.0) might be different.

Differences between 32bit and 64bit

The main differences are describes in OSS note 3218166 – SAP GUI for Windows: Functional differences of the 64bit version compared to the 32bit version.

The better performance of the controls and download functions are described in this OSS note: 2724656 – SAP GUI NWRFC Controls: 64bit support for Logon, Table, Function and BAPI controls – SAP for Me.

Compatibility issues

The Office compatibility issues are described in the following OSS notes:

Basic rule: when SAPGUI 64bit is to work with Office products, make sure also the Office products are installed with 64bit version.