This blog contains experience gained over the years of implementing (and de-implementing) large scale IT applications/software.

Detecting & Reducing Space Used For SAP Business Workplace Documents

Within the SAP Netweaver 7.0 system is a complete e-mail tool that allows users to send/receive electronic documents.
These documents are visible in the SAP Business Workplace (TX: SBWP) inbox/outbox and also in the SAP Connect transmission requests (TX: SOST).

As time goes by and users accumulate documents in their inbox and internal/external mails get sent through SAPConnect, space in the database will be used.

SAP Note: 966854 recommends running RSBCS_REORG to clear down these documents and free the space.
Unfortunately it doesn’t tell you how much space is taken up and how much you could get back.

Using the details in SAP Note: 706478 it is possible to check some of the tables at the database level.
Once again, the note doesn’t list all tables involved.
Instead, running the RSBCS_REORG report in “Test” mode reveals the full extent of the tables where records will be deleted:

So using this information, the following constructed SQL query will return the current size of the database segments (Oracle) for the selected tables (FOR ECC 6.0 based systems):


SELECT *
FROM (
select sum(s.bytes)/1024/1024 size_mb ,
s.segment_name,
s.segment_type,
s.segment_name table_name,
t.ddtext descr
from dba_segments s,
sapsr3.dd02t t
where s.segment_name in ('BCST_BOR',
'BCST_CAM',
'BCST_RE',
'BCST_SR',
'SOC3',
'SOCS',
'SOCX',
'SOER',
'SOES',
'SOFM',
'SOOD',
'SOOS',
'SOST')
and s.segment_name = t.tabname
and ddlanguage='E'
group by s.segment_name, s.segment_type, s.segment_name, t.ddtext
union all
select sum(s.bytes)/1024/1024 size_mb ,
s.segment_name,
s.segment_type,
i.table_name,
t.ddtext descr
from dba_segments s,
sapsr3.dd02t t,
dba_indexes i
where i.table_name in (
'BCST_BOR',
'BCST_CAM',
'BCST_RE',
'BCST_SR',
'SOC3',
'SOCS',
'SOCX',
'SOER',
'SOES',
'SOFM',
'SOOD',
'SOOS',
'SOST')
and i.table_name = t.tabname
and i.index_name = s.segment_name
and ddlanguage='E'
group by s.segment_name, s.segment_type, i.table_name, t.ddtext
) t1
ORDER BY t1.table_name ASC, t1.segment_type DESC;

For R/3 4.7 you can use the query below (removes the table and index descriptions):

SELECT *
FROM (
select sum(s.bytes)/1024/1024 size_mb ,
s.segment_name,
s.segment_type,
s.segment_name table_name
from dba_segments s
where s.segment_name in ('BCST_BOR',
'BCST_CAM',
'BCST_RE',
'BCST_SR',
'SOC3',
'SOCS',
'SOCX',
'SOER',
'SOES',
'SOFM',
'SOOD',
'SOOS',
'SOST')
group by s.segment_name, s.segment_type, s.segment_name
union all
select sum(s.bytes)/1024/1024 size_mb ,
s.segment_name,
s.segment_type,
i.table_name
from dba_segments s,
dba_indexes i
where i.table_name in (
'BCST_BOR',
'BCST_CAM',
'BCST_RE',
'BCST_SR',
'SOC3',
'SOCS',
'SOCX',
'SOER',
'SOES',
'SOFM',
'SOOD',
'SOOS',
'SOST')
and i.index_name = s.segment_name
group by s.segment_name, s.segment_type, i.table_name
) t1
ORDER BY t1.table_name ASC, t1.segment_type DESC;

You may just be able to see that the SOC3 table is using ~7GB of space with an index of 144MB and a lob object of 64KB.

Now if you run the RSBCS_REORG report using “Test” mode, with the settings to remove the documents that are >60 days old, then you can estimate what percentage of records will be removed from table SOC3 and therefore estimate the space saving.

As a rule of thumb, it may be wise to remove the documents from users who have left the company.
Generally the SAP account will be locked, so you can pull the account names using the following SQL query then add them into the RSBCS_REORG report “User” field:

SELECT DISTINCT bname FROM sapsr3.usr02 WHERE uflag =128;

NOTE: When running RSBCS_REORG, it will not remove assigned workflows from the “Workflow” folder (or sub-folders).

You may also consider running the report for the user who runs the SAPConnect background job step.  As this user will have the majority of occupied space.

Once you’ve deleted the records that are not required, the space in the database tables will be freed.
However, this will not release the space to the rest of the database, only the tables from where the records were deleted.
Stay tuned for my up-coming post on how to free the table segment space after you’ve removed thousands of records from the Oracle database.

Useful SAP Reports

It’s always good to have the exact report handy, just incase the transaction is not in your SAP role:

BTCTRNS1 – Suspend All Jobs For an Upgrade
BTCTRNS2 – Un-Suspend All Jobs For an Upgrade
RDBMIDOC – Create IDocs from change pointers and send.
RBDMOIND – Status conversion of successfull IDoc communication.
RSALDBRG – Reorganise CCMS Alert Database
RSALERTTEST – Test alerts
RSAVGL00 – Table adjustment across clients
RSINCL00 – Extended program list
RSBDCSUB – Release batch-input sessions automaticly
RSCPINST – Check language installation config.

RSCSAUTH – Authorisations assigned to ABAP reports.

RSTXSCRP – Transport SAPscript files across systems
RGUGBR00 – Substitution/Validation utility
RSBCSRE03 – Clean old SOST records (send deliveries)
RSBDCOS0 – Execute Shell command (non-interactive).
RSBTCDEL – Clean the old background job records
RSDBCREO – Clean batch input session log
RSEIDOCA – Active IDoc Monitoring
RSORAPATCHINFO – Oracle patch level.
RSPARAM – Display all instance parameters
RSPO0041 – Removing old spooling objects
RSSNAPDL – Clean the old ABAP error dumps
RSSLG200 – Remove expired application logs (SLG1).
RSSLGK90 – Delete application logs created before the specified date.
RSSOREST – Clean old SOST records (send deliveries)
RSPO1041 – Cross-Client Spool Request Cleanup.
RSPOR_SETUP – BW / BI Configuration Consistency Check
RSTXICON – List all icons in the system
RSTRFCEG – Consistency check of outbound queues (RFC/trfc/qrfc).
RSUSR002 – Roles by complex selection (new)
RSUSR003 – Check the passwords of users SAP* and DDIC in all clients
RSUSR006 – List users last login
RSUSR020 – Profiles by complex selection
RSUSR050 – Compare users
RSUSR070 – Roles by complex selection
RSUSR200 – List users by login date.
RSWUWFML2 – Delivers work items via users e-mail address.
RSWWWIDE – Remove work items and related sub-items.
RSXMB_CANCEL_MESSAGES – Cancel messages in error.
RSXMB_CHECK_MSG_QUEUE – Check messages in queue.
RSXMB_SHOW_STATUS – Show statuses of XI messages in the persistence layer.
SSF_ALERT_CERTEXPIRE – Certificate expiry check.

Useful SAP Transactions

Here are a collection of SAP transactions that I find useful:

AISUSER – Solution Manager maintain S-user for maint-opt.
AL08 – All Users Logged On
AL13 – Display Shared Memory
ALRTCATDEF – Alert category definitions
ALRTDISP – Alert display
ALTINBOX – Alert inbox
BDLSS – Shows all items associated with the logical system name.
BDM7 – ALE Audit Statistics
BD10 – Send Material Master
BD12 – Send Customer Master
BD14 – Send Vendor Master
BD22 – Reorganise (Delete) Change Pointers
BD87 – ALE Message Monitor
BF24 – Create Product (User exits)
BF34 – Register user exit event to function module.
CG3Z – Transfer file from frontend.
CMOD – List user exits
DB02 – Database Tables/Tablespace Statistics
DB13 – Database Planning Calendar
DB14 – Database Operations Log
DB26 – Database Parameters
DBCO – External Database Connections in SAP.
F.10 – GL Accounts
F110 – BACS Payments
FBL1N – List Invoice Documents
IDX1 – Port Maintenance In IDoc Adapter
IDX2 – Meta Data Overview in IDoc Adapter
IDX5 – XI IDoc search.
LISTSCHEMA – BW Lists underlying tables for InfoCubes.
MMRV – Show current posting period
OAAD – Archivelink Administration of Stored Documents
OAER – Business Document Navigator
OAM1 – ArchiveLink Monitor
OAC0 – Define content servers
OAWD – Archivelink Document Storage.
OB29 – Define Posting Periods (See also SPRO -> Fianncial Accounting -> Financial Accounting Global Settings -> Fiscal Year)
OMJ3 – Printer Determination by Plant.
OMJR – Printer Determination by Output Type.
OS01 – Ping servers
ORA_PERF – Analyse tables, delete statistics.
OY18 – Reports for table logging.
PA30 – Maintain HR Master
PFAL – HR ALE Transfer of Master Data.
PFCG – Role Maintenance
PFTC – Workflow task maintenance.
PFTC_CHG – Change a workflow task.
PFUD – Profile consistency (mass user comparison) check (schedule job).
RMPS_SET_SUBSTITUTE – Set Workflow substitute.
PPOME – HR Mini Master (Personnel Management)
PPOMW – HR Mini Master (Organisational Management)
RRMX – Launch BEX Analyser
RSA7 – BW Delta Queue Maintenance
RSCSAUTH  – Maintain authorisation groups.
RSM37 – Display background jobs with parameters.
RSRDA – Stop all daemons for real-time data acquisition in BW.
RZ01 – Job Scheduling Monitor.
RZ03 – Display/ Manully Switch Operation Mode (start/stop instance).
RZ04 – Maintain Operations Modes
RZ12 – Maintain RFC groups.
RZ21 – Monitoring Properties
RZ70 – SLD Administration
SA38 – ABAP Reporting
SAPL0ARC – Archiving Customising For Object.
SCCL – Local Client Copy.
SCEM – CATT initial screen.
SCU3 – Analyse table logging logs
SDCCN – Service Data Control Centre
SECR – AIS (Audit Information System)
SE03 – System Change Option
SE11 – Data Dictionary Display
SE21 – Package Builder.
SE61 – Change display screen text.
SE93 – Transaction lookup.
SE37 – ABAP Function Modules
SE54 – Generate Table Maintenance.
SBIW – Maintain Business Information Warehouse Data Sources
SCU0 – Customizing Cross System Viewer
SLDCHECK – Check status of the SLD
SLDAPICUST – SLD API Customizing
SLG1 – Analyse application log
SLG2 – Application Logs Delete
SMLG – Logon groups.
SMGW – Gateway monitoring
SMICM – ICM Monitor
SMQ1 – qRFC Monitor (Outbound Queue)
SMQ2 – qRFC Monitor (Inbound Queue)
SMQ3 – qRFC Monitor (Saved E-Queue)
SMQE – qRFC Administration
SMSY – SOLMAN – Landscape Directory
SMSY_SETUP – Solution Directory Setup
SMX – Own Jobs
SM18 – Security Audit Log Reorganisation
SM19 – Security Audit Log Configuration
SM20 – Security Audit Log Analysis
SM35 – Batch Input Log (LSMW etc)
SM58 – Asynchornous RFC Error Log
SM63 – Maintain Operation Modes Calendar
SM64 – Background Jobs Events.
SM65 – Background processing check.
SM66 – All processes across system.
SM69 – Maintain External Commands
SO36 – Automatic System Forwarding for E-Mails
SOA0 – ArchiveLink Document Types.
SOLMAN_WORKCENTER – Solution Manager Maintenance Optimizer.
SP12 – TemSe administration
SSAA – System Administrator Assistant
ST02 – SAP Buffer Tuning
ST03 – Global Workload Monitor
ST04 – Database Statistics
ST06 – Operating System Monitor
SUCU – Table / View Authorisations.
SUGR – User Group Maintenance
SWDD – Workflow Builder.
SWDM – Workflow Builder
SWI1 – Workflow Instance Log
SWE2 – Workflow linkages
SWEL – Display Event Trace
SWELS – Switch on/off event trace
SWEQADM – Event Queue Administration
SWEQBROWSER – Event queue browser
SWO1 – Business Object Builder
SWU0 – Workflow event simulation
SWU3 – Workflow customizing
SWUS – Test Workflow
SWWL – Delete workflow
SXMB_MONI – Integration Engine Monitoring
SXMB_MONI_BPE – Process Engine Monitoring
SXMB_IFR – Call Integration Builder
SXMB_ADM – Integration Engine Admin
SXI_CACHE – XI Directory Cache
SXI_MONITOR – XI Message Monitoring
TU02 – Change parameters
USMM – User Measurement Statistics.
WE02 – IDoc Display
WE07 – IDoc Monitoring
WE05 – IDoc List.
WE09 – IDoc Search.
WE11 – Delete IDocs
WE19 – IDoc Test Tool
WE20 – IDoc Partner Profiles
WE40 – Idoc administration setup
WE41 – Outbound Process codes.
WE42 – Inbound process codes.
WE46 – IDoc Admin
WE60 – IDoc Types Documentation
XK02 – Changer Vendor Details

Useful SAP Tables

During my time as a SAP BASIS administrator, I have accumulated a number of useful database tables.

ADR6 – User Address Data (cross with USR21)
AGR_1250 – Authorization data for the activity group
AGR_USERS – Assignment of roles to users
AGR_SELECT – Assignment of roles to Tcode
AGR_PROF – Profile name for role
AGR_DEFINE – Role definition
BDCPS – Change Pointers
DDLOG – Table buffer changes for sync between dialog instances.
DD02T – SAP Tables and descriptions.
DD09L – SAP Tables (with logging PROTOKOLL=X)
PA0105 – HR Communications InfoType (includes USERID to PERNO).
SH_PRIN – Printer list
TADIR – Repository object table.
TBRG – All Authorisation Groups.
TDDAT – Tables to Authorisation Groups.
TBTCP – Background Job Steps (see field AUTHCKNAM for job user)
TOLE – OLE Link table
USR02 – User passwords.
USR01 – Users.
USR04 – User Master Authorisations.
USR10 – Authorisation Profiles.
UST04 – Users to profiles.
TDEVC – Package table.
TSP03D – Printer Output Devices
TST03 – Spool requests
TSTC – Transactions
TVARV – Variant Variables
VARI – Variants

Basic Performance Tuning Guide – SAP NetWeaver 7.0 – Part I – Finding Slow Running Programs

For me, as a BASIS administrator, it’s the most fun part of the job.  Performance tuning!
I enjoy making things faster, more efficient.  It seems German (
https://www.urbandictionary.com/define.php?term=german%20efficiency) in some ways, and I guess that I must have a little OCD in me, but it’s rewarding.

I can’t believe how simple performance tuning can be sometimes.  If I write the process down it even seems simple:
1, Find slow running programs.
2, Analyse why they are slow or poor performers.
3, Tune them.
4, Cup of tea.
5, See them fly.

For those Lean Six Sigma followers, this fits in with DMAIC (https://en.wikipedia.org/wiki/Six_Sigma) quite nicely.
I bet it would even look good on a fish bone diagram (
https://www.leansixsigmasource.com/2009/04/15/how-to-construct-a-fishbone-diagram/) (sorry, I did mean “cause & effect diagram” honest).

I’m going to break these steps down.

Let’s start with number 1:Find Slow Running Programs
So you have your new SAP system all installed.
The consultancy that briskly implemented it and have now rolled-off, have left it running beautifully (
https://www.zdnet.com/blog/projectfailures/san-diego-fires-axon-over-erp-implementation-problems/1960).

Why wouldn’t they.
As an operations specialist (
https://www.it-implementor.co.uk/2011/06/are-you-sure-im-not-consultant-not.html), you get called in.
Of course, you’re an expert and you know that profiling a system is one of those tasks that needs to be done to help you troubleshoot performance problems.  But being an expert, you also know that there are bigger fish to fry after a fresh implementation of anything.
So we assume that it is not plausible to use a comparative profile of before and after performance.

Let’s assume that a report/transaction has been reported as running slowly today by a single user (one helpdesk ticket https://lukasland.com/humour/Computing-General/Help-Desk-Hell.htm).
You’re on the case and you can look at the problem right now.
What’s you’re first call?
Wrong!  Crying won’t get you anywhere!
We need to see if the problem is caused by the system in general, the user (sometimes you do get them) or something else.
I always use the following methods:

1, Check SM66 (global work process overview). It’s easier than checking SM50, then remembering that you’re on a system with Apps servers (additional dialog instances).
What’s currently running?
Look specifically at the “Time” and “Action” columns:

  SM66 global work process overview

If there are any long running programs (large “Time” values) in the list, what “Action” are they performing?  Could it affect the report that the user has identified as being slow?

2, Check SM21 (System Log) always good to keep abreast of potential system wide issues!  Brownie points (https://en.wikipedia.org/wiki/Brownie_points) from the big boss for being so quick!
Any problems in here will also mention short dumps in ST22, so no need to check ST22 unless it’s in the system log.

3, Check STAD (SAP Workload – Single Business Transactions).  This shows specific transactions that the user has completed in the <n>hours (after this they get aggregated and shown in ST03N/ST03G depending on your collector settings).
Use the “Show Business Transaction Tots” option, it’s easier to see the wood for the trees (https://www.woodfortrees.org/).
Enter the username into the filter and adjust the time period to search for (when did the problem happen?).

 STAD single business transactions

Great!  You can see the individual transactions performed by the user (even ITS based services e.g. BSPs will be shown):

TIP: Try it without the filter on a small system to see what you can actually get.  It’s quite a lot of information.  RFCs, background jobs, HTTP.

 STAD business transaction analysis

Check out the “Response Time”, “CPU time” and “DB req time” columns.
See if any specific transaction stands out above the rest for these three values.

If you expand the “+” folder on the very left, you will see each dialog step (screen) that the user has been through:

 STAD business transaction analysis output

The time gap between each screen is the previous screens response time + roll-time + front-end time + “Think Time”.

So now you’ve found the slow program, you need to analyse it.
Part II of this guide shows how to read and decipher the single record statistics using STAD.
Part III of this guide shows how to perform an SQL Trace.