06-04-2009 4:23 PM
Hi All,
I have hashehed internal table like this.
data : it_zawcumsetz like hashed table of zawcumsetz with unique key
KTONR_OPUS ZZ_AWC WAERS_OPUS.
I am geeting entries in table.
LOOP AT it_zawcumsetz into wa_zawcumsetz.
IF wa_zawcumsetz-zz_awc IS INITIAL.
wa_zawcumsetz-zz_awc = 'X'. "New value is * for
ENDIF.
MODIFY TABLE it_zawcumsetz FROM wa_zawcumsetz.
ENDLOOP.
i want to modify key value in loop.
Rather than append from wa to another internal table is not possiable.
Can anybody please tell me how to solve this pblm.
Thanks,
06-04-2009 5:51 PM
Hi Katta.
If you created a hashed table just to improve the MODIFY inside the loop, change your itab to a standard table and use field symbol:
DATA: it_zawcumsetz TYPE TABLE OF zawcumsetz.
FIELD-SYMBOLS: <fs_zawcumsetz> LIKE LINE OF it_zawcumsetz.
LOOP AT it_zawcumsetz ASSIGNING <fs_zawcumsetz>.
IF <fs_zawcumsetz>-zz_awc IS INITIAL.
<fs_zawcumsetz>-zz_awc = 'X'.
ENDIF.
ENDLOOP.
If you can't change to a standard table, maybe you can duplicate the itab, just for the loop:
DATA: it_std TYPE TABLE OF zawcumsetz.
FIELD-SYMBOLS: <fs_std> LIKE LINE OF it_std.
it_std = it_zawcumsetz.
LOOP AT it_std ASSIGNING <fs_std>.
IF <fs_std>-zz_awc IS INITIAL.
<fs_std>-zz_awc = 'X'.
ENDIF.
ENDLOOP.
it_zawcumsetz = it_std.
REFRESH it_std.
Regards
Darley
06-05-2009 6:41 AM
Hi,
Check this link below
http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb35eb358411d1829f0000e829fbfe/content.htm
regards,
Mani
06-05-2009 6:47 AM
Hi,
Check this link too, good one
http://www.sap-basis-abap.com/abap/use-hashed-tables-to-improve-performance.htm
http://learningabap.wordpress.com/2008/06/24/use-of-hashed-tables/
regards,
Mani