Application Development and Automation 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: 
Read only

delete specific row from internal table type any

Former Member
0 Likes
3,558

Hi,

I want to delete specific table row from table type any and I getting dump,

there is specified way to do that for table type any?

Regards,

joy

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,116

Hi

It depends on the command you're using to delete the record.

The type ANY means the internal table could be STANDARD, SORTED and HASHED, so you can't use command to manage internal table uses the INDEX, but the key only:

FORM DELETE_TAB  USING    P_TAB TYPE ANY TABLE.

   DATA WA TYPE CHAR10.

   DELETE TABLE P_TAB WITH TABLE KEY (WA) = 'AAAA'.

ENDFORM.                    " DELETE_TAB

bu you need to define the key of course

Max

3 REPLIES 3
Read only

Former Member
0 Likes
2,117

Hi

It depends on the command you're using to delete the record.

The type ANY means the internal table could be STANDARD, SORTED and HASHED, so you can't use command to manage internal table uses the INDEX, but the key only:

FORM DELETE_TAB  USING    P_TAB TYPE ANY TABLE.

   DATA WA TYPE CHAR10.

   DELETE TABLE P_TAB WITH TABLE KEY (WA) = 'AAAA'.

ENDFORM.                    " DELETE_TAB

bu you need to define the key of course

Max

Read only

amy_king
Active Contributor
0 Likes
2,116

Hi Joy,

You could also delete by index, e.g.,

DELETE itab INDEX some_index.

Or if you were looping through your table,

LOOP AT itab...

    DELETE itab. " deletes the current loop index

ENDLOOP.

Cheers,

Amy

Read only

Former Member
0 Likes
2,116

Hi joy

You can use delete statement to delete data from internal table different variant of delete statement are {-

DELETING Records:

Single Record: DELETE <ITAB> INDEX <N>.

Multiple Record: DELETE <ITAB> WHERE <Condition>

DELETE <ITAB> FROM <N1> TO <N2>.

DELETING ADJACENT DUPLICATES:

NOTE: Make Sure that the Duplicates should be Adjacent, which can be done through SORTING.

So that, Sorting the <ITAB> is Mandatory.

NOTE: The Duplication of Records(s) depends on the comparing fileds.

DELETE ADJACENT DUPLICATES FROM <ITAB>

Thanks

Anshul Mishra

COMPARING <F1><F2>……..