matinal:abap 循环语句

2023-10-14 13:58:17 浏览数 (1)

代码语言:javascript复制
*&---------------------------------------------------------------------*
*& Report  Z9
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT Z9.

DATA num TYPE i.

num = 10.

DO num TIMES.
  WRITE: / 'dowhile第', sy-index , '次循环'.
ENDDO.

ULINE.

DO .

  WRITE: / '现在是第',sy-index,'次循环'.

  IF sy-index = 8.
    exit.
  ENDIF.

ENDDO.


ULINE.

DATA i type i.
i = 0.
WHILE  i < 10.
  WRITE: / 'while第',sy-index,'次循环'.
  i = i   1.
ENDWHILE.

0 人点赞