SAP AI Core

The whole world and also SAP are investing a lot in AI.

This blog explains technical references for the SAP AI Core. We stick to technical facts, not opinions, nor future predictions, nor business cases. There are already more than sufficient blogs on these topics.

SAP AI Core main description

The main information of SAP AI Core can be found in this document published by SAP. Current version at time of writing this blog was from May 2026.

It contains background information about:

  • Architecture
  • License and consumption measurement
  • Setup
  • Security
  • And many more topics

Online cost calculator

Check this link for the online SAP AI Core Cost Calculator.

Starter training

Training for starters:

SAP Help

General SAP help is available on this link.

Useful OSS notes

Available LLM GenAI models on BTP are listed in this OSS note: 3437766 – Availability of Generative AI Models.

Available machine types for Machine Learning: 3660109 – Availability of Hardware Instance Types.

Other OSS notes:

SAP AI architecture

SAP AI golden path for architecture can be read on this official SAP page. This page also refers to a Forbes article on reasons why 95% of AI pilots fail.

The API issue

The problem with AI is the use it needs of the SAP API’s. SAP has created barrier for usage in its API policy: API_Policy_latest.pdf and the FAQ Frequently Asked Questions On SAP API Policy.

This policy goes back to the classic indirect access discussion. SAP cannot sell end user licenses if a single agent is doing the work.

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.

SAP favorites

Any user can add favorite transactions to his personal menu. This can be done in the SAP menu by right clicking on the menu and select the option add to favorites.

Sharing favorites

A user can share favorites by downloading them and sending the file to another user to upload. Upload or download to PC: go to menu Favorites and select Download to PC or Upload from PC. Reference OSS note 456728 – Easy Access: download/upload of favorites.

Technical parts of favorites

The tables for favorites are explained in OSS note 2169093 – User favorites are missing:

  • SMEN_BUFFC – Table for Storing Favorites
  • SMENFAVDAT – Date of Last Change to Favorites
  • SMEN_BUFFI – Links for Favorites

Currently there is no know mass download/upload program for user favorites. Custom program can be written using function modules MENU_FAVORITES_DOWNLOAD and MENU_FAVORITES_UPLOAD.

Favorites across versions

When upgrading to a newer SAP version, transactions get updated as well. Example in SAP ECC transaction XK01 is used for creating vendors. In S4HANA this is replace with transaction BP.

SAP table PRGN_CORR2 contains these translations:

Background OSS note: 3454002 – List of obsolete transaction codes and authorization objects.

With an upgrade the user favorites are not updated automatically.

TLS v1.3 setup

Transport Layer Security is used for web traffic. TLS v1.3 is a modern way of implementing this. It is safer and faster than the older TLS v1.2.

AspectTLS 1.2TLS 1.3
Year standardized20082018
Handshake latency2 round trips (typically)1 round trip (or 0‑RTT)
Cryptographic algorithmsMany (incl. weak/legacy)Only modern, secure algorithms
Forward secrecyOptionalMandatory
Security postureFlexible but complexSimpler, safer by design
CompatibilityVery wideRequires modern stacks
The problem with TLSv1.3 is that old infrastructure and applications still do not support it properly. Please be careful with testing when activating.

General SAP background notes:

TLS v1.3 for ABAP

Background OSS notes:

Do look at the regressions listed in OSS note 3318423 – Is TLS 1.3 Supported by SAP Kernel for ABAP and SAP S/4HANA? – SAP for Me. Most of them are fixed by applying latest kernel and/or crypto library update.

OSS note 3346659 – TLS Ciphersuite String Configuration for SAP AS ABAP Systems and for SAP Kernel Software Components contains section to enable TLS v1.3 next to TLS v1.2. This might be a good intermediate implementation step.

For some reasons there might be issues with custom code using HTTP_GET, HTTP_POST or similar. See OSS note 2582368 – SapSSL update for client-side sending of TLS extension SNI by saphttp, sapkprotp, sldreg. Workaround according to this note is to use HTTP2_GET and HTTP2_POST from function group SCMS instead.

TLS v1.3 for HANA

Background OSS notes:

TLS v1.3 for other SAP products

TLS v1.3 support for other SAP products (list is not extensive, search on me.sap.com if your product is not yet in the list):

How to validate if TLS v1.3 is setup?

In Edge, open the developer tools (F12), and select the Security Tool (click on the three dots …): screen looks as follows:

In the middle part with Connection you can see the TLS version.