Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

performance with delete

Former Member
0 Likes
780

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.

6 REPLIES 6
Read only

former_member206439
Contributor
0 Likes
735

Hi

It is not advisable to delete or insert entries in standard table with ABAP statements

any way provide me ur code

Read only

0 Likes
735

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.

Read only

0 Likes
735

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.

Read only

0 Likes
735

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.

Read only

Former Member
0 Likes
735

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 ............

Read only

Former Member
0 Likes
735

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.