Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Modifing of Hashed internal Table

Former Member
0 Kudos

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.

1 REPLY 1

Former Member
0 Kudos

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