‎2009 Jul 29 12:40 PM
Hello Experts i have an issue,
i have developed a small report where in the selection screen there are 2 buttons for insert and delete respectively.
i am inserting 100 records int0 a standard table,the table contains 1 crore records.
Now when i am deleteing the same 100 records it is taking much time and inse30 i can see the database utilization is more .
can anyone have solution for this.
Regards,
Badri.
‎2009 Jul 29 12:48 PM
Hi
It is not advisable to delete or insert entries in standard table with ABAP statements
any way provide me ur code
‎2009 Jul 29 1:19 PM
DELETE FROM stxh WHERE tdobject = 'YIPMFOOTPR' OR
tdobject = 'YIPMLIEFBW'.
IF sy-subrc IS INITIAL.
COMMIT WORK.
l_dbcnt = sy-dbcnt.
MESSAGE i000 WITH l_dbcnt 'Entries deleted successfully from table'(031) text-013.
ELSE.
ROLLBACK WORK.
MESSAGE i000 WITH 'Entries not found in the table'(032) text-013.
ENDIF.
‎2009 Jul 29 2:41 PM
Hi Srinivas,
U shuld not update or delete standard tables directly with ABAP statements.
Check whether any standard function module is available for ur requirement.
Since ur table consists crores of records ,definitely performance will be down.Try using any FM.
Regards,
Lakshman.
‎2009 Jul 29 2:48 PM
Actually the table which u have specified is related to SAP Script text file header .
I don't know why ur trying to update this table.
I found some function modules which seems to be useful for ur requirement.
CP_TX_QSS_DELETE Delete a long text for an inspection characteristic
HEADER_MODIFY_TEXTLINE Update inline line of the task list header
TEXT_UPDATE
Regards,
Lakshman.
‎2009 Jul 29 12:48 PM
are you looping at the internal table and then deleting the records one at a time?
You can try to use the 'Where' clause with the delete statement
Delete XXXX where ............
‎2009 Jul 30 2:09 PM
Hi Bussu Badri,
try giving with max no.of parameters , like
DELETE FROM STXH CLIENT SPECIFIED
WHERE MANDT = CLIENT
AND TDOBJECT = OBJECT
AND TDNAME IN R_NAME " Range is specified , so as you can include more.
AND TDID IN R_ID
AND TDSPRAS IN R_LANGUAGE. " No.of parameters , depends on ur requirement
and here the rows are deleted permanently from the database table in the next database commit. Until then, you can cancel the deletion in a database rollback.
hope it might be helpfull
Regards,
Aby.