‎2007 Aug 24 12:07 PM
Hello all,
Is there any way in which we can optimise this loop ??
LOOP AT I_SEA WHERE MATNR EQ I_MATNR.
T_SEA = I_SEA.
APPEND T_SEA.
ENDLOOP.
Regards
Sudha
‎2007 Aug 24 12:13 PM
Hi,
Instead of using header line you can use fields symbols.
Field-symbols <f_sea> type <type of internal table i_sea>.
Loop at i-sea assigning <f_sea> where matnr EQ i_matnr.
wa_tea = <f_sea>.
append wa_seat to t_sea.
endloop.
Field symbols dioes not required any space... it point outs directly the data and pushes it further/
rewards if useful.
regards ,
nazeer
‎2007 Aug 24 12:10 PM
Plz can you give clear information in your question.
Regards,
Vimal
‎2007 Aug 24 12:10 PM
‎2007 Aug 24 12:12 PM
Hi,
Try
APPEND LINES OF I_SEA TO T_SEA.
DELETE T_SEA WHERE MATNR <> l_MATNR.
<b>Do not do</b>
T_SEA[] = I_SEA[]. "This will overwrite existing data
Regards,
Sesh
‎2007 Aug 24 12:13 PM
Hi,
Instead of using header line you can use fields symbols.
Field-symbols <f_sea> type <type of internal table i_sea>.
Loop at i-sea assigning <f_sea> where matnr EQ i_matnr.
wa_tea = <f_sea>.
append wa_seat to t_sea.
endloop.
Field symbols dioes not required any space... it point outs directly the data and pushes it further/
rewards if useful.
regards ,
nazeer
‎2007 Aug 24 12:17 PM
Hi Sudha..
this will be much better if both the Tables have same structure...
<b>T_SEA[] = I_SEA[].
Delete t_sea where matnr ne i_matnr.</b>
Reward if Helpful.
<b></b>
‎2007 Aug 24 12:33 PM
tsea[] = isea[]
delete tsea
This code consumes more time than the loop.
‎2007 Aug 24 12:41 PM
Hi,
Performance always depends on the kind of data and amount of data you have in this case.
For some cases your code can be good in performance and for some cases mycode can give you the performance.
So as you said if the performance is good with your code then its good for the current data you have.
Regards,
Sesh
‎2007 Aug 24 12:37 PM
Hi Sudha,
The performance would depend on the no. of Entries in I_SEA which are equal to I_MATNR.
Since you are saying that the loop is taking less time as compared to T_SEA = I_SEA. Then the no. of records with I_SEA-MATNR = I_MATNR are less.
So this cant be further optimizied & the loop which you have placed is perfect.
Best regards,
Prashant