03-30-2009 7:33 PM
Hi Friends,
How to delete records in a hashed table. Below is my code. I am getting error..."You can not use explicit/implicit operations on hashed tables". Could you plz help.
loop at xth_data ASSIGNING <ls_data2>.
ASSIGN COMPONENT 'S_CHAS-0FISCPER3' OF STRUCTURE <ls_data2> TO <fiscpd>.
if <fiscpd> <> 12.
delete xth_data.
endif.
endloop.
Regards,
Chinna
03-30-2009 7:54 PM
>
> Hi Friends,
>
> How to delete records in a hashed table. Below is my code. I am getting error..."You can not use explicit/implicit operations on hashed tables". Could you plz help.
>
>
> loop at xth_data ASSIGNING <ls_data2>.
> ASSIGN COMPONENT 'S_CHAS-0FISCPER3' OF STRUCTURE <ls_data2> TO <fiscpd>.
> if <fiscpd> <> 12.
> delete xth_data.
> endif.
> endloop.
>
> Regards,
> Chinna
Did you read the help on [DELETE|http://help.sap.com/saphelp_nw04/helpdata/EN/06/aafd54fc4011d195280000e8353423/content.htm]?
DELETE TABLE xth_data FROM <ls_data>.
matt
03-30-2009 8:05 PM
Hi Matt,
FYI...I read the help and used 'delete xth_data from <ls_data2>.' only. But the error is same.
Cheers
Chinna
03-30-2009 8:10 PM
Hi - I think you haven't read the document provided by Matt properly. Try to pass a key to delete the record. Go through the document once again, specially the example given for hashed table.
Kuntal
03-31-2009 5:23 AM
loop at xth_data ASSIGNING <ls_data2>.
ASSIGN COMPONENT 'S_CHAS-0FISCPER3' OF STRUCTURE <ls_data2> TO <fiscpd>.
if <fiscpd> 12.
* option 1:
delete table xth_data with table key <key condition>.
*option 2:
delete table xth_data INDEX sy-tabix.
endif.
endloop.
Regards,
Lalit Mohan Gupta