12-11-2008 6:56 AM
Hi,
Can you people help me with this problem.
I have an internal table with different data e.g :
A 2
B 1
C 3
A 1
D 7
B 5
Now i want to put the values of A,B,C,D into another internal table with some other calculation done.
But when i am using READ Table with KEY my second internal table is getting filled with A=2 and the second A=2 as well instead of 1.I guess because it is reading the first record only as its finding A first.
How will i fix this one.
Kind Regards,
12-11-2008 7:00 AM
>
> Hi,
>
> Can you people help me with this problem.
> I have an internal table with different data e.g :
> A 2
> B 1
> C 3
> A 1
> D 7
> B 5
> Now i want to put the values of A,B,C,D into another internal table with some other calculation done.
> But when i am using READ Table with KEY my second internal table is getting filled with A=2 and the second A=2 as well instead of 1.I guess because it is reading the first record only as its finding A first.
> How will i fix this one.
>
> Kind Regards,
Can you tell me the exact requirement of yours?
12-11-2008 7:00 AM
Hi
If your second table also has the values of first itab say A,B,C,D
Then sort your first table.
loop at second_tab.
loop at first_tab where fnam = second_tab-fnam
endloop.
endloop
Best Regards
Ramchander Rao.K
12-11-2008 7:02 AM
Hi,,,
my second itab dont v the values of A,B,C,D. I will fill up the second itab with the values of first itab.
12-11-2008 7:01 AM
In the read statement mention both fields.
ex:
READ TABLE IT_bkpf WITH KEY bukrs = IT_bsis-bukrs
belnr = it_bsis-belnr
gjahr = it_bsis-gjahr.
12-11-2008 7:02 AM
Hi,
Instead of Read statement use the Loop at itab with where clause... in this case you get the second record also..
12-11-2008 7:03 AM
take an intermediate internal table.
itab_temp[] = itab[].
now use read table from temp table and delete that entry after reading it so the next read table will point to next entry