START ROUTINE  HELP

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

hi Veer,
you can try
tables : Y_CUST_LE.
data : it_ycust like Y_CUST_LE occurs 0 with header line,
       l_tabix like sy-tabix.
select * from Y_CUST_LE into table it_ycust.
delete data_package where Yacc_SEQ = ´ZROO´ and
0PRICE_LIST = ´ ´.
loop at data_package.
l_tabix = sy-tabix.
read table it_ycust with key fieldname = data_pacakge-fieldname.
if sy-subrc = 0.
data_pacakge-customer = it_ycust-customer.
data_pacakge-salesorg = it_ycust-customer.
data_pacakge-ylegentitiyinfoobject = it_ycust-yleg_entity.
modify data_package index l_tabix.
endif.
endloop.
(or you can try master attribute in update rules to derive that 3 fields).
hope this helps.

Similar Messages

  • Start Routine Help - PLEASE...

    Hello All BW/ABAP gurus, I am not good at ABAP and I need some help in writing  Start routine.
    Basically my (SIMPLIFIED) requirement is, I have the data coming in as series of 3 fields (data always will come) and if there are multiple values in those fields I have to create multiple records in the ODS with a sequence number.
    For example if the data record is like
    ABC01 00     99    88
    Then my data record in ODS should be
    ABC01   0001          99
    ABC01   0002          88
    And if the data record is:
    ABC01 00     00    88
    My record in ODS should be just
    ABC01   0001          88
    So that’s the logic I am expecting in the start routine…
    So I kind of written the key part of code in the section below… Any one who is good in ABAP and has written similar code in Start Routine, please correct if there are any mistakes … thanks a ton in advance…
    CODE starts here:
    DATA COUNT_SEQ N.
    BEGIN ITAB_MAIN.
         KEY_FLD_01     AS /BIC/  ……….
         KEY_SEQ_01    AS /BIC/ ………..
         DATA_FLD_01 AS /BIC/ ………
    END ITAB_MAIN.
    BEGIN ITAB_INNER.
         KEY_SEQ_01    AS /BIC/ ………..
         DATA_FLD_01 AS /BIC/ ………
    END ITAB_INNER.
    LOOP AT DATA_PACKAGE.
    REFRESH ITAB_MAIN.
    ITAB_MAIN-KEY_FLD_01 = DATA_PACKAGE-KEY_FLD_01.
    COUNT_SEQ = 1.
    IF DATA_PACKAGE- DATA_FLD_01  > 0.
         ITAB_INNER-KEY_SEQ_01 = COUNT_SEQ.
         ITAB_INNER-DATA_FLD_01 = DATA_PACKAGE- DATA_FLD_01.
         COUNT_SEQ = COUNT_SEQ + 1.
          IF COUNT_SEQ = 1.
              MODIFY ITAB_INNER.
          ELSE
              APPEND ITAB_INNER.
          END IF.
    END IF.
    IF DATA_PACKAGE- DATA_FLD_01  > 0.
         ITAB_INNER-KEY_SEQ_01 = COUNT_SEQ.
         ITAB_INNER-DATA_FLD_01 = DATA_PACKAGE- DATA_FLD_01.
         COUNT_SEQ = COUNT_SEQ + 1.
          IF COUNT_SEQ = 1.
              MODIFY ITAB_INNER.
          ELSE
              APPEND ITAB_INNER.
          END IF.
    END IF.
    IF DATA_PACKAGE- DATA_FLD_02  > 0.
         ITAB_INNER-KEY_SEQ_01 = COUNT_SEQ.
         ITAB_INNER-DATA_FLD_02 = DATA_PACKAGE- DATA_FLD_02.
         COUNT_SEQ = COUNT_SEQ + 1.
          IF COUNT_SEQ = 1.
              MODIFY ITAB_INNER.
          ELSE
              APPEND ITAB_INNER.
          END IF.
    END IF.
    IF DATA_PACKAGE- DATA_FLD_03  > 0.
         ITAB_INNER-KEY_SEQ_01 = COUNT_SEQ.
         ITAB_INNER-DATA_FLD_03 = DATA_PACKAGE- DATA_FLD_03.
         COUNT_SEQ = COUNT_SEQ + 1.
          IF COUNT_SEQ = 1.
              MODIFY ITAB_INNER.
          ELSE
              APPEND ITAB_INNER.
          END IF.
    END IF.
    ITAB_INNER [] ITAB_MAIN.
    CLEAR ITAB_MAIN.
    CLEAR ITAB_INNER.
    END LOOP.

    I think could be as that:
    DATA COUNT_SEQ N.
    DATA_PACKAGE_NEW like DATA_PACKAGE occurs 0 with header line.
    REFRESH DATA_PACKAGE_NEW .
    LOOP AT DATA_PACKAGE.
    ITAB_MAIN-KEY_FLD_01 = DATA_PACKAGE-KEY_FLD_01.
    COUNT_SEQ = 1.
    IF DATA_PACKAGE- DATA_FLD_01 > 0.
    DATA_PACKAGE_NEW-KEY_SEQ_01 = COUNT_SEQ.
    DATA_PACKAGE_NEW-DATA_FLD_01 = DATA_PACKAGE- DATA_FLD_01.
    ADD 1 TO COUNT_SEQ.
    APPEND DATA_PACKAGE_NEW.
    END IF.
    < same for 2, 3, 4>
    END LOOP.
    REFRESH DATA_PACKAGE.
    DATA_PACKAGE[] = DATA_PACKAGE_NEW[].
    I hope this help

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

  • ABAP Help at start routine of Update rule

    Good After Noon All,
    My requirement is that cube ZAPO_C24M  there’s an UPDR flowing from 8ZAPO_C24M back to itself so to speak.The request is to change the data in the cube from Fiscal Year Variant Z3 to Z4.
    But in start routine  i have to  take the existing record and reverse all of the key figures, and also change the RECORDMODE of the record to indicate it is a reversal record. This for specific Country KR and for these country the Fiscal variant is Z3. Again in the start routine, create a new record identical to the existing record that has Fiscal Year Variant Z4 instead of Z3.
    So the idea is we’d load from the cube and send back to the cube one record that reverses out the existing data, and another record that contains the same data but with Fiscal Variant Z4 instead of Z3.
    Please Help me.
    Points will be awarded for the right answer

    Hi Vaishali,
    In the start routine copy the DATA_PACKAGE to a local table.
    Select the records where the specific country is KR.
    Delete all other records.
    Then read the records in loop, Keep one record same and just change the fiscal year variant.
    And for the same multiply all the key figures by -1.
    Transfer the content of the local table back to DATA_PACKAGE.
    maintain one to one mapping in the update rule.
    I am sure it will update, but you need to be sure that if you change Fiscal year variant then probably your fiscal period value should change. In that case you have to update it accordingly in the start routine.
    Regards.

  • ABAP HELP in Start routine

    Hello everybody,
    I have written a code to delete some records in start routine, we are using BI 7.0.
    here is the code,
    TYPES: BEGIN OF tys_SC_3,
    TCTUSERNM TYPE /BI0/OITCTUSERNM,
    END  OF tys_SC_3.
    DATA zz_s_SC_3 type sorted table of tys_SC_3 with unique key TCTUSERNM.
    DATA zz_s_SC_4 like line of zz_s_SC_3.
    select TCTUSERNM from /B12/ARIAO0100 into table zz_s_SC_3
    where TCTIOBJNM = '0TCAIPROV' and TCTLOW = '/MRG/RIMAC_01'.
    DELETE SOURCE_PACKAGE where TCTUSERNM NOT IN zz_s_SC_3.
    When I am running this code,I am getting an error
    "E:"ZZ_S_SC_3" does not have the structure of a selection table."
    can anybody out there help me out,
    Thank you,
    Karthik

    Hi,
    you need to define zz_s_SC_3 as:
    data: zz_s_SC_3 type standard table of rsrange.
    do the select as:
    select TCTUSERNM as low from /B12/ARIAO0100 into table zz_s_SC_3
    modify zz_s_sc_3 to set the fields sign and option to 'I' and 'EQ' for all records then it will work.
    Siggi

  • Code help - start routine

    I have two ODS's - ODS1 and ODS2 . ODS1 feeds data to ODS2 using an
    uppdate rule .ODS1 data is as follows
    Billno  Itemno cond keyfig
    10     1     a     1
    10     1     b     3
    10     1      c     5
    20     1     d     7
    20     1     e     8
    20     1     f     1
    20     1     g     1
    30     2     h     4
    30     3     h     2
    I need to populate a field in ODS2 (say sum) by summing
    all values of keyfig for each bill no . for example in the
    above case ods2-sum should be filled with values 9 ,16 and 6
    for billno's 10,20& 30 respectively .
    can someone pls help me with required code.
    thanks

    Hi,
    In the start routine write the selection:
    DATA: begin of it_int occurs 0,
                    billno type ods2-billno,
                    sum type ods2-sum,
                 end of it_int.
    select billno sum( keyfig ) from ods1
    into table it_int groupby billno orderby billno.
    In the update routine for ods2-sum read the it_init:
    read table it_int with key
    billno = COMM_STRUCTURE-billno.
    if sy-subrc = 0.
      result = it_int-sum.
    endif.
    Regards,
    Prema

  • Help on Start Routine

    Hello All,
    I cannot determine how to bring only records based on customer master data field =status in the data target ,
    and the rest to delete it in the *start routine*.  Please help.  I am adding my code below. Any help is appreciated.
    DATA: L_field1 LIKE /BI0/customer-field1,
            L_customer LIKE structure-customer.
      LOOP AT DATA_PACKAGE.
        SELECT SINGLE field1 INTO L_field1
         FROM /BI0/customer
          WHERE customer = DATA_PACKAGE-customer
            AND field1= 'status'.
        IF SY-SUBRC NE 0.
            DELETE DATA_PACKAGE.
          ENDIF.
      ENDLOOP.
    Thanks,
    Su

    Dennis,
    Thank you so much for the quick response.
    I think it is working. I only have one concern!!!!.
    I feel like during the testing I found something weird that eventhough there are only 8 records in the psa and four records only have the value ('status') that we need from customer master data-field1, it is still picking the 5th record, not sure why.  I see that once it is written in to the data target then the value is showing it as 'status' and in psa it is different.
    So I wonder if it is converting that field in the routine based on our constant!  Please let me know your input.
    p.s data target does not have the field1 available.  So just like you corrected my code it has to bring it from customer master data and join customer to with the customer-field1 =' status', then pick else delete other records.
    Regards,
    Su

  • Help on Start Routine at Transfer Rule.

    Hi guys,
    We r extracting data from generic extractor into BW.My target is to fill Attributes of 0Customer(Infoprovider) Infoobject.
    We have added two navigational attributes to it CLASS A and CLASS B.
    Data coming from R/3 has three fields Customer,Class,n field called as ATWRT.
    For each customer there are two records .
    For Ex
    Customer                         Class                          ATWRT
    001                                   A                                 FOOD
    001                                   B                                 Supermarket
    002                                   A                                 Chain
    003                                   B                                  Magnum
    In the target customer is key
    Now the TASK is that in the target the definition for class A which is present in ATWRT should go to navigational attribute ClassA
    n Defination for B should go in NAV Attribute CLASS B . that means there should be single record in the target comprising both value in NAV attribute.
    For Ex
    Customer                Class A                             Class B
    001                         FOOD                                Supermarket
    002                         Chain                                  Magnum
    i want to write program in start routine of transfer rules. If u can suggest any other method also it will good to me to sort this issue. Suggestions are expected.
    Points will be awarded for the write suggestion.
    Pls help me out.

    Dennis,
    Thank you so much for the quick response.
    I think it is working. I only have one concern!!!!.
    I feel like during the testing I found something weird that eventhough there are only 8 records in the psa and four records only have the value ('status') that we need from customer master data-field1, it is still picking the 5th record, not sure why.  I see that once it is written in to the data target then the value is showing it as 'status' and in psa it is different.
    So I wonder if it is converting that field in the routine based on our constant!  Please let me know your input.
    p.s data target does not have the field1 available.  So just like you corrected my code it has to bring it from customer master data and join customer to with the customer-field1 =' status', then pick else delete other records.
    Regards,
    Su

  • Help with start routine

    Hi,
    <b>I am new to ABAP.Can anyone help me wih this code</b>
    <b>The following code is in start routine</b>
    LOOP AT DATA_PACKAGE.
    SELECT /BIC/ZPACTGY /BIC/ZMPIINIR FROM /BIC/PZCONDTYP
               INTO IT_ZCONDTYP
               WHERE /BIC/ZCONDTYP = DATA_PACKAGE-/BIC/ZCONDTYP.
    IF ( IT_ZCONDTYP-/BIC/ZPACTGY Eq 'VVR12' OR
              IT_ZCONDTYP-/BIC/ZPACTGY Eq 'VVR13' or
              IT_ZCONDTYP-/BIC/ZPACTGY Eq 'VVR14' or
              IT_ZCONDTYP-/BIC/ZPACTGY Eq 'VVV10' or
              IT_ZCONDTYP-/BIC/ZMPIINIR Eq 'Y' or
              ( IT_ZCONDTYP-/Bic/zcondtyp ge 'Y100'
              and IT_ZCONDTYP-/Bic/zcondtyp le 'Y199' ) ).
         APPEND DATA_PACKAGE.
         ENDIF.
    endselect.
      ENDLOOP.
    <b>what I am trying to accomplish is I want my data which is in the internal table to satisfy the following conditions. and place it in internal table .(or whatever is correct)</b>
    IT_ZCONDTYP-/BIC/ZPACTGY Eq 'VVR12' OR
              IT_ZCONDTYP-/BIC/ZPACTGY Eq 'VVR13' or
              IT_ZCONDTYP-/BIC/ZPACTGY Eq 'VVR14' or
              IT_ZCONDTYP-/BIC/ZPACTGY Eq 'VVV10' or
              IT_ZCONDTYP-/BIC/ZMPIINIR Eq 'Y' or
              ( IT_ZCONDTYP-/Bic/zcondtyp ge 'Y100'
              and IT_ZCONDTYP-/Bic/zcondtyp le 'Y199' ) ).
    <b>and read this from another transfer routine</b>
    CLEAR RESULT.
    READ TABLE IT_ZCONDTYP WITH KEY
    /BIC/ZCONDTYP = COMM_STRUCTURE-/BIC/ZCONDTYP
          BINARY SEARCH.
    IF SY-SUBRC EQ 0.
      RESULT = IT_ZCONDTYP-/BIC/ZCONDTYP.
    ENDIF.
    <b>This is mostly related to BW.So if someone can give their opinion on how to achieve this I will be very grateful.</b>
    thanks,
    Kal

    hi Kal,
    you have to specify what are you going to add to the datapackage internal table (before the append data_package statement).
    hope this helps.
    LOOP AT DATA_PACKAGE.
    SELECT /BIC/ZPACTGY /BIC/ZMPIINIR FROM /BIC/PZCONDTYP
    INTO IT_ZCONDTYP
    WHERE /BIC/ZCONDTYP = DATA_PACKAGE-/BIC/ZCONDTYP.
    IF ( IT_ZCONDTYP-/BIC/ZPACTGY Eq 'VVR12' OR
    IT_ZCONDTYP-/BIC/ZPACTGY Eq 'VVR13' or
    IT_ZCONDTYP-/BIC/ZPACTGY Eq 'VVR14' or
    IT_ZCONDTYP-/BIC/ZPACTGY Eq 'VVV10' or
    IT_ZCONDTYP-/BIC/ZMPIINIR Eq 'Y' or
    ( IT_ZCONDTYP-/Bic/zcondtyp ge 'Y100'
    and IT_ZCONDTYP-/Bic/zcondtyp le 'Y199' ) ).
    <i>DATA_PACKAGE-... = ....
    DATA_PACKAGE-... = ....
    DATA_PACKAGE-... = ....</i>
    APPEND DATA_PACKAGE.
    ENDIF.
    endselect.
    ENDLOOP.

  • 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

  • Need help in ABAP coding in start routine

    Hi,
    I have a requriement like
    -To take the value of month which is an attribute of category(info Object) for which category value is 1. I need to apply the month obtained as the filter to another info object. I have opted to write this ABAP code in start routine. Can anyone guide me on this code.
    Thanks in advance.

    do you not have an abap-er at your disposal? i don't imagine this to be quick & dirty that can be written without access to your system! some analysis work may also be required before the actual coding can be done...so I wouldn't post the entire functional spec (business requirement) here hoping for a solution; that would be too weird.
    Regards.

  • Help needed on start routines in update rules

    Hi All,
    I want to extract data from two data sources(For ex 2LIS_02_HDR, 2LIS_02_ITM).
    I am using 2 first layer ODS' and one second layer ODS for consolidation.I want to write a start routine in the update rules so that the data of the MATNR(Material Number) field from 2LIS_02_ITM will be populated in the second layer ODS when the keys (EBELN) of the datasources are equal in the first layer ODS'.
    Can anyone send me the code for this requirement?
    Thanks in Advance,
    Sanjana.

    i am assuming u have a direct transformation with 2lis_02_hdr
    and u want to look up on the DSO of 2lis_02_ITM to get the material.
    MATNR = 0material
    EBELN = 0docnum.
    put this code in the start routine of the transformation of 2lis_02_HDR.
    TYPES: BEGIN OF s_itm,
                material TYPE /bi0/oimaterial,
                docnum TYPE /bi0/oidocnum,
                END OF s_itm.
        DATA: wa_itm TYPE s_itm,
              t_itm TYPE STANDARD TABLE OF s_itm.
    LOOP AT DATA_PACKAGE.
            SELECT material
                          docnum
            FROM /bic/aDSO_itm
       APPENDING TABLE t_itm
       WHERE docnum = <comm_structure>-docnum.
    endloop.
    IF NOT t_itm[] IS INITIAL.
          SORT t_itm ASCENDING BY docnum.
         DELETE ADJACENT DUPLICATES FROM t_itm      COMPARING docnum.
         ENDIF.
    Now write this below code in the update routine of 0material in the transformation from 2lis_2_HDR.
    CLEAR RESULT.
    READ TABLE T_itm INTO WA_Itm WITH KEY
          DOCNUM  = comm_structure-docnum.
    BINARY SEARCH.
    IF SY-SUBRC = 0.
      RESULT = WA_itm-material.
    ENDIF.

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

  • ABAP code for BI 7.0 transformations start routine

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

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

  • Update Routine & Start Routine in BI 7.0

    Hi Experts,
    We have recently upgraded from BI 7.0 , I am confused about where to write start routine & update routine in transformations of BI 7.0?
    Please mention any pointers?
    Thanks.
    Sharat.

    Hi
    When you open the start routine you will see a routines info which gives you help on this.
    A summary would be:
    Update routine in transformation.
    RESULT = source_field-material.
    Basically you can acess the value of the record by using source_field.
    Start routine.
    The data comes in the form of an internal table with name SOURCE_PACKAGE.
    You can access the values by looping into a work area.
    LOOP AT SOURCE_PACKAGE assigning <source_fields>.
    ENDLOOP.
    End routine(This is a new feature in BI 7.0 where you can modify data when transformations are complete and before data is updated to info-providers)
    The data comes in the form of an internal table with name RESULT_PACKAGE.
    You can access the values by looping into a work area.
    LOOP AT RESULT_PACKAGE assigning <result_fields>.
    ENDLOOP.
    Hope this helps you to understand the basics of the abap used in the transformations .
    Regards
    Samarpita

Maybe you are looking for