ABAP clear,refresh,free清空內表的區別


 

clear itab,僅清空HEADER LINE,對內表數據存儲空間不影響,保留內存區。 refresh itab,不清空HEADER LINE,清除內表數據存儲空間,但保存內存區。 free itab,不清空HEADER LINE,清空內表數據存儲空間。

clear itab[],清空內表數據存儲空間里的內容。

 

例子:

REPORT ZZZZZZZZZ.

types:begin of head, mantr(10) type c, id(10) type c, end of head. data gt_head type table of head with header line.

gt_head-mantr = 'wo'. gt_head-id = '00001'. append gt_head.

gt_head-mantr = 'you'. gt_head-id = '00002'. append gt_head.

free gt_head. write:gt_head.

loop at gt_head. write: / gt_head. endloop.

gt_head-mantr = 'he'. gt_head-id = '00003'. append gt_head. write:gt_head.


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM