Tuesday, April 24, 2007

De SAPFANS - Debugg desde PSA

I have written code in Start Routine and for few characteristics and key figure fields in the update routine. I am getting wrong values in ODS data.

I want to debug Start routine and fields of update routine.
Could any one of you suggest how to debug the Start routine and update routine code ???



Respuestas:

Or have a look at help.sap.com. In short: Go to the monitor, right-click a data package and choose simulate update. The rest should be pretty self-explanatory


Hi there,
try simulate update option with breakpoints in the routines. You can only use it when updating via PSA.

You can insert an endless loop in the beginning of your start routine or update rule routine, for example:

DATA: x(1) type c.

x = 1.
While x = 1.
Endwhile.

Then you execute your load. Go to transaction sm50 in your BW system and when you see that your process keeps hanging, you go to Program/Mode > Program > Debugging. Then you come into your code

De SAPFANS - Debugg query

Hi,
is ther a way to bebug the Bex exit. I tried to set break-point in the code and when tried to debug seems like it doesnt go there.

please let me know if this possible

Set your break point, and then execute the same query into BW, not with the Bex. For that, use transaction RSRT or RSRT1.

Creando Sistemas Externos (creando conexión sistemas fuentes)

You can specify the type of source system in the Administrator Workbench in the source system tree with the Create function.

You can make the settings for the logical system name in the BW Customizing Implementation Guide under Business Information Warehouse à Connections to other Systems à General Connection Settings. In the source system, you will find the settings for the logical system in the Implementation Guide under Cross Application Components à Distribution (ALE) à Basic Settings

Creating External Systems

Prerequisites

  1. You have made the following settings in the BW Customizing Implementation Guide under Business Information Warehouse ® Connections to other Systems.
    • General connection settings,
    • Verify workflow customizing.
  1. As a rule, no system changes are permitted in productive systems at all. Connecting a system as a source system to a BW or connecting a BW to a new source system will, however, mean changes as far as the system change option is concerned. For the clients concerned in the BW system therefore, you have made sure that the following changes are permitted during the source system connection.
      • Cross-client Customizing and Repository changes

In the BW Customizing Implementation Guide, select the relevant client under Business Information Warehouse ® Connections to Other Systems ® General Connection Settings ® Assign Logical System to Client, then choose Goto ® Detail. Choose the entry Changes to Repository and Cross-Client Customizing Permitted in the field Changes to Cross-Client Objects.

      • Changes to the software components local developments and Business Information Warehouse.

You can set up the changeability with Transaction SE03 (Organizer Tools). Choose Organizer Tools ® Administration ® Set Up System Change Option, then Execute. Make the settings in the subsequent screen.

      • Changes in the customer name range

Again, you can set up the changeability for the customer name area with Transaction SE03.

      • Changes to BW namespaces /BIC/ and /BI0/

Again, you can set up the changeability of the BW namespace with Transaction SE03.

Procedure

  1. In the BW Administrator Workbench, choose Source system tree ® Context menu (right mouse button) ® Create, and select the radio button for creating an external system.
  2. Enter a name and a description.
  3. For your extraction tool, maintain the destination that is to be referred to when loading data from BW.

Result

When you use the created destinations, the ALE settings that are necessary for communication between a BW system and an external system, are created in BW in the background. The BW settings in BW are created to a new link.

See also:

Maintaining InfoSources (External System)

Autorización para transporte de Roles

Si desea transportar los roles debe actualizar la autorización para el transporte de roles . El usuario requiere el objeto de autorización S_USER_AGR con la actividad "Transportar" (21) para los roles correspondientes.

1. Llame a la actualización de roles (PFCG)

2. Seleccione el rol deseado

3. Seleccione Modificar

4. Seleccionar en la tarjeta de registro Autorizaciones la función Modificar datos de autorización

5. Seleccione + Manualmente

6. Indique el objeto de autorización S_USER_AGR.

7. Seleccione Basis - Administración -> Autorizaciones: Verificación de roles.

8. Seleccione al bajo Actividad al menos el valor 21 para la actividad Transportar.

9. Indique bajo Nombre de rol el rol (los roles) o "*".

Agunas Notas OSS

Algunas notas:

646883 las PI de CO y PS R/3 no coinciden con las partidas totales en Bw

355432 RRI: incorrect call of report transactions 2

331843 RRI: incorrect call of report transactions

Verifica los días hábiles desde un calendario en BW


PROGRAM UPDATE_ROUTINE.

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

* TABLES: ...

* Rutina para validar Dias Habiles

*TYPES: BEGIN OF ti_estruc,

* /bic/zfecfin LIKE /bic/cs8z_ss_0025-/bic/zfecfin,

* /bic/zfecini LIKE /bic/cs8z_ss_0025-/bic/zfecini,

* /bic/zfecterm LIKE /bic/cs8z_ss_0025-/bic/zfecterm,

* /bic/zrecmots LIKE /bic/cs8z_ss_0025-/bic/zrecmots,

* /bic/zrecresul LIKE /bic/cs8z_ss_0025-/bic/zrecresul,

* /bic/zrectpo LIKE /bic/cs8z_ss_0025-/bic/zrectpo,

* /bic/zrutemp LIKE /bic/cs8z_ss_0025-/bic/zrutemp,

* /bic/zlocalid LIKE /bic/cs8z_ss_0025-/bic/zlocalid.

*TYPES:

*recno LIKE sy-tabix,

*conta(04) TYPE n,

*END OF ti_estruc.

*

*DATA: ti_entradas TYPE STANDARD TABLE OF ti_estruc WITH HEADER LINE

* WITH NON-UNIQUE DEFAULT KEY INITIAL SIZE 0.

*

*TYPES:

* BEGIN OF data_package_copy.

* INCLUDE STRUCTURE /bic/cs8z_ss_0025.

*TYPES:

* recno LIKE sy-tabix,

* END OF data_package_copy.

*DATA:

* data_package_copy TYPE STANDARD TABLE OF data_package_copy

* WITH HEADER LINE

* WITH NON-UNIQUE DEFAULT KEY INITIAL SIZE 0.

DATA: lc_dias TYPE i, " Numero de dias entre fechas

lc_diash TYPE i, " Numero de dias habiles

lc_fecha LIKE sy-datum, " Fecha para funcion

lc_indic LIKE scal-indicator, " Indicador de dia habil

lc_tabix LIKE sy-tabix.

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

FORM compute_data_field

TABLES MONITOR STRUCTURE RSMONITOR "user defined monitoring

USING COMM_STRUCTURE LIKE /BIC/CS8Z_SS_0025

RECORD_NO LIKE SY-TABIX

RECORD_ALL LIKE SY-TABIX

SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS

CHANGING RESULT LIKE /BIC/VZSSI_CO04T-/BIC/ZDIAS_HAB

RETURNCODE LIKE SY-SUBRC

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

*

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

* fill the internal table "MONITOR", to make monitor entries

*++++++++++++++++ Inicio de Rutina

* LOOP AT DATA_PACKAGE.

CLEAR: lc_dias, lc_diash.

* lc_tabix = sy-tabix.

* Restar fechas

lc_dias = COMM_STRUCTURE-/bic/zfecfin - COMM_STRUCTURE-/bic/zfecini.

ADD 1 TO lc_dias.

* Asignar fecha inicial a variable local

lc_fecha = COMM_STRUCTURE-/bic/zfecini.

* Ciclo de búsqueda de Días Habiles dentro del periodo

DO lc_dias TIMES.

CALL FUNCTION 'DATE_CONVERT_TO_FACTORYDATE'

EXPORTING

correct_option = '+'

date = lc_fecha

factory_calendar_id = 'CL'

IMPORTING

workingday_indicator = lc_indic

EXCEPTIONS

calendar_buffer_not_loadable = 1

correct_option_invalid = 2

date_after_range = 3

date_before_range = 4

date_invalid = 5

factory_calendar_not_found = 6

OTHERS = 7.

* Comparación de Día Habil

IF lc_indic IS INITIAL.

ADD 1 TO lc_diash.

ENDIF.

* Incrementar fecha

ADD 1 TO lc_fecha.

ENDDO.

RESULT = lc_diash.

* MODIFY DATA_PACKAGE.

* ENDLOOP.

* result value of the routine

* RESULT = .

* if the returncode is not equal zero, the result will not be updated

RETURNCODE = 0.

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

ABORT = 0.

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

*

El calendario se parametriza en SPRO de BW:





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.