2008 Jul 24 2:20 PM
Hi Gurus.
I have a local table lt_table.
At some point of my code I modify that table using indexes and it works well.
The problem is that after I change that table I cannot read it into a structure with the changes being reflected.
Something like this.
DATA:
i type sy-tabix,
lt_table type table of bla,
ls_table type bla.
LOOP AT SOME_TABLE INTO SOME_WA.
READ lt_table into ls_table
WITH KEY field1 = SOME_WA-field1
BINARY SEARCH.
...
MODIFY lt_table FROM ls_table index i.
ENDLOOP.
After I modify the table, I can see in debug that the table was modified but the structure ls_table doesn't see the new results...
Is this normal behaviour from ABAP?
Thank you for your replies.
Jorge
2008 Jul 24 2:27 PM
hi,
u r moving it to internal table and after modifying u can find that in table what else the result want.
hi,
u r moving it to internal table and after modifying u can find that in table what else the result want.
2008 Jul 24 2:27 PM
hi,
u r moving it to internal table and after modifying u can find that in table what else the result want.
2008 Jul 24 2:27 PM
LOOP AT SOME_TABLE INTO SOME_WA.
READ lt_table into ls_table
WITH KEY field1 = SOME_WA-field1
BINARY SEARCH.
if sy-subrc eq 0.
i = sy-tabix.
.....
...
MODIFY lt_table FROM ls_table index i.
clear ls_table.
endif.
ENDLOOP.if you don't use clear. and then check ls_table you will see old data only.
where are you reading. which index you are reading that also matters.
2008 Jul 24 2:27 PM
Hi,
check by using,
MODIFY <itab> INDEX <idx> FROM <wa>
TRANSPORTING <field>.Regards
Adil
2008 Jul 24 2:27 PM
Your looping criteria is on SOME_TABLE and modifying ls_table where only the work area will be modified.. so keep looping in a reverse way to incorporate your modified changes
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |