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

how to delete default values

Former Member
0 Likes
1,747

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
Read only

Former Member
0 Likes
889

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
Read only

Former Member
0 Likes
890

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á

Read only

0 Likes
889

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

Read only

0 Likes
889

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