STATICS 靜態變數的用法

2023-02-03

*&---------------------------------------------------------------------*
*& Report ZSTATICS 靜態變數的用法。 *
*&---------------------------------------------------------------------*
REPORT ZSTATICS.
DO 3 TIMES.
      PERFORM CALL_SUB1.
ENDDO.

FORM CALL_SUB1.
STATICS lv_val1 type i.
lv_val1 = lv_val1 + 1.
write: / 'statics ', lv_val1.
endform.