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: 

Delete records in Hashed table

Former Member
0 Kudos

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

4 REPLIES 4

matt
Active Contributor
0 Kudos

>

> 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

Former Member
0 Kudos

Hi Matt,

FYI...I read the help and used 'delete xth_data from <ls_data2>.' only. But the error is same.

Cheers

Chinna

former_member376453
Contributor
0 Kudos

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

Former Member
0 Kudos
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