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: 

How to delete the data inside a internal table?

Former Member
0 Kudos

I got a internal table name g_itab1.

currently my g_itab1 has a FNAME(50) component.

Inside my component there is ADMINO, EYEAR, FIRSTNAME, LASTNAME and CONTACT.

I want to clear away ADMINO, EYEAR, FIRSTNAME, LASTNAME and CONTACT inside my internal table.

How do i clear it? i have tried using CLEAR g_itab1.

It doesn't work.. the data are still inside.

1 ACCEPTED SOLUTION

former_member200338
Active Contributor
0 Kudos

Use refresh g_itab1[]

9 REPLIES 9

Former Member
0 Kudos

Hi,

Use Refresh Statement.

Refresh will clear the contents of both the header line and the body of the internal table. Free will clear both and release the memory allocated as well.

Syntax :

REFRESH itab.

Thanks.

Former Member
0 Kudos

hi,

try to use delete statement

former_member200338
Active Contributor
0 Kudos

Use refresh g_itab1[]

0 Kudos

clear:g_itab1 ,g_itab1[]

varma_narayana
Active Contributor
0 Kudos

Hi

You can use :

REFRESH g_itab1.

or

CLEAR g_itab1[] . "Delete the records from the BODY

Both statements will delete the Entire records from itab.

REWARD IF hELPFUL.

Former Member
0 Kudos

Hi

if you want remove total then go for <b>refresh itab.</b>

if you want to go for some fields then use <b>DELETE itab where</b>

<b>Reward if usefull</b>

Former Member
0 Kudos

use this.

CLEAR g_itab1[]. " FOR BODY CLEAR

REFRESH g_itab1. " FOR HEADER CLEAR

Message was edited by:

Amit Singla

Former Member
0 Kudos

hi

DELETE TABLE itab WITH TABLE KEY k1 = v1 ... kn = vn.

Example to delete all of the lines between 5 and 36 in a table of names where the entry begins with one of the letters 'A' to 'C'.

DELETE itab FROM 5 TO 36 WHERE NAME CA 'ABC'.

reward if useful

regards

sree

Former Member
0 Kudos

Thanks everyone!!!!

I've solved my problem!!! 😃