Start Routine for transfer rules

Hello experts,
I want to use the SQL DISTINCT keyword to return non-duplicate results from a table in a DataSource (data base) in a the start routine for the transfer rules.
How do I address that table in the start routine of the TR?
I thought about something like that.
TABLES: mytable
DATA: itab_mytable type table of mytable
SELECT DISTINCT CUSTID, etc.
FROM mytable into table i_tab.
I am new to ABAP so I would be happy to get some suggestions!
thanx in advance
Axel

Hello Oscar,
as fa as I understood the entire data package in the transfer structure format is used as parameter (DATAPAK) for the routine.
so I want to perform a SQL statement on DATAPAK!
But it sais it can't find DATAPAK in ABAP-Dictionary as a table!
can I actually perform SQL statements on DATAPAK?
Thanx
Axel

Similar Messages

  • How to find the existing START ROUTINEs in Transfer Rules in whole system ?

    Hi all,
       How to find the existing Start Routines in Transfer Rules in BW System, please ?
       I know that we could find from the Transfer Rules.
       Is there any way to find instead of looking at Transfer Rules for <b>each</b> InfoSource?
    Thanks,
    Venkat.

    Hi Venkat
    You can find it in these tables
    RSTRAN
    RSUPDROUT
    RSAROUT
    RSAABAP
    RSAABAPINV
    Thanks
    Tripple k

  • 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

  • How to write a Globla Routine for Transfer Rules

    Hi Experts,
    How to write a Global Routine for Tranfer Rules ? Where all the infoobjects need to be grouped? Effect need to be shown on group of fields that are available in a single structure.
    Thanks in Advance
    Vara

    Hi,
    Are you aware of Start Routine available?.. This helps to write a routine on all the infoObjects available in Transfer Structure
    http://help.sap.com/saphelp_nw04/helpdata/en/b3/0ef3e8396111d5b2e80050da4c74dc/frameset.htm
    regards
    Happy Tony

  • Debugging: start routine in transfer rules

    Hi !
    can you please tell me how to debug start routines  and field routines in transfer rules?
    If possible please tell me too debugging of update rules.

    Hi Rajib,
    Go to the monitor -> Details tab -> Processing -> Choose the datapackage you want to debug -> Right click -> Simulate update -> Choose eather activate debugging in transfer rules (to debug in transfer rules) or debugging in update rules(for start routine and update rules).
    You can mention the number records you want to debug also, if you have an idea of which records you want to debug you can give the number of that record.
    Once the debug screen comes up, press F8...the control stops at first break point...from there you can do a step by step debugging (F5).
    Hope this helps...
    Regards,
    Kalyan

  • Start routine for  Update Rules

    I need to write a start routine for the update rules for an DSO with main idea as follows:
    I must compare the record that comes from the infopackage with the record that's already in my DSO. If the X date for the same 0PM_ORDER is the same as one in my DSO - do nothing
    If the X date is previous to the X date in my DSO for the same 0PM_ORDER - the new record must be created and at the same time all the records with subsequent(later) X dates for this 0PM_ORDER must be deleted.
    If the X date is later than the X date in my DSO for the same 0PM_ORDER - the new record must be created.

    Hi,
    Find the below code.
    DATA: BEGIN OF ITAB1,
    ZDATE TYPE /BIC/DATE
    END OF ITAB1.
    SELECT zdate FROM /BI0/QEMPLOYEE INTO corresponding
    fields
    of ITAB1 where employee = SOURCE_FIELDS-EMPLOYEE.
    IF ITAB1-ZDATE COMMUNICATE_STRUCT-DATE
    RESULT = ITAB1-CLM_IPAA.
    ENDIF.
    ENDSELECT.
    There will be an table for each DSO if you go for an manage DSO you will get three table i.e New,Active and Change Log take Active tables date field and compare with the communication structure that comes to routine.
    The above example is just an example table will be different from DSO to DSO.
    Let me know your thoghts.
    Regards,
    Shivu.

  • Start routine in Transfer Rules for Data Mart update

    Hi,
    Is it possible to create a start routine in a transfer rule of a Datamart update (from ODS to Cube)?
    Thxs.
    LauQ

    Roberto,
    If I read well the content of note 499404 - referred to in 630854 - I conclude that it is recommended to use update rules rather than transfer rules in the case of ODS objects when one wishes to modify data records up to the eventual data target.
    Do you agree?
    Thxs.
    LauQ

  • Start Routine in Transfer Rules

    Hi all ,
       I am trying to write a start routine in the Transfer rules ....I just want to know which is package that i have to loop to get mt records ....
    id it LOOP at DATAPAK ....
      My records ...
    ENDLOOP
    This is where i need to put the logic or else where ..please let me know

    hi,
    check if sample code helps
    DATA: l_s_datapak_line type TRANSFER_STRUCTURE,
    l_s_errorlog TYPE rssm_s_errorlog_int.
    tables : table1.
    data : l_field1 liek table1-field1,
           l_tabix like sy-tabix.
    loop at datapak into l_s_datapak_line.
    l_tabix = sy-tabix.
    fill field1 with data
    select single field1 into l_field1
    from table1 where fieldintable1 = l_s_datapak_line-[fieldname]
    if sy-subrc = 0.
      l_s_datapak_line-field1 = l_field1.
      modify datapak from l_s_datapak_line index l_tabix.
    endif.
    endloop.

  • Enhancing 0MATERIAL_ATTR?Writing Start routine in Transfr rules in BW side?

    Hi All,
    I got a requirement of enhancing the 0MATERIAL_ATTR extract structure with 10 fields.
    The logic is written in R3 extraction User exit ZXRSAU02 for populating the data from MARA table.
    In the BW side also, the corresponding objects created & mapped in Communication & Transfer structure, the update rules also activated for 0MATERIAL_ATTR.
    Details:
    The DS is: 0MATERIAL_ATTR
    ES is: BIW_MARA_S
    Table is: MARA
    Enhanced fields in ES are: like ZR, ZR1, ZR2 to ZR9.
    BW Objects created are: like ZB, ZB1, ZB2 to ZB9.
    I need help in writing start routine in transfer rules:
    The below logic needs to be included in the start routine -
    --->" If the following fields in extractor are all blank then populate them all with the value in ZR, ZR1, ZR2 to ZR9.
    ---> If the above are not all blank then don't modify. These will update as per the Transfer rules."
    Please help in writing the code for the Logic mentioned above.
    Thanks in Advance.

    Hi,
    as suggested you can do this in ZXRSAU02 or in the start routine
    In the start routine
    data wa_datapak type TRANSFER_STRUCTURE .
    data l_tabix like sy-tabix.
    loop at datapak into wa_datapak .
    l_tabix = sy-tabix .
    if wa_datapak-zr is initial or wa_datapak-zr1 is initial -
    wa_datapak-zr9 is initial .
    clear  : wa_datapak-zr. -- clear : wa_datapak-zr9 .
    modify datapack from wa_datapack index l_tabix.
    endloop.
    hope this helps
    PV

  • Start routine and update rules

    Hi,
    What is accessed first:-
    Start Routines or Update Rules?
    What is the use of global variables in start routine?
    Please reply.
    Thanks.

    Hi......
    You have different types of Routines in BW .
    1) Start Routine in Transfer Rules
    2) Transfer Routine in Transfer Rules.
    3)Start Routine in Update Rules
    4)Update Routine in Update Rules.
    The routines that you write in transfer rules are applicable to all the Data targets that get the data from that particular Infosource, when you are going to write some code in Transfer rules, you have to understand that you are going to manupilate the data that is going to get into BW .
    If you are going to write in Update Rules , then that logic is going to apply only for that particular Data target .
    Eg : Let suppose I have a Flat file that gets data from 3 countries, US, Canada and Mexico.
    Now I have prepared the data source for the same . But I dont want to have the data of Mexico in to BW itself.
    So I will write a Start routine at TR to eliminate the data of Mexico.
    My Next step is I want the data of US into one ODS and Canada data in to another ODS.
    For this I handle the dataflow at Start routine in Update rules, to eliminate Canada data for US ODS and Vice Versa.
    Global variables in Start routine
    You can have global variables, internal tables populated by the
    startup routine. This data will be available to the field
    routines. Create yourself a start routine, declare some
    variables in the global section, and then create a field
    routine. You will be able to use the globally declared objects
    in the field routine
    Please check below help link for routines in sap netweaver 2004s
    http://help.sap.com/saphelp_sem60/helpdata/en/e3/732c42be6fde2ce10000000a1550b0/frameset.htm
    How to guide "How to transformations routines".Please check the below link:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/dc1d9990-0201-0010-16aa-db3c4eb8b642
    start routine in transfer rules
    Look up to load master data
    excluding
    Start Routine in Transfer Rules
    Sample code in Update Rule to restrict data selection?
    Append Datapak - transfer start routine
    Excluding Blank field in Infopackage Filter
    Trans Routine ABAP help ..
    transfer routine
    Date key figure: Convert DATS format to DEC format
    Date Conversion in Flat File
    Transfer Routine ABAP
    conversion exit
    Date Conversion
    Problem with  conversion char to numc in transference rules
    conversion routine..?
    update routine
    How to call a function in Update Rules to reverse a key figure sign
    Need Sample Code for Update Rules
    Date calculation
    Difference between data in PSA and Data in Infocube
    No RETURNCODE <> 0 allowed in update routines in transfer mode
    the diffrerece between DEC and (yyyymmdd) 8 char in Time defination
    Access master data in update rules
    Date key figure: Convert DATS format to DEC format
    start routine in update rules
    Is it possible to read a third ODS in update rules between two ODS?
    update rule coding while loading data from ODS to CUBE
    Start Routine in Update Rules to populate additional fields from ODS
    Coding in Update Rules accessing a Z-Table
    Start routine
    Hope this helps you..........
    Regards,
    Debjani.........
    Edited by: Debjani  Mukherjee on Oct 1, 2008 4:58 PM

  • Is difference between update routine,start routine and transfer routine

    Hi All,
    What is difference between transfer routine and update routine.

    Hi Venkat,
    Routine is a set of ABAP code which is used to select a record or transform the field value at the time of loading the data.
    Types of routines:
    Tranfer Routines in Transfer Rules:
    Start Routines in Transfer Rules:
    Update Routines in Update Rules:
    Start Routines in Update Rules:
    Transfer/Update routine:
    It's the set of ABAP code used in Transfer/Update rules. Transfer/Update routine is used to change the value of a particular field/object at the time of loading data.
    Ex: Populate the amount/discount field by using Price and Quantity based on the given conditions.
    Start Routine:
    Start routine can be used in both Transfer Rules and Update Rules. Start routine is used to determine whether to load a particular record or not.
    Ex: From the data related to the year 2005, we can select only the records which belong to a particular month or fiscal period.
    Ultimately Transfer/Update routines are to update the value of a particular field. Start routines are used to select entire record.
    You can get more details about routines at :
    Routines
    ROUTINES
    Routines and Examples
    Start Routines
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/60cecb1d-0a01-0010-8289-b14fd99062fa
    take a look this doc for abap used in bw
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/4493c4a6-0301-0010-62a2-efd6ded61e04
    ABAP book that always mentioned :
    http://cma.zdnet.com/book/abap/
    assign points if useful ***
    Regards
    CSM Reddy

  • Urgent: ABAP routine in transfer rules

    Hi,
    when i am loading master data from R/3 into BW, i need to filter some records based on material type. there is no option in RSA6 (on R/3) or in Infopackage (BW) to make it available for filter.
    So i assume i need to write ABAP routine in transfer rules. can some one help me with ABAP. i need to load the records only when MTART field(material type) in MARA is "FINI" or "RAW" and skip other records.
    what is difference between deleting the whole data packet and deleting the record.
    Thank you very much in advance
    Regards
    Emil

    Hi
    Write the below code in the start routine of your transfer rules.
    Regards
    Prakash
    DATA: IT_DATA        TYPE STANDARD TABLE OF TRANSFER_STRUCTURE
                         WITH HEADER LINE
                         WITH NON-UNIQUE DEFAULT KEY INITIAL SIZE 0.
    DATA: S_DATA, T_DATA TYPE TRANSFER_STRUCTURE.
    LOOP AT DATAPAK INTO S_DATA.
    IF S_DATA-MTART EQ 'A' OR S_DATA-MTART EQ 'B'.
    MOVE S_DATA TO T_DATA.
    DELETE S_DATA.
    ELSE.
    DELETE S_DATA.
    ENDIF.
    APPEND T_DATA TO IT_DATA.
    ENDLOOP.
    CLEAR T_DATA.
    DATAPAK[] = IT_DATA[].
    Assigning points is a way of saying thanks on SDN!!

  • ABAP Guidelines for transfer rules & Update rules

    Is there any guidelines for abap when using it for transfer rules and update rules? I am looking for some best practise in this area.
    Thank you,

    There is no specific differences in the standards/coding procedure for Transfer Vs. Update Rulse.
    This can only come from a combination of requirement, design and experience! (in no particular order)
    for e.g.
    If the converions are the same for all data targets, you would use the transfer routine, start routine in the Transfer rules.
    If the converions are different for different data targets, you would use the update routine, start routine in the Update rules.
    Key concerns being performance, modularization, reduced effort and ease of maintenance.
    Not sure I have answered you question! Please get back if there is something specific you are interesed in (a scenario perhaps!)
    Rishi

  • Routine in transfer rules

    I am using the datasrource 0MM_PUR_VE_01,if the score for Evaluation
    Criteria or the score for subcriterion is Zero then this datasource is
    not picking those particular records
    Vendor    Eval.Crite      Subcriterion score   Score for Subcrit Eval. Crit
    1              Price01           Price Level 01               87
                    Quality02        Line/Stock 02               87
                                          Vendor Audit 03             0
                                          Delivery03 On-Time
                    Delivery01                                           87
                                          Quantity Reliability02      0
                                          Shipping Instructions03
    can be checked with t-code me61
    If the score of the Evaluation criteria or score of subcriterion is 0 the datasource 0MM_PUR_VE_01 is not picking that particular record
    in the above example Datarsc not picking the records of subcriterion Vendor Audit 03, Quantity Reliability02,
    actually this data is coming from table ELBP so whenever the score is zero even tha table is not storing that particular record
    I will have 5 evaluation criterion like Price,Quality,Delivery,Service,Service & the subcriterions for these also are fixed
    so i BW transfer rules I have to write a code in such a way that if the particular record is missing then it shouls treat it as score 0
    Ex:-\
    Eval criter          Score
    Price                  10
    Quality                20
    Delivery               0
    Service                10
    Service                 20
    Now my table wont store the record Delivery as the score is 0
    As my evaluation criteria ar e fixed in the update rules I need thelogic that if particular record is missing then it should show it as 0
    If my requiremnt is not clear pls let me knoe
    as this has to be solved very urgently
    Thanks
    Maya

    Hi,
    If you want it to write in Transfer Rule
    assumption that you have permant/contract in transfer rule as per <b>"  can see the attribute permanent/contract in the transfer rules as it is the attribute"</b>
    and
    Permanant--"p'
    Con--'C"
    Try this code in Employee number
    DATA: ZEMP TYPE TRANSFER_STRUCTURE-/BIC/ZEMPNumber.
    zemp = TRan_structure-/bic/zempNUmber.
    if TRan_structure-/bic/zpercon = 'P'.
    concatenate '7' Zemp to ZEMP.
    else
    concatenate '8' zemp to zemp.
    endif.
    RESULT = zemp.
    Yes to can read from Master Data table.
    you can write code in Start routine in Update rule.
    check out this...
    Re: Start Rou
    Regards,
    San!

  • Diff between the Start routine and Update rules?

    Hi Gurus
    Diff between the Start routine and Update rules?
    Thanks in advance
    Raj

    Hi,
    Routines are like conditions or business rules that could be applied to filter the data while entering the BW system or could be used to apply certain conditions on the info objects itself.Update rule level you manipulate your data and  write your start routine.
    There are 4 types of routines
    1. Start routine- Could be used at two levels (transfer rule level and the Update rule level)
    This Start routine written at the transfer rule level helps filter the necessary data coming from the source system.
    For Example: If you decide to extract data that contain only quantity greater than 500 , then you could specify the Start rouitne to achieve this.
    The Start routine at the Update rule level provides similar functionality but at this point it helps direct specific data to 
    different data targets.  For Example: If there 3 data targets being fed from the Infosource, you may want to apply some condition to each data target, like send year 2000 data ti Data target1, 2001 to data target 2 and so on.  This can be achieved by using Start routine at the Update rule level
    2. Transfer Routine: This feature is available at the transfer rule levels
    While performing the transfer rules operation, there are 4 features available to the developers to create business rules on top pf the Infoobjects.
    1. You could do a one to one mappping of the Infoobject
    2. Provide a constant value
    3. Include a formula
    4. Write an ABAP routine.
    These 4 options refers to the transfer routine
    3. Update Routine:
    The limitations of just having 4 options in the transfer routine is overcome at the update rule level. There are various other 
    sophisticated features avaialable apart from the 4 options mentioned above. These business rules could be specified pertaining to each data target.
    4. Conversion Routine: It provides functionality to do Currency and unit conversion.
    Regards.

Maybe you are looking for

  • [Solved] Subdomain no Database Access (MySQL)

    I'm confused about the missing database connection, I have added a screenshot that explains the problem. http://postimage.org/image/f1u804lp7/full/ (1920x1080) Running Apache, MySQL, PHP, Memcache, System hostname localhost.localdomain (127.0.0.1) Op

  • Older BMW Quicktime Videos not Playing

    I have some older 2004 BMW Videos such as Ticker, Ambush, Star etc which I have not played in awhile. These Videos now do not play on my new Intel iMac running the latest version of Quicktime. Any suggestions ?

  • Backup - BR0274E File '.../sap.ora' not found

    Hi, I've got following error message in our backup protocol. BR0051I BRBACKUP 7.00 (26)                                            BR0055I Start of database backup: bdxjfifx.anf 2008-02-28 20.00.01    BR0484I BRBACKUP log file: /oracle/P02/sapbackup/

  • Bank keys selection on F110

    Hi All, In the Customer master data ->payment transaction, There are two bank keys (of same country) with different Partner Bank Type 'A' , 'B' are assigned In F110 For the documents of type Direct bank collect, for some documents selected the first

  • Xsl editing in codeview

    i used to edit my xsl-files in the codeview in dreamweaver mx 2004. now i changed to dreamweaver 8, the problem is i can't edit xsl-files correctly, every changed character gets ugly, Ex. a "g" gets to 3 spaces. what is this good for? or am i doing s