2008 Oct 29 9:27 AM
Hi guys,
I need a simple imput from you:
I have an internat tab with 5 columns. Now I need just one of them (column called KUNNR).
I tryd to do it this way:
LOOP AT gt_hierarchie INTO gs_hierarchie.
APPEND gs_hierarchie-kunnr TO lt_kunnr.
ENDLOOP.
This works perfect, now the itab lt_kunnr contains all kunnr from gt_hierarchie and the "old" ones, which where in lt_kunnr before.
BUT it takes too much time! Only this short statement take over 30(!) minutes! Even longer, but after 30 minutes I cancel it...
Is there any other way to get this single column to my other itab?
Thanks
Michael
Edited by: Michael Fallenbüchel on Oct 29, 2008 10:29 AM
2008 Oct 29 9:33 AM
wow, how many entries does gt_hierarchie have?
Are you 100% sure that this is the statement causing this long runtime?
There is some gain by using LOOP AT ... ASSIGNING ... instead of LOOP AT ... INTO ... (data is not copied, just referenced).
Thomas
2008 Oct 29 9:31 AM
>Only this short statement take over 30(!) minutes! Even longer, but after 30 minutes I cancel it...
There may be some other problem
check it once.
2008 Oct 29 9:33 AM
wow, how many entries does gt_hierarchie have?
Are you 100% sure that this is the statement causing this long runtime?
There is some gain by using LOOP AT ... ASSIGNING ... instead of LOOP AT ... INTO ... (data is not copied, just referenced).
Thomas
2008 Oct 29 9:42 AM
Sometimes you can't the the forest 'cause of so much woods
The problem was a loop around my append! The first step, this loop has only 1 entry - after the append, there where 450000 entrys - and so on.
Feeling stupid now
But thanks for the quick help!
2008 Oct 29 9:33 AM
Hi,
If possible can you tell how are you populating:
gt_hierarchie and rest data of lt_kunnr.
So that we could help you out with better performance.
Thanks & Regards,
Navneeth K.
2008 Oct 29 9:33 AM
Hai,
I hope the following code will help you,
Clear It_kunnr.
Refresh It_kunnr.
LOOP AT gt_hierarchie INTO gs_hierarchie.
MOVE gs_hierarchie-kunnrunnr TO lt_kunnr.
APPEND It_kunnr.
ENDLOOP.
Regards,
Harish
2008 Oct 29 9:37 AM
if kunnr is the first column of ur table gt_hierarchie, you can move in this way.
lt_kunnr = gt_hierarchie.
Regards
Sathar
2008 Oct 29 9:37 AM
Hi Michael,
sounds strange, the only reason I could imagine is that one line of gt_hierarchie contains lot of data (e.g. subtables), in this case you should use a field symbol: "loop at gt_... assigning <ls_hierarchie>".
Best regards
Thomas