SHARE
TWEET

Untitled

a guest Apr 6th, 2011 623 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. REPORT zsa_govnokod_001.
  3.  
  4. PARAMETERS: p_count1 TYPE i.
  5.  
  6. DATA p_count2 TYPE i.
  7. DATA lv_is_odd TYPE i.
  8. DATA lv_syindex(3) TYPE c.
  9.  
  10. DO p_count1 TIMES.
  11.   p_count2 = sy-index.
  12.   lv_is_odd = sy-index MOD 2. "0 - чёт, 1 - нечет
  13.  
  14.   DO p_count2 TIMES.
  15.     IF lv_is_odd = 1.
  16.       lv_syindex = sy-index.
  17.     ELSE.
  18.       lv_syindex = p_count2 + 1 - sy-index. "для чётных разворачиваем порядок с помощью арифметики
  19.     ENDIF.
  20.     WRITE lv_syindex LEFT-JUSTIFIED.
  21.     IF sy-index NE p_count2. WRITE '-'. ENDIF. "если не последняя запись - вставляем разделитель
  22.   ENDDO.
  23.   WRITE /.
  24. ENDDO.
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top