Clear, free e refresh

DATA: itab TYPE TABLE OF mara WITH HEADER LINE,
      a(1) TYPE c.

BREAK-POINT.
MOVE: 1   TO itab-matnr,
      '1' TO itab-ernam,
      'X' TO a.
APPEND itab TO itab.

********************************************************************************
* -= CLEAR =-                                                                  *
* Se for tabela sem header line limpa o conteudo mas o espaço fica em memória  *
* Se for tabela com header line limpa o header mas o espaço fica em memória    *
********************************************************************************
CLEAR: itab, a.

MOVE: 2   TO itab-matnr,
      '2' TO itab-aenam.
APPEND itab TO itab.

********************************************************************************
* -= REFRESH =-                                                                *
* Limpa o conteudo mas o espaço fica em memória                                *
********************************************************************************
REFRESH: itab.

MOVE: 3   TO itab-matnr,
      '3' TO itab-vpsta.
APPEND itab TO itab.

********************************************************************************
* -= FREE =-                                                                   *
* Limpa o conteudo e libera o espaço em memória                                *
********************************************************************************
FREE: itab, a.

MOVE: 4   TO itab-matnr.
APPEND itab TO itab.

BREAK-POINT.

CLEAR: itab.
FREE:  itab.
MOVE: 1   TO itab-matnr,
      '1' TO itab-ernam.
APPEND itab TO itab.

CLEAR: itab[], a.

MOVE: 2   TO itab-matnr,
      '2' TO itab-aenam.
APPEND itab TO itab.

REFRESH: itab[].

MOVE: 3   TO itab-matnr,
      '3' TO itab-vpsta.
APPEND itab TO itab.

FREE: itab[].

MOVE: 4   TO itab-matnr.
APPEND itab TO itab.

BREAK-POINT.

 

Deixe um comentário

O seu endereço de e-mail não será publicado. Campos obrigatórios são marcados com *

This site uses Akismet to reduce spam. Learn how your comment data is processed.