Skip to Content
0
Former Member
Mar 11, 2009 at 06:44 PM

writing Abap in transfer rules

113 Views

hi guys i need to write a routine for object for 0tct_c01 cube..

where ever

BI Application ZJNPROJECT_Q00080_WBS_WT

i want to change it to BW BAC.

as its a character i cannot do this in update rules.

can somebody help me with this code i am not good a abap.. i need to know where to insert it and the right syntax?.

code is below...

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

PROGRAM CONVERSION_ROUTINE.

  • Type pools used by conversion program

TYPE-POOLS: RS, RSARC, RSARR, SBIWA, RSSM.

  • Declaration of transfer structure (selected fields only)

TYPES: BEGIN OF TRANSFER_STRUCTURE ,

  • InfoObject 0TCTSESUID: CHAR - 000025

  • SESSIONUID(000025) TYPE C,

  • InfoObject 0TCTSTEPUID: CHAR - 000025

  • STEPUID(000025) TYPE C,

  • InfoObject 0TCTUSERNM: CHAR - 000012

  • UNAME(000012) TYPE C,

  • InfoObject 0TCTSTEPTP: CHAR - 000004

  • STEPTP(000004) TYPE C,

  • InfoObject 0TCTSTEPCNT: NUMC - 000004

  • STEPCNT(000004) TYPE N,

  • InfoObject 0TCTHANDLID: NUMC - 000004

  • HANDLEID(000004) TYPE N,

  • InfoObject 0TCTUTIME: TIMS - 000006

  • UTIME(000006) TYPE T,

  • InfoObject 0CALDAY: DATS - 000008

  • CALDAY(000008) TYPE D,

  • InfoObject 0TCTRTIMEC: DEC - 000021

  • RUNTIME(000011) TYPE P,

  • InfoObject 0TCTIFPROV: CHAR - 000030

  • INFOPROV(000030) TYPE C,

  • InfoObject 0TCTOBJPROP: CHAR - 000010

  • OBJPROP(000010) TYPE C,

  • InfoObject 0TCTSTATLEV: NUMC - 000001

  • STATLEVEL(000001) TYPE N,

  • InfoObject 0TCTTIMSTMP: DEC - 000021

  • STARTTIME(000011) TYPE P,

  • InfoObject 0TCTIFTYPE: CHAR - 000004

  • INFOPROV_TYPE(000004) TYPE C,

  • InfoObject 0LOGSYS: CHAR - 000010

  • LOGSYS(000010) TYPE C,

  • InfoObject 0TCTBIOBJCT: CHAR - 000040

OBJECT(000040) TYPE C,

  • InfoObject 0TCTBIOTYPE: CHAR - 000004

  • OBJECT_TYPE(000004) TYPE C,

  • InfoObject 0TCTBISBOBJ: CHAR - 000040

SUB_OBJECT(000040) TYPE C,

  • InfoObject 0TCTBISOTYP: CHAR - 000004

  • SUB_OBJECT_TYPE(000004) TYPE C,

  • InfoObject 0TCTTIMEFE: DEC - 000021

  • TIME_FE(000011) TYPE P,

  • InfoObject 0TCTTMEOLAP: DEC - 000021

  • TIME_OLAP(000011) TYPE P,

  • InfoObject 0TCTTIMEDM: DEC - 000021

  • TIME_DM(000011) TYPE P,

  • InfoObject 0TCTTMEPLAN: DEC - 000021

  • TIME_PLAN(000011) TYPE P,

  • InfoObject 0TCTTIMENA: DEC - 000021

  • TIME_NOTASSIGNED(000011) TYPE P,

  • InfoObject 0TCTTIMEALL: DEC - 000021

  • TIME_OVERALL(000011) TYPE P,

  • InfoObject 0TCTHOURSLT: NUMC - 000002

  • HOUR_SLOT(000002) TYPE N,

  • InfoObject : DEC - 000015

  • RUNTIME_CATEGORY(000008) TYPE P,

  • InfoObject 0TCTQUCOUNT: INT4 - 000010

  • QUERY_COUNTER(000004) TYPE I,

  • InfoObject 0TCTWTCOUNT: INT4 - 000010

  • TEMPLATE_COUNTER(000004) TYPE I,

  • InfoObject 0TCTDBTRANS: DEC - 000021

  • DBTRANS(000011) TYPE P,

  • InfoObject 0TCTDBSEL: DEC - 000021

  • DBSEL(000011) TYPE P,

END OF TRANSFER_STRUCTURE .

  • Global code used by conversion rules

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

  • TABLES: ..

  • DATA: ...

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

----


  • FORM COMPUTE_TCTBIOBJCT

----


  • Compute value of InfoObject 0TCTBIOBJCT

  • in communication structure /BIC/CS0TCT_IS01

*

  • Technical properties:

  • field name = TCTBIOBJCT

  • data element = /BI0/OITCTBIOBJCT

  • data type = CHAR

  • length = 000045

  • decimals = 000000

  • ABAP type = C

  • ABAP length = 000045

  • reference field =

----


  • Parameters:

  • --> RECORD_NO Record number

  • --> TRAN_STRUCTURE Transfer structure

  • <-- RESULT Return value of InfoObject

  • <-> G_T_ERRORLOG Error log

  • <-- RETURNCODE Return code (to skip one record)

  • <-- ABORT Abort code (to skip whole data package)

----


FORM COMPUTE_TCTBIOBJCT

USING RECORD_NO LIKE SY-TABIX

TRAN_STRUCTURE TYPE TRANSFER_STRUCTURE

G_S_MINFO TYPE RSSM_S_MINFO

CHANGING RESULT TYPE /BI0/OITCTBIOBJCT

G_T_ERRORLOG TYPE rssm_t_errorlog_int

RETURNCODE LIKE SY-SUBRC

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

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

  • DATA: l_s_errorlog TYPE rssm_s_errorlog_int.

break-point .

  • RESULT = .

  • returncode <> 0 means skip this record

  • RETURNCODE = 0.

    • abort <> 0 means skip whole data package !!!

  • ABORT = 0.

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

    ENDFORM.

    ----


    • FORM INVERT_TCTBIOBJCT

    ----


    • Inversion of selection criteria for InfoObject 0TCTBIOBJCT

    *

    • This subroutine needs to be implemented only for SAP RemoteCubes

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

    • (drill through).

    *

    ----


    • --> I_RT_CHAVL_CS Ranges table for current InfoObject

    • --> I_THX_SELECTION_CS Selection criteria for all other InfoObjects

    • <-- C_T_SELECTION Selection criteria for fields of

    • transfer structure

    • <-- E_EXACT Flag: Inversion was exact

    ----


    FORM INVERT_TCTBIOBJCT

    USING I_RT_CHAVL_CS TYPE RSARC_RT_CHAVL

    I_THX_SELECTION_CS TYPE RSARC_THX_SELCS

    CHANGING C_T_SELECTION TYPE SBIWA_T_SELECT

    E_EXACT TYPE RS_BOOL.

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

    DATA:

    L_S_SELECTION LIKE LINE OF C_T_SELECTION.

    • An empty selection means all values

    CLEAR C_T_SELECTION.

    L_S_SELECTION-FIELDNM = 'OBJECT'.

    • ...

    • Selection of all values may be not exact

    E_EXACT = RS_C_FALSE.

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

    ENDFORM.