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: 

urgent: how to add additional records to hashed table

Former Member
0 Kudos
854

Hi,

I want to add records to a hashed table.

my code is:

data: ipn_pc_zoba type hashed table of tpn_pc_zoba with unique key vbeln.

loop at izoba into wzoba.

clear wpn_pc_zoba .

read table ipn_pc_zoba into wpn_pc_zoba with key vbeln = wzoba-LS_KDAUF.

if sy-subrc ne 0.

wpn_pc_zoba-vbeln = wzoba-LS_KDAUF.

append wpn_pc_zoba to ipn_pc_zoba.

endif.

endloop.

The Error is : You cannot use explicit or implicit index operations on tables with types "HASHED TABLE" or "ANY TABLE". "IPN_PC_ZOBA" has the type "HASHED TABLE". It is possible that .

How to solve this?

Please reply ASAP.

Regards,

SRI

4 REPLIES 4

former_member589029
Active Contributor
0 Kudos
155

You need to use INSERT instead of APPEND for a hashed table with the unique key specified in the workarea.

Regards,

Michael

Former Member
0 Kudos
155

inplace of append use insert statement.

This will solve ur problem.

Former Member
0 Kudos
155

Hi,

insert is not working.

former_member589029
Active Contributor
0 Kudos
155

In your code you should use

INSERT WPN_PC_ZOBA INTO IPN_PC_ZOBA.

This is the only way to append data to a hashed table. It will also only work as long as wpn_pc_zoba-vbeln is unique in the hashed table.

If you are getting an error, what does the error say?

Michael