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

dump

Former Member
0 Likes
347

this is my part of coding, this is the place where my program goes to dump for time exceeds.

how to correct this coding and how about the performance of the tables cdhdr and cdpos.

pls suggest me on this.

Regards

Rajaram

loop at it1.

if zdate-high is not initial.

select single CHANGENR UDATE UTIME

from cdhdr

into (it1-CHANGENR1 , it1-UDATE , it1-UTIME)

where CHANGENR = it1-CHANGENR and

UDATE BETWEEN ZDATE-LOW AND ZDATE-HIGH.

IF SY-SUBRC = 0.

modify it1.

ELSE.

DELETE IT1.

ENDIF.

else.

select single CHANGENR UDATE UTIME

from cdhdr

into (it1-CHANGENR1 , it1-UDATE , it1-UTIME)

where CHANGENR = it1-CHANGENR and

UDATE = ZDATE-LOW.

IF SY-SUBRC = 0.

modify it1.

ELSE.

DELETE IT1.

ENDIF.

endif.

endloop.

1 REPLY 1
Read only

Former Member
0 Likes
321

hi

First you are writting a select statement inside a loop which is not acceptable from performance point of view. that try passing the primary field values while retrieving the values from the table CDHDR and also instead of passing UDATE BETWEEN ZDATE-LOW AND ZDATE-HIGH.you can try to use UPDATE IN S_DATE(select option).

NOW to improve the performance

1.Try passing the primary field values while retrieving the data form dtab.

2.instead of hitting the data base table again and again inside the loop you can use select <field names > from chdphr into <internal table >for all enteries in table itab where....

and than can read the values form <internal table> to modify itab.

Thanks

ANd than can