Skip to main content

Does anyone know how can you remove disk space (hence reduce APC consumption) removing specific rows from a table?

 

I would need to remove permanently rows from a table based on a specific sub-query. I have limited space available so i cannot use operations that require, even for a small period of time, twice increase in space occupation

 

Thanks in advance

 

 

Hi Paolo,

there are 2 ways to limit your APC:

  • either from start using appropriate filters when you extract data. This is the most convenient , yet it doesn't work well on some tables like the invoice BKPF and BSEG in the P2P process.
  • or after extraction using a subquery in a transformation. When you execute that transformation depends whether you need some data during transformations before removing them to gain space.

 

When using a subquery, I usually create a very basic temp table that determine the records to remove from a specific table. You only need to have the relevant key in there: for example, for BKPF and BSEG it would be MANDT, BELNR, BUKRS, GJAHR. You don't need to get down to the item line for BESG (BSEG-BUZEI) since you delete the header data, so all lines should be removed from BSEG.

Then you can execute the DELETE statement on the relevant table to clean up using the related temp table data, and finally you scrap the temp table: for example with BKPF

DELETE FROM TABLE BKPF WHERE MANDT||BELNR||GJAHR||BUKRS IN SELECT(MANDT||BELNR||GJAHR||BUKRS FROM TEMP_FI);

DROP TABLE IF EXISTS TEMP_FI;

kind regards

Marc


Thanks Marc!


Reply