Start Routine Lookup!

Hi
How to write a lookup in Start Routine to calling customer table. we are maintains values in custom table.
i am
Regds,DS

Hi,
You simply need to create an internal table of type customer table in start routine global declaration part.
After that you will have to populate that internal table using select query in start routine. e.g.
SELECT *
FROM  XYZ
into table it_xyz
where key1 = 'AB'. etc.
In this case XYZ is customer table and it_xyz is internal table. Once values are available in internal table you can use them in field routine or start routine as per the need.
Regards,
Durgesh.

Similar Messages

  • Regarding start routine used for lookups

    Hi All,
    I am doing a lookup whose logic is being defined in start routine. My requirment is like this.
    I am having an infoobject(1) having a master data and it also have an attribute having the master data too.
    Now I am having one more object(2) having the masterdata and an attribute with out data.
    In my routine I have defined a logic to compare two infoobjects. If they are equal then load the data of the attribute of first infoobject into the second infoobject.
    I have defined the logic like this in routine.
    SELECT /BIC/Z_LOOKUP2
                         FROM /BIC/Z_LOOKUP1
        INTO /BIC/Z_LOOKUP4
           FOR ALL ENTRIES IN SOURE_PACKAGE[]
        WHERE  /BIC/Z_LOOKUP3 = SOURCE_FIELDS-/BIC/Z_LOOKUP1
        END SELECT.
    I am geeting an error as /BIC/Z_LLOKUP1 IS NOT defined in ABAP dictionary as a table,.
    How can I resolve this.
    Please help me.
    Z_LOOKUP1 is having Z_LOOKUP2 as an attribute and,
    Z_LLOKUP3 is having Z_LLOKUP4 as an attribute.
    Thanks.
    Vinay,

    Hi,
    Just check the master data table created for your infoObject Z_LOOKUP1. It would be something like /BIC/PZ_LOOKUP100.
    If you are still getting the error, post your exact code here and we can take a look.
    Hope this helps!
    Regards,
    Saurabh

  • Lookup DSO in Start Routine and End Routine to update date

    Hi Gurus,
    I need a Start Routine & help, while loading the data from DSO to Info Cube.
    In the DSO ( /BIC/AZSD_O0300 ) & in the InfoCube I have a common fields are
    0DOC_NUMBER ( DOCUMENT NUMBER), 0S_ORD_ITEM ( Sales Document Item Number ), 0SCHED_LINE ( Schedule Line ) and 0MATAV_DATE ( Material Available Date ).
    Data in DSO is as follows
    0DOCNUMBER_ 0SORD_ITEM_ 0SCHEDLINE_ 0MATAVDATE_
    1001 10 1 05/21/2011
    1001 20 2 05/26/2011
    1001 10 2 05/22/2011
    1001 20 1 05/18/2011
    1002 20 1 05/20/2011
    1002 10 1 05/24/2011
    1002 10 2 05/28/2011
    Data should load in the InfoCube as below.
    0DOCNUMBER    0S_ORD_ITEM     0SCHED_LINE    0MATAV_DATE
    1001          10    1   05/21/2011
    1001          20    2   05/18/2011
    1001          10    2   05/21/2011
    1001          20     1  05/18/2011
    1002         20     1  05/20/2011
    1002         10    1   05/24/2011
    1002         10     2   05/24/2011  
    When ever schedule line is 2 for the record we have to check both Document number and 0S_ORD_ITEM are same change the Material moving date to the date schedule line is 1 for the same document and same order item number.
    Your help is really appreciated.
    Thanks
    Ganesh Reddy.

    Thanks Parth and Raj. I have written code almost as you suggested just little changes.
    Start Routine
    TABLES:/BIC/AZSD_O0300.
    DATA:ITAB_DSO LIKE /BIC/AZSD_O0300.
    TYPES: BEGIN OF ITABTYPE,
    DOC_NUM TYPE /BI0/OIDOC_NUMBER,
    SAL_DOC_NUM TYPE /BI0/OIS_ORD_ITEM,
    SCHED_NUM TYPE /BI0/OISCHED_LINE,
    MAT_AV_DATE TYPE /BI0/OIMATAV_DATE,
    END OF ITABTYPE.
    DATA : ITAB TYPE STANDARD TABLE OF ITABTYPE
           WITH HEADER LINE
           WITH NON-UNIQUE DEFAULT KEY INITIAL SIZE 0.
    data: wa_itab type ITABTYPE.
    SELECT DOC_NUMBER S_ORD_ITEM SCHED_LINE MATAV_DATE
      FROM /BIC/AZSD_O0300
      INTO TABLE ITAB
      WHERE SCHED_LINE = '1'.
    Field Routine.
    if SOURCE_FIELDS-S_ORD_ITEM <> '1'.
          read table itab into wa_itab with key    doc_num =
          SOURCE_FIELDS-DOC_NUMBER
                                             SAL_DOC_NUM =
                                             SOURCE_FIELDS-S_ORD_ITEM.
          if sy-subrc = 0.
          RESULT = wa_itab-MAT_AV_DATE.
        endif.
      endif.
    I haven't check how the data is coming. But for now I am closing this issue.
    Thanks Again
    Ganesh Reddy.

  • 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

  • Error while transporting Transformation: Syntax error in Start Routine

    Hi Everyone,
    I'm facing a strange problem during transporting one of the Business Content cubes from Dev. to Quality.
    I'd activated the DSO 'Purchase Order Items (0PUR_O01)' and its entire data flow from the 4 datasources 2LIS_02_CGR, 2LIS_02_SCN, 2LIS_02_SGR, and 2LIS_02_ITM from BC. Then I migrated the Transfer/Update rules to transformations and the DataSources to BI7 DataSource. So far so good. The migration was successful and all the objects were activated.
    Now when I transport the same to Quality, the import fails with return code 8 and the error message says:
    'Start of the after-import method RS_TRFN_AFTER_IMPORT for object type(s) TRFN (Activation Mode)'
    'Start Routine: Syntax error in routine'
    I verified that the transformation where the error orrured was the one from InfoSource Z2LIS_02_ITM to DSO 0PUR_O01. I went and checked the start routine and it did indeed have a syntax error:
    'In PERFORM or CALL FUNCTION "ROUTINE_9998", the actual parameter SOURCE_PACKAGE" is incompatible with the formal parameter DATA_PACKAGE". '
    But when I check in the Dev. system, there is no syntax error for the same routine. Later, I tried to transport only the said transformation by re-activating it in Dev, and again I got the same error.
    I have no idea why I'm getting a syntax error in the start routine when there are non in the Dev. system. Also none of the coding is customised, it was only the BC code, migrated to a transformation.
    Any suggestions on the steps I could take to transport the transformation to my quality system?
    Thanks,
    Ram

    Hi Ajay, Shanthi, svu and Ray
    I do indeed have a start routine in my transformation and it was migrated from a 3.x update rule to a BI 7 transformation routine.
    The migration was successful and the Start Routine has NO syntax errors in the start routine in the Dev. system. I only encounter the error while transporting it to the Quality system. I cannot modify the code in the Quality system because it is non-changelable and there is no point in trying to change the code in Dev. because there are no errors over there.
    I've also made sure that I've transported all the necessary objects required by the transformations to quality. The routine does not perform a lookup, it simply deletes some records from the data package based on the processkey value (which is itself present in the data package).

  • 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

  • Start Routine not working correctly.

    Hi gurus,
    I'm having a problem with a start routine in an update rule to one of my cubes. I debug it and it seems to work fine. However, it ends the simulation saying in the error message "No active update rules exist for this infosource." However, I think it's something to do with the logic I have in my start routine. Below is the start routine which I am trying to debug. I'm doing a lookup on an ODS and if no match is found on that ODS by Sales Order and Sales Order Item, I do another lookup on an object that has the same information that I'm looking to append to the transaction record. Any help would be greatly appreciated. I'm thinking the second loop against the internal table might not be working correctly as it seems to just sit on that table.
    Thanks in advance,
    John
    PROGRAM UPDATE_ROUTINE.
    $$ begin of global - insert your declaration only below this line  -
    TABLES: ...
    DATA:   PENDING_QTY  LIKE /BIC/AZO_BKLG100-/BIC/ZQTYPEND1,
            ABSOLUTE_QTY LIKE /BIC/AZO_BKLG100-/BIC/ZQTYPEND1,
            TEN_PERCENT  LIKE /BIC/AZO_BKLG100-/BIC/ZQTYPEND1,
            TEN_PERCENT_VALUE TYPE P LENGTH 4 DECIMALS 2 VALUE '0.1'.
    DATA:   ZWEEK LIKE SCAL-WEEK.
    $$ end of global - insert your declaration only before this line   -
    The follow definition is new in the BW3.x
    TYPES:
      BEGIN OF DATA_PACKAGE_STRUCTURE.
         INCLUDE STRUCTURE /BIC/CSZO_PMO1_ENHANCED.
    TYPES:
         RECNO   LIKE sy-tabix,
      END OF DATA_PACKAGE_STRUCTURE.
    DATA:
      DATA_PACKAGE TYPE STANDARD TABLE OF DATA_PACKAGE_STRUCTURE
           WITH HEADER LINE
           WITH NON-UNIQUE DEFAULT KEY INITIAL SIZE 0.
    FORM startup
      TABLES   MONITOR STRUCTURE RSMONITOR "user defined monitoring
               MONITOR_RECNO STRUCTURE RSMONITORS " monitoring with record n
               DATA_PACKAGE STRUCTURE DATA_PACKAGE
      USING    RECORD_ALL LIKE SY-TABIX
               SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS
      CHANGING ABORT LIKE SY-SUBRC. "set ABORT <> 0 to cancel update
    $$ begin of routine - insert your code only below this line        -
    fill the internal tables "MONITOR" and/or "MONITOR_RECNO",
    to make monitor entries
    TABLES : /BIC/AZO_PMI100.    "Active PM Invoice ODS
    TABLES : /BIC/PZ_CTBWOBJ.    "CTBW Order Master
      DATA: T_DATA_PAK  LIKE DATA_PACKAGE OCCURS 0 WITH HEADER LINE,
            T_DATA_PAK1 LIKE DATA_PACKAGE OCCURS 0 WITH HEADER LINE,
            IV_INVQTY like /BIC/AZO_PMI100-INV_QTY,
            IV_INVVAL like /BIC/AZO_PMI100-NETVAL_INV,
            BEGIN OF IT_INVOICES OCCURS 0,
                  INV_SALES_ORD    LIKE /BIC/AZO_PMI100-/BIC/ZSORDDORD,
                  INV_SALES_ITEM   LIKE /BIC/AZO_PMI100-/BIC/ZSORDIORD,
                  INV_DOC_NUM      LIKE /BIC/AZO_PMI100-/BIC/ZBILLDINV,
                  INV_DOC_ITEM     LIKE /BIC/AZO_PMI100-/BIC/ZBILLIINV,
                  INV_QTY          LIKE /BIC/AZO_PMI100-INV_QTY,
                  NETVAL_INV       LIKE /BIC/AZO_PMI100-NETVAL_INV,
                  ZBRAND           LIKE /BIC/AZO_PMI100-/BIC/ZBRAND,
                  ZBRANDOWN        LIKE /BIC/AZO_PMI100-/BIC/ZBRANDOWN,
                  ZDESGNOWN        LIKE /BIC/AZO_PMI100-/BIC/ZDESGNOWN,
                  ZFLAGBKLG        LIKE /BIC/AZO_PMI100-/BIC/ZFLAGBKLG,
                  ZNOCOLORS        LIKE /BIC/AZO_PMI100-/BIC/ZNOCOLORS,
                  ZNOSPCLRS        LIKE /BIC/AZO_PMI100-/BIC/ZNOSPCLRS,
                  ZOPENFCTY        LIKE /BIC/AZO_PMI100-/BIC/ZOPENFCTY,
                  ZPACKSYST        LIKE /BIC/AZO_PMI100-/BIC/ZPACKSYST,
                  ZPPG             LIKE /BIC/AZO_PMI100-/BIC/ZPPG,
                  ZAPPLICAT        LIKE /BIC/AZO_PMI100-/BIC/ZAPPLICAT,
                  ZPAPERGDE        LIKE /BIC/AZO_PMI100-/BIC/ZPAPERGDE,
                  ZPRINTMTH        LIKE /BIC/AZO_PMI100-/BIC/ZPRINTMTH,
                  ZQUALITY         LIKE /BIC/AZO_PMI100-/BIC/ZQUALITY,
                  ZSHAPE           LIKE /BIC/AZO_PMI100-/BIC/ZSHAPE,
                  ZSIZE            LIKE /BIC/AZO_PMI100-/BIC/ZSIZE,
                  ZVARIANT         LIKE /BIC/AZO_PMI100-/BIC/ZVARIANT,
                  ZVOLUME          LIKE /BIC/AZO_PMI100-/BIC/ZVOLUME,
            END OF IT_INVOICES,
            BEGIN OF IT_CTBW OCCURS 0,
                  CTBW_SALES_ORD    LIKE /BIC/PZ_CTBWOBJ-/BIC/ZSORDDORD,
                  CTBW_SALES_ITEM   LIKE /BIC/PZ_CTBWOBJ-/BIC/ZSORDIORD,
                  CTBW_BRAND        LIKE /BIC/PZ_CTBWOBJ-/BIC/ZBRAND,
                  CTBW_BRANDOWN     LIKE /BIC/PZ_CTBWOBJ-/BIC/ZBRANDOWN,
                  CTBW_DESGNOWN     LIKE /BIC/PZ_CTBWOBJ-/BIC/ZDESGNOWN,
                  CTBW_NOCOLORS     LIKE /BIC/PZ_CTBWOBJ-/BIC/ZNOCOLORS,
                  CTBW_NOSPCLRS     LIKE /BIC/PZ_CTBWOBJ-/BIC/ZNOSPCLRS,
                  CTBW_C_APM_006    LIKE /BIC/PZ_CTBWOBJ-/BIC/C_APM_006,
                  CTBW_PACKSYST     LIKE /BIC/PZ_CTBWOBJ-/BIC/ZPACKSYST,
                  CTBW_PAPERGDE     LIKE /BIC/PZ_CTBWOBJ-/BIC/ZPAPERGDE,
                  CTBW_PPG          LIKE /BIC/PZ_CTBWOBJ-/BIC/ZPPG,
                  CTBW_PRINTMTH     LIKE /BIC/PZ_CTBWOBJ-/BIC/ZPRINTMTH,
                  CTBW_QUALITY      LIKE /BIC/PZ_CTBWOBJ-/BIC/ZQUALITY,
                  CTBW_SHAPE        LIKE /BIC/PZ_CTBWOBJ-/BIC/ZSHAPE,
                  CTBW_SIZE         LIKE /BIC/PZ_CTBWOBJ-/BIC/ZSIZE,
                  CTBW_VARIANT      LIKE /BIC/PZ_CTBWOBJ-/BIC/ZVARIANT,
                  CTBW_VOLUME       LIKE /BIC/PZ_CTBWOBJ-/BIC/ZVOLUME,
            END OF IT_CTBW.
    *These deletions are already included in the InfoPackage:
    *Keep only PackMat Finished Materials SOrders:
    *DELETE DATA_PACKAGE
      WHERE MATL_GROUP(5) NE 'PM-FM'.
    *Keep only open SOrders:
    *DELETE DATA_PACKAGE
       where /BIC/ZOSTATUS = 'C'.
    *Keep only MC and CF SOrders:
    *DELETE DATA_PACKAGE
       where DOC_TYPE NE 'ZOR6' AND DOC_TYPE NE 'ZOR9'.
    *Keep only non rejected SOrders:
    DELETE DATA_PACKAGE
        where REASON_REJ IS NOT INITIAL.
              Exclude list of statistical Item Categories (not billing
              relevant).
    DELETE DATA_PACKAGE WHERE
       ITEM_CATEG = 'ZPC1' or     
       ITEM_CATEG = 'ZPC2' or     
       ITEM_CATEG = 'ZPC3' or
       ITEM_CATEG = 'ZPC4' or
       ITEM_CATEG = 'ZTAF' or     
       ITEM_CATEG = 'ZTAE' or     
       ITEM_CATEG = 'ZTAG' or     
       ITEM_CATEG = 'ZTSV'.
      REFRESH: T_DATA_PAK,T_DATA_PAK1,
               IT_INVOICES, IT_CTBW.
      T_DATA_PAK[] = DATA_PACKAGE[].
      T_DATA_PAK1[] = DATA_PACKAGE[].
      DATA : COUNT1 LIKE SY-TABIX.
      DESCRIBE TABLE T_DATA_PAK1 LINES COUNT1.
      IF NOT COUNT1 IS INITIAL.
       Selection for Invoice Items    ***********
    SORT T_DATA_PAK1 BY /BIC/ZSORDDORD /BIC/ZSORDIORD.
       SELECT   /BIC/ZSORDDORD /BIC/ZSORDIORD /BIC/ZBILLDINV /BIC/ZBILLIINV
                INV_QTY        NETVAL_INV
                /BIC/ZBRAND    /BIC/ZBRANDOWN /BIC/ZDESGNOWN /BIC/ZFLAGBKLG
                /BIC/ZNOCOLORS /BIC/ZNOSPCLRS /BIC/ZOPENFCTY /BIC/ZPACKSYST
                /BIC/ZPPG      /BIC/ZAPPLICAT /BIC/ZPAPERGDE /BIC/ZPRINTMTH
                /BIC/ZQUALITY  /BIC/ZSHAPE    /BIC/ZSIZE     /BIC/ZVARIANT
                /BIC/ZVOLUME
           INTO  TABLE IT_INVOICES
           FROM /BIC/AZO_PMI100
           FOR ALL ENTRIES IN T_DATA_PAK1
           WHERE /BIC/ZSORDDORD   = T_DATA_PAK1-/BIC/ZSORDDORD AND
                 /BIC/ZSORDIORD  = T_DATA_PAK1-/BIC/ZSORDIORD AND
    051114: Exclude pro forma invoices from selection.
                    ( bill_type NE 'ZPF1' AND bill_type NE 'ZPF2' AND
                      bill_type NE 'ZPF3').
        SORT: IT_INVOICES BY INV_SALES_ORD   INV_SALES_ITEM.
        DELETE IT_INVOICES WHERE ZQUALITY IS INITIAL.
        REFRESH: T_DATA_PAK1.
      LOOP AT T_DATA_PAK.
         CLEAR: T_DATA_PAK1, IV_INVQTY, IV_INVVAL, IT_INVOICES, IT_CTBW.
         MOVE-CORRESPONDING T_DATA_PAK TO T_DATA_PAK1.
         loop at IT_INVOICES
              where INV_SALES_ORD  = T_DATA_PAK-/BIC/ZSORDDORD
                and INV_SALES_ITEM = T_DATA_PAK-/BIC/ZSORDIORD.
            IV_INVQTY = IV_INVQTY + IT_INVOICES-INV_QTY.
            IV_INVVAL = IV_INVVAL + IT_INVOICES-NETVAL_INV.
         endloop.
            Use req. del. date if not conf. del. date is available
            Changes being made to use conf. del. date instead of
            req. del. date.   This is not always filled in.
         IF T_DATA_PAK1-/BIC/ZDATESCHL IS INITIAL.
           MOVE T_DATA_PAK1-DSDEL_DATE to T_DATA_PAK1-/BIC/ZDATESCHL.
         ENDIF.
         move:
             IV_INVQTY                  to T_DATA_PAK1-INV_QTY,
             IV_INVVAL                  to T_DATA_PAK1-NETVAL_INV,
             IT_INVOICES-ZBRAND         to T_DATA_PAK1-/BIC/ZBRAND,
             IT_INVOICES-ZBRANDOWN      to T_DATA_PAK1-/BIC/ZBRANDOWN,
             IT_INVOICES-ZDESGNOWN      to T_DATA_PAK1-/BIC/ZDESGNOWN,
             IT_INVOICES-ZFLAGBKLG      to T_DATA_PAK1-/BIC/ZFLAGBKLG,
             IT_INVOICES-ZNOCOLORS      to T_DATA_PAK1-/BIC/ZNOCOLORS,
             IT_INVOICES-ZNOSPCLRS      to T_DATA_PAK1-/BIC/ZNOSPCLRS,
             IT_INVOICES-ZOPENFCTY      to T_DATA_PAK1-/BIC/ZOPENFCTY,
             IT_INVOICES-ZPACKSYST      to T_DATA_PAK1-/BIC/ZPACKSYST,
             IT_INVOICES-ZPPG           to T_DATA_PAK1-/BIC/ZPPG,
             IT_INVOICES-ZAPPLICAT      to T_DATA_PAK1-/BIC/ZAPPLICAT,
             IT_INVOICES-ZPAPERGDE      to T_DATA_PAK1-/BIC/ZPAPERGDE,
             IT_INVOICES-ZPRINTMTH      to T_DATA_PAK1-/BIC/ZPRINTMTH,
             IT_INVOICES-ZQUALITY       to T_DATA_PAK1-/BIC/ZQUALITY,
             IT_INVOICES-ZSHAPE         to T_DATA_PAK1-/BIC/ZSHAPE,
             IT_INVOICES-ZSIZE          to T_DATA_PAK1-/BIC/ZSIZE,
             IT_INVOICES-ZVARIANT       to T_DATA_PAK1-/BIC/ZVARIANT,
             IT_INVOICES-ZVOLUME        to T_DATA_PAK1-/BIC/ZVOLUME.
         if IT_INVOICES-ZFLAGBKLG is initial.
            SELECT /BIC/ZSORDDORD
                   /BIC/ZSORDIORD
                   /BIC/ZBRAND
                   /BIC/ZBRANDOWN
                   /BIC/ZDESGNOWN
                   /BIC/ZNOCOLORS
                   /BIC/ZNOSPCLRS
                   /BIC/C_APM_006
                   /BIC/ZPACKSYST
                   /BIC/ZPAPERGDE
                   /BIC/ZPPG
                   /BIC/ZPRINTMTH
                   /BIC/ZQUALITY
                   /BIC/ZSHAPE
                   /BIC/ZSIZE
                   /BIC/ZVARIANT
                   /BIC/ZVOLUME
           INTO  TABLE IT_CTBW
           FROM /BIC/PZ_CTBWOBJ
           FOR ALL ENTRIES IN T_DATA_PAK1
           WHERE /BIC/ZSORDDORD   = T_DATA_PAK1-/BIC/ZSORDDORD AND
                 /BIC/ZSORDIORD  =  T_DATA_PAK1-/BIC/ZSORDIORD AND
                 OBJVERS = 'A'.
        SORT: IT_CTBW BY CTBW_SALES_ORD   CTBW_SALES_ITEM.
        DELETE IT_CTBW WHERE CTBW_QUALITY IS INITIAL.
         REFRESH: T_DATA_PAK1.
         endif.
         loop at IT_CTBW
            where CTBW_SALES_ORD  = T_DATA_PAK-/BIC/ZSORDDORD
            and CTBW_SALES_ITEM = T_DATA_PAK-/BIC/ZSORDIORD.
         endloop.
           move:
             IT_CTBW-CTBW_BRAND         to T_DATA_PAK1-/BIC/ZBRAND,
             IT_CTBW-CTBW_BRANDOWN      to T_DATA_PAK1-/BIC/ZBRANDOWN,
             IT_CTBW-CTBW_DESGNOWN      to T_DATA_PAK1-/BIC/ZDESGNOWN,
             IT_CTBW-CTBW_NOCOLORS      to T_DATA_PAK1-/BIC/ZNOCOLORS,
             IT_CTBW-CTBW_NOSPCLRS      to T_DATA_PAK1-/BIC/ZNOSPCLRS,
             IT_CTBW-CTBW_PACKSYST      to T_DATA_PAK1-/BIC/ZPACKSYST,
             IT_CTBW-CTBW_PPG           to T_DATA_PAK1-/BIC/ZPPG,
             IT_CTBW-CTBW_PAPERGDE      to T_DATA_PAK1-/BIC/ZPAPERGDE,
             IT_CTBW-CTBW_PRINTMTH      to T_DATA_PAK1-/BIC/ZPRINTMTH,
             IT_CTBW-CTBW_QUALITY       to T_DATA_PAK1-/BIC/ZQUALITY,
             IT_CTBW-CTBW_SHAPE         to T_DATA_PAK1-/BIC/ZSHAPE,
             IT_CTBW-CTBW_SIZE          to T_DATA_PAK1-/BIC/ZSIZE,
             IT_CTBW-CTBW_VARIANT       to T_DATA_PAK1-/BIC/ZVARIANT,
             IT_CTBW-CTBW_VOLUME        to T_DATA_PAK1-/BIC/ZVOLUME.
           if T_DATA_PAK1-MATERIAL+0(1) eq 'A'.
              move T_DATA_PAK1-MATERIAL+1(4) to T_DATA_PAK1-/BIC/ZQUALITY.
              move T_DATA_PAK1-MATERIAL+5(3) to T_DATA_PAK1-/BIC/ZSIZE.
              move T_DATA_PAK1-MATERIAL+8(2) to T_DATA_PAK1-/BIC/ZVARIANT.
           endif.
          APPEND T_DATA_PAK1.
         ENDLOOP.
      ENDIF.
      IF SY-SUBRC EQ 0.
        DATA_PACKAGE[] = T_DATA_PAK1[].
        ABORT = 0.
      ENDIF.
      REFRESH: T_DATA_PAK, T_DATA_PAK1.
      REFRESH: IT_INVOICES, IT_CTBW.
      FREE: T_DATA_PAK,T_DATA_PAK1.
      FREE: IT_INVOICES, IT_CTBW.
    if abort is not equal zero, the update process will be canceled
      ABORT = 0.
    $$ end of routine - insert your code only before this line         -
    ENDFORM.
    Edited by: John Lucky on Jan 25, 2008 10:58 PM

    Hi,
    Why is the hard coding of "breakpoint" done.
    Try removing it.
    Regards
    Merlin.

  • Wrong index being chosen-start routine slow

    Hi,
    We are uploading 6Million odd records using lookup and aggregation in the start routine of update rules from an ODS into an infocube.
    One such lookup is on the source ODS itself and takes the longest. The WHERE clause of the SELECT exactly matches one of the secondary indices 020 but is not used when the datapack size is 50,000 but is used only when the datapacksize is a few 100 records. However, the index that does get used in the case of large datapackages  is 030 which only partially matches the fields in the WHERE clause.
    I have tried the following modifications of the SELECT as two alternatives but neither works :
    1) used the Oracle hint INDEX specifically for index 020
    2) removed the FOR ALL ENTRIES IN DATA_PACKAGE clause and used a ranges table for selection in the WHERE clause on certain fields
    The index 020 has been 'Analysed' and statistics have been created.
    Does someone have ideas on why a particular index will not get used in this specific case ?
    Best regards
    Anuradha
    Message was edited by: anuradha govil

    Hi,
    could you post the code ?
    /manfred

  • Need some help on Start routines,

    Hi Gurus,
    I am new to SAP ABAP, I am a BI consultant with 0 ABAP knowledge, Please help me writing a code for the following scenario.(START ROUTINE)
    I have a DSO(S_DSO) as source and cube(T_CUBE) as target, and before extracting the data into T_CUBE i need to validate the data. for this I got one more DSO(LU_DSO) for look up.
    structures of the dso's and cube :
    S_DSO  ............                                                T_CUBE .........   .....                        LU_DSO
    ZDOC_NO  .........                           ZDOC_NO ...........                       ZDOC_NO
    ZPROD_FAM  ........                                       ZPROD_FAM .........       ZPROD_FAM
    QTY   .........    .....................                                                             QTY........
    UNIT_PRICE  ..........                                        UNIT_PRICE.......
    LOGIC
    if S_DSO-ZDOC_NO = LU_DSO-ZDOC_NO AND S_DSO-ZPROD_FAM = LU_DSO-ZPROD_FAM
    THEN
    S_DSO-ZDOC_NO = T_CUBE-ZDOC_NO AND S_DSO-ZPROD_FAM = T_CUBE-ZPROD_FAM AND
    S_DSO-QTY = T_CUBE-QTY AND S_DSO-UNIT_PRICE = T_CUBE-UNIT_PRICE
    please help me to achieve this....please provide code from the initializations of internal tables not just the looping conditions.
    You help will be most appreciated
    Surabhi
    Edited by: surabhi5579 on Mar 28, 2009 8:14 PM
    Edited by: surabhi5579 on Mar 28, 2009 8:16 PM
    Edited by: surabhi5579 on Mar 28, 2009 8:17 PM
    Edited by: surabhi5579 on Mar 28, 2009 8:17 PM

    Hi Viren,
    I did applied the code in Start routine but the out put is not as required.
    My Data model is as follows:
    zmd_dso(source dso)                                        
    zdocno..  zprod_fam.. qty.. price                               
    a001...      A    ...         10   ... 100                                      
    a002 ...    B     ...          20  ...  200                                      
    a003...     C     ...          30  ...  300
    zmd_dsc(lookup dso)
    zdocno ...  zprod_fam
    a001  ....      A 
    a003    ....    C
    desired output
    zdata_ic(target)
    zdoc_no ...  zprod_fam ..  qty   ..  price
    aoo1  ...     A    ...          10   ...    100
      a003   ...    C   ...            30 ...      300
    As per the above table   zmd_dso is the source DSO and Zdata_ic is Target Cube, but in between there is DSO called zmd_dsc which contains zdoc_no and zprod_fam   and after the transfermation u can see the cube filterd by the values in zmd_dsc which is a look up dso. the doc_no "  a002" and the Zprod_fam "B" are not present in the lookup dso and that is the reason why the entries are not visible in the cube after extraction.
    I tried ur code, but the result is same as source dso  i can see all the records which are available in the source dso and it is not cross checking the lookup dso that is Zmd_dsc.
    I hope ur understanding what i meant to say. sorry if i am confusing you.
    Edited by: surabhi5579 on Mar 29, 2009 7:08 PM
    Edited by: surabhi5579 on Mar 29, 2009 7:19 PM

  • Start Routine in Transformations

    Hi,
    For my reporting purpose i need to Transfer data from Cube to DSO
    I need a start routine for the following requirment when transfering data from Cube to DSO
    The Key fields in DSO are Location & Emp_ID and Date fields are ZAP_DTE (DATS)
    CUBE-->DSO
    While doing the transfer...i need to compare Emp and his ZAP_DTE AND need to transfer only if AP_DTE for that EMP is greater than the exisisting one else ignore the record
    As i new to BW please update with the routine
    Thanks

    Hi Shambhu
    We usually write out code in the section:
    $$ begin of routine - insert your code only below this line        -
    What is the difference between writing the code in
    $$ begin of 2nd part global - insert your code only below this line  *
    and
    $$ begin of routine - insert your code only below this line        - ?
    Kind regards
    Erik

  • How do you identify the Logical system in start routine of a transformation

    My scenario is this.  I have five r3 systems that I am extracting from.   In the start routine of the transformation from the r3 data source to my data store I  am going to delete data and I need to know the source system id.    How do I identify the logical system or source system id in the transformation.  Is there a system field that contains this information.    I do not want to hard code the source system id in the routine.

    hi
    have a lool at tables rsreqdone and rsbkrequest with a join you should be able to determine the source.
    regards
    Boujema
    How to give points: Mark your thread as a question while creating it. In the answers you get, you can assign the points by clicking on the stars to the left. You also get a point yourself for rewarding (one per thread).
    Edited by: Boujema Bouhazama on May 9, 2008 12:04 AM

  • Can we use Perform statement in start routine ,Form and endform.

    Hi,
    Can we use Perform statement in start routine ? Then write the ABAP code between Form and Endform.
    Example : Can I use Perform ABC in start routine. Then define ABC at the end of start routine.
          Form ABC,
          ......<ABAP> code .....
          Endform.

    Hi,
    In BI 7.0 we have start routines defined using Class where you might be able to create your own performs, but in case of BW3.5 Start routines are defined using Form so there I don't think it will allow you to create one more form.
    But you can surely try both the approaches.
    Reards,
    Durgesh.

  • Start routine in transformation

    Hi,
        I need to read master data in a start routine only once.If I write a select statement in the start routine , the select is executed for every data package.I want the select to be executed only once and data can be used by all data packages.I tried keeping the code in the global section of the start routine class and that didn't help either.
       Any ideas.
    Thanks in advance

    Hi Siva,
    Then..Use Static Internal table...
    Structured Static Internal Table Definition
    - STATICS itab TYPE tabtype [WITH HEADER LINE].
    - STATICS itab TYPE tabkind OF linetype
    [WITH [UNIQUE|NON-UNIQUE] keydef]
    [INITIAL SIZE n] [WITH HEADER LINE]. 
    - STATICS itab LIKE tabkind OF lineobj
    [WITH [UNIQUE|NON-UNIQUE] keydef]
    [INITIAL SIZE n] [WITH HEADER LINE].
    - STATICS itab TYPE linetype OCCURS n [WITH HEADER LINE].
    - STATICS itab LIKE lineobj OCCURS n [WITH HEADER LINE].
    - STATICS: BEGIN OF itab OCCURS n,
    END OF itab [VALID BETWEEN f1 AND f2].
    STATICS itab TYPE RANGE OF type.
    STATICS itab LIKE RANGE OF f
    @@@@@@@@@@@@@22
    Logic: make flag variable as static variable in global area.
    First data package...
    IF flag EQ ' '.
    Read Master data table and put in STATIC internal TABLE.
    So the next time(next data package)..not read from master data table
    flag = 'X'.
    ENDif.
    LOOP DATA_PACKAGE.
    ENDLOOP.
    @@@@@@@@@@@@2
    Regards,
    San!
    Message was edited by:
            Sandeep Khatri(San!)

  • Start Routine in Update Rule

    I want to replace all '# ' values showing up in a report with  space. For this I plan to write a Start Routine in the Update Rules which should scan all the data coming in into the cube and replace all  null or '' with space.
    What is the best way to write this routine. It should check all data in all the fields of the data load coming in.
    Thanks

    Hi,
         The space is shown as # in the BW Reports, to confirm check the value in the cube for this field, so
          you need to change that to some other character like X or Y or explain your end users that SAP
          designates a space as # and it will be displayed that way in the reports.
    Regards,
    Raj

  • How to add new records in Start routine or end routine.

    Hi All,
            My requirement is to transfer data from one DSO to anothe DSO. But while transfering a single record frorm DSO1 i want to add 7 records to DSO2 for each record in DSO1 with slight change in data( with a different key). I want to do it in start routine or end routine. How can i do it. If you have any ABAP code for this then please send.
    Regards
    Amlan

    you can use this code, replace the fields where i have marked with <>.
    DATA : WA_RESULT_PACKAGE TYPE DSO2,
           WA_RESULT_PACKAGE1 LIKE WA_RESULT_PACKAGE.
    DATA : IT_RESULT_PACKAGE LIKE TABLE OF WA_RESULT_PACKAGE.
    DATA : DATE1 TYPE SY-DATUM.
    DATA : DAYDIFF TYPE i.
    DATA : RECORD_NO type rsarecord.
    SORT RESULT_PACKAGE BY <KEY FIELDS> "specify the key fields here
    RECORD_NO = 1.
    LOOP AT RESULT_PACKAGE INTO WA_RESULT_PACKAGE.
         IF WA_RESULT_PACKAGE_1-<KEYFIELDS> NE WA_RESULT_PACKAGE-<KEYFIELDS>.
              WA_RESULT_PACKAGE_1 = WA_RESULT_PACKAGE.
              DAYDIFF = WA_RESULT_PACKAGE-ENDDATE - WA_RESULT_PACKAGE-STARTDATE.
                   WHILE DAYDIFF NE 0.
                        DATE1 = WA_RESULT_PACKAGE-STARTDATE + DAYDIFF.
                        MOVE DATE1 TO WA_RESULT_PACKAGE-<KEYFIELDDATE>.
                        MOVE RECORD_NO TO WA_RESULT_PACKAGE-RECORD.
                        APPEND WA_RESULT_PACKAGE INTO IT_RESULT_PACKAGE.
                        DAYDIFF = DAYDIFF - 1.
                        RECORD_NO = RECORD_NO + 1.
                        CLEAR DATE1.
                   ENDWHILE.
              CLEAR DAYDIFF.
         ENDIF.
    ENDLOOP.
    DELETE RESULT_PACKAGE[].
    RESULT_PACKAGE[] = IT_RESULT_PACKAGE[].
    Reg Point 3.
    The Key figures will then show up in the report aggregated.Hope that is fine with you.
    Note:
    Before loading data, in DTP set the semantic key with the key field of the DSO1.This brings all the similar data w.r.t the key fields from the PSA together in a single package.
    rgds, Ghuru

Maybe you are looking for

  • BI error while trying to execute a report from a role - HELP

    Hi experts, I just started in a new BI project and there were some roles already created, I tried to execute a report in one of these roles (SAP_BW_TEMPLATE-Procurement) and I receive a pop-up window saying: "Windows cannot find "report technical nam

  • Cursor printing on xy graph

    I am using Labview version 6.1 in Windows 2000. I have an XY graph that has active cursors used to select an interval of data for analysis from a raw data set. I pass the necessary parameters of this graph including scale settings, labels, the data s

  • Wrong status after UD is taken

    Hi, we take usage decisions automatically with a custom-made program. But the problem is, even after the UD is taken, the system status is still INSP RREC. How can we put the ilot on the right status? Anyone can help me? Thanks. Jessica

  • DATA_PACKAGE:  SORT & ( INSERT or  APPEND ) ?

    Hello Folks, <u>Problemdescription:</u> I need two compare to consecutiv records in a DataPackage to a give sort order and upon the result of the comparison I need to insert an new record. <u>Question:</u> Can I <b>SORT</b> a DATA_PACKAGE with a give

  • Removing items from startup - particulary VMware Fusion network settings.

    Hi Folks, as I'm semi new to MAC stuff I was posting in another thread and looking at my console logs, one of which I found was the below. I did run VMware Fusion beta for windows access for a while but deleted it ages ago. However the logs show the