Skip to Content
0
Former Member
Jan 13, 2014 at 09:43 AM

Delete entries from DB in background

153 Views

Hi Experts,

I've a problem and I need your help. I've created a report in which there is a code to delete entries from different tables.

In a first moment report deletes all entries from dbtable1 and after dbtable2 and dbtable3 etc etc.

In order to improve performance I've tried to delete those entries in parallel mode using multiple backgorund tasks.

In order to do this I've created a custom function module that receive the entries to be deleted, the name of DBtable and it deletes all entries.

From the report I've inserted this code:

CALL FUNCTION 'ZXXX_DB_DELETE' IN BACKGROUND TASK

EXPORTING

DBTABLE = 'DBTABLENAME'

TABLES

LIST_VALUE = list_entries.

I've tested function module and in foreground it works fine. It deletes all entries that are listed in importing table from parameter dbtable.

When I try to run my report function modules are called correctly (SY-SUBRC is zero), I see a background job that is running through SM50, but no entries are deleted from all tables.

It seems that in background system run a ROLLBACK instead COMMIT that is in the code.

I've tried to insert commit directly in function module and also in the main report, but without success in both cases.

Could you help me to solve this kind of issue?

Thank you very much

Alessandro