2008 Mar 25 12:00 PM
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
2008 Mar 25 12:08 PM
You need to use INSERT instead of APPEND for a hashed table with the unique key specified in the workarea.
Regards,
Michael
2008 Mar 25 12:12 PM
inplace of append use insert statement.
This will solve ur problem.
2008 Mar 25 12:48 PM
2008 Mar 25 1:25 PM
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