Application Development 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: 

Performance Issue

Former Member
0 Kudos

HI,

When I am copying the entries from one table to another table and using modifying statement,

it is taking a lot of time during execution.

the number of entries in the first table are some 20,000 records

my logic is:

1)selecting the records from the first table into an internal table

2)loop and the modify the second table.

the performance is too slow.

is there any way where i can increase the performance.

Thanks

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

Are you using select - endslect. Modifying in Loop.

Why not use SELECT INTO TABLE ITAB.

( itab has structire of your first database table )

Populate entries from ITAB to ITAB1.

( Itab1 has structure of you second database table

For modify you can use

MODIFY <DBTAB> from TABLE ITAB1.

Cheers

8 REPLIES 8

Former Member
0 Kudos

Use field symbols. It can improve the performance.

Former Member
0 Kudos

Hi

Are you using select - endslect. Modifying in Loop.

Why not use SELECT INTO TABLE ITAB.

( itab has structire of your first database table )

Populate entries from ITAB to ITAB1.

( Itab1 has structure of you second database table

For modify you can use

MODIFY <DBTAB> from TABLE ITAB1.

Cheers

0 Kudos

Hi Guys:

My code is like below:

1)select particular fields from ztable1 into table itab1.

2)loop at itab1

modify ztable2 from table itab1.

commitwork for sy-subrc = 0

endloop.

is there anything i have to change to make it fast?

0 Kudos


select particular fields from ztable1 
           into table itab1.

data: xztable2 type ztable2.

loop at itab1.

move itab1 to xztable2.
modify ztable2 from xztable2.

endloop.


Regards,

Rich Heilman

0 Kudos

Hi,

how about this.

giving modify after loop.

MODIFY TABLE itab [FROM wa] [TRANSPORTING f1 ... fn].

reward points for helpfull answers and close the thread if your question is solved.

regards,

venu.

0 Kudos

Hi,

You are using "modify ztable2 from table itab1", then why is inside the loop. It means that you are modifying the entries n square times. Drop the loop..endloop.

If the modify line is of form "Modify ztable2 from itab1", then you might want to consider creating a modification table itab2 and modifying ztable2 in one shot.

Another suggestion is to move the commit work outside the loop if possible.

Raj

0 Kudos

I am not sure why you are looping at the itab1 if it has the same structure as the database table ZTABLE2. All you need to do is

modify ZTABLE2 from table itab1.

Srinivas

0 Kudos

Hi Guys,

Thanks for the answers. The problem is solved now. I did not use any loop.

I did award the points.

Thank You very much for all of those who participated in this thread.