Table AQLDB clean up

Table AQLDB is used for storing data of SAP Queries created via SQ01 queries. Cleaning this up can be tricky job.

Deletion of old query data

Deletion of old SAP query data is performed via program RSAQQLRE_MASS:

Background OSS note: 2336268 – SQ01: Reorganization of saved lists.

In case of inconsistencies, install program Z_INCONSISTENT_SAVED_LISTS from OSS note 2173291 – Saved List cannot be deleted by program RSAQQLRE.

Clean up of generated programs

Program RSAQDEL0 can be used to clean up generated query program data:

System queries, generated programs and obsolete programs can be cleaned up.

Background notes:

Data archiving: material ledger data

This blog will explain how to archive material ledger data via object CO_ML_DAT. Generic technical setup must have been executed already, and is explained in this blog.

Object CO_ML_DAT

Go to transaction SARA and select object CO_ML_DAT.

Dependency schedule:

Main tables that are archived:

  • CKMLCR (material ledger data)
  • CKMLPP (period totals)

Technical programs and OSS notes

Write program: SAPRCKMN_NEU

Delete program: SAPRCKMO_NEU

Read from archive: SAPRCKMP_NEU_LESEN

Reload program: SAPRCKMP_NEU_RUECKLADEN

Relevant OSS notes:

Application specific customizing

Archiving object CO_ML_DAT has no specific customizing. Retention period is set on the write program screen.

Executing the write run and delete run

In transaction SARA, CO_ML_DAT select the write run:

Select your data, save the variant and start the archiving write run.

After the write run is done, check the logs. CO_ML_DAT archiving has high speed, and high percentage of archiving (up to 100%).

Proved a good name for the archive file for later use!

Deletion run is standard by selecting the archive file and starting the deletion run.

Data retrieval

Data retrieval is via program SAPRCKMP_NEU_LESEN. But the retrieval has no proper selection. Output is also hard to read.

Report SNIF: search active customer enhancements

Report SNIF can be used to find active customer enhancements like BADI, user exit, BTE event.

To start the report go to transaction SA38, enter report SNIF and execute:

Select the items you want to search for that are implemented and press execute. Wait until the result shows:

Here you can see which exits are active. Double click on a line will jump to the code.

Background OSS notes

Update process debugging

As ABAP developer you sometime need to update a piece of ABAP code that is part of the Update logic. To get debugging done there some more actions are required.

ABAP debugging should only be done by experienced ABAP developers who know the pros and cons of debugging in Update. If you are not experience enough, stop reading and let an experienced person do the job.

Update process debugging

First set your break point in the Z code or standard code that does the update. If you run the normal transaction, you will notice this break point will not be called.

Now start your normal transaction again. Go to debug mode.

Choose menu Settings and Change debugger profile / Settings:

Select Update Debugging and press Save.

In the main transaction go to the point where you are about to save the data. Before pressing the save button, key in /h for debug. Now press the save button. you jump to debug mode. Press F8 to continue the current session. Wait a few seconds, and the update debug will start now:

The update debug starts now. Now you can debug the ABAP logic used in the UPDATE task. Please notice in the debug screen you see you are doing the UPDATE process debug on top of the screen.

If you have set breakpoints before in the correct code then these are now active.

MASS transaction

The MASS transaction is a powerful transaction to perform mass data updates in a system. It can be used both by IT and business people for data conversion and mass updates on data due to business changes.

But you have to use it wisely. If used unwisely it can overload a system by performing too much changes at the same time or by locking too much data and causing enqueue overflow issues.

As basis person you might not execute the MASS transaction, but is good to realize how it works, since consultants and business might use it. As mentioned before it is a powerful tool that can save a lot of time. So as basis person use the knowledge below to help and not to forbid the use of the MASS transaction.

MASS transaction use

Start transaction MASS. For new runs, select the object and leave the variant field empty:

Press execute. Select the table or tables of the object you want to update:

Select the fields to update:

Press execute. Now enter the selection of materials you need to update:

Press execute.

On top set the new value. Below you see the old values:

Now press the mass update button to transfer the new value to the existing values:

You can now do a final check. Press the Save button on top to save the changes. Depending on the amount of records and complexity of the change this might take more time.

Best practice: run the MASS update first on a non productive system which is a copy of production data. This will give you good idea on the runtimes and performance impact.

Example blogs for mass changes for customer data and vendor data.

Save as variant

If you want to re-use the MASS update for later use, or if you need to run several batches, you can save your setup as variant. This is bit hidden: select the menu option Goto and then Save as variant:

Batch sizes

Try to keep maximum of 10.000 items per MASS update. If you use MASS more often, you can go higher if basis person is guiding the updates and monitoring the system closely.

OSS notes

Relevant OSS notes:

Data archiving: handling units

This blog will explain how to archive handling units via object LE_HU. Generic technical setup must have been executed already, and is explained in this blog.

Object LE_HU

Go to transaction SARA and select object LE_HU.

Dependency schedule:

In case you use production planning backflush, you must archive those first. Then material documents, shipment costs (if in use), SD transport (if in use) and deliveries.

Main tables that are archived:

  • VEKP (Handling unit header table)
  • VEPO (Handling unit item)

Technical programs and OSS notes

Preprocessing program: RHU_AR_ARCHIVABILITY_CHECK

Write program: RHU_AR_WRITE_TO_ARCHIVE

Delete program: RHU_AR_DELETE_FROM_DATABASE

Read from archive: RHU_AR_READ_FROM_ARCHIVE

Reload program: RHU_AR_RELOAD_ARCHIVE

Relevant OSS notes:

Application specific customizing

Archiving object LE_HU has no specific customizing. Retention period is set on the write program screen.

Execution the preprocessing run

In transaction SARA, LE_HU select the preprocessing run:

The run will show you how many can be archived and how many cannot be archived (mainly due to status and preceding documents):

Executing the write run and delete run

In transaction SARA, LE_HU select the write run:

Select your data, save the variant and start the archiving write run.

After the write run is done, check the logs. LE_HU archiving has average speed, but not so high percentage of archiving (about 40 to 90%).

Unfortunately the LE_HU object does not have a Note field to give the archive file a correct name. If you still want to do so, you have to do this in SARA via the management of archiving sessions: select the session and change the description there:

Deletion run is standard by selecting the archive file and starting the deletion run.

Data retrieval

Data retrieval is via program RHU_AR_READ_FROM_ARCHIVE.

Program RSMEMORY

Program RSMEMORY can be used to check current ABAP memory settings.

Start transaction SE38 and key program RSMEMORY and press execute. In higher ABAP versions transaction SMEMORY is available.

Result:

If a user faces a TSV_TNEW_PAGE_ALLOC_FAILED and really needs to process a lot of data only once, you can use program RSMEMORY to temporarily increase the memory. Keep screen shot of old settings. Increase the memory class value in quota dialog settings for Step 1. Also increase abap/head area dia (and the total accordingly). Now press the Copy button to activate. This is per application server. Settings are lost after restart. But it is best to already change back to old settings after the user issue is fixed (by using the screen shot you made before the settings changes).

SAP background

OSS note 177226 – Documentation rsmemory.

SAP help file link.

Data archiving: profit center accounting documents

This blog will explain how to archive profit center accounting documents transports via object EC_PCA_ITM. Generic technical setup must have been executed already, and is explained in this blog.

Object EC_PCA_ITM

Go to transaction SARA and select object EC_PCA_ITM.

Dependency schedule:

This means for profit center accounting archiving that there are no dependent objects.

Main tables that are archived:

  • GLPCA (profit center actual line items)
  • GLPCP (profit center plan line items)

Technical programs and OSS notes

Write program: EC_PCA_ITM_WRI

Delete program: EC_PCA_ITM_DEL

Read program: RGUGLPCA

Relevant OSS notes:

Application specific customizing

EC_PCA_ITM has no application specific customization for setting retention periods.

Executing the write run and delete run

In transaction SARA, EC_PCA_ITM select the write run:

Select your data, save the variant and start the archiving write run.

Give the archive session a good name that describes controlling area, company code and year. This is needed for data retrieval later on.

After the write run is done, check the logs. EC_PCA_ITM archiving has high speed, and high percentage of archiving (up to 99%).

Deletion run is standard by selecting the archive file and starting the deletion run.

Data retrieval

Data retrieval is via program RGUGLPCA:

Put in the correct input values and select the right archive files.

The output is a fairly simple list.

Data archiving: SD transport

This blog will explain how to archive SD transports via object SD_VTTK. Generic technical setup must have been executed already, and is explained in this blog.

Object SD_VTTK

Go to transaction SARA and select object SD_VTTK.

Dependency schedule:

In case you use production planning backflush, you must archive those first. Then material documents and shipment costs (if in use).

Main tables that are archived:

  • VTTK (shipment header)
  • VTTP (shipment item)

Technical programs and OSS notes

Write program: SDVTTKWRS

Delete program: SDVTTKDLS

Reload program: SDVTTKRL

Relevant OSS notes:

Application specific customizing

In the application specific customizing for SD_VTTK you can maintain the document retention time settings:

Executing the write run and delete run

In transaction SARA, SD_VTTK select the write run:

Select your data, save the variant and start the archiving write run.

Give the archive session a good name that describes sales organization/shipment point and year. This is needed for data retrieval later on.

After the write run is done, check the logs. SD_VTTK archiving has average speed, but not so high percentage of archiving (up to 40 to 90%).

Deletion run is standard by selecting the archive file and starting the deletion run.

Data retrieval

Data retrieval is not possible. Only reload via program SDVTTKRL.