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 statement for string type internal table

Former Member
0 Likes
4,304

Hi Guys,

I have string type internal table. Now i want to delete the initial values in internal table.

Is it possible to delete using DELETE statement?

Code:

Data gt_tab TYPE STANDARD TABLE OF string.

Delete gt_tab where _____ is initial????


Note: I knew we can delete it through loop statement.

Thanks,

Chella

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
3,345

Did you try to use pseudo component TABLE_LINE?

Quickly rattle off a question or expend brain power reading... I can't see it catching on.

11 REPLIES 11
Read only

RaymondGiuseppi
Active Contributor
3,346

Did you try to use pseudo component TABLE_LINE?

Read only

3,345

If people would get away from using STANDARD tables all the time and start using HASHED and SORTED by default, they'd eventually stumble on TABLE_LINE when they're defining the key.

Read only

3,345
Read only

0 Likes
3,345

Quickly rattle off a question or expend brain power reading... I can't see it catching on.

Read only

0 Likes
3,345

Hi Guys,

Thanks to everyone.

DELETE gt_tab WHERE table_line IS INITIAL. -- This statement itself working fine. But i was used inside perform, it was STANDARD TABLE so It was not allowed.


Thanks,
Chella

Read only

0 Likes
3,345

Don't use FORMs - they're obsolete.

Read only

3,345

Huh?

Read only

0 Likes
3,345

Thanks for let us know.

Read only

0 Likes
3,345

It is documented.

Read only

0 Likes
3,345

To clarify what Horst is saying - There is no reason why using DELETE... on a standard table inside a form would be forbidden.

What you've posted makes no sense.

Read only

matt
Active Contributor
0 Likes
3,345

You'll be better off, performance wise, using a SORTED TABLE.

Data gt_tab TYPE SORTED TABLE OF string WITH NON-UNIQUE KEY table_line.
Delete gt_tab where table_line is initial.