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

optimize a query

Former Member
0 Likes
413

if not lt_sources_invalid[] is initial.

clear: ls_source.

loop at lt_sources_invalid into ls_source.

clear: ls_pto_source.

move-corresponding ls_source to ls_pto_source.

append ls_pto_source to pto_sources_tab_invalid.

clear: ls_source.

endloop.

endif. " invalid sources

2 REPLIES 2
Read only

Former Member
0 Likes
399

Hi

if lt_sources_invalid and pto_sources_tab_invalid tables having the same structure then you can use directly..

pto_sources_tab_invalid[] = lt_sources_invalid[].

Read only

Former Member
0 Likes
399

it looks ok.....

probably you don't need to mention the clear statement in the loop as the loop will take care of clearing the work area and then populate it with the contents of the next row. may be it makes more sense to use the clear statement after the loop execution is over.

if not lt_sources_invalid[] is initial.

clear: ls_source.

loop at lt_sources_invalid into ls_source.

clear: ls_pto_source.

move-corresponding ls_source to ls_pto_source.

append ls_pto_source to pto_sources_tab_invalid.

endloop.

clear: ls_source.

endif. " invalid sources