2007 Sep 17 12:44 PM
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
2007 Sep 17 12:50 PM
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á
2007 Sep 17 12:50 PM
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á
2007 Sep 17 12:57 PM
i used both refresh and clear itab[],but both throw error:' " YOU MAY NOT DELETE OR OVERWRITE WITH IN A LOOP".
2007 Sep 17 1:26 PM
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