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

Similar Messages

  • How to write ABAP Routeines in Update/Transfer Rules ?

    Hi Experts,
    Iam new to BW and i don't have ABAP knowledge.Can any body help me ..to write ABAP Routeines in Update rules/Transfer rules.Give me some basic knowledge with proper example.and what type of routeines we need to write ?
    I will appreciate if some one helps me with proper Documentation.My mail id is [email protected]
    Points will be rewarded.
    Thanks in advance,
    Nayanasri.

    Hi Nayanasri,
    It is not mendatory that u need to write Update routines for all update rules. It depends on the requirement. Without update routine u can always manage. My last implementation was for a small chemical firm where i did not use any of the update routine. Suppose if u want to change the records in datapackage depending on certain conditions, then u can go for this. I'm just pasting one of my update routine program
    PROGRAM UPDATE_ROUTINE.
    $$ begin of global - insert your declaration only below this line  -
    TABLES: ...
    DATA:   ...
    $$ 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/CS8YGTGDCL6B.
    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
    DELETE DATA_PACKAGE WHERE /bic/yverbr NE  'V2'.
    DELETE DATA_PACKAGE WHERE /bic/ydpbasfs = 0 AND /bic/yoplqty = 0.
    ENDFORM.
    Where the delete statement deletes the records when the field /bic/yverbr noe equals to 'V2' or deletes it when /bic/ydpbasfs equals zero.
    If the explanation is not suffecient, pls post further
    Regards
    Sriram

  • 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

  • How to write an inverse routine for an info object at field level.

    Hi All,
    Our requirement is as follows:
    Need to populate 0MAT_PLANT in a virtual provider. But during query performance it is like -
    If someone were to add a filter to the BW query on 0MAT_PLANT, it would take the system awhile to search the APO database for that 18 CHAR material number because the data in APO is stored differently (40 CHARs).  The point of the  inverse routine is to convert the 18 CHAR to be 40 CHAR for those times when someone selects on 0MAT_PLANT.  That way, the field types match and finding the data in APO is much quicker.
    Hence if we need selection on the selection scree of the query for 0MAT_PLANT, we are trying for inverse routine which will convert 18 chars to 40 chars in the query level and the performance will be quicker.
    See, 0MAT_PLANT is of 18 Char length. We are mapping it from ZMATNR in source which is of 40 chars. Thus initially in the field routine we will write a code to convert 0MAT_PLANT to 18 from 40.
    Below is the code and the place we now we also need to write inverse routine to convert it to 40 from 18 chars.
    *****Code to convert from 40 chars to 18******
    *In APO if the material contains all integers values the material will
    * come over as a 40 byte field.  It needs to be shortened.
      IF SOURCE_FIELDS-/BIC/ZMATNR CO '0123456789'.
        short_material = SOURCE_FIELDS-/BIC/ZMATNR+22(18).
    *In APO if the material contains any character fields the material will
    * not be zero filled and will be left alligned. Take the 1st 18 bytes.
      ELSE.
        short_material = SOURCE_FIELDS-/BIC/ZMATNR(18).
      ENDIF.
    *add leading zeros to numeric only value
      IF short_material CO '0123456789 '.
         w_num18 = short_material.
         short_material = w_num18.
      ENDIF.
      RESULT = short_material.
    *$*$ end of routine -
    ***********here the iverse routine need to write************
    *       Method invert_0MATERIAL
    *       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 invert_0MATERIAL.
    *$*$ begin of inverse routine - insert your code only below this line*-*... "insert your code here
    Here you would write logic in 0MAT_PLANT to do the opposite of the above,
    convert 18 back to 40 characters.
    *$*$ end of inverse routine - insert your code only before this line *-*
      The articulated form above in RED says that the subroutine i.e. the inverse routine is implemented for direct access and report to report interface.
    Could anybody please help me or let me know any idea related to this.

    Hi All,
    Our requirement is as follows:
    Need to populate 0MAT_PLANT in a virtual provider. But during query performance it is like -
    If someone were to add a filter to the BW query on 0MAT_PLANT, it would take the system awhile to search the APO database for that 18 CHAR material number because the data in APO is stored differently (40 CHARs).  The point of the  inverse routine is to convert the 18 CHAR to be 40 CHAR for those times when someone selects on 0MAT_PLANT.  That way, the field types match and finding the data in APO is much quicker.
    Hence if we need selection on the selection scree of the query for 0MAT_PLANT, we are trying for inverse routine which will convert 18 chars to 40 chars in the query level and the performance will be quicker.
    See, 0MAT_PLANT is of 18 Char length. We are mapping it from ZMATNR in source which is of 40 chars. Thus initially in the field routine we will write a code to convert 0MAT_PLANT to 18 from 40.
    Below is the code and the place we now we also need to write inverse routine to convert it to 40 from 18 chars.
    *****Code to convert from 40 chars to 18******
    *In APO if the material contains all integers values the material will
    * come over as a 40 byte field.  It needs to be shortened.
      IF SOURCE_FIELDS-/BIC/ZMATNR CO '0123456789'.
        short_material = SOURCE_FIELDS-/BIC/ZMATNR+22(18).
    *In APO if the material contains any character fields the material will
    * not be zero filled and will be left alligned. Take the 1st 18 bytes.
      ELSE.
        short_material = SOURCE_FIELDS-/BIC/ZMATNR(18).
      ENDIF.
    *add leading zeros to numeric only value
      IF short_material CO '0123456789 '.
         w_num18 = short_material.
         short_material = w_num18.
      ENDIF.
      RESULT = short_material.
    *$*$ end of routine -
    ***********here the iverse routine need to write************
    *       Method invert_0MATERIAL
    *       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 invert_0MATERIAL.
    *$*$ begin of inverse routine - insert your code only below this line*-*... "insert your code here
    Here you would write logic in 0MAT_PLANT to do the opposite of the above,
    convert 18 back to 40 characters.
    *$*$ end of inverse routine - insert your code only before this line *-*
      The articulated form above in RED says that the subroutine i.e. the inverse routine is implemented for direct access and report to report interface.
    Could anybody please help me or let me know any idea related to this.

  • 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

  • How to write a case statement for the totals column of two different years (2013 and 2014) of the same month so that I can get a +/- column

    Please Help!!!
    How to write a case statement for the totals column of two different years (2013 and 2014) of the same month so that I can get a +/- column.
                                      January 2014         January
    2013                            +/-
                    Region   Entry   Exit  Total    Entry   Exit   Total   (Total of Jan2014-Total of Jan2013)
                    A               2         3      
    40        5       7        30                    40-30= 10

    What is a table structure? Sorry cannot test it right now..
    SELECT <columns>,(SELECT Total FROM tbl WHERE Y=2014)-(SELECT Total FROM tbl WHERE Y=2013)
    FROM tbl
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • How to refer field of DataSource in transfer rule for DSO object  in BI 7.0

    hello Gurus,
    I am new to BI 7.
    pls tellme how to refer field of DataSource in transfer rule for DSO object.
    I will assign points to proper answer.
    Praveen.

    hi praveen,
    when u create the transformation for the DSO, it asks for the source. in that you enter your datasource, then you get the datasource fields on one side and the rules in the middle and the DSO objects on the other side. whichever field of DataSource you want to refer in tranformation rule, just connect that field to the rule for the required object of the DSO.
    hope this will help you.
    regards
    vaibhav

  • If you write routine in transfer rules what will happen

    If you write routine in transfer rules what will happen?

    Hi,
    If we write routines in Transfer Rules:
    If it is Start Routine: Record Level Transformation
    If it is at Rules: Field Level Transformation
    In both case, the transformations are activated before the data entering into BW.
    Hope this Information helps u..........
    Assigning points is the way of saying THANKS in SDN
    Regards
    Ramakrishna Kamurthy

  • How to write the regular expression for Square brackets?

    Hi,
    I want regular expression for the [] ‘Square brackets’.
    I have tried to insert in the below code but the expression not validate the [] square brackets.
    If anyone knows please help me how to write the regular expression for ‘[]’ Square brackets.
    private static final Pattern DESC_PATTERN = Pattern.compile("({1}[a-zA-Z])" +"([a-zA-Z0-9\\s.,_():}{/&#-]+)$");Thanks
    Raghav

    Since square brackets are meta characters in regex they need to be escaped when they need to be used as regular characters so prefix them with \\ (the escape character).

  • How to write the CMD command for restarting all obi services?

    Hi Experts,
    BIEE:11.1.1.6
    How to write the CMD command for restarting all obi services automatically by windows task scheduler?
    I am try to write the code as below, but it does not work. Please help me to review it and check what I am missing.Thanks.
    Or is there any better method for solving my requirement ? Please share me.Thanks very much.
    cd C:\InstallPath\OBIEE\instances\instance1\bin
    opmnctl stopall
    opmnctl startall
    I am facing the problem that it does not excute the 'opmnctl startall' code, which will be stopped after 'opmnctl stopall',
    So how to modify the command ?Thanks

    See if any of the these are useful or solves your query -
    4.5.2 Using a Windows Service to Start and Stop System Components
    http://docs.oracle.com/cd/E23943_01/bi.1111/e10541/components.htm#BABEEAAI
    4.5.3 Using the Oracle BI Systems Management API to Programmatically Start and Stop Oracle Business Intelligence
    http://docs.oracle.com/cd/E23943_01/bi.1111/e10541/components.htm#BABFGICA
    Edited by: Abhi on May 8, 2013 4:44 AM

  • How to find the standard Idoc for Transfer Order (LT03)

    hi
    How to find the standard Idoc for Transfer Order (LT03)
    How to create the Idoc on LT03
    plz help me out
    Thank u
    Ram

    Someone is using FM: L_IDOC_INPUT_WMTORD, message type WMTORD and basic type WMTOID01 in doing this when trying to send an Idoc to an external system when a transfer order for a delivery note is created (LT03). Is it OK
    Please reward points

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

  • 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

  • Debugging of Routines in transfer rules

    Hi All,
    I wrote a routine and trying to debug.I tried to debug using "Simulate update" option when we right click in the monitor screen.I don't know how to proceed from there.Could some one explains the steps to debug the routine in transfer rules?
    Your help is greatly appreciated.
    Thanks
    Manish

    Hello Manish,
    You can create a Watch point if you are looking for some InfoObject / table field values.
    Or you can keep pressing F5 for step by step debugging (takes long time) and double click the field when you see them.
    If you want to go by block by block instead of line you can use F6 and F7 and if you want to execute you can F8 as what we do for execution.
    If you are sure where you want to check then set a break point by double click or select the line and click the Break Point Icon in the top and press F8, the system will automatically stops at the break point then double click the field you need and check the value in the right side window.
    If you are using BW3.x the you can switch between New Debug mode (Multiple screen and will be difficult to use if you are new) and Classical Debug Mode (easy to use)
    Hope it helps
    Thanks
    Chandran

  • 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

Maybe you are looking for

  • Audio out options question - HDMI + component?

    I have looked thru the manual and forums, but have not seen the answer to my question. If I hook an ATV to my TV with HDMI, and also use the Right and Left (red and white component) audio out cables to my stereo (which does not have TOS link digital

  • When to use qualified lookup table?

    Hi all, I am confused with the qualified lookup table and lookup table, for the situation that a company has more than one contact person, I created a table "contact person", which has following fields: first name, last name, phone number, email addr

  • Space Designer and surround

    I can't seem to turn up any info on this so... Does Space Designer support surround? Are there any surround IRs included? Thanks. JP

  • Base Documnet details in A/R PLD

    Dear All, I copy a Sales Order to a Delivery Challan, i Copy This Delivery Challan to a A/ R Invoice. I Need the Document number and their posting dates of both sales order and delivery documnet base number onto the A/R Invoice PLD. I AM able to achi

  • Je ne visualise plus iTunes store

    Bonjour, ça fait plus d'un mois que je n'ai rien dans ma fenêtre principale d'iTunes et pourtant je suis connecté à iTunes store, je suis sur un iMac; par contre en wifi ça marche sur mon iPod. Quoi faire?