Start Routine to Populate Account Group

Hello Thanks for your help and response from SDN but I modified the code as below but still it did not work now at all .please help
Data: my_index like sy-tabix.
Data: SOURCE_WA TYPE tys_sc_1.
    types: begin of I_MAT_TYPE,
     CUSTOMER       type  /BI0/OICUSTOMER,
     ACCNT_GRP          type /BI0/OIACCNT_GRP,
   end of I_MAT_TYPE.
    DATA: I_MAT TYPE STANDARD TABLE OF I_MAT_TYPE INITIAL SIZE 0.
DATA: I_MAT_WA TYPE I_MAT_TYPE.
IF  I_MAT[] IS INITIAL.
SELECT CUSTOMER ACCNT_GRP FROM /BI0/PCUSTOMER APPENDING CORRESPONDING
FIELDS OF TABLE I_MAT.
*FOR ALL ENTRIES IN SOURCE_PACKAGE WHERE CUSTOMER EQ
*SOURCE_PACKAGE-DEBITOR.
SORT I_MAT BY CUSTOMER.
ENDIF.
LOOP AT SOURCE_PACKAGE INTO SOURCE_WA.
MY_INDEX = SY-TABIX.
READ TABLE I_MAT INTO I_MAT_WA WITH KEY CUSTOMER = SOURCE_WA-DEBITOR.
IF SY-SUBRC = 0.
SOURCE_WA-ACCNT_GRP = I_MAT_WA-ACCNT_GRP.
ENDIF.
MODIFY SOURCE_PACKAGE FROM SOURCE_WA index my_index.
ENDLOOP.

Hi Soniya,
Have you tried debugging the report.
After the ENDLOOP of  (LOOP AT SOURCE_PACKAGE ... ), is the internal table SOURCE_PACKAGE updated properly with required data.
Now you have to update the database table using this internal table. So you have to use MODIFY statement. Also try calling the COMMIT WORK statement after the statement for Modifying the DATABASE TABLE using the INTERNAL TABLE SOURCE_PACKAGE.
Regards
Abhishek

Similar Messages

  • Start Routine to Populate Account Group Field from Master data of 0Customer

    Hello Friends. Please help me edit this ABAP code to make it work. I am putting this code in start routine in between two DSO. where I am using the
    Start Routine to Populate Account Group Field from Master data of 0Customer. I do not want to use read from master data functionality since that field 0customer is not there in dso but similar field 0debitor is there. so i want to put this code
    during the load from source DSO to Target DSO.
    Error Explicit length specifications are necessary with types C, P, X, N und
    DATA: L_S_DP_LINE TYPE DATA_PACKAGE_sTRUCTURE.
        types: begin of comp,
         CUSTOMER       type  /BI0/OICUSTOMER,
         ACCNT_GRP          type /BI0/OIACCNT_GRP,
       end of comp.
        DATA: l_S_comp type comp.
        DATA: L_th_COMP TYPE HASHED TABLE OF COMP WITH UNIQUE KEY customer INITIAL SIZE 0.
    IF  L_th_COMP[] IS INITIAL.
    SELECT CUSTOMER ACCNT_GRP FROM /BI0/PCUSTOMER APPENDING CORRESPONDING FIELDS OF TABLE L_th_COMP.
    ENDIF.
    LOOP AT SOURCE_PACKAGE INTO L_S_DP_LINE.
    READ TABLE L_TH_COMP INTO L_S_COMP WITH TABLE KEY CUSTOMER = L_s_DP_LINE-CUSTOMER
    IF SY-SUBRC = 0.
    L_S_DP_LINE-/BIC/ACCNT_GRP = L_S_COMP-/BIC/ACCNT_GRP.
    MODIFY SOURCE_PACKAGE FROM L_S_DP_LINE.
    ENDIF.
    ENDLOOP.
    soniya kapoor
    Message was edited by:
            soniya kapoor

    Hello Wond Thanks for Good Answer and good option, But Client does not like this option and does not like Nav Attribute so he does not want to turn on any Nav Attribute, In general also We hav requirement to read a third table while uploading 1 dso table to 2 dso table,
    so  Please help me edit this ABAP code to make it work. I am putting this code in start routine in between two DSO. where I am using the
    Start Routine to Populate Account Group Field from Master data of 0Customer.
    No syntax Error But during the load it is updating the source table and not the target table. how to define now target table.
    ***SOURCE DSO Table
    types: begin of typ_tgl1.
        include type /BIC/AZDAFIAR000.
        types: end of typ_tgl1.
        types: begin of comp,
         CUSTOMER       type  /BI0/OICUSTOMER,
         ACCNT_GRP          type /BI0/OIACCNT_GRP,
       end of comp.
    DATA: L_th_COMP TYPE HASHED TABLE OF COMP WITH UNIQUE KEY customer
    INITIAL SIZE 0.
      data: wa_itab type COMP.
        data: wa_zdtg type typ_tgl1.
    IF  L_th_COMP[] IS INITIAL.
    ***Master Data Table
    SELECT CUSTOMER ACCNT_GRP FROM /BI0/PCUSTOMER APPENDING CORRESPONDING
    FIELDS OF TABLE L_th_COMP.
    sort L_th_COMP by CUSTOMER.
    ENDIF.
    LOOP AT L_th_COMP into wa_itab.
    select * from /BIC/AZDAFIAR000 into wa_zdtg
                        where DEBITOR  eq wa_itab-CUSTOMER.  *** SOURCE DSO Table
    IF SY-SUBRC = 0.
    wa_zdtg-ACCNT_GRP = wa_itab-ACCNT_GRP.
    MODIFY /BIC/AZDAFIAR000 from wa_zdtg. *** modify SOURCE DSO Table
    ENDIF.
      endselect.
        endloop.
    soniya kapoor

  • Start Routine to populate the Logical Source System

    Hi Friends please help me with the below
    1. <b>Requirement</b> : to Populate The system Date , Source System
    in BI for Each load request.
    <b>
    1 Solution:</b> I thought of writing the Start Routine for this but it is giving me error
    syntax Error: END METHOD MISSING?????
    2. Also I have requirement to populate 0sourcsys source system id, can any body help how to populate that.
    Thanks
    Poonam Roy
    <b>ABAP Code.</b>
    I have the End Method. what more to do.
      METHOD start_routine.
    *=== Segments ===
        FIELD-SYMBOLS:
          <SOURCE_FIELDS>    TYPE tys_SC_1.
        DATA:
          MONITOR_REC     TYPE rstmonitor.
    <b>
    $$ begin of routine - insert your code only below this line        -</b>
    ... "insert your code here
    <b>
    FORM STARTROUTINE
    USING G_S_MINFO TYPE RSSM_S_MINFO
    CHANGING DATAPAK type TRANSTRU
    ABORT LIKE SY-SUBRC.
    DATA: ZLOAD_DAT LIKE SY-DATUM
    ZZSOURSYS TYPE RSLOGSYS
    IF G_S_MINFO-DATAPAKID=1
    SOURCE_FIELDS-ZLOAD_DAT = SY-DATE.
    SOURCE_FIELDS-ZZSOURSYS = G_S_MINFO-LOGSYS.
    ENDIF.
    ABORT = 0.
    ENDFORM.
    ENDMETHOD.
    ENDCLASS</b>.
    *--  fill table "MONITOR" with values of structure "MONITOR_REC"
    *-   to make monitor entries
    ... "to cancel the update process
       raise exception type CX_RSROUT_ABORT.
    $$ end of routine - insert your code only before this line         -
      ENDMETHOD.

    Hi,
    Check whether the formula is useful here than Routine. Because you can see the Sy-datum , source system( I Guess) fields as avaialable formula elements .
    With rgds,
    Anil Kumar Sharma .P

  • How to populate the variable created in start routine to a field.

    Hi
    I have created a variable ZCUST in the Start routine and I have written some code to populate this value. Now there is a field in the update rules, Z_YTCUST. I want to assign the result of the variable created in start routine to this field. How can I go abt doin this? I have tried but for some reason the result shows 0.
    Thank you.

    Hi,
           Make sure the variable used in the start routine is a global variable. then assign the value u get it from the start routine in the update rule result field.

  • How to write a start routine in the trasnformations ?

    Hi Experts,
    I am working on BI 7, As I want to write a start routine in transformations of 0FIGL_O02 DSO, to allow the GL accounts with cost center data. Already there is a delete statement please find.
    *DELETE SOURCE_PACKAGE where BAL_FLAG = 'X'. I had made comment to allow the G/L accounts. since I have some GL Accounts which does'nt have the cost center data, so in this case I have to write a ABAP code to allow this G/L accounts with cost center data.
    So Let me know if anyone can help me how to write the ABAP code in the start routine.
    Thanks
    sekhar

    Hi,
                Yopu can write the below lines of code adn try
        SORT source_package BY Receive nr  Type ASCENDING.
        DELETE ADJACENT DUPLICATES FROM source_package COMPARING Receive nr  Type.
    But you should make sure which record of the either rows need to deleted
    i.e in
    F9001;LU;J001;662;
    F9001;LU;J002;662
    You need to decide to eliminate 1st or 2nd one.(depends on your requirement)

  • How to write the start routine in the transformations ?

    Hi Experts,
    I am working on BI 7, As I want to write a start routine in transformations of 0FIGL_O02 DSO, to allow the GL accounts with cost center data. Already there is a delete statement please find.
    *DELETE SOURCE_PACKAGE where BAL_FLAG = 'X'. I had made comment to allow the G/L accounts. since I have some GL Accounts which does'nt have the cost center data, so in this case I have to write a ABAP code to allow this G/L accounts with cost center data.
    So Let me know if anyone can help me how to write the ABAP code in the start routine.
    Thanks
    sekhar

    Hi Experts,
    I am working on BI 7, As I want to write a start routine in transformations of 0FIGL_O02 DSO, to allow the GL accounts with cost center data. Already there is a delete statement please find.
    *DELETE SOURCE_PACKAGE where BAL_FLAG = 'X'. I had made comment to allow the G/L accounts. since I have some GL Accounts which does'nt have the cost center data, so in this case I have to write a ABAP code to allow this G/L accounts with cost center data.
    So Let me know if anyone can help me how to write the ABAP code in the start routine.
    Thanks
    sekhar

  • Start routine in DSO Self transformations

    Hi SCN,
    I need to write start routine to fill one of my target feild.
    Here my info object is ZCust and attribute zpur_grp
    My DSO have 0customer and zpur_grp.
    Am creating self transformations for my dso and need to fill zpur_grp from zcust if dso-zpur_grp is blank.
    condition is dso-0customer = info object-customer.
    Am new to abap code part and confused about specifying fields and tables(/bic/).
    Need suggestions to write sample format code.
    Thanks in advance.
    Chandra

    Hi Chandra,
    U need to write look-up code.
    Below s sample code. it might be help you.
    Declare Internal Table Like follow:
    TYPES: BEGIN OF TY_CUST,
                      ZCust TYPE /BIC/ ZCust ,
                      zpur_grp TYPE /BIC/ zpur_grp
                   END OF TY_CUST.
    select value for internal table.
    SELECT /BIC/ ZCust /BIC/zpur_grp
           FROM /BIC/PZCust
           INTO TABLE IT_CUST
           FOR ALL ENTRIES IN SOURCE_PACKAGE
           WHERE /BIC/ZCust = SOURCE_PACKAGE-/BIC/0customer
           AND OBJVERS = 'A'.
    Then write Lookup code in start routine.
    LOOP AT SOURCE_PACKAGE ASSIGNING <SOURCE_FIELDS>.
           clear : WA_CUST_DBDIV.
    * Read internal table for customer
           READ TABLE IT_CUST
           WITH KEY ZCust = <SOURCE_FIELDS>-/BIC/0custome
           INTO WA_CUST_DBDIV
           BINARY SEARCH.
    *Populate the corresponding Customer and DB Division in RESULT_PACKAGE
           IF SY-SUBRC = 0.
             <SOURCE_FIELDS>-/BIC/0custome = WA_CUST_DBDIV-ZCust.
             <SOURCE_FIELDS>-/BIC/zpur_grp = WA_CUST_DBDIV-zpur_grp.
    ENDLOOP.
    Hope it 'll help you.
    Regards,
    Mukesh

  • End Routine to populate custom AFS field for Billing Item extractor

    I have the following scenario for Billing 2LIS_13_VDITM datasource
    Doc_No   Item  Material    Item_Categ   AFS_field
    2000        11     XYZ          123
    2000        12     XYZ          123                  US1
    3000        11     PQR          456                 
    3000        12     PQR          456                  CA1
    I need to populate the AFS_field in the first row also for all Doc Nos for certain Item categories (eg 123 & 456). I need to do this on the first transformation from PSA to DSO. I was planning to write a SELECT statement in the Start Routine with the PSA table as the reference as seen below and then write an End Routine calling this reference table. But the PSA table name is different in Dev, QA and Prod so I cannot use this.
    TYPES: BEGIN OF S_AFS,
    VBELN TYPE C LENGTH 10,
    PSTYV TYPE C LENGTH 4,
    MATNR TYPE C LENGTH 18,
    J_4KRCAT TYPE C LENGTH 16,
    J_4KSCAT TYPE C LENGTH 16,
    END OF S_AFS.
    DATA: LT_AFS TYPE STANDARD TABLE OF S_AFS,
          LS_AFS TYPE S_AFS.
    DATA: LT_DATA TYPE tyt_SC_1.
    LT_DATA[] = SOURCE_PACKAGE[].
    SORT LT_DATA DESCENDING BY VBELN MATNR J_4KRCAT.
    DELETE ADJACENT DUPLICATES FROM LT_DATA COMPARING VBELN MATNR.
    SELECT VBELN MATNR J_4KRCAT J_4KSCAT
    INTO CORRESPONDING FIELDS OF TABLE LT_AFS
    FROM /BIC/B0000777001
    FOR ALL ENTRIES IN LT_DATA WHERE VBELN = LT_DATA-VBELN AND MATNR =
    LT_DATA-MATNR.
    SORT LT_AFS BY VBELN MATNR.
    I am not an expert in writing ABAP code. Any suggestions are greatly appreciated and points will be assigned. Thank you.

    Hi
    why do want to select the data from PSA table ?Already your trying to load data from PSA to DSO.
    you want to populate the AFS field value in DSO right?
    1. First you have to add AFS field in ur DSO
    2. Write the Start routine based on ur scenario(select the data based on ur scenario and put into internal table).
    3. wirte AFS field leval  transfer routine(Read the corresponding record based on docu num,item num) pass into RESULT.
    Regards,
    GR

  • Syntax error in start routine

    Dear All,
    I have activated the infocube 0sd_c03 with grouping "in data flow before" and the infocube is activated with datasources
    2LIS_11_VAITM
    2LIS_11_VAHDR
    2LIS_12_VCITM
    2LIS_12_VCHDR
    2LIS_13_VDITM
    2LIS_13_VDHDR in 3.x where as
    TRCS 2LIS_13_VDITM -> CUBE 0SD_C03 in transformation with DTP.
    when I activate the transformation I get error as mentioned below:
    Start Routine: Syntax error in routine and in the start routine when I check the details of the error is
                      E:In PERFORM or CALL FUNCTION "ROUTINE_9998", the actual parameter
                               "SOURCE_PACKAGE" is incompatible with the formal parameter
                                   "DATA_PACKAGE".
    If source pakage is replaced by data package the system message is data_package is not available.
    What do I do to resolve this issue.
    KS

    hi,
    There is a structral diffrence between SOURCE_PACKAGE and DATA_PACKAGE
    so you need to change tys_SC_1_full
    go through the below links for similar problem
    Re: 0IC_C03: 2LIS_03_BF Transformation Start Routine Activation error
    Re: 2LIS_03_BF transformation problem

  • 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

  • Using internal tables in BI 7 Start routines

    Hi All
    I tried searching for using internal tables in a start routine in BI 7 could not find the right pointers.
    This is what I am trying to do is the following:
    In a DSO ZSD_O01  I have a sales order and sales order item number and this DSO also contains the Contract number and the contract Item number.
    The DSO structure is as follows:
    /BIC/AZSD_O0100
    DOC_NUMBER
    ITEM
    CONTRACT
    CITEMNUM
    I want to read the data in this DSO into a internal table. But the key fields in this DSO is DOC_NUMBER and ITEM so I want to read this data into a internal table only for the first data package into the internal table. Thereafter I want to lookup into the internal table given the doc_number and ITEM to find the CONTRACT and CITEMNUM.
    Can any of you kindly show me how to :
    - Read data from a DSO into a internal table
    - Read the internal table for the first data package
    - How do I make the access in the internal table fast when my lookup in the internal table is not on the
      DSO key columns but on a different key column
    Appreciate your help
    Thanks
    Karen

    Hi Karen ,
    It will be helpful if you tell your requirement  as the approach you suggested is not looks convincing .May be their is some easy way and we can suggest you better approach
    -how to check for source_package = 1
    You need to hard code it .
    We decide package size at DTP level so you can declare a global variable .let say you have 50000 size of your  package then use global variable as counter and read only when record_count is <= 50000 .
    -how to declare the internal table so the values in it exists between different data packages
    Declare a global table and select data into it .A global table retain data across  the packages .
    - The key on which I need to lookup in the internal table is not the key fields as in the DSO
    Its ok .Let say you are doing lookup on A B and C field of DSO1 and the values may duplicate  in your source .then you just need to read the internal table having data from DSO2  with key field  A B C .
    Better if you set them as semantic keys at DTP level so that all  duplicate entries of A B  C will appear in same package .
    global Declarations
    In your start routine you will have this following code :
      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   -
    One question
    Why you want to populate values for 1 source package only not for all ?This will be helpful to understand your requirement and may be we can fulfill it in some other manner .
    Regards,
    Jaya Tiwari

  • Add Multiple records to G/L account group.

    Dear ABAP Experts,
    i have requirement that is using  BDC recording file  the Functional People wants to add records to the G/L Account group. The FI consultant gave the recording file, based on the recording file i developed a BDC program. This BDC program will work for single record. After creating single record system will ask for transport request .
    REPORT  ZDP_ACC_GRP.
    TYPES: BEGIN OF TY_TAB,
            KTOPL TYPE KTOPL,
            KTOKS TYPE KTOKS,
            TXT30 TYPE TXT30,
            VONNR TYPE VONNR,
            BISNR TYPE BISNR,
           TRKORR TYPE TRKORR,
       END OF TY_TAB.
    data: lt_tab type table of ty_tab,
           wa_tab type ty_tab.
    data: begin of record,
    * data element: KTOPL
             KTOPL_01_001(004),
    * data element: KTOKS
             KTOKS_01_002(004),
    * data element: TXT30_077T
             TXT30_01_003(030),
    * data element: VONNR_077S
             VONNR_01_004(010),
    * data element: BISNR_077S
             BISNR_01_005(010),
    * data element: TRKORR
             TRKORR_006(020),
           end of record.
    *       Batchinputdata of single transaction
    DATA:   BDCDATA type table of BDCDATA  WITH HEADER LINE.
    *       messages of call transaction
    DATA:   MESSTAB type table of BDCMSGCOLL  WITH HEADER LINE.
    *       error session opened (' ' or 'X')
    DATA:   E_GROUP_OPENED.
    *       message texts
    TABLES: T100.
    data:lv_file type string.
    parameters: p_fname type IBIPPARMS-PATH.
    at selection-screen on value-request for p_fname.
    CALL FUNCTION 'F4_FILENAME'
      EXPORTING
        PROGRAM_NAME        = SYST-CPROG
        DYNPRO_NUMBER       = SYST-DYNNR
        FIELD_NAME          = 'P_FNAME'
      IMPORTING
        FILE_NAME           = p_fname .
    start-of-selection.
    lv_file = p_fname.
    CALL FUNCTION 'GUI_UPLOAD'
       EXPORTING
         FILENAME                      = LV_FILE
    *   FILETYPE                      = 'ASC'
        HAS_FIELD_SEPARATOR           = 'X'
       TABLES
         DATA_TAB                      = LT_TAB
      EXCEPTIONS
        FILE_OPEN_ERROR               = 1
        FILE_READ_ERROR               = 2
        NO_BATCH                      = 3
        GUI_REFUSE_FILETRANSFER       = 4
        INVALID_TYPE                  = 5
        NO_AUTHORITY                  = 6
        UNKNOWN_ERROR                 = 7
        BAD_DATA_FORMAT               = 8
        HEADER_NOT_ALLOWED            = 9
        SEPARATOR_NOT_ALLOWED         = 10
        HEADER_TOO_LONG               = 11
        UNKNOWN_DP_ERROR              = 12
        ACCESS_DENIED                 = 13
        DP_OUT_OF_MEMORY              = 14
        DISK_FULL                     = 15
        DP_TIMEOUT                    = 16
        OTHERS                        = 17  .
    LOop at  lt_tab into wa_tab.
    perform bdc_dynpro      using 'SAPL0F09' '0020'.
    perform bdc_field       using 'BDC_CURSOR'
                                   'V_T077S-TXT30(01)'.
    perform bdc_field       using 'BDC_OKCODE'
                                   '=NEWL'.
    perform bdc_dynpro      using 'SAPL0F09' '0020'.
    perform bdc_field       using 'BDC_CURSOR'
                                   'V_T077S-BISNR(01)'.
    perform bdc_field       using 'BDC_OKCODE'
                                   '=SAVE'.
    perform bdc_field       using 'V_T077S-KTOPL(01)'
                                   WA_TAB-KTOPL."record-KTOPL_01_001.
    perform bdc_field       using 'V_T077S-KTOKS(01)'
                                   WA_TAB-KTOKS."record-KTOKS_01_002.
    perform bdc_field       using 'V_T077S-TXT30(01)'
                                   WA_TAB-TXT30."record-TXT30_01_003.
    perform bdc_field       using 'V_T077S-VONNR(01)'
                                   WA_TAB-VONNR."record-VONNR_01_004.
    perform bdc_field       using 'V_T077S-BISNR(01)'
                                   WA_TAB-BISNR."record-BISNR_01_005.
    perform bdc_dynpro      using 'SAPLSTRD' '0300'.
    perform bdc_field       using 'BDC_CURSOR'
                                   'KO008-TRKORR'.
    perform bdc_field       using 'BDC_OKCODE'
                                   '=LOCK'.
    perform bdc_field       using 'KO008-TRKORR'
                                   WA_TAB-TRKORR."record-TRKORR_006.
    perform bdc_dynpro      using 'SAPL0F09' '0020'.
    perform bdc_field       using 'BDC_CURSOR'
                                   'V_T077S-KTOPL(02)'.
    perform bdc_field       using 'BDC_OKCODE'
                                   '=BACK'.
    perform bdc_dynpro      using 'SAPL0F09' '0020'.
    perform bdc_field       using 'BDC_CURSOR'
                                   'V_T077S-KTOPL(02)'.
    perform bdc_field       using 'BDC_OKCODE'
                                   '=BACK'.
    perform bdc_transaction using 'OBD4'.
    ENDLOOP.
    FORM BDC_TRANSACTION USING TCODE.
       DATA: L_MSTRING(480).
       DATA: L_SUBRC LIKE SY-SUBRC.
    * batch input session
    * call transaction using
         REFRESH MESSTAB.
         CALL TRANSACTION 'OBD4' USING BDCDATA
                          MODE  'A'" CTUMODE
                          UPDATE 'S'"CUPDATE
                          MESSAGES INTO MESSTAB.
         L_SUBRC = SY-SUBRC.
           LOOP AT MESSTAB.
             SELECT SINGLE * FROM T100 WHERE SPRSL = MESSTAB-MSGSPRA
                                       AND   ARBGB = MESSTAB-MSGID
                                       AND   MSGNR = MESSTAB-MSGNR.
             IF SY-SUBRC = 0.
               L_MSTRING = T100-TEXT.
               IF L_MSTRING CS '&1'.
                 REPLACE '&1' WITH MESSTAB-MSGV1 INTO L_MSTRING.
                 REPLACE '&2' WITH MESSTAB-MSGV2 INTO L_MSTRING.
                 REPLACE '&3' WITH MESSTAB-MSGV3 INTO L_MSTRING.
                 REPLACE '&4' WITH MESSTAB-MSGV4 INTO L_MSTRING.
               ELSE.
                 REPLACE '&' WITH MESSTAB-MSGV1 INTO L_MSTRING.
                 REPLACE '&' WITH MESSTAB-MSGV2 INTO L_MSTRING.
                 REPLACE '&' WITH MESSTAB-MSGV3 INTO L_MSTRING.
                 REPLACE '&' WITH MESSTAB-MSGV4 INTO L_MSTRING.
               ENDIF.
               CONDENSE L_MSTRING.
               WRITE: / MESSTAB-MSGTYP, L_MSTRING(250).
             ELSE.
               WRITE: / MESSTAB.
             ENDIF.
           ENDLOOP.
       REFRESH BDCDATA.
    ENDFORM.
    FORM BDC_DYNPRO USING PROGRAM DYNPRO.
       CLEAR BDCDATA.
       BDCDATA-PROGRAM  = PROGRAM.
       BDCDATA-DYNPRO   = DYNPRO.
       BDCDATA-DYNBEGIN = 'X'.
       APPEND BDCDATA.
    ENDFORM.
    FORM BDC_FIELD USING FNAM FVAL.
         CLEAR BDCDATA.
         BDCDATA-FNAM = FNAM.
         BDCDATA-FVAL = FVAL.
         APPEND BDCDATA.
    ENDFORM.
    But the FI consultant wants to add multiple records to 'G/L account group'.After adding records before saving the system need to ask transport request at the last.
    How can I write code ...??
    Please help me.

    Hi Srikanth,
    Thanks for reply,
    You  are right we need to load hierarchy for G/L then we can see all the G/L's for all G/L groups.
    I have one more question when I check in RSA3 for the G/L account numbers, I could not find them.
    I am using the datasource fi_gl_4 and in rsa3 I can see 1000 records data and when I put filter on G/L account and search for the G/L number I needed I cant see it, but it is there in the functional transaction(f.01)?
    How to check for the required G/L's in rsa3 ?
    Thx

  • Start routine errors while activating transformations 2LIS_13_VDITM

    Hi Friends,
    I have an error while activating transformation for Cube: 0SD_C03
    Transformation Z2LIS_13_VDITM
    The start routine error is like this->
    Start Routine: Syntax error in routine
    Rule (target: 0SUBTOT_1S, group: 01 Standard Group): Syntax error in routine
    Rule (target: 0SUBTOT_2S, group: 01 Standard Group): Syntax error in routine
    Rule (target: 0SUBTOT_3S, group: 01 Standard Group): Syntax error in routine
    Rule (target: 0SUBTOT_4S, group: 01 Standard Group): Syntax error in routine
    Rule (target: 0SUBTOT_5S, group: 01 Standard Group): Syntax error in routine
    Rule (target: 0SUBTOT_6S, group: 01 Standard Group): Syntax error in routine
    Rule (target: 0QUANT_B, group: 01 Standard Group): Syntax error in routine
    Rule (target: 0DOC_ITEMS, group: 01 Standard Group): Syntax error in routine
    Rule (target: 0NET_VAL_S, group: 01 Standard Group): Syntax error in routine
    Rule (target: 0COST_VAL_S, group: 01 Standard Group): Syntax error in routine
    Rule (target: 0GR_WT_KG, group: 01 Standard Group): Syntax error in routine
    Rule (target: 0NT_WT_KG, group: 01 Standard Group): Syntax error in routine
    Rule (target: 0VOLUME_CDM, group: 01 Standard Group): Syntax error in routine
    Rule (target: 0BP_GRP, group: 01 Standard Group): Syntax error in routine
    Rule (target: 0CP_CATEG, group: 01 Standard Group): Syntax error in routine
    S:RSTRAN:552 38 0CRM_PROD 01 Standard Group 0MATERIAL
    Rule (target: 0DEB_CRED, group: 01 Standard Group): Syntax error in routine
    Rule (target: 0PROD_CATEG, group: 01 Standard Group): Syntax error in routine
    Key rule 43 (target field: 0VERSION): Initial update set
    pls guys if some one can suggest me to solve this i would be very greateful
    Bala
    Edited by: bala dondeti on Jun 20, 2011 12:32 PM
    Edited by: bala dondeti on Jun 20, 2011 12:43 PM

    Thanks for the info Umesh,
    Just to be sure - I should simply change "SOURCE_PACKAGE" to "DATA_PACKAGE" in the code of the start routine? "Source_Package" is present in two places in that code:
    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.
    and then after that in:
    Migrated update rule call
      Perform routine_9998
      TABLES
        SOURCE_PACKAGE
      CHANGING
        l_abort.
    Or should I revert to the 3.5 version? (as a side note, that Data Source (2LIS_13_VDITM) has been activated in 7.0 version by default, when I replicated data sources in BW).
    Praveen, as to your remarks, I have the datasource 2LIS_13_VDITM (in version 7.0) active, along with the appropriate Infosource. Transformation between the DataSource and InfoSource is active, and only the transformation between the InforSource and the Cube poses problems.
    BR,
    Alek

  • Data Source 0HR_PA_0 Syntax Error in the start routine while activating

    Hi All,
    I have migrated the Business content for the data source 0HR_PA_0
    While activating the transformation-2 there is errors like:
    Start Routine: Syntax error in routine
    Rule (target: 0HDCNT_LAST, group: 01 Standard Group): Syntax error in routine
    Rule (target: 0AGE_KYF, group: 01 Standard Group): Syntax error in routine
    .................... etc
    I need help to resolve this issue.
    Thanks & Regards,
    Savitha

    Hello Jurgita,
    When Data Source was migrated the codes related to COMM_STRUCTURE was missing in the start routinue.
    Following codes (in bold) with regard to COMM_STRUCTURE added and then got activated
    4.     *--
    5.         COMM_STRUCTURE   type tys_sc_1__rule_25,
    6.         l_subrc          type sy-tabix,
    7.         l_abort          type sy-tabix,
    8.         ls_monitor       TYPE rsmonitor,
    9.         ls_monitor_recno TYPE rsmonitors.
    10.     
    11.       REFRESH:
    12.         MONITOR.
    13.     
    14.     * Runtime attributs
    15.         SOURCE_SYSTEM  = p_r_request->get_logsys( ).
    16.         move-corresponding SOURCE_FIELDS to COMM_STRUCTURE.
    17.     
    18.     *  Migrated update rule call
    19.       Perform routine_0011
    20.       using
    21.         COMM_STRUCTURE
    22.       CHANGING
    Regards,
    Savitha
    Edited by: Savitha  Ravi on Jun 19, 2009 6:34 AM

  • Want to change ACCOUNT GROUP to BP from CRM to ECC

    Hi All,
    We would like to change the Account group of our (Inside/Outside sales persons) when they are replicating from CRM to ECC.  We did change the PIDE setting according to our requirement but surprisingly 10-12 BPs are not getting changed. We opened an OSS and they suggested to write a Z function module and
    registering it in the table CRMC_BUT_CALL_FU for the CRM OUTBOUND which HARDCODES the CLASSIFICATION DATA to the BP in accordance with the PIDE settings so as to get the ACCOUNT GROUP for these BPs.
    I checkede the tcode CRMC_BUT_CALL_FU for the CRM OUTBOUND where we need to place our own FM. I know to write a FM, but not quite sure how to start. Can anyone out there please help me with this.
    Any suggestions are highly appreciated.
    Thanks,
    Karuna.

    I was able to change the account status from EXPIRE(GRACE) to OPEN. The trick as you hint at is to create a temporary profile, assign that profile to the account in question, saving the password from dba_users first, changing the password, logging in with the new password, then alter the user assigning back the original password with the identified by values clause in the later user statement and lastly assigning the original profile, either DEFAULT or custom.
    Here is the temp profile I used which used values less than 1 for the critical limits involved here. Cannot have limit values less than 1 in 9i according to Oracle but you can in 10g.
    CREATE PROFILE "TEMP_PROFILE" LIMIT CPU_PER_SESSION DEFAULT
    CPU_PER_CALL DEFAULT
    CONNECT_TIME DEFAULT
    IDLE_TIME 15
    SESSIONS_PER_USER DEFAULT
    LOGICAL_READS_PER_SESSION DEFAULT
    LOGICAL_READS_PER_CALL DEFAULT
    PRIVATE_SGA DEFAULT
    COMPOSITE_LIMIT DEFAULT
    PASSWORD_LIFE_TIME .0001
    PASSWORD_GRACE_TIME 5
    PASSWORD_REUSE_MAX 1
    PASSWORD_REUSE_TIME .0001
    PASSWORD_LOCK_TIME .0103
    FAILED_LOGIN_ATTEMPTS 3
    PASSWORD_VERIFY_FUNCTION DEFAULT;
    Thanks for your help.

Maybe you are looking for