Routine code

Hello ALL ,
       iam working in BW but i need to find out  the cause of error because of abap routine can please help me in understanding the code.
iam having below routine between 2 ods(Tables) when i first load data from 1st ODS(Table) to second iam getting wrong value but when i do repair full request iam getting correct value can anybody help me why its happening is it because of below routine.
Points will be assigned for every helpful answer
Main Program
PROGRAM UPDATE_ROUTINE.
$$ begin of global - insert your declaration only below this line -
TABLES: ...
DATA: ...
INCLUDE RS_BCT_MM_UPDATE_RULES.
$$ 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/CS8YO02_SCL
RECORD_NO LIKE SY-TABIX
RECORD_ALL LIKE SY-TABIX
SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS
CHANGING RESULT LIKE /BIC/AYO02_POH00-ORDER_VAL
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
result value of the routine
IF ( COMM_STRUCTURE-PROCESSKEY = '001' or "Bestellung
COMM_STRUCTURE-PROCESSKEY = '011' or
COMM_STRUCTURE-PROCESSKEY = '021' or
COMM_STRUCTURE-PROCESSKEY = '004' or "LP
COMM_STRUCTURE-PROCESSKEY = '014' or
COMM_STRUCTURE-PROCESSKEY = '024' )
AND COMM_STRUCTURE-BWAPPLNM EQ 'MM'
AND COMM_STRUCTURE-ORDER_VAL 0.
PERFORM LOC_CURR_CONVERT
USING COMM_STRUCTURE-ORDER_VAL
COMM_STRUCTURE-DOC_DATE
COMM_STRUCTURE-ORDER_CURR
COMM_STRUCTURE-LOC_CURRCY
COMM_STRUCTURE-EXCHG_RATE
CHANGING RESULT.
if the returncode is not equal zero, the result will not be updated
RETURNCODE = 0.
else.
RETURNCODE = 4.
endif.
if abort is not equal zero, the update process will be canceled
ABORT = 0.
Include program
FORM LOC_CURR_CONVERT *
--> LC_DOCUMENT_VALUE *
--> LC_DATE *
--> LC_DOCUMENT_CURRENCY *
--> LC_LOCAL_CURRENCYY *
--> LC_RATE *
<-> LC_LOCAL_VALUE *
FORM loc_curr_convert
USING lc_document_value
lc_date
lc_document_currency
value(lc_local_currency)
lc_rate
CHANGING lc_local_value.
conversion of lc_rate from floating-point to decimal. Necessary for *
call of CONVERT_TO_LOCAL_CURRENCY.
data lc_rate_dec type p decimals 5.
lc_rate_dec = lc_rate.
IF lc_document_currency = lc_local_currency
no conversion necessary -> Main case 1
AND NOT ( lc_document_currency IS INITIAL
OR lc_local_currency IS INITIAL ) .
lc_local_value = lc_document_value.
ELSEIF NOT ( lc_document_currency IS INITIAL
OR lc_local_currency IS INITIAL OR lc_date IS INITIAL ) .
conversion necessary with lc_date -> Normally not possible
CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'
EXPORTING
date = lc_date
foreign_amount = lc_document_value
foreign_currency = lc_document_currency
local_currency = lc_local_currency
rate = lc_rate_dec
IMPORTING
EXCHANGE_RATE =
local_amount = lc_local_value
EXCEPTIONS
NO_RATE_FOUND = 1
OVERFLOW = 2
NO_FACTORS_FOUND = 3
NO_SPREAD_FOUND = 4
DERIVED_2_TIMES = 5.
IF sy-subrc NE 0.
message a802 with lc_date lc_document_currency lc_local_currency
sy-subrc.
ENDIF.
ELSE.
if conversion not possible -> assign target values
lc_local_value = lc_document_value.
lc_local_currency = lc_document_currency.
ENDIF.
ENDFORM.
Thanks & Regards

What do mean by "wrong value".  What is the "right" value.  What data are you putting in?  What data do you expect out?
matt

Similar Messages

  • End Routine Code not Working after Support Pack Upgrade

    Hi BI Community,
    We have recently upgraded to SPS17 (BW SP19) for our production system and the code deriving the values of several attributes in the end routine of the transformation for one InfoObject (as info provider) does not work anymore. We have been trying to identify the root cause but the fact is that we did not change anything to the InfoObject and its transformation and this used to work fine. The strange thing is that when we debugged the code we could see the value of the aforementioned attributes was derived correctly but the value is just not updated to the InfoObject where we still see the old values for these attributes.
    We have a similar InfoObject with the same end routine code in the transformation and it is working fine. We are out of idea what could have caused this during the SP upgrade.
    Thanks in advance for your feedback.
    Regards,
    Peter

    Cannot say what might have caused it but one check you can perform.
    Open your transformation in change mode and you can see a button next to create end routine button, titled ' Update Behavior of End Routine Change', click on that and say all fields.
    Hope it helps...
    Regards,
    Ashish

  • 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

  • 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

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

  • Sample ABAP routine code to load only previous month data in INFOPACKAGE

    Hi all,
    I want to create one ABAP routine in InfoPackage (Variables change to selection values with background processing) for 0CALMONTH ( Calender year month) so that whenever this infopackage is executed it should fetch only previous month data.
    Can anyone please provide any sample code for that.
    Thanks in advance.
    Uday shankar.

    Hi
    Please check with below code, hope this will resolve your issue
    WHEN: 'ZLASTP'.
         CLEAR: h_period, h_gjahr.
         CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'
           EXPORTING
             i_date               = sy-datum
       I_MONMIT             = 00
             i_periv              = 'AF'
          IMPORTING
            e_buper              = h_period
            e_gjahr              = h_gjahr
    EXCEPTIONS
       INPUT_FALSE          = 1
       T009_NOTFOUND        = 2
       T009B_NOTFOUND       = 3
       OTHERS               = 4
         IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
         ENDIF.
         IF h_period = '001'.
           h_gjahr = h_gjahr - 1.
           h_period = '012'.
         ELSE.
           h_period = h_period - 1.
         ENDIF.
         CLEAR l_s_range.
         CONCATENATE h_gjahr h_period INTO l_s_range-low.
         l_s_range-sign = 'I'.
         l_s_range-opt  = 'EQ'.
         APPEND l_s_range TO e_t_range.

  • Routine code in transformation

    Hi all,
    For filling Info Object ( ZPLANTYPE) , I am  to fetch  from other DSO, for that I have written code in routine please see below , but I am getting this error  like this ''SOURCE_FIELDS-/BIC/ZCARR_ID" is unknown. It is neither in one of please help me in this the specified tables nor defined by a "DATA" statement.''
    TABLES : /BIC/AZFLIGHTS00.
       data : WA_ptype like /BIC/AZFLIGHTS00.
    SELECT SINGLE /BIC/ZPLANTYPE INTO WA_ptype FROM /BIC/AZFLIGHTS00 where
           /BIC/ZCARR_ID = source_fields-/BIC/ZCARR_ID AND
           /BIC/ZCONNID = source_fields-/BIC/ZCONNID.
         RESULT = WA_ptype .
    Please correct me If something wrong in Code.
    Regards.
    hari

    Also 1 small correction
    >
    >  TABLES : /BIC/AZFLIGHTS00.
    >    data : WA_ptype like /BIC/ZPLANTYPE.
    > SELECT SINGLE /BIC/ZPLANTYPE INTO WA_ptype FROM /BIC/AZFLIGHTS00 where
    >        /BIC/ZCARR_ID = source_fields-/BIC/ZCARR_ID AND
    >        /BIC/ZCONNID = source_fields-/BIC/ZCONNID.
    >
    >
    >      RESULT = WA_ptype .
    >
    Regards,
    Rathy

  • Strat routine code in transfer rules for the Extractor - 0CO_OM_CCA_1

    Dear SDNers,
    I have a scenario to implement a start rouine code in the transfer rulesfor the Extractor - 0CO_OM_CCA_1 , please give a light on this.
    Scenario:
    The extractor 0C0_OM_CCA_1 brings in Cost Center transactional data for costs and allocation into the SAP BI data warehouse. A cross reference table will be created in SAP BI for Profit Center. These tables will have CRM (CARDIAC RHYTHM MANAGEMENT) Profit Centers stored in them.
    In the transfer rules for 0CO_OM_CCA_1, add ABAP code in the start routine to block CRM (CARDIAC RHYTHM MANAGEMENT) data. The code will have the following logic:
    Check Cost center master data table u2018/BI0/QCOSTCENTERu2019
    This table u2018/BI0/QCOSTCENTERu2019 being time dependent, use the last day of the fiscal period from transactional data as the date to select from u2018/BI0/QCOSTCENTERu2019.
    Go to the Profit center reference table and identify if the data belongs to BSC Boston Scientific/CRM (CARDIAC RHYTHM MANAGEMENT).
    Block CRM (CARDIAC RHYTHM MANAGEMENT) data.
    Best Regards,
    Satya
    Edited by: satya prasad on Sep 8, 2009 8:16 AM

    You could give this a try:
    DATA: wa_qcostcenter TYPE /bi0/qcostcenter,
          wa_ppcxref TYPE /bic/ppcxref,       "Custom Profit Center Cross-Reference table
          l_tabix TYPE sy-tabix,
          l_last_date TYPE d.
    LOOP AT data_package.
      l_tabix = sy-tabix.
      CALL FUNCTION
        'LAST_DAY_IN_PERIOD_GET'
      EXPORTING
        i_gjahr = data_package-fiscper+0(4)
        i_periv = data_package-fiscvarnt
        i_poper = data_package-fiscper+4(3)
      IMPORTING
        e_date = l_last_date.
      SELECT SINGLE
      FROM
        /bi0/qcostcenter
      INTO
        wa_qcostcenter
      WHERE
        costcenter = data_package-kostl
        AND dateto <= l_last_date
        AND datefrom >= l_last_date.
      IF sy-subrc EQ 0.
        SELECT
        FROM
          /bic/ppcxref
        INTO
          wa_ppcxref
        WHERE
          profit_ctr = wa_qcostcenter-profit_ctr.
        IF sy-subrc EQ 0.
          IF wa_ppcxref-data = 'CRM'.
            DELETE
              data_package
            INDEX
              l_tabix.
          ENDIF.
        ENDIF.
    ENDLOOP.
    Edited by: Dennis Scoville on Sep 8, 2009 4:32 PM

  • ROUTINE CODE HELP

    HI FRIENDS,
    I WANT CREATE A START ROUTINE IN UPDATE RULES TO FILTER OUT TWO FIELDS WITH A SELECTION :
    MY TWO FIELDS ARE
         Yacc_SEQ  = ´ZROO´ .
            0PRICE_LIST = ´  ´ . (EMPTY)
    AND
    I WANT TO DERIVE 3 FIELDS LIKE 0CUSTOMER, 0SALESORG, YLEG_ENTITY FROM A MASTER TABLE INFOROBJECT NAMED Y_CUST_LE
    I AM REALLY NEW TO ROUTINES, PLEASE SOMEONE HELP ME WITH THE ABAP CODE FOR THE ABOVE REQUIREMENTS.
    HELP IS  APPRECIATED (URGENT)
    POINTS WILL BE FULLY AWARDED
    THANKS IN ADVANCE
    VEER

    Hi AHP,
    to get the attention from more people
    thanks for ur quick reply
    i am not deleting those selections from the package
    like delete data_package where Yacc_SEQ = ´ZROO´ and
    0PRICE_LIST = ´ ´.
    I want to add only those selections in the my data package
    this is one logic to the routine should incorporate.
    second logic is to
    I  WANT TO DERIVE 3 FIELDS LIKE 0CUSTOMER, 0SALESORG, YLEG_ENTITY FROM A MASTER data attribute TABLE INFO OBJECT NAMED Y_CUST_LE
    y_CUST_LE is not present in the update rules itself
    please send me the code for thse two logics,
    thank you very much
    regards,
    veer
    Message was edited by: vvs kom
    Message was edited by: vvs kom

  • Help with a 'simple' routine (code)

    Hello all,
    I know I should be better at writing routines but I just cant seem to get the time to practice!
    Please help me with the following.
    I have an infoobject ZHE_YRSES that has 2 attribute 0FISCYEAR and ZFSCYR_ED (both of which are going to be 4 digit years)
    I also have a I have a cube that includes object ZHE_YRSES and a counter ZUQSTUDT
    When the data come into the cube I would like
    ZUQSTUDT to equal (ZFSCYR_ED minus  0FISCYEAR ) + 1
    Please could you let me know what code I need to put in a transformation for something like this!
    I will get better at this I promise!!
    The template is  
    METHOD compute_ZUQSTUDT.
    *   IMPORTING
    *     request     type rsrequest
    *     datapackid  type rsdatapid
    *    EXPORTING
    *      RESULT type _ty_s_TG_1-/BIC/ZUQSTUDT
        DATA:
          MONITOR_REC    TYPE rsmonitor.
    *$*$ begin of routine - insert your code only below this line        *-*
    ... "insert your code here
    *--  fill table "MONITOR" with values of structure "MONITOR_REC"
    *-   to make monitor entries
    ... "to cancel the update process
    *    raise exception type CX_RSROUT_ABORT.
    ... "to skip a record
    *    raise exception type CX_RSROUT_SKIP_RECORD.
    ... "to clear target fields
    *    raise exception type CX_RSROUT_SKIP_VAL.
         RESULT = .
    *$*$ end of routine - insert your code only before this line         *-*
      ENDMETHOD.                    "compute_ZUQSTUDT

    Hi,
    First of all you will have to read the master data and related attributes in start routine, create an internal table of type p table of infoobject ZHE_YRSES and fetch all the reocords.
    Start Routine********************
    Data: i_t_data type  standard table of /bic/pzhe_yrses.
    select zhe_yrses 0fiscyear ZFSCYR_ED from /bic/pzhe_yrses into table i_t_data.
    Field Routine****************
    Later in field routine you can put following code, take ZHE_YRSES infoobject as input to your field routine,
    Inside routine you will have to read the internal table.
    Read table i_t_data into wa_data with key zhe_yrses = source_fields-zhe_yrses.
    if sy-subrc = 0.
    RESULT = wa_data-zfscyr_ed-wa_data-0fiscper+1.
    endif.
    You will get the required value.
    Regards,
    Durgesh.

  • Update routine code

    Hi friends,
    I have a field YREPCURR in the update rules, it needs to updated based on the attribute of /BIC/YREPCURR in 0salesorg
    plz help me writing a routine for this field
    help will be really appreciated, points would be fully awarded
    regards,
    veer

    Hi
    I'm giving it a try as a ABAP beginner myself!?!
    TABLES: /BI0/PSALESORG.
    data: YREPCURR like /BIC/YREPCURR-/BI0/PSALESORG.
    select single /BIC/YREPCURR from /BI0/PSALESORG into YREPCURR where objvers = 'A' and
    SALESORG = comm_structure-SALESORG.
    if sy-subrc = 0.
    result = YREPCURR.
    endif.
    OR
    You can also use the option of Attribute of in the Update ruled mapping.
    Regards,

  • 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

  • Start/End routine code to delete last 5 characters

    Hi All,
              I have a field 15 CHAR in length in my data source. The first 10 characters are always numbers followed by a hyphen(-) and 4 more numbers.
    I want to store this into my DSO as a 10 character field containing just the first 10 numbers and drop the last 5 characters. Can anyone suggest me the routine for this?
    Thanks!
    Missy

    Hi Missy,
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/609eea32-455e-2c10-c08a-c23adf8c934e?quicklink=index&overridelayout=true
    Have a look to above docs link.
    I hope, it will help you alot!!!
    Thanks,
    Ajay

  • Writing ABAP code in routine

    hi all,
    actually we r loading data from flat file to the cube.in that flat file,there was a column x. under that clumn there are 2 repeated values A & B. in this case we have to tell the system that to pick only A under that X column. plz tell me the code and where to put that code in transfer rules
    thanks in advance,
    jack

    Hi Jack,
    You can use the following piece of code
    if tran_structure-columnX = 'A'.
    result = tran_structure-columnX.
    endif.
    u can put this routine code in the transfer rule for column X in the transfer rules tab.While creating the routine choose the 'column X' as source field.
    Alternatively u can do it at the update rule level as well.
    Hope it helps.
    Regards,
    Rathy

Maybe you are looking for

  • Resetting the File browse item in Javascript in Apex 4.0

    Hi, Can anyone please help to reset the File browse item in Apex with Javascript. For example I have an File Browse item P10_FILE_BROWSE, I have selected some file in it and on Click of button, I want to set NULL in that File Browse item "P10_FILE_BR

  • Perform a RFC call

    Hi! My scenario is as follows: IDoc -> XI -> Email This works fine, but now I need to do a RFC call back to the server which sent the IDoc to XI to get the email address of the receiver dynamically. I imported the corresponding RFC (BAPI_ISUTASK_GETC

  • How do you record video in photo booth?

    an apple genius was able to record video in photo booth - now i don't see any way to do this... does anyone know?

  • "Could not drag and drop" smart symbol in FW CS4

    When I drag a smart symbol from the common library over to my document, I get the message "Could not drag and drop. An error occured."  I see this error whether or not I see the library conflict message.  However, the symbol is placed in my document

  • My mouse works but does not control the software

    my mouse works but does not control the software