04-30-2008 7:04 AM
Hi,
1. Can we perform Binary Search on a Hashed table or not ?
2. How can we modify a particular record in hashed internal table ?
Can we write like this ?
itab-field(3) = 'Hai'.
Modify itab with key field2 = '1' .
Thanks and Regards,
Satya.
04-30-2008 7:09 AM
Have a look at below sample report:
REPORT demo_int_tables_modify .
DATA: BEGIN OF line,
col1 TYPE i,
col2 TYPE i,
END OF line.
DATA itab LIKE HASHED TABLE OF line WITH UNIQUE KEY col1.
DO 4 TIMES.
line-col1 = sy-index.
line-col2 = sy-index ** 2.
INSERT line INTO TABLE itab.
ENDDO.
line-col1 = 2.
line-col2 = 100.
MODIFY TABLE itab FROM line.
LOOP AT itab INTO line.
WRITE: / line-col1, line-col2.
ENDLOOP.
Have a look at below link for details:
[Changing Lines|http://help.sap.com/saphelp_nw70/helpdata/en/fc/eb35eb358411d1829f0000e829fbfe/content.htm]
I hope it helps.
Best Regards,
Vibha
Please mark all the helpful answers