Advertisement
Guest User

Untitled

a guest
Apr 6th, 2011
552
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.   DATA: v_index TYPE i.
  2.   DATA: v_odd TYPE i.
  3.   DATA: v_string TYPE string.
  4.  
  5.   DO 9 TIMES.
  6.     WRITE / ''.
  7.     v_index = sy-index.
  8.     v_odd = sy-index mod 2.
  9.     IF v_odd EQ 0.
  10.       v_string = sy-index.
  11.       WRITE v_string.
  12.       DO v_index TIMES.
  13.         v_string = v_index - sy-index.
  14.         IF v_string NE 0. WRITE: '-', v_String. ENDIF.
  15.       ENDDO.
  16.     ELSE.
  17.       DO sy-index TIMES.
  18.         v_string = sy-index.
  19.         IF sy-index > 1. WRITE '-'. ENDIF.
  20.         WRITE v_string.
  21.       ENDDO.
  22.     ENDIF.
  23.   ENDDO.
Advertisement
RAW Paste Data Copied
Advertisement