Skip to Content
0
Former Member
Dec 14, 2007 at 01:15 PM

We have problems in abap rules when migrate the infosource

72 Views

We are having problems to do the migration of some objects of version

3.x to version 7.

There are some objects standard like Update Rule, InfoSource and

Datasource that when we migrated the rules ABAPS contained in the

Update Rule and Infosource are not migrate properly.

We are using the method of automatic migration that when clicking the

right button on the object, choosing the option additional functions,

create transformation and input the name of the new infosource. The

same way is necessary to migrate the transfer structure. After this we

migrated the Datasource and we tried to activate all objects, but

several erros happened in the abap rules.

Example: In the new Transformation based n Upadate Rule 0PS_C08 in the

key figure 0AMOUNT, the routine show me the follow error:

“E:Field "COMM_STRUCTURE" is unknown. It is neither in one of the

specified tables nor defined by a "DATA" statement. "DATA" statement

"DATA" statement.”

This is one example, but this conversion happened for several

transformations with abap rules.

Which is the recommendation for the standard objects in this case and

the others cases ? For objects Z* there some recommendation too?

Old Routine in Upadte Rule:

"PROGRAM UPDATE_ROUTINE.

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

  • TABLES: ...

  • DATA: ...

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

FORM compute_data_field

TABLES MONITOR STRUCTURE RSMONITOR "user defined monitoring

RESULT_TABLE STRUCTURE /BI0/V0PS_C08T

USING COMM_STRUCTURE LIKE /BIC/CS0CO_OM_NAE_1

RECORD_NO LIKE SY-TABIX

RECORD_ALL LIKE SY-TABIX

SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS

ICUBE_VALUES LIKE /BI0/V0PS_C08T

CHANGING RETURNCODE LIKE SY-SUBRC

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

*

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

type-pools: PSBW1.

data: l_psbw1_type_s_int1 type psbw1_type_s_int1.

data: lt_spread_values type PSBW1_TYPE_T_ACT_SPREAD.

field-symbols: .

  • füllen Rückgabetabelle !

move-corresponding to RESULT_TABLE.

check not RESULT_TABLE-amount is initial.

append RESULT_TABLE.

endloop.

  • 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 -

*

ENDFORM.

"

New Routine - Based on Update - DTP:

"PROGRAM trans_routine.

*----


*

  • CLASS routine DEFINITION

*----


*

*

*----


*

CLASS lcl_transform DEFINITION.

PUBLIC SECTION.

  • Attributs

DATA:

p_check_master_data_exist

TYPE RSODSOCHECKONLY READ-ONLY,

*- Instance for getting request runtime attributs;

  • Available information: Refer to methods of

  • interface 'if_rsbk_request_admintab_view'

p_r_request

TYPE REF TO if_rsbk_request_admintab_view READ-ONLY.

PRIVATE SECTION.

TYPE-POOLS: rsd, rstr.

  • Rule specific types

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

... "insert your code here

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

ENDCLASS. "routine DEFINITION

$$ begin of 2nd part global - insert your code only below this line *

$$ end of rule type

TYPES:

BEGIN OF tys_TG_1_full,

  • InfoObject: 0CHNGID ID de execução de modificação.

CHNGID TYPE /BI0/OICHNGID,

  • InfoObject: 0RECORDTP Categoria de registro.

RECORDTP TYPE /BI0/OIRECORDTP,

  • InfoObject: 0REQUID ID requisição.

REQUID TYPE /BI0/OIREQUID,

  • InfoObject: 0FISCVARNT Variante de exercício.

FISCVARNT TYPE /BI0/OIFISCVARNT,

  • InfoObject: 0FISCYEAR Exercício.

FISCYEAR TYPE /BI0/OIFISCYEAR,

  • InfoObject: 0CURRENCY Código da moeda.

CURRENCY TYPE /BI0/OICURRENCY,

  • InfoObject: 0CO_AREA Área de contabilidade de custos.

CO_AREA TYPE /BI0/OICO_AREA,

  • InfoObject: 0CURTYPE Tipo de moeda.

CURTYPE TYPE /BI0/OICURTYPE,

  • InfoObject: 0METYPE Tipo de índice.

METYPE TYPE /BI0/OIMETYPE,

  • InfoObject: 0VALUATION Perspectiva de avaliação.

VALUATION TYPE /BI0/OIVALUATION,

  • InfoObject: 0VERSION Versão.

VERSION TYPE /BI0/OIVERSION,

  • InfoObject: 0VTYPE Ctg.valor para reporting.

VTYPE TYPE /BI0/OIVTYPE,

  • InfoObject: 0WBS_ELEMT Elemento do plano da estrutura do projeto

*(elemento PEP).

WBS_ELEMT TYPE /BI0/OIWBS_ELEMT,

  • InfoObject: 0COORDER Nº ordem.

COORDER TYPE /BI0/OICOORDER,

  • InfoObject: 0PROJECT Definição do projeto.

PROJECT TYPE /BI0/OIPROJECT,

  • InfoObject: 0ACTIVITY Tarefa do diagrama de rede.

ACTIVITY TYPE /BI0/OIACTIVITY,

  • InfoObject: 0NETWORK Diagrama de rede.

NETWORK TYPE /BI0/OINETWORK,

  • InfoObject: 0PROFIT_CTR Centro de lucro.

PROFIT_CTR TYPE /BI0/OIPROFIT_CTR,

  • InfoObject: 0COMP_CODE Empresa.

COMP_CODE TYPE /BI0/OICOMP_CODE,

  • InfoObject: 0BUS_AREA Divisão.

BUS_AREA TYPE /BI0/OIBUS_AREA,

  • InfoObject: 0ACTY_ELEMT Elemento operação diagram.rede.

ACTY_ELEMT TYPE /BI0/OIACTY_ELEMT,

  • InfoObject: 0STATUSSYS0 Status do sistema.

STATUSSYS0 TYPE /BI0/OISTATUSSYS0,

  • InfoObject: 0PS_OBJ Tipo de objeto do PS.

PS_OBJ TYPE /BI0/OIPS_OBJ,

  • InfoObject: 0VTSTAT Código estatístico para ctg.valor.

VTSTAT TYPE /BI0/OIVTSTAT,

  • InfoObject: 0AMOUNT Montante.

AMOUNT TYPE /BI0/OIAMOUNT,

  • Field: RECORD Nº registro de dados.

RECORD TYPE RSARECORD,

END OF tys_TG_1_full.

  • Additional declaration for update rule interface

DATA:

MONITOR type standard table of rsmonitor WITH HEADER LINE,

MONITOR_RECNO type standard table of rsmonitors WITH HEADER LINE,

RECORD_NO LIKE SY-TABIX,

RECORD_ALL LIKE SY-TABIX,

SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS.

  • global definitions from update rules

  • TABLES: ...

  • DATA: ...

FORM routine_0001

CHANGING

RETURNCODE LIKE sy-subrc

ABORT LIKE sy-subrc

RAISING

cx_sy_arithmetic_error

cx_sy_conversion_error.

  • init variables

  • not supported

  • icube_values = g.

  • CLEAR result_table. REFRESH result_table.

type-pools: PSBW1.

data: l_psbw1_type_s_int1 type psbw1_type_s_int1.

data: lt_spread_values type PSBW1_TYPE_T_ACT_SPREAD.

field-symbols: .

  • füllen Rückgabetabelle !

move-corresponding to RESULT_TABLE.

check not RESULT_TABLE-amount is initial.

append RESULT_TABLE.

endloop.

  • 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.

ENDFORM. "routine_0001

$$ end of 2nd part global - insert your code only before this line *

*----


*

  • CLASS routine IMPLEMENTATION

*----


*

*

*----


*

CLASS lcl_transform IMPLEMENTATION.

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

Data:

*--

l_subrc type sy-tabix,

l_abort type sy-tabix,

ls_monitor TYPE rsmonitor,

ls_monitor_recno TYPE rsmonitors.

REFRESH:

MONITOR.

  • Runtime attributs

SOURCE_SYSTEM = p_r_request->get_logsys( ).

  • Migrated update rule call

Perform routine_0001

CHANGING

l_subrc

l_abort.

*-- Convert Messages in Transformation format

LOOP AT MONITOR INTO ls_monitor.

move-CORRESPONDING ls_monitor to MONITOR_REC.

append monitor_rec to MONITOR.

ENDLOOP.

IF l_subrc <> 0.

RAISE EXCEPTION TYPE cx_rsrout_skip_val.

ENDIF.

IF l_abort <> 0.

RAISE EXCEPTION TYPE CX_RSROUT_ABORT.

ENDIF.

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

ENDMETHOD. "compute_0AMOUNT

*----


*

  • Method invert_0AMOUNT

*----


*

*

  • This subroutine needs to be implemented only for direct access

  • (for better performance) and for the Report/Report Interface

  • (drill through).

  • The inverse routine should transform a projection and

  • a selection for the target to a projection and a selection

  • for the source, respectively.

  • If the implementation remains empty all fields are filled and

  • all values are selected.

*

*----


*

*

*----


*

METHOD invert_0AMOUNT.

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

... "insert your code here

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

ENDMETHOD. "invert_0AMOUNT

"

Please, HELP!!!!

Thanks,

Mateus.