Skip to Content
0
Former Member
Jun 17, 2008 at 04:58 PM

how to know if ZTABLE is initial

415 Views

Hi guys.

Im using a dinamic table and i need to know if that table is empty (is a real table not an internal).

if i use is initial, gives me if the variable is empty and i need to know if the real table, that is in the variable is empty.

data: DIM_TABLE TYPE TABLENAME.

if dim_table is initial.

DELETE FROM (dim_table).

if sy-subrc = 0.

CASE ti_table .

WHEN 'gt_ztsdhr000'.

INSERT (dim_table) FROM TABLE gt_ztsdhr000.

WHEN 'gt_ztsdhr001'.

INSERT (dim_table) FROM TABLE gt_ztsdhr001.

WHEN 'gt_ztsdhr002'.

INSERT (dim_table) FROM TABLE gt_ztsdhr002.

WHEN 'gt_ztsdhr003'.

INSERT (dim_table) FROM TABLE gt_ztsdhr003.

WHEN 'gt_ztsdhr004'.

INSERT (dim_table) FROM TABLE gt_ztsdhr004.

WHEN OTHERS.

ENDCASE.

endif.

endif.