Вы находитесь на странице: 1из 7

*&---------------------------------------------------------------------*

*& Report ZPATTERNShiva


*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT ZPATTERNShiva.

***********************************************************************
*1
*1 2
*1 2 3
*1 2 3 4
*1 2 3 4 5

*PARAMETERS N TYPE I.
*
*
*DATA TEMP TYPE I.
*
*DO N TIMES.
*
* TEMP = SY-INDEX.
*
* DO TEMP TIMES.
*
*WRITE SY-INDEX.
*
*ENDDO.
*
*WRITE /.
*
*ENDDO.

***************************************************************************
*1
*
*2 1
*
*3 2 1
*
*4 3 2 1
*
*5 4 3 2 1

*PARAMETERS N TYPE I.

*DATA : TEMP TYPE I,


*
*DO N TIMES.
* TEMP = SY-INDEX.
*
* DO TEMP TIMES.
*
*WRITE TEMP.
**TEMP = TEMP - 1.
*
*
*
*
*ENDDO.
*
*WRITE /.
*
ENDDO.
***********************************************************
*5 4 3 2 1
*4 3 2 1
*3 2 1
*2 1
*1

*PARAMETERS N TYPE I.

*DATA TEMP TYPE I.


*
*DATA TEMP1 TYPE I.
*
*TEMP = N.
*
*DO N TIMES.
*
*TEMP1 = TEMP.
*
* DO TEMP TIMES.
*
* WRITE TEMP1.
*
*TEMP1 = TEMP1 - 1.
*
* ENDDO.
*
*TEMP = TEMP - 1.
*
* WRITE /.
*
* ENDDO.
**************************************************************************
*1
*2 1
*1 2 3
*4 3 2 1
*1 2 3 4 5

*PARAMETERS N TYPE I.
*
*DATA: TEMP TYPE I,
*
* TEMP1 TYPE I.
*
*DO N TIMES.
*
*TEMP1 = SY-INDEX MOD 2.
*
*IF TEMP1 NE 0.
*
*DO SY-INDEX TIMES.
*
*TEMP = SY-INDEX.
*
*WRITE TEMP.
*
*ENDDO.
*
*ELSE.
*
*TEMP = SY-INDEX.
*
*DO SY-INDEX TIMES.
*
*WRITE TEMP.
*
*TEMP = TEMP - 1.
*
*ENDDO.
**/
*ENDIF.
*
*WRITE /.
*ENDDO.
******************************************************************
*1
*1 2
*1 2 3
*1 2 3 4
*1 2 3 4 5
*4 3 2 1
*3 2 1
*2 1
*1

*PARAMETERS N TYPE I.
*
*DATA: TEMP TYPE I,
*
* TEMP1 TYPE I.
*
*DO N TIMES.
*
*TEMP = SY-INDEX.
*
* DO TEMP TIMES.
*
* WRITE SY-INDEX.
*
* ENDDO.
*
*WRITE /.
*
*ENDDO.
*
*N = N - 1.
*TEMP = N.
*DO N TIMES.
* TEMP1 = TEMP.
* DO TEMP TIMES.
*WRITE: TEMP1.
*TEMP1 = TEMP1 - 1.
* ENDDO.
* TEMP = TEMP - 1.
*WRITE /.
* ENDDO.

************************************************************************
*@
*$ $
*@ @ @
*$ $ $ $
*@ @ @ @ @
************************************************************************
*
*PARAMETERS N TYPE I.
*
*DATA: TEMP TYPE I,
*
* TEMP1 TYPE I.
*
*DO N TIMES.
*
*TEMP1 = SY-INDEX MOD 2.
*
*IF TEMP1 NE 0.
*
*DO SY-INDEX TIMES.
*
*TEMP = SY-INDEX.
*
*WRITE '@'.
*
*ENDDO.
*
*ELSE.
*
*TEMP = SY-INDEX.
*
*DO SY-INDEX TIMES.
*
*WRITE '$'.
*
*TEMP = TEMP - 1.
*
*ENDDO.
*
*ENDIF.
*
*WRITE /.
*ENDDO.

************************************************************************
*INDIA
*INDI
*IND
*IN
*I
************************************************************************

DATA: N TYPE I,
N1 TYPE I.

PARAMETERS TEMP TYPE STRING.


N = STRLEN( TEMP ).
N1 = N.
DO N TIMES.

WRITE / TEMP+0(N1).
N1 = N1 - 1.
ENDDO.
*WRITE /.

************************************DECLARATION IS COMMON FOR BELOW PATTERNS

PARAMETERS N TYPE I.
data:pos type i.
DATA: P_NUM TYPE I,
p type i.

************************************************************************
* 1
* 2 2 *
* 3 3 3 *
************************************************************************

DO N TIMES.

P_NUM = SY-INDEX.
DO P_NUM TIMES.
WRITE: P_NUM.
ENDDO.
WRITE / .
ENDDO.

************************************************************************
* 1
* 2 1 *
* 3 2 1 *
************************************************************************
*
*DO N TIMES.
** P_NUM = SY-INDEX.
*
* p_num = n.
* DO P_NUM TIMES.
*
* WRITE: P_NUM.
* P_NUM = P_NUM - 1.
* ENDDO.
* WRITE / .
*
* n = n - 1.
* ENDDO.

************************************************************************
* 1 *
* 2 3 *
* 3 4 5 *
************************************************************************

*DO N TIMES.
* P_NUM = SY-INDEX.
* DO P_NUM TIMES.
* WRITE: P_NUM.
* P_NUM = P_NUM + 1.
* ENDDO.
* WRITE / .
* ENDDO.

************************************************************************
* * *
* * * *
* * * * *
************************************************************************

*DO N TIMES.
*
**pos = 1.
**pos = pos + 1.
*
* P_NUM = SY-INDEX.
*
* DO P_NUM TIMES.
*
** p = p_num / 2.
**
** if p = 0.
** p = pos / 2.
** WRITE: 'y'.
** if p = 1.
** else.
*
* write: '*'.
*
**else.
**
** write: 'y'.
**
*
** endif.
* ENDDO.
*
** write: 'y'.
*
* WRITE / .
* ENDDO.
**********************************************************************
*1
*2 3
*4 5 6
*7 8 9 10
*11 12 13 14 15

*parameters n type i.
*data:temp type i,
* temp1 type i.
*temp = 1.
*DO n TIMES.
*do sy-index times.
* write temp.
*temp = temp + 1.
*enddo.
*write /.
*ENDDO.