BW-ABAP start routine code logic

Hello friends,
I am writing start rotine code between ODS and InfoCube.I need your help determining the right logic.
Requirement is as follows.
1. Create one database table to store GL account ranges.
2. This table will have multiple ranges of GL account.
3. Write a code such a way that only GL acc. range in this table is included and  
    all the other records containing GL acc. outside this range should be deleted.
Here is the logic which I have developed.
Please help me with your suggestion.
Message was edited by:
        John Anderson

Hi John,
   I did not check the syntax of this program and I am very bad at remembering the syntax. Let me know if you face any problem with the code I am supplying.
Code removed ....
Best Regards,
Kazmi
Message was edited by:
        Kazmi

Similar Messages

  • BW 3.5 Start Routine Start Routine Code

    Hi,
    I am writing a Start Routine in BW 3.5 and the logic we have seems to be working but not updating the target ods. We are adding a date field to the target ODS and need to source it from another ODS.  The key structures for each ods is different
    Taget ODS:
    Header
    Line ITem
    Schedule Line
    Source ODS:
    Header
    Line Item
    When we run the start routine the date field will not update for the schedule lines, it will create a new record in the target ods with the Header Line ITem and Date.
    Has anyone had to code this logic before in a 3.5 Start Routine, where you needed to update a date field with ODS with different key strucutures.
    Thanks for any help on this issue.

    Its difficult in BW 3.5 to include this logic in START_ROUTINE as you cannot add the extra to_date field to the DATA_PACKAGE table.
    You need to create a new global internal table with the same structure of DATA_PACKAGE with additional field to_date. then use the logic to fill in the global internal table
    define a internal table new_data_package with the required structure like (docno, eventtype, fromdate todate)
    data: l_w_datapkg_001 type data_package,
    data: l_w_newdatapkg type new_data_package,
    data: l_w_datapkg_011 type data_package
    LOOP AT DATA_PACKAGE INTO l_w_datapkg_001 WHERE event_type = '001'.
    l_w_newdatapkg-docno = l_w_datapkg_001-docno.
    l_w_newdatapkg-event_type = l_w_datapkg_001-event_type.
    l_w_newdatapkg-fromdate = l_w_datapkg_001-date.
    MOVE CORRESPONDING FIELDS OF l_w_datapkg_001 INTO l_w_newdatapkg.
    READ TABLE data_package INTO l_w_datapkg_011
    WITH KEY docno = l_w_datapkg_001-docno
                     event_type = '011'.
    l_w_newdatapkg-to_date = l_w_datapkg_011-date.
    APPEND l_w_newdatapkg TO new_data_package          
    ENDLOOP.
    Now the new datapackage contains the ODS2 data that u needed

  • Start Routine code error of Perform routine 9998

    Hi,
    I have install standard and then migrate to 7.0 all the flow of modeling.
    but after loading data in PSA, while activation i will found following problem (error in routine).
    In PERFORM or CALL FUNCTION ROUTINE_9998, the actual parameter SOURCE_PACKAGE is incompatible with the formal parameter DATA_PACKAGE.
    please suggest me.

    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
        TYPES:
          BEGIN OF tys_SC_1,
         InfoObject: 0MPOINT Measuring point.
            MPOINT           TYPE /BI0/OIMPOINT,
         InfoObject: 0MDOC Measurement Document.
            MDOC           TYPE /BI0/OIMDOC,
         InfoObject: 0MPOBJ Object Number of Measuring Point Object.
            MPOBJ           TYPE /BI0/OIMPOBJ,
         InfoObject: 0MPTYP Type of Measuring Point.
            MPTYP           TYPE /BI0/OIMPTYP,
         InfoObject: 0PSORT Position Number of Measuring Point in Object (
    *Sort Field).
            PSORT           TYPE /BI0/OIPSORT,
         InfoObject: 0ASSEMBLY Assembly.
            ASSEMBLY           TYPE /BI0/OIASSEMBLY,
         InfoObject: 0ATINN Internal Characteristic Number.
            ATINN           TYPE /BI0/OIATINN,
         InfoObject: 0MDATE Date of Measurement.
            MDATE           TYPE /BI0/OIMDATE,
         InfoObject: 0TIME Time.
            TIME           TYPE /BI0/OITIME,
         InfoObject: 0DESIRSI Target Value for Measuring Point in SI Unit.
            DESIRSI           TYPE /BI0/OIDESIRSI,
         InfoObject: 0TVIND Target Value for Measuring Point Is Defined.
            TVIND           TYPE /BI0/OITVIND,
         InfoObject: 0MRMINI Lower Measurement Area Limit Is Defined.
            MRMINI           TYPE /BI0/OIMRMINI,
         InfoObject: 0MRMINSI Lower Meas. Limit or Min. Total Counter Read
    *ing in SI Unit.
            MRMINSI           TYPE /BI0/OIMRMINSI,
         InfoObject: 0MRMAXI Upper Measurement Area Limit Is Defined.
            MRMAXI           TYPE /BI0/OIMRMAXI,
         InfoObject: 0SIUNIT SI unit.
            SIUNIT           TYPE /BI0/OISIUNIT,
         InfoObject: 0CJUMPSI Counter Overflow Reading in SI Unit.
            CJUMPSI           TYPE /BI0/OICJUMPSI,
         InfoObject: 0PYEARSI Annual Performance in SI Unit.
            PYEARSI           TYPE /BI0/OIPYEARSI,
         InfoObject: 0CREATED_BY Created By.
            CREATED_BY           TYPE /BI0/OICREATED_BY,
         InfoObject: 0READSI Measured Value/Total Counter Reading in SI Un
    *it.
            READSI           TYPE /BI0/OIREADSI,
         InfoObject: 0READEU Measured Value in Document Entry Unit.
            READEU           TYPE /BI0/OIREADEU,
         InfoObject: 0RECDU Unit of Measurement for Document Entry.
            RECDU           TYPE /BI0/OIRECDU,
         InfoObject: 0CNTRRSI Counter Reading in SI Unit.
            CNTRRSI           TYPE /BI0/OICNTRRSI,
         InfoObject: 0CDIFFSI Counter Reading Difference in SI Unit.
            CDIFFSI           TYPE /BI0/OICDIFFSI,
         InfoObject: 0CAT_TYPE Catalog.
            CAT_TYPE           TYPE /BI0/OICAT_TYPE,
         InfoObject: 0CAT_GROUP Code group.
            CAT_GROUP           TYPE /BI0/OICAT_GROUP,
         InfoObject: 0FI_STATUS Processing Status.
            FI_STATUS           TYPE /BI0/OIFI_STATUS,
         InfoObject: 0DIM_ID Dimension Key.
            DIM_ID           TYPE /BI0/OIDIM_ID,
         InfoObject: 0CNTIND Measuring Point is Counter.
            CNTIND           TYPE /BI0/OICNTIND,
         InfoObject: 0EQUIPMENT Equipment Number.
            EQUIPMENT           TYPE /BI0/OIEQUIPMENT,
         InfoObject: 0FUNCT_LOC Functional Location.
            FUNCT_LOC           TYPE /BI0/OIFUNCT_LOC,
         InfoObject: 0CAT_CODE Code.
            CAT_CODE           TYPE /BI0/OICAT_CODE,
         InfoObject: 0MRMAXSI Upper Meas. Limit or Max. Total Counter Read
    *ing in SI Unit.
            MRMAXSI           TYPE /BI0/OIMRMAXSI,
         InfoObject: 0DOCAF Measurement Document Included for Associated T
    *ask.
            DOCAF           TYPE /BI0/OIDOCAF,
         InfoObject: 0RECORDMODE BW Delta Process: Update Mode.
            RECORDMODE           TYPE RODMUPDMOD,
         InfoObject: ZSTEXT Object Number Text.
            /BIC/ZSTEXT           TYPE /BIC/OIZSTEXT,
         Field: RECORD.
            RECORD           TYPE RSARECORD,
          END   OF tys_SC_1.
        TYPES:
          tyt_SC_1        TYPE STANDARD TABLE OF tys_SC_1
                            WITH NON-UNIQUE DEFAULT KEY.
    $$ begin of global - insert your declaration only below this line  -
        ... "insert your code here
    $$ end of global - insert your declaration only before this line   -
        METHODS
          start_routine
            IMPORTING
              request                  type rsrequest
              datapackid               type rsdatapid
            EXPORTING
              monitor                  type rstr_ty_t_monitors
            CHANGING
              SOURCE_PACKAGE              type tyt_SC_1
            RAISING
              cx_rsrout_abort.
        METHODS
          inverse_start_routine
            IMPORTING
              i_th_fields_outbound         TYPE rstran_t_field_inv
              i_r_selset_outbound          TYPE REF TO cl_rsmds_set
              i_is_main_selection          TYPE rs_bool
              i_r_selset_outbound_complete TYPE REF TO cl_rsmds_set
              i_r_universe_inbound         TYPE REF TO cl_rsmds_universe
            CHANGING
              c_th_fields_inbound          TYPE rstran_t_field_inv
              c_r_selset_inbound           TYPE REF TO cl_rsmds_set
              c_exact                      TYPE rs_bool.
    ENDCLASS.                    "routine DEFINITION
    $$ begin of 2nd part global - insert your code only below this line  *
    TYPES:
      BEGIN OF tys_SC_1_full,
         InfoObject: 0MPOINT Measuring point.
        MPOINT           TYPE /BI0/OIMPOINT,
         InfoObject: 0MDOC Measurement Document.
        MDOC           TYPE /BI0/OIMDOC,
         InfoObject: 0MPOBJ Object Number of Measuring Point Object.
        MPOBJ           TYPE /BI0/OIMPOBJ,
         InfoObject: 0MPTYP Type of Measuring Point.
        MPTYP           TYPE /BI0/OIMPTYP,
         InfoObject: 0PSORT Position Number of Measuring Point in Object (
    *Sort Field).
        PSORT           TYPE /BI0/OIPSORT,
         InfoObject: 0ASSEMBLY Assembly.
        ASSEMBLY           TYPE /BI0/OIASSEMBLY,
         InfoObject: 0ATINN Internal Characteristic Number.
        ATINN           TYPE /BI0/OIATINN,
         InfoObject: 0MDATE Date of Measurement.
        MDATE           TYPE /BI0/OIMDATE,
         InfoObject: 0TIME Time.
        TIME           TYPE /BI0/OITIME,
         InfoObject: 0DESIRSI Target Value for Measuring Point in SI Unit.
        DESIRSI           TYPE /BI0/OIDESIRSI,
         InfoObject: 0TVIND Target Value for Measuring Point Is Defined.
        TVIND           TYPE /BI0/OITVIND,
         InfoObject: 0MRMINI Lower Measurement Area Limit Is Defined.
        MRMINI           TYPE /BI0/OIMRMINI,
         InfoObject: 0MRMINSI Lower Meas. Limit or Min. Total Counter Read
    *ing in SI Unit.
        MRMINSI           TYPE /BI0/OIMRMINSI,
         InfoObject: 0MRMAXI Upper Measurement Area Limit Is Defined.
        MRMAXI           TYPE /BI0/OIMRMAXI,
         InfoObject: 0SIUNIT SI unit.
        SIUNIT           TYPE /BI0/OISIUNIT,
         InfoObject: 0CJUMPSI Counter Overflow Reading in SI Unit.
        CJUMPSI           TYPE /BI0/OICJUMPSI,
         InfoObject: 0PYEARSI Annual Performance in SI Unit.
        PYEARSI           TYPE /BI0/OIPYEARSI,
         InfoObject: 0CREATED_BY Created By.
        CREATED_BY           TYPE /BI0/OICREATED_BY,
         InfoObject: 0READSI Measured Value/Total Counter Reading in SI Un
    *it.
        READSI           TYPE /BI0/OIREADSI,
         InfoObject: 0READEU Measured Value in Document Entry Unit.
        READEU           TYPE /BI0/OIREADEU,
         InfoObject: 0RECDU Unit of Measurement for Document Entry.
        RECDU           TYPE /BI0/OIRECDU,
         InfoObject: 0CNTRRSI Counter Reading in SI Unit.
        CNTRRSI           TYPE /BI0/OICNTRRSI,
         InfoObject: 0CDIFFSI Counter Reading Difference in SI Unit.
        CDIFFSI           TYPE /BI0/OICDIFFSI,
         InfoObject: 0CAT_TYPE Catalog.
        CAT_TYPE           TYPE /BI0/OICAT_TYPE,
         InfoObject: 0CAT_GROUP Code group.
        CAT_GROUP           TYPE /BI0/OICAT_GROUP,
         InfoObject: 0FI_STATUS Processing Status.
        FI_STATUS           TYPE /BI0/OIFI_STATUS,
         InfoObject: 0DIM_ID Dimension Key.
        DIM_ID           TYPE /BI0/OIDIM_ID,
         InfoObject: 0CNTIND Measuring Point is Counter.
        CNTIND           TYPE /BI0/OICNTIND,
         InfoObject: 0EQUIPMENT Equipment Number.
        EQUIPMENT           TYPE /BI0/OIEQUIPMENT,
         InfoObject: 0FUNCT_LOC Functional Location.
        FUNCT_LOC           TYPE /BI0/OIFUNCT_LOC,
         InfoObject: 0CAT_CODE Code.
        CAT_CODE           TYPE /BI0/OICAT_CODE,
         InfoObject: 0MRMAXSI Upper Meas. Limit or Max. Total Counter Read
    *ing in SI Unit.
        MRMAXSI           TYPE /BI0/OIMRMAXSI,
         InfoObject: 0DOCAF Measurement Document Included for Associated T
    *ask.
        DOCAF           TYPE /BI0/OIDOCAF,
         InfoObject: 0RECORDMODE BW Delta Process: Record Mode.
        RECORDMODE           TYPE RODMUPDMOD,
         Field: RECNO Data record number.
        RECNO           TYPE RSARECORD,
      END   OF tys_SC_1_full.
    TYPES:
      tyt_SC_1_full        TYPE STANDARD TABLE OF tys_SC_1_full
                        WITH NON-UNIQUE DEFAULT KEY.
    TYPES:
      BEGIN OF tys_TG_1_full,
         Field: SID Master data ID.
        SID           TYPE RSSID,
         Field: DATAPAKID Data packet number.
        DATAPAKID           TYPE RSDATAPID,
         Field: RECORD Data record number.
        RECORD           TYPE RSARECORD,
         InfoObject: 0MPOINT Measuring point.
        MPOINT           TYPE /BI0/OIMPOINT,
         InfoObject: 0MDOC Measurement Document.
        MDOC           TYPE /BI0/OIMDOC,
         InfoObject: 0MRMINSI Lower Meas. Limit or Min. Total Counter Read
    *ing in SI Unit.
        MRMINSI           TYPE /BI0/OIMRMINSI,
         InfoObject: 0FI_STATUS Processing Status.
        FI_STATUS           TYPE /BI0/OIFI_STATUS,
         InfoObject: 0DIM_ID Dimension Key.
        DIM_ID           TYPE /BI0/OIDIM_ID,
         InfoObject: 0CNTIND Measuring Point is Counter.
        CNTIND           TYPE /BI0/OICNTIND,
         InfoObject: 0EQUIPMENT Equipment Number.
        EQUIPMENT           TYPE /BI0/OIEQUIPMENT,
         InfoObject: 0FUNCT_LOC Functional Location.
        FUNCT_LOC           TYPE /BI0/OIFUNCT_LOC,
         InfoObject: 0CAT_CODE Code.
        CAT_CODE           TYPE /BI0/OICAT_CODE,
         InfoObject: 0CAT_TYPE Catalog.
        CAT_TYPE           TYPE /BI0/OICAT_TYPE,
         InfoObject: 0CAT_GROUP Code group.
        CAT_GROUP           TYPE /BI0/OICAT_GROUP,
         InfoObject: 0CREATED_BY Created By.
        CREATED_BY           TYPE /BI0/OICREATED_BY,
         InfoObject: 0MPOBJ Object Number of Measuring Point Object.
        MPOBJ           TYPE /BI0/OIMPOBJ,
         InfoObject: 0READEU Measured Value in Document Entry Unit.
        READEU           TYPE /BI0/OIREADEU,
         InfoObject: 0CJUMPSI Counter Overflow Reading in SI Unit.
        CJUMPSI           TYPE /BI0/OICJUMPSI,
         InfoObject: 0PYEARSI Annual Performance in SI Unit.
        PYEARSI           TYPE /BI0/OIPYEARSI,
         InfoObject: 0PSORT Position Number of Measuring Point in Object (
    *Sort Field).
        PSORT           TYPE /BI0/OIPSORT,
         InfoObject: 0ASSEMBLY Assembly.
        ASSEMBLY           TYPE /BI0/OIASSEMBLY,
         InfoObject: 0ATINN Internal Characteristic Number.
        ATINN           TYPE /BI0/OIATINN,
         InfoObject: 0MDATE Date of Measurement.
        MDATE           TYPE /BI0/OIMDATE,
         InfoObject: 0TIME Time.
        TIME           TYPE /BI0/OITIME,
         InfoObject: 0TVIND Target Value for Measuring Point Is Defined.
        TVIND           TYPE /BI0/OITVIND,
         InfoObject: 0MRMINI Lower Measurement Area Limit Is Defined.
        MRMINI           TYPE /BI0/OIMRMINI,
         InfoObject: 0DESIRSI Target Value for Measuring Point in SI Unit.
        DESIRSI           TYPE /BI0/OIDESIRSI,
         InfoObject: 0SIUNIT SI unit.
        SIUNIT           TYPE /BI0/OISIUNIT,
         InfoObject: 0DESIREU Target Value for Measuring Point in Document
    Entry Unit.
        DESIREU           TYPE /BI0/OIDESIREU,
         InfoObject: 0CNTRRSI Counter Reading in SI Unit.
        CNTRRSI           TYPE /BI0/OICNTRRSI,
         InfoObject: 0CDIFFSI Counter Reading Difference in SI Unit.
        CDIFFSI           TYPE /BI0/OICDIFFSI,
         InfoObject: 0RECDU Unit of Measurement for Document Entry.
        RECDU           TYPE /BI0/OIRECDU,
         InfoObject: 0MRMINEU Lower Meas. Limit or Min. Total Counter Read
    *ing Document UoM.
        MRMINEU           TYPE /BI0/OIMRMINEU,
         InfoObject: 0MRMAXEU Upper Meas. Limit or Max. Total Counter Read
    *ing in Doc. M.U..
        MRMAXEU           TYPE /BI0/OIMRMAXEU,
         InfoObject: 0MRMAXI Upper Measurement Area Limit Is Defined.
        MRMAXI           TYPE /BI0/OIMRMAXI,
         InfoObject: 0CNTRREU Counter Reading in Document Entry Unit.
        CNTRREU           TYPE /BI0/OICNTRREU,
         InfoObject: 0CDIFFEU Counter Reading Difference in Document Entry
    Unit.
        CDIFFEU           TYPE /BI0/OICDIFFEU,
         InfoObject: 0RECORDMODE BW Delta Process: Record Mode.
        RECORDMODE           TYPE RODMUPDMOD,
         InfoObject: 0MRMAXSI Upper Meas. Limit or Max. Total Counter Read
    *ing in SI Unit.
        MRMAXSI           TYPE /BI0/OIMRMAXSI,
         InfoObject: 0READSI Measured Value/Total Counter Reading in SI Un
    *it.
        READSI           TYPE /BI0/OIREADSI,
      END   OF tys_TG_1_full.
    TYPES:
      BEGIN OF tys_SC_1__RULE_34,
         InfoObject: 0DESIRSI Target Value for Measuring Point in SI Unit.
        DESIRSI           TYPE /BI0/OIDESIRSI,
         InfoObject: 0TVIND Target Value for Measuring Point Is Defined.
        TVIND           TYPE /BI0/OITVIND,
         InfoObject: 0SIUNIT SI unit.
        SIUNIT           TYPE /BI0/OISIUNIT,
         InfoObject: 0RECDU Unit of Measurement for Document Entry.
        RECDU           TYPE /BI0/OIRECDU,
         Field: RECORD.
        RECORD           TYPE RSARECORD,
      END   OF tys_SC_1__RULE_34.
    TYPES:
      BEGIN OF tys_SC_1__RULE_35,
         InfoObject: 0MRMINI Lower Measurement Area Limit Is Defined.
        MRMINI           TYPE /BI0/OIMRMINI,
         InfoObject: 0MRMINSI Lower Meas. Limit or Min. Total Counter Read
    *ing in SI Unit.
        MRMINSI           TYPE /BI0/OIMRMINSI,
         InfoObject: 0SIUNIT SI unit.
        SIUNIT           TYPE /BI0/OISIUNIT,
         InfoObject: 0RECDU Unit of Measurement for Document Entry.
        RECDU           TYPE /BI0/OIRECDU,
         Field: RECORD.
        RECORD           TYPE RSARECORD,
      END   OF tys_SC_1__RULE_35.
    TYPES:
      BEGIN OF tys_SC_1__RULE_36,
         InfoObject: 0MRMAXI Upper Measurement Area Limit Is Defined.
        MRMAXI           TYPE /BI0/OIMRMAXI,
         InfoObject: 0SIUNIT SI unit.
        SIUNIT           TYPE /BI0/OISIUNIT,
         InfoObject: 0RECDU Unit of Measurement for Document Entry.
        RECDU           TYPE /BI0/OIRECDU,
         InfoObject: 0MRMAXSI Upper Meas. Limit or Max. Total Counter Read
    *ing in SI Unit.
        MRMAXSI           TYPE /BI0/OIMRMAXSI,
         Field: RECORD.
        RECORD           TYPE RSARECORD,
      END   OF tys_SC_1__RULE_36.
    TYPES:
      BEGIN OF tys_SC_1__RULE_37,
         InfoObject: 0SIUNIT SI unit.
        SIUNIT           TYPE /BI0/OISIUNIT,
         InfoObject: 0RECDU Unit of Measurement for Document Entry.
        RECDU           TYPE /BI0/OIRECDU,
         InfoObject: 0CNTRRSI Counter Reading in SI Unit.
        CNTRRSI           TYPE /BI0/OICNTRRSI,
         InfoObject: 0CNTIND Measuring Point is Counter.
        CNTIND           TYPE /BI0/OICNTIND,
         Field: RECORD.
        RECORD           TYPE RSARECORD,
      END   OF tys_SC_1__RULE_37.
    TYPES:
      BEGIN OF tys_SC_1__RULE_38,
         InfoObject: 0SIUNIT SI unit.
        SIUNIT           TYPE /BI0/OISIUNIT,
         InfoObject: 0RECDU Unit of Measurement for Document Entry.
        RECDU           TYPE /BI0/OIRECDU,
         InfoObject: 0CDIFFSI Counter Reading Difference in SI Unit.
        CDIFFSI           TYPE /BI0/OICDIFFSI,
         InfoObject: 0CNTIND Measuring Point is Counter.
        CNTIND           TYPE /BI0/OICNTIND,
         Field: RECORD.
        RECORD           TYPE RSARECORD,
      END   OF tys_SC_1__RULE_38.
    Additional types for start routine interface
    TYPES:
      data_package_structure type tys_SC_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:   ...
    *******DATA:  G_T_0EQUIPMENT  TYPE STANDARD TABLE OF /BI0/MEQUIPMENT.
    data: lt_data type ref to data.
    data: ls_data type ref to data.
    field-symbols: <G_T_0EQUIPMENT> type standard table.
    field-symbols: <G_S_0EQUIPMENT> type any.
    field-symbols: <FUNCT_LOC> type any.
    field-symbols: <DATEFROM> type any.
    field-symbols: <DATETO> type any.
    constants: c_tabname type rstlogotab value '/BI0/MEQUIPMENT'.
    *&      Form  routine_9998
          text
         -->DATA_PACKAGE            text
         -->ABORT                   text
         -->RAISING                 text
         -->CX_SY_ARITHMETIC_ERROR  text
         -->CX_SY_CONVERSION_ERROR  text
    FORM routine_9998
      TABLES DATA_PACKAGE TYPE tyt_SC_1_full
      CHANGING
        ABORT          LIKE sy-subrc
      RAISING
        cx_sy_arithmetic_error
        cx_sy_conversion_error.
    init variables
    fill the internal tables "MONITOR" and/or "MONITOR_RECNO",
    to make monitor entries
    In this start routine missing functional location for
    an equipment is added to a Data Package record, if it is available
    in the master data of the equipment
      create data lt_data type table of (c_tabname).
      assign lt_data->* to <G_T_0EQUIPMENT>.
      create data ls_data type (c_tabname).
      assign ls_data->* to <G_S_0EQUIPMENT>.
      assign component 'FUNCT_LOC' of structure <G_S_0EQUIPMENT> to
    <FUNCT_LOC>.
      assign component 'DATE_FROM' of structure <G_S_0EQUIPMENT> to
    <DATEFROM>.
      assign component 'DATE_TO' of structure <G_S_0EQUIPMENT> to
    <DATETO>.
      CALL FUNCTION 'RSAU_READ_MASTER_DATA'
        EXPORTING
          I_IOBJNM                = '0EQUIPMENT'
          I_FLG_WHOLE_TABLE       = 'X'
        IMPORTING
          E_TABLE                 = <G_T_0EQUIPMENT>
        EXCEPTIONS
          READ_ERROR              = 1
          NO_SUCH_ATTRIBUTE       = 2
          WRONG_IMPORT_PARAMETERS = 3
          CHAVL_NOT_FOUND         = 4
          OTHERS                  = 5.
      CASE SY-SUBRC.
        WHEN 0.
          LOOP AT <G_T_0EQUIPMENT> INTO <G_S_0EQUIPMENT>.
            IF <FUNCT_LOC> IS INITIAL.
              DELETE <G_T_0EQUIPMENT>.
            ENDIF.
    master data collected and condensed
          ENDLOOP.
          LOOP AT DATA_PACKAGE.
            IF ( DATA_PACKAGE-FUNCT_LOC IS INITIAL ) AND
               ( DATA_PACKAGE-EQUIPMENT IS NOT INITIAL ).
              READ TABLE <G_T_0EQUIPMENT> WITH KEY
                ('EQUIPMENT') = DATA_PACKAGE-EQUIPMENT INTO <G_S_0EQUIPMENT>
              IF SY-SUBRC = 0.
                IF ( DATA_PACKAGE-MDATE >= <DATEFROM> )
                   AND ( DATA_PACKAGE-MDATE <= <DATETO> ).
    record for equipment exists and valid
                  DATA_PACKAGE-FUNCT_LOC = <FUNCT_LOC>.
                  MODIFY DATA_PACKAGE.
                ENDIF.
              ENDIF.
            ENDIF.
          ENDLOOP.
        WHEN 4.
    master data is not (yet) loaded
        WHEN OTHERS.
    problem occured, output as warning
          MONITOR-MSGID = SY-MSGID.
          MONITOR-MSGTY = 'W'.
          MONITOR-MSGNO = SY-MSGNO.
          MONITOR-MSGV1 = SY-MSGV1.
          MONITOR-MSGV2 = SY-MSGV2.
          MONITOR-MSGV3 = SY-MSGV3.
          MONITOR-MSGV4 = SY-MSGV4.
          APPEND MONITOR.
      ENDCASE.
    if abort is not equal zero, the update process will be canceled
      ABORT = 0.
    ENDFORM.                    "routine_9998
    *&      Form  routine_0001
          text
         -->COMM_STRUCTURE          text
         -->RESULT                  text
         -->RETURNCODE              text
         -->ABORT                   text
         -->RAISING                 text
         -->CX_SY_ARITHMETIC_ERROR  text
         -->CX_SY_CONVERSION_ERROR  text
    FORM routine_0001
      USING
        COMM_STRUCTURE type tys_SC_1__RULE_34
      CHANGING
        RESULT         TYPE tys_TG_1_full-DESIREU
        RETURNCODE     LIKE sy-subrc
        ABORT          LIKE sy-subrc
      RAISING
        cx_sy_arithmetic_error
        cx_sy_conversion_error.
    init variables
    fill the internal table "MONITOR", to make monitor entries
      CLEAR RESULT.
      IF COMM_STRUCTURE-TVIND = 'X'.
        CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
          EXPORTING
            INPUT                      = COMM_STRUCTURE-DESIRSI
            NO_TYPE_CHECK              = 'X'
      ROUND_SIGN                 = ' '
            UNIT_IN                    = COMM_STRUCTURE-SIUNIT
            UNIT_OUT                   = COMM_STRUCTURE-RECDU
          IMPORTING
      ADD_CONST                  =
      DECIMALS                   =
      DENOMINATOR                =
      NUMERATOR                  =
            OUTPUT                     = RESULT
       EXCEPTIONS
         CONVERSION_NOT_FOUND       = 1
         DIVISION_BY_ZERO           = 2
         INPUT_INVALID              = 3
         OUTPUT_INVALID             = 4
         OVERFLOW                   = 5
         TYPE_INVALID               = 6
         UNITS_MISSING              = 7
         UNIT_IN_NOT_FOUND          = 8
         UNIT_OUT_NOT_FOUND         = 9
         OTHERS                     = 10
        IF SY-SUBRC <> 0.
          MONITOR-MSGID = SY-MSGID.
          MONITOR-MSGTY = 'W'.
          MONITOR-MSGNO = SY-MSGNO.
          MONITOR-MSGV1 = SY-MSGV1.
          MONITOR-MSGV2 = SY-MSGV2.
          MONITOR-MSGV3 = SY-MSGV3.
          MONITOR-MSGV4 = SY-MSGV4.
          APPEND MONITOR.
        ENDIF.
      ENDIF.
    if abort is not equal zero, the update process will be canceled
      ABORT = 0.
    ENDFORM.                    "routine_0001
    *&      Form  routine_0002
          text
         -->COMM_STRUCTURE          text
         -->RESULT                  text
         -->RETURNCODE              text
         -->ABORT                   text
         -->RAISING                 text
         -->CX_SY_ARITHMETIC_ERROR  text
         -->CX_SY_CONVERSION_ERROR  text
    FORM routine_0002
      USING
        COMM_STRUCTURE type tys_SC_1__RULE_35
      CHANGING
        RESULT         TYPE tys_TG_1_full-MRMINEU
        RETURNCODE     LIKE sy-subrc
        ABORT          LIKE sy-subrc
      RAISING
        cx_sy_arithmetic_error
        cx_sy_conversion_error.
    init variables
    fill the internal table "MONITOR", to make monitor entries
      CLEAR RESULT.
      IF COMM_STRUCTURE-MRMINI = 'X'.
        CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
          EXPORTING
            INPUT                      = COMM_STRUCTURE-MRMINSI
            NO_TYPE_CHECK              = 'X'
      ROUND_SIGN                 = ' '
            UNIT_IN                    = COMM_STRUCTURE-SIUNIT
            UNIT_OUT                   = COMM_STRUCTURE-RECDU
          IMPORTING
      ADD_CONST                  =
      DECIMALS                   =
      DENOMINATOR                =
      NUMERATOR                  =
            OUTPUT                     = RESULT
       EXCEPTIONS
         CONVERSION_NOT_FOUND       = 1
         DIVISION_BY_ZERO           = 2
         INPUT_INVALID              = 3
         OUTPUT_INVALID             = 4
         OVERFLOW                   = 5
         TYPE_INVALID               = 6
         UNITS_MISSING              = 7
         UNIT_IN_NOT_FOUND          = 8
         UNIT_OUT_NOT_FOUND         = 9
         OTHERS                     = 10
        IF SY-SUBRC <> 0.
          MONITOR-MSGID = SY-MSGID.
          MONITOR-MSGTY = 'W'.
          MONITOR-MSGNO = SY-MSGNO.
          MONITOR-MSGV1 = SY-MSGV1.
          MONITOR-MSGV2 = SY-MSGV2.
          MONITOR-MSGV3 = SY-MSGV3.
          MONITOR-MSGV4 = SY-MSGV4.
          APPEND MONITOR.
        ENDIF.
      ENDIF.
    if abort is not equal zero, the update process will be canceled
      ABORT = 0.
    ENDFORM.                    "routine_0002
    *&      Form  routine_0003
          text
         -->COMM_STRUCTURE          text
         -->RESULT                  text
         -->RETURNCODE              text
         -->ABORT                   text
         -->RAISING                 text
         -->CX_SY_ARITHMETIC_ERROR  text
         -->CX_SY_CONVERSION_ERROR  text
    FORM routine_0003
      USING
        COMM_STRUCTURE type tys_SC_1__RULE_36
      CHANGING
        RESULT         TYPE tys_TG_1_full-MRMAXEU
        RETURNCODE     LIKE sy-subrc
        ABORT          LIKE sy-subrc
      RAISING
        cx_sy_arithmetic_error
        cx_sy_conversion_error.
    init variables
    fill the internal table "MONITOR", to make monitor entries
      CLEAR RESULT.
      IF COMM_STRUCTURE-MRMAXI = 'X'.
        CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
          EXPORTING
            INPUT                      = COMM_STRUCTURE-MRMAXSI
            NO_TYPE_CHECK              = 'X'
      ROUND_SIGN                 = ' '
            UNIT_IN                    = COMM_STRUCTURE-SIUNIT
            UNIT_OUT                   = COMM_STRUCTURE-RECDU
          IMPORTING
      ADD_CONST                  =
      DECIMALS                   =
      DENOMINATOR                =
      NUMERATOR                  =
            OUTPUT                     = RESULT
       EXCEPTIONS
         CONVERSION_NOT_FOUND       = 1
         DIVISION_BY_ZERO           = 2
         INPUT_INVALID              = 3
         OUTPUT_INVALID             = 4
         OVERFLOW                   = 5
         TYPE_INVALID               = 6
         UNITS_MISSING              = 7
         UNIT_IN_NOT_FOUND          = 8
         UNIT_OUT_NOT_FOUND         = 9
         OTHERS                     = 10
        IF SY-SUBRC <> 0.
          MONITOR-MSGID = SY-MSGID.
          MONITOR-MSGTY = 'W'.
          MONITOR-MSGNO = SY-MSGNO.
          MONITOR-MSGV1 = SY-MSGV1.
          MONITOR-MSGV2 = SY-MSGV2.
          MONITOR-MSGV3 = SY-MSGV3.
          MONITOR-MSGV4 = SY-MSGV4.
          APPEND MONITOR.
        ENDIF.
      ENDIF.
    if abort is not equal zero, the update process will be canceled
      ABORT = 0.
    ENDFORM.                    "routine_0003
    *&      Form  routine_0004
          text
         -->COMM_STRUCTURE          text
         -->RESULT                  text
         -->RETURNCODE              text
         -->ABORT                   text
         -->RAISING                 text
         -->CX_SY_ARITHMETIC_ERROR  text
         -->CX_SY_CONVERSION_ERROR  text
    FORM routine_0004
      USING
        COMM_STRUCTURE type tys_SC_1__RULE_37
      CHANGING
        RESULT         TYPE tys_TG_1_full-CNTRREU
        RETURNCODE     LIKE sy-subrc
        ABORT          LIKE sy-subrc
      RAISING
        cx_sy_arithmetic_error
        cx_sy_conversion_error.
    init variables
    fill the internal table "MONITOR", to make monitor entries
      CLEAR RESULT.
      IF COMM_STRUCTURE-CNTIND = 'X'.
        CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
          EXPORTING
            INPUT                      = COMM_STRUCTURE-CNTRRSI
            NO_TYPE_CHECK              = 'X'
      ROUND_SIGN                 = ' '
            UNIT_IN                    = COMM_STRUCTURE-SIUNIT
            UNIT_OUT                   = COMM_STRUCTURE-RECDU
          IMPORTING
      ADD_CONST                  =
      DECIMALS                   =
      DENOMINATOR                =
      NUMERATOR                  =
            OUTPUT                     = RESULT
       EXCEPTIONS
         CONVERSION_NOT_FOUND       = 1
         DIVISION_BY_ZERO           = 2
         INPUT_INVALID              = 3
         OUTPUT_INVALID             = 4
         OVERFLOW                   = 5
         TYPE_INVALID               = 6
         UNITS_MISSING              = 7
         UNIT_IN_NOT_FOUND          = 8
         UNIT_OUT_NOT_FOUND         = 9
         OTHERS                     = 10
        IF SY-SUBRC <> 0.
          MONITOR-MSGID = SY-MSGID.
          MONITOR-MSGTY = 'W'.
          MONITOR-MSGNO = SY-MSGNO.
          MONITOR-MSGV1 = SY-MSGV1.
          MONITOR-MSGV2 = SY-MSGV2.
          MONITOR-MSGV3 = SY-MSGV3.
          MONITOR-MSGV4 = SY-MSGV4.
          APPEND MONITOR.
        ENDIF.
      ENDIF.
    if abort is not equal zero, the update process will be canceled
      ABORT = 0.
    ENDFORM.                    "routine_0004
    *&      Form  routine_0005
          text
         -->COMM_STRUCTURE          text
         -->RESULT                  text
         -->RETURNCODE              text
         -->ABORT                   text
         -->RAISING                 text
         -->CX_SY_ARITHMETIC_ERROR  text
         -->CX_SY_CONVERSION_ERROR  text
    FORM routine_0005
      USING
        COMM_STRUCTURE type tys_SC_1__RULE_38
      CHANGING
        RESULT         TYPE tys_TG_1_full-CDIFFEU
        RETURNCODE     LIKE sy-subrc
        ABORT          LIKE sy-subrc
      RAISING
        cx_sy_arithmetic_error
        cx_sy_conversion_error.
    init variables
    fill the internal table "MONITOR", to make monitor entries
      CLEAR RESULT.
      IF COMM_STRUCTURE-CNTIND = 'X'.
        CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
          EXPORTING
            INPUT                      = COMM_STRUCTURE-CDIFFSI
            NO_TYPE_CHECK              = 'X'
      ROUND_SIGN                 = ' '
            UNIT_IN                    = COMM_STRUCTURE-SIUNIT
            UNIT_OUT                   = COMM_STRUCTURE-RECDU
          IMPORTING
      ADD_CONST                  =
      DECIMALS                   =
      DENOMINATOR                =
      NUMERATOR                  =
            OUTPUT                     = RESULT
       EXCEPTIONS
         CONVERSION_NOT_FOUND       = 1
         DIVISION_BY_ZERO           = 2
         INPUT_INVALID              = 3
         OUTPUT_INVALID             = 4
         OVERFLOW                   = 5
         TYPE_INVALID               = 6
         UNITS_MISSING              = 7
         UNIT_IN_NOT_FOUND          = 8
         UNIT_OUT_NOT_FOUND         = 9
         OTHERS                     = 10
        IF SY-SUBRC <> 0.
          MONITOR-MSGID = SY-MSGID.
          MONITOR-MSGTY = 'W'.
          MONITOR-MSGNO = SY-MSGNO.
          MONITOR-MSGV1 = SY-MSGV1.
          MONITOR-MSGV2 = SY-MSGV2.
          MONITOR-MSGV3 = SY-MSGV3.
          MONITOR-MSGV4 = SY-MSGV4.
          APPEND MONITOR.
        ENDIF.
      ENDIF.
    if abort is not equal zero, the update process will be canceled
      ABORT = 0.
    ENDFORM.                    "routine_0005
    TYPES: BEGIN OF TY_/BI0/PMPOINT,
          MPOINT      TYPE /BI0/PMPOINT-MPOINT,
       MRNGU     TYPE /BI0/PMPOINT-MRNGU,
    END of TY_/BI0/PMPOINT.
    DATA: /BI0/PMPOINT_TEMP TYPE STANDARD TABLE OF
    TY_/BI0/PMPOINT,
          W_/BI0/PMPOINT_TEMP like line of /BI0/PMPOINT_TEMP.
    $$ end of 2nd part global - insert your code only before this line   *
          CLASS routine IMPLEMENTATION
    CLASS lcl_transform IMPLEMENTATION.
          Method start_routine
          Calculation of source package via start routine
      <-> source package
      METHOD start_routine.
    *=== Segments ===
        FIELD-SYMBOLS:
          <SOURCE_FIELDS>    TYPE tys_SC_1.
        DATA:
          MONITOR_REC     TYPE rstmonitor.
    *$*$ 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,
          MONITOR_RECNO.
    Runtime attributs
        SOURCE_SYSTEM  = p_r_request->get_logsys( ).
    Migrated update rule call
        Perform routine_9998
        TABLES
          SOURCE_PACKAGE
        CHANGING
          l_abort.
    *-- Convert Messages in Transformation format
        LOOP AT MONITOR_RECNO INTO ls_monitor_recno.
          move-CORRESPONDING ls_monitor_recno to MONITOR_REC.
          append monitor_rec to MONITOR.
        ENDLOOP.
        LOOP AT MONITOR INTO ls_monitor.
          move-CORRESPONDING ls_monitor to MONITOR_REC.
          append monitor_rec to MONITOR.
        ENDLOOP.
        IF l_abort <> 0.
          RAISE EXCEPTION TYPE CX_RSROUT_ABORT.
        ENDIF.
    $$ end of routine - insert your code only before this line         -
      ENDMETHOD.                    "start_routine
          Method inverse_start_routine
          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 inverse_start_routine.
    $$ 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.                    "inverse_start_routine
    ENDCLASS.                    "routine IMPLEMENTATION

  • Start routine code for deleting records in different language

    Hello,
    can someone please specify the exact code to be used in start routine, and whre exactly it needs to be pasted?
    this code is needed for master data notifaction type which is loaded for both languages German and English.
    german records are to be avoided.
    thanks,

    Ciao Claudio,
    this issue about languages selection is an old situation...
    The problem is that language selection is not possible, even if you have this field checked for selection !!!
    Look at OSS Note 324684...
    "If a field of a DataSource - typically with field name 'LANGU' or 'SPRAS' - is assigned to InfoObject '0langu', the field is not provided in the selection fields although the field actually can be selected. In this case, all languages of the language vector active in the BW System are requested by the source system but the language selection cannot be defined in the Scheduler.
    A precondition is that the language field of the DataSource in the source system is maintained as selection field. This setting is done in Transaction RSA6 (or RSO2 for customer developments)."
    Bye,
    Roberto

  • ABAP Start Routine

    Hello,
    I am writing a Start Routine in my update rules from an ODS into another ODS.  My start routine is basically just restricting some data from being updated into my data target.  I am restricting based on 0VYPTE = 20.  That is, if a records has 0VTYPE = 20 I am deleting it from the data_package.  If I debug through the program, it works correctly with one record but when I throw in about 120K records it doesn't work. Can someone please have a look and tell me what is wrong here?
    LOOP AT DATA_PACKAGE.
         <b>IF DATA_PACKAGE-VTYPE NE 10.</b>
           DELETE DATA_PACKAGE.
             CONTINUE.
         ELSE.
           IF DATA_PACKAGE-/BIC/CASES NE 'CS'.
                 PERFORM load_mrscube_tables USING DATA_PACKAGE-SOURSYSTEM.
                 PERFORM BASEUNIT_CONVERT tables
                                              MONITOR
                                     using    DATA_PACKAGE-MATERIAL
                                              DATA_PACKAGE-SOURSYSTEM
                                              DATA_PACKAGE-/BIC/CASES
                                              'CS'
                                              DATA_PACKAGE-/BIC/CASES_REV
                                     changing
                                              quant_out.
                     EXIT.
                 EXIT.
         modify DATA_PACKAGE.
           ENDIF.
         ENDIF.
    ENDLOOP.

    Hi Nyrvole,
       Try to change the code this way and check(debug).
    DELETE DATA_PACKAGE WHERE VTYPE NE 10.
    LOOP AT DATA_PACKAGE.
    IF DATA_PACKAGE-/BIC/CASES NE 'CS'.
    PERFORM load_mrscube_tables USING DATA_PACKAGE-SOURSYSTEM.
    PERFORM BASEUNIT_CONVERT tables
    MONITOR
    using DATA_PACKAGE-MATERIAL
    DATA_PACKAGE-SOURSYSTEM
    DATA_PACKAGE-/BIC/CASES
    'CS'
    DATA_PACKAGE-/BIC/CASES_REV
    changing
    quant_out.
    EXIT. -- WHY THIS EXIT FOR...??
    EXIT. -- WHY THIS EXIT FOR...??
    modify DATA_PACKAGE. -- ARE YOU CHANGING ANY RECORDS..??
    ENDIF.
    ENDLOOP.
    Put break-point after end loop and dugug and see the no of records.
    Hope it Helps
    Srini

  • Append Duplicate entries in Start Routine through ABAP code

    Hi Experts,
    I need to write an ABAP code in the start routine for the following conditions.
    For every record in fiscal period (FISCPER) which has non u2013quarter months eg if Jan/Feb ie (001.2007 or 002.2007) I need to create an additional duplicate record which keeps all the other values same but negates the key figures and replaces the month by a quarter ending month
    Eg: if my records are
    FISCPER   COMP_CODE    GLACCT       BALANCE
    001.2007     1000                     6789090       70
    002.2007      1000                    6789090       80
    I need to create/append duplicate entries by negating the Balance value and replacing the Fiscper with 003.2007
    FISCPER COMP_CODE   GLACCT   BALANCE
    003.2007    1000                6789090    -70
    003.2007    1000                6789090    - 80
    Hence the entire structure should now look like:
    001.2007       1000        6789090         70
    002.2007       1000        6789090         80
    003.2007       1000        6789090        -70
    003.2007       1000        6789090       - 80
    Similarly, I need to append duplicate entries for all non quarter ending months and replacing the Fiscper with the quarter ending month and also negate the Key figure value.
    Hence, similarly,
    001.2007        1000            6789090             70
    002.2007        1000            6789090             80
    003.2007        1000            6789090             -70
    003.2007        1000            6789090            - 80
    004.2007        1000            6789090              30
    005.2007        1000            6789090              90
    006.2007        1000            6789090             -30
    006.2007        1000            6789090             -90
    I am very new to ABAP, can someone please provide the ABAP start routine code for this..
    Regards,
    Dipali

    Hi,
        Check the below code. Paste it in yr Start Routine.
    '*'Begin of code
    DATA : wa_Data_Package LIKE Data_Package.
    DATA : t_Data_Package LIKE Data_Package.
    DATA : wa_temp LIKE Data_Package-BALANCE.
    Loop at Data_Package into wa_Data_Package.
    IF ( wa_Data_Package-FISCPER EQ 001/2007 ) or
         ( wa_Data_Package-FISCPER EQ 002/2007 ).
      wa_temp = wa_Data_Package-BALANCE.
      t_Data_Package-FISCPER = 003/2007.
      t_Data_Package-BALANCE = -wa_temp.
      Clear : wa_temp.
    ELSEIF ( wa_Data_Package-FISCPER EQ 004/2007 ) or
                 ( wa_Data_Package-FISCPER EQ 005/2007 ).
      wa_temp = wa_Data_Package-BALANCE.
      t_Data_Package-FISCPER = 006/2007.
      t_Data_Package-BALANCE = -wa_temp.
      Clear : wa_temp.
    ELSEIF ( wa_Data_Package-FISCPER EQ 007/2007 ) or
                 ( wa_Data_Package-FISCPER EQ 008/2007 ).
      wa_temp = wa_Data_Package-BALANCE.
      t_Data_Package-FISCPER = 009/2007.
      t_Data_Package-BALANCE = -wa_temp.
      Clear : wa_temp.
    ELSEIF ( wa_Data_Package-FISCPER EQ 010/2007 ) or
                 ( wa_Data_Package-FISCPER EQ 011/2007 ).
      wa_temp = wa_Data_Package-BALANCE.
      t_Data_Package-FISCPER = 012/2007.
      t_Data_Package-BALANCE = -wa_temp.
      Clear : wa_temp.
    ENDIF.
    APPEND t_Data_Package to Data_Package
    Endloop.
    '*'End of code
    Regards,
    Balaji V

  • Start Routine: Syntax error in routine 2LIS_03_BF Transformations

    Hi experts,
    I enhanced the 2lis_03_bf data source, and replicated the data source in bw system, i have mapped the transformations and when i try to activate the transformations it is giving the below error.
    Start Routine: Syntax error in routine
    when i check the start routine it is giving the  below error message.
    E:In PERFORM or CALL FUNCTION "ROUTINE_9998", the actual parameter
    "SOURCE_PACKAGE" is incompatible with the formal parameter
    "DATA_PACKAGE".
    please provide me the solution.
    Regards
    venuscm

    Hi Venu,
    This seems to me like you have earlier migrated the update rules to transformations. We did the same earlier and faced issues whenever we add new fields/infoobjects. The error message was different, if i remember correctly.
    We had to add the new field/infoobject added, to the structure '_ty_s_*****' that exists at the top of the start routine code. This was one disadvantage of migration of rules.

  • Simple start routine

    Hi friends,
    I need a simple start routine code.
    It should only load data for first quarter.
    Fiscal period is the time characteristic.
    3 months in a quarter Example : 200701 - 200703.
    Thankyou.

    Assumed that data_package can be filtered based on Year & Month.If it should be filtered based on some date field then there should be minor modifications.
    DATA : V_YEAR TYPE C(4),
    V_LOW TYPE C(6),
    V_HIGH TYPE C(6).
    RANGES : R_YRMON LIKE <Use the same field reference of data_package table for the date field>
    V_YEAR = SY-DATUM+0(4).
    CONCATENATE V_YEAR '01' INTO V_LOW.
    CONCATENATE V_YEAR '03' INTO V_HIGH.
    R_YRMON-SIGN = 'I'.
    R_YRMON-OPTION = 'BT'.
    R_YRMON-LOW = V_LOW.
    R_YRMON-OPTION = V_HIGH.
    APPEND R_YRMON.
    CLEAR R_YRMON.
    *This filters out all data other than the first quarter
    DELETE DATA_PACKAGE WHERE <DATE FIELD> NOT IN R_YRMON.

  • ABAP code for BI 7.0 transformations start routine

    Hi all,
    I am trying to update data from DSO1 (Source1: transaction data) to Infocube(TARGET)
    In the transformations Start routine, I have to read DSO2(Source2: Master data) for some fields.
    DSO1 has CUSTOMER as part of key
    DSO2 has CUSTOMER (key) and other fields....FIELD1, FILED2, FIELD3
    Infocube to be updated with FIELDS1,2 & 3 WHILE READING DSO2.
    WHERE DSO1 CUSTOMER matches with DSO2 CUSTOMER.
    Also, data NOT TO BE UPLOADED into Infocube if FIELD1 in DSO2= NULL
    Please give me the abap code for the above logic.
    Appreciate any help in this regard.
    Thanks.

    This is a doc from this site:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6090a621-c170-2910-c1ab-d9203321ee19
    Ravi Thothadri

  • ABAP assistance - start routine logic in update rule

    I have used an existing update rule and have based my logic around the same.  The purpose of the rule is to look up customer master data and get a subset of customer numbers from the transaction records so that the values for customer number from the transactional data will not be updated if it does not match with existing master data customer numbers.
    The loads are full and we drop the data before we load.
    I have listed the logic below (the number at the front is to be considered as the line number) and a list of open questions that I have thereafter:
    Start routine logic:
    1  DATA: l_index LIKE sy-tabix.
    2  DATA: BEGIN OF ls_customer,
    3        customer TYPE /BI0/OICUSTOMER,
    4        objver TYPE RSOBJVERS,
    5     END OF ls_customer,
    6      lt_customer LIKE TABLE OF ls_customer.
    7  REFRESH: lt_customer.
    8  LOOP AT DATA_PACKAGE.
    all customers from data package
    9    ls_customer-custno = DATA_PACKAGE-custid.
    10  ls_customer-objver = 'A'
    11    APPEND ls_customer TO lt_customer.
    12   ENDLOOP.
    12  SORT lt_customer.
    13  DELETE ADJACENT DUPLICATES FROM lt_customer.
    14   IF NOT lt_customer[] IS INITIAL.
    15    SELECT /BI0/OICUSTOMER RSOBJVERS
    16      FROM /BI0/PCUSTOMER
    17      INTO CORRESPONDING FIELDS OF TABLE lt_customer
    18      FOR ALL ENTRIES IN lt_customer
    19      WHERE ls_customer-custno = DATA_PACKAGE-custid
    20      AND ls_customer-objver = 'A'
    21    SORT lt_customer BY customer ASCENDING                    
    22  ENDIF.
    Questions
    Line
    1 - what is the purpose of this line? What is it that is being declared
    2 - in some code I have seen this line with OCCURS 0 at the end what does this mean with and without the term?
    4 - I am using the Data Element name is this correct or should I use the field name?
    3 - 5 here I declare an internal structure/table is that correct?
    6 - here I declare a work area based on the internal table is that correct?
    7 - What would happen if I avoided using the REFRESH statement?
    8 - 12 - Is this syntactically correct, I am trying to get a set of data which is the customer numbers which match the master data customers and the master data record is án active version and than appendíng to the work area?
    13 - My understanding is this will reduce the number of records in the work area is this correct and needed?
    14 - 22 I am trying to identify my required set of data but feel I am repeating myself, could someone advise?
    Finally what logic would I actually need to write in the key figure object, could I use something like:
    Result = lt_customer.
    Thanks
    Edited by: Niten Shah on Jun 30, 2008 8:06 PM

    1. This line is not required
    2. OCCURS 0 is the OLD way of defining an internal table with that structure.  As it is, it just defines a flat structure.
    3. Data element is usually best
    3-5 Yes
    6. No.  Here you are declaring a table of the type of the flat structure.  Just as the ABAP says!
    7. Nothing.  But by putting this in, you ensure that you know the state of the table (empty) before you start looping through the data package
    8-12. You can tell if it is syntactically correct by pressing Ctrl-F2 when in the editor.  Looks ok.
    13. Ensures your list of customers contains no duplicated.  The code up to this point is building a list of all the unique customers in the data package.
    14-22. Goes to the database and brings back ONLY those customers which are found in the master data.  Looks ok.
    This is a start routine (that's why you've got a data package).  You don't use result.  You should update the datapackage.  But this you haven't done.  Double click on the table name /BIC/PCUSTOMER to get the correct field names.
    So you have to loop through the data package again, and check if the customer in the datapackage is lt_customer.  If it is, fine, otherwise you blank it and report an error, or set an error message or whatever.
    I wouldn't do it like this.  I'd do something like this:
    STATICS: st_customer TYPE HASHED TABLE OF TYPE /bi0/oicustomer
                                  WITH UNIQUE KEY TABLE_LINE.
    * st_customer retains its value between calls, so only populate if empty
    * In one run of the infopackage, this will mean you do only one read of
    * the master data, so very efficient.
    IF st_customer IS INITIAL.
      SELECT customer FROM /BI0/PCUSTOMER
                              INTO TABLE st_customer
                              WHERE objvers EQ 'A'. " Only active values
    ENDIF.
    * Go through data package
    LOOP AT DATA_PACKAGE.
    * Check whether the customer exists.
      READ TABLE st_customer TRANSPORTING NO FIELDS
                  WITH TABLE KEY table_line = DATA_PACKAGE-custid.
      CHECK sy-subrc IS NOT INITIAL.
    * If you get here, the customer isn't valid.  So I'm just setting it blank
      CLEAR DATA_PACKAGE-custid.
      MODIFY DATA_PACKAGE. " Updates the datapackage record
    ENDLOOP.
    Even this is not fully optimised, but it's not bad.
    I strongly suggest that you get yourself sent on the basic ABAP programming course if you're going to do a lot of this.  Otherwise, read the ABAP documentation in the help.sap.com, and, from the editor, get the cursor on each ABAP keyword and press F1 to read the ABAP help.
    matt

  • Execute ABAP code in Start Routine only once

    I have ABAP code in a start routine that I only want to execute once. Is there a way to tell this is first execution of the start routine?
    Also can I find out these value in the start routine ABAP:
    1. How many data packets there are?
    2. What data packet I am processing?
    Regards,
    Mike...

    Hi,
    I've just setup a little test:
    TRules, Start Routine Global Decl:
    DATA: GVI TYPE I, GVN(5) TYPE N.
    Start Routine:
    IF GVI IS INITIAL.
    GVI = 1.
    ELSE.
    ADD 1 TO GVI.
    ENDIF.
    MOVE GVI TO GVN.
    This is basically counting the times the start routine is executed and populating the var GVN; I am posting GVN in a char ZTESTGV in the target cube. I am posting as well the datapakID in my cube.
    I have loaded two requests (each 4 packets)
    the first one first to PSA and then from the PSA to the target: this is Serially using one single process. Here's the result in the cube:
    Request________________________________DATAPAKID_____ZTESTGV
    REQU_8B5ASGQNYYNIV1OJN68HFH1SR____________1____________1
    REQU_8B5ASGQNYYNIV1OJN68HFH1SR____________2____________2
    REQU_8B5ASGQNYYNIV1OJN68HFH1SR____________3____________3
    REQU_8B5ASGQNYYNIV1OJN68HFH1SR____________4____________4
    In this case the global variable is persistent accross packets.
    the second request is loaded in paralell: this is, multiple processes are executed at the time. Here's the result in the cube:
    Request________________________________DATAPAKID_____ZTESTGV
    REQU_14QVH21BSVH44FAJW94BD7N2H____________1____________1
    REQU_14QVH21BSVH44FAJW94BD7N2H____________2____________1
    REQU_14QVH21BSVH44FAJW94BD7N2H____________3____________1
    REQU_14QVH21BSVH44FAJW94BD7N2H____________4____________1
    In this case the global variable is always1 !!
    This is logic since several a process cannot access the internal memory used by another one...
    Conclusion; the global variable will work only if the load is serial...
    hope this helps...
    Olivier.

  • ABAP Code in Start Routine for restricing the data records from ODS1 - ODS2

    Hi
    I need small ABAP Code in Start Routine Of Update rules Of ODS . Im in BW 3.5 .
    I have records like below in first layer ODS and i want to restrict some records while going to second layer ODS ..
    ODS1 :-
    DocNO   EventType    Date
    123         001             08/08/2008
    123         003             08/08/2008
    123         011              09/08/2008
    I want one record in ODS2 for this document number whose EventType = 001 only and date of third record ... like below
    Doc NO     EventType      From Date          Todate
    123              001               08/08/2008         09/08/2008
    So how can i get like this record in the ODS2 which will get data from ODS1 . So i need to write the code in the start routine of the ODS2 .
    So please give the me the code for start routine ....
    Regards
    Suresh

    Its difficult in BW 3.5 to include this logic in START_ROUTINE as you cannot add the extra to_date field to the DATA_PACKAGE table.
    You need to create a new global internal table with the same structure of DATA_PACKAGE with additional field to_date. then use the logic to fill in the global internal table
    define a internal table new_data_package with the required structure like (docno, eventtype, fromdate todate)
    data: l_w_datapkg_001 type data_package,
    data: l_w_newdatapkg type new_data_package,
    data: l_w_datapkg_011 type data_package
    LOOP AT DATA_PACKAGE INTO l_w_datapkg_001 WHERE event_type = '001'.
    l_w_newdatapkg-docno = l_w_datapkg_001-docno.
    l_w_newdatapkg-event_type = l_w_datapkg_001-event_type.
    l_w_newdatapkg-fromdate = l_w_datapkg_001-date.
    MOVE CORRESPONDING FIELDS OF l_w_datapkg_001 INTO l_w_newdatapkg.
    READ TABLE data_package INTO l_w_datapkg_011
    WITH KEY docno = l_w_datapkg_001-docno
                     event_type = '011'.
    l_w_newdatapkg-to_date = l_w_datapkg_011-date.
    APPEND l_w_newdatapkg TO new_data_package          
    ENDLOOP.
    Now the new datapackage contains the ODS2 data that u needed

  • ABAP Routine code for the below logic

    Hello BW Experts ,
    I need to write a complex ABAP routine in BW .
    Following is the detail explaination .
    Can anyone tell me the ABAP code for the below logic?
    It would be a greate help as I am unable to do this
    since last two days.
    WBS Elements are maintained at  IOS and  Warranty levels in R/3 side.
    The IOS WBS is a top level of WBS element and below that the Warranty WBS level.
    The IOS and Warranty WBS elements can be differentiated by means of priority field.
    When priority = i   , WBS Element is known as  IOS Level WBS Element and
    When  priority = Y the WBS element is known as Warranty WBS element.
    The Equipment Number is maintained compulsorily at IOS Level WBS elements only.
    It is not maintained at  Warranty WBS Element.
    But the Cost is maintained at Warranty WBS Elements.
    In BW I need all Warranty WBS ( priority = Y) along with their cost figures and Equipment Numbers.
    But as the Equipment Number is not maintained compulsorily at Warranty WBS level we have asked to
    Copy it from  IOS WBS ( priority = i ) and assign it to Warranty WBS level ( priority = Y ).
    So I have included the Equipment Number in the ODS and in update rules I need to write the routine for it as
    per the above logic.
    The Equipment Number is coming from Master data of  WBS Element.
    The WBS element master data we are loading in BW .
    Also the same WBS Element transaction data is coming from the transaction data data source in BW.
    Following fields / infoobjects and the table names in BW :
    1. Equipment Number : /BIC/ZEQUIPMNT  and table name /BIC/MZWBS_ELEM.
    2. WBS Element       : ZWBS_ELEM  is coming from transaction data data source as well as master data.
                                     In ODS update rules it is coming from  transaction data data source Comm_structure-ZWBS_ELEM.
                                     Also we are loading separetly the master data for ZWBS_ELEM.
                                     The  ZEQUIPMNT is an attribute of ZWBS_ELEM.
    3. Priority                :  PRIORITY     and table name /BIC/MZWBS_ELEM.
                                      The info object name for Priority is 0Priority but in master data table /BIC/MZWBS_ELEM
                                      the field name is    PRIORITY.
                                     When PRIORITY = ' i ' then    ZWBS_ELEM is at IOS Level
                                     When PRIORITY = ' y ' then  ZWBS_ELEM is at Warranty Level.
    4. ODS name :  /BIC/AZCOST00 and same is table name active data table .
    So please tell me the routine Code .
    Best Regards ,
    Amol.

    Hi Dinaker,
    Did you find any solution for this issue. I too have a similar requirement of pulling all the service orders for a specific Purchase Order in the BW report.
    Thanks,
    SAPBWI

  • ABAP Code Problem in Start Routine to Fill the value from Look-up Table ???

    Hi all,
         I am trying to fill the values of DOC_NUMBER & PLANT from look-up table /BIC/AZSD_O0700 (Billing Item ODS) for each BILL_NUM in Start Routine for Update Rules of Billing Header ODS and modify the data_package.
    What is wrong with the below ABAP code, PLEASE ???
    data: it_data type standard table of data_package_structure
            with header line
            with non-unique default key initial size 0.
    types: begin of billing_item_type,
                 BILL_NUM          like /BIC/AZSD_O0700-BILL_NUM,
                 DOC_NUMBER   like /BIC/AZSD_O0700-DOC_NUMBER,
                 PLANT               like /BIC/AZSD_O0700-PLANT,
             end of billing_item_type.
    refresh it_data.
    clear it_data.
    it_data[] = DATA_PACKAGE[].
    refresh DATA_PACKAGE.
    clear DATA_PACKAGE.
    loop at it_data.
        select DOC_NUMBER PLANT into (it_data-DOC_NUMBER, it_data-PLANT)
               from /BIC/AZSD_O0700
               where  BILL_NUM  = it_data-BILL_NUM
               and    FISCVARNT = it_data-fiscvarnt.
        endselect.
        if sy-subrc = 0.
           move-corresponding it_data to DATA_PACKAGE.
        endif.
      endloop.
      modify DATA_PACKAGE.
    Thanks,
    Venkat.

    Hi Venkat,
      Two things -One is the performance and the other ... there is no Append  within the loop.
      Try moving the select statement ousdie the loop to improve performance and move the modify statement into the loop ... change modify to append. Code below.
       Let me know if you need more help.
    Best regards,
    Kazmi
    data: it_data type standard table of data_package_structure
    with header line
    with non-unique default key initial size 0.
    types: begin of billing_item_type,
    BILL_NUM like /BIC/AZSD_O0700-BILL_NUM,
    DOC_NUMBER like /BIC/AZSD_O0700-DOC_NUMBER,
    PLANT like /BIC/AZSD_O0700-PLANT,
    end of billing_item_type.
    refresh it_data.
    clear it_data.
    it_data] = DATA_PACKAGE[.
    refresh DATA_PACKAGE.
    clear DATA_PACKAGE.
    loop at it_data.
    select DOC_NUMBER PLANT into (it_data-DOC_NUMBER, it_data-PLANT)
    from /BIC/AZSD_O0700
    where BILL_NUM = it_data-BILL_NUM
    and FISCVARNT = it_data-fiscvarnt.
    endselect.
    if sy-subrc = 0.
    move-corresponding it_data to DATA_PACKAGE.
    Append DATA_PACKAGE.
    endif.
    endloop.

  • ABAP code in start routine (delete no in)

    In my start routine, I would like to delete some data package whose employee id is not in the selection list.
    but there are some ABAP grammer error in the where condition. Can somebody help this? I tried to read the document for 'WHERE - IN seltab', but still I could not give the right code.
    <p>
      employeeid_itab type table of string.
      select /bic/zpe_employeeid into table employeeid_itab from /bic/pzpe_employeeid.
      DELETE SOURCE_PACKAGE where ZEMP_employee_ID NOT IN employeeid_itab.
    It seems that internal table employeeid_itab could not be directly used after the IN keyword.
    how can I do this?
    Edited by: Ben Li on Feb 22, 2008 2:09 PM

    Hi Oscar,
          Actually I had tried this before, using the code like the following,
          <p>
    Types: EmployeeID(7) type  c.
    <p>
    data: sel_itab type  range of EmployeeID.
    <p>
    select /bic/zpe_employeeid into table sel_itab from /bic/pzpe_employeeid.
    <p>
    delete SOURCE_PACKAGE where zemp_employee_id  not in sel_itab.
    <p>
         The grammer check is OK, but when I debug it, I found that there are records in sel_itab, but all the records just have one charactor, actually, my employeeID have 7 charactors in database. So it does not work, I think I miss something in define  of the range table. Can you please figure out? Thanks a lot.

Maybe you are looking for