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 default values

Former Member
0 Kudos
1,066

hi

experts plz help

in my program after clear one field take ur default values (NUMC),bcoz after clear

my table body have no values so whn another table which match the fieldes that time it take default(00) values and throw wrong values so how i m delete that default values from my internal table header.

thanks a lot for answer and get points

1 ACCEPTED SOLUTION

Former Member
0 Kudos
208

Hi!

Mostly CLEAR clears only the table header. Use REFRESH to clear all records from and internal table.

If you are confused using CLEAR statement, then you can separate your internal table and the work area, like this:

DATA: gt_mara LIKE STANDARD TABLE OF mara,

wa_mara LIKE LINE OF gt_mara.

CLEAR wa_mara.

REFRESH gt_mara.

Regards

Tamá

3 REPLIES 3

Former Member
0 Kudos
209

Hi!

Mostly CLEAR clears only the table header. Use REFRESH to clear all records from and internal table.

If you are confused using CLEAR statement, then you can separate your internal table and the work area, like this:

DATA: gt_mara LIKE STANDARD TABLE OF mara,

wa_mara LIKE LINE OF gt_mara.

CLEAR wa_mara.

REFRESH gt_mara.

Regards

Tamá

0 Kudos
208

i used both refresh and clear itab[],but both throw error:' " YOU MAY NOT DELETE OR OVERWRITE WITH IN A LOOP".

0 Kudos
208

The message means you cannot empty the contents of an internal table whilst you are processing it i.e. you must do it outside the loop... so

loop at gt_data.
  clear: gt_data[].
endloop.

makes no sense as you are destroying the array you are looping around.

Just use "refresh gt_data." or "clear: gt_data, gt_data[]." outside a loop to drop the contents from memory.

Jonathan