Tuesday, April 24, 2007

Collect a las caraterĂ­siticas de un cubo para agregar los ratios

PROGRAM UPDATE_ROUTINE.

*$*$ begin of global - insert your declaration only below this line *-*

* TABLES:

DATA: BEGIN OF ti_entrada OCCURS 0.

INCLUDE STRUCTURE /bic/cs8zssi_co02.

DATA: END OF ti_entrada.

DATA: lc_pack(03).

*$*$ end of global - insert your declaration only before this line *-*

* The follow definition is new in the BW3.x

TYPES:

BEGIN OF DATA_PACKAGE_STRUCTURE.

INCLUDE STRUCTURE /BIC/CS8ZSSI_CO02.

TYPES:

RECNO LIKE sy-tabix,

END OF DATA_PACKAGE_STRUCTURE.

DATA:

DATA_PACKAGE TYPE STANDARD TABLE OF DATA_PACKAGE_STRUCTURE

WITH HEADER LINE

WITH NON-UNIQUE DEFAULT KEY INITIAL SIZE 0.

FORM startup

TABLES MONITOR STRUCTURE RSMONITOR "user defined monitoring

MONITOR_RECNO STRUCTURE RSMONITORS " monitoring with record n

DATA_PACKAGE STRUCTURE DATA_PACKAGE

USING RECORD_ALL LIKE SY-TABIX

SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS

CHANGING ABORT LIKE SY-SUBRC. "set ABORT <> 0 to cancel update

*

*$*$ begin of routine - insert your code only below this line *-*

* fill the internal tables "MONITOR" and/or "MONITOR_RECNO",

* to make monitor entries

* Rutina para buscar el promedio de Nro.Documentos de Cobro en un

* perĂ­odo

* Lectura de data package para hacer el collect sobre la TI

BREAK-POINT.

LOOP AT DATA_PACKAGE.

MOVE DATA_PACKAGE TO ti_entrada.

COLLECT ti_entrada.

ENDLOOP.

* Calculo del promedio

LOOP AT ti_entrada.

IF NOT ti_entrada-/bic/znumdoc IS INITIAL.

ti_entrada-/bic/zpromedio = ti_entrada-/bic/znumdoct3 /

ti_entrada-/bic/znumdoc.

MODIFY ti_entrada INDEX sy-tabix.

ENDIF.

ENDLOOP.

REFRESH DATA_PACKAGE.

LOOP AT ti_entrada.

MOVE ti_entrada TO DATA_PACKAGE.

APPEND DATA_PACKAGE.

ENDLOOP.

* if abort is not equal zero, the update process will be canceled

ABORT = 0.

*$*$ end of routine - insert your code only before this line *-*

*

ENDFORM.

0 Comments:

Post a Comment

<< Home