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: 

how to read an hash table

Former Member
0 Kudos
2,867

SELECT lifnr

name1

stcd1

stcd2

FROM lfa1 INTO TABLE fp_i_lfa1

FOR ALL ENTRIES IN fp_i_bsik

WHERE lifnr = fp_i_bsik-lifnr.

IF sy-subrc = 0.

sort fp_i_lfa1 by lifnr name1 stcd1.

endif.

now i want to read the table

read table fp_i_lfa1 into l_wa_lfa1 with key lifnr = l_wa_bsik1-lifnr

binary search.

but iam getting error as lfa1 is an hash table

then in what way i have to read.

Regards,

Sunil.

1 ACCEPTED SOLUTION

Former Member
499

Hi,

Do not add the Binary search with the Read table

Regards

Sudheer

7 REPLIES 7

kiran_k8
Active Contributor
0 Kudos
499

Sunil,

LFA1 is a transparent table.

K.Kiran.

Former Member
0 Kudos
499

Hi

Use this statement in the loop of fp_i_bsik by reading into i_wa_bsik.

loop at fp_i_bsik into l_wa_bsik1.

read table fp_i_lfa1 into l_wa_lfa1 with key lifnr = l_wa_bsik1-lifnr

binary search.

.......................

endloop.

Reward points for useful Answers

Regards

Anji

Former Member
0 Kudos
499

HI,

Lfa1 is not Hash table .

It is a Transparent table

Regards

suresh.d

Message was edited by:

suresh dameruppula

Former Member
500

Hi,

Do not add the Binary search with the Read table

Regards

Sudheer

former_member186741
Active Contributor
499

leave out the binary search clause.

0 Kudos
499

Hi,

You cannot use BINARY SEARCH for hashed tabls,

For hashed table the data is read using HASHING machanism so dont use BINARY SEARCH.

Also you need to give the FULL KEY to read from the hashed table.

Regards,

Sesh

Former Member
0 Kudos
499

Thank u guys.

for ur immediate response