Challenge - Defining "global" variable accessible in Transfer Rules Routine

Hi,
Is there a way to define a global variable in BW which is accessible via all the "Routines" in the Transfer Rules in the Info Source.
Scenario:
1) I have a field called ZTEXT in the transfer rules.
2) I am adding code in the Routine to manipulate this data in the Transfer Rules for the Info Source.  Ultimately the RESULT will be populated with a value.
RESULT = .
returncode <> 0 means skip this record
  RETURNCODE = 0.
abort <> 0 means skip whole data package !!!
  ABORT = 0.
$$ end of routine - insert your code only before this line   
3) In the Routine Code, the value of the RESULT will be derived based on what's in a field called "g_value".  I don't want to derive the value in the "g_value" field in each Routine for each record that gets processed as it will take a performance hit. I am looking for a way that "g_value" can be populated once e.g. in a START Routine or another alternative and then "g_value" can be used throughout the Routine for any field in the transfer Rules.
Is there a way to define and populate "g_value" as a global variable so its VALUE can be retained and used in all the Routines in the same transfer rules.  Note that there will be a fair amount of logic to derive "g_value" and hence the need to avoid deriving it each time.
Could someone advise me if this is even possible?  If so, could you give me a ABAP code sample for it please? 
Thank you very much,
Haritha

if you create the variable as global and in your start routine, calculate and give it a value, you can use that value in all your individual routines.

Similar Messages

  • Define Global Variable in XSLt

    H,
    Please let me know how to define Global Variable in XSLT.
    I have define a variable under for-each and i want to use that variable after for-each.
    Please suggest on the same.
    Thanks,
    Pradeep

    Hi Pradeep,
    IN XSL design, right click on target node and then select --> Add Variable. Give the name you desire to that variable and click OK. You can use that variable anywhere in that particular XSLT. In the source xsl you will see entry like this after adding your variable
    "<xsl:variable name="your variable name">value you want to give</xsl:variable>".
    Hope this helps.
    Regards,
    Karan

  • How can I define global variable in user exit whic I can use anywhere.

    Hi all,
    How can I define global variable( Table ) which I can use when it come back to same user exit where I defined and stored some data.
    What I mean is I want to define 1 global table.
    In user exit when it comes I store some information. and again when it will come I will have that stored information so I can use it.
    Thanks a lot in advance.

    You can use EXPORT  TO MEMORY ID and IMPORT FROM MEMORY ID Statement for this.
    EXPORT T_ITAB FROM T_ITAB TO MEMORY ID 'ABC'.
    IMPORT T_ITAB TO T_ITAB FROM MEMORY ID 'ABC.'

  • Loading defining global variables?

    Hello all!
    I have a project that is an online presentation, which I (being no pro in codeing) create in Edge and Muse. I create the animation in Edge, publish it as OAM and place it into the muse site/page. Master looks fine and I am happy with it.
    My problem, that I have to solve, is that it has to be translated into 44 Languages and kept updated regularly, which is near to impossible without using external data source.
    I thought to create an XML file for each language and use it for text and maybe Image content. I can use an xml file for a specific animation, but at my current knowledge level i!Il have to define the variables and the source of content for each and every animation/object.
    What I would like to see is that if you land on the Index page, you can choose the preferred language, and all the content appeares in the given language. For that (my best guess) I'll have to define global variables, which do not lose their value i.e.: which is my preferred language.
    How do I do that? Had anyone a similar issue? Also, how do I use external data in Muse?
    Any help would be appreciated!
    Greetz
    ND

    Here it is :
    In the Stage > document.compositionReady event handler, we define a JavaScript object LANG containing
    • a property flag that is the state of the displayed flag (in the example file, symbol drapeau, french for flag) ;
    • a function switchLang executed each time the flag is clicked, to refresh the content of
    - the three titles (b1A_tit, b1B_tit, b1C_tit) by  assigning hard-coded values,
    - the three texts (b1A_txt, b1B_txt, b1C_txt) by loading HTML snippets files in a text folder.
    LANG =
      flag: 'NL',
      switchLang: function()
        sym.getSymbol('bandeauH').getSymbol('drapeau').stop( LANG.flag);
        var symBloc1A = sym.getSymbol("bloc1A");
        var symBloc1B = sym.getSymbol("bloc1B");
        var symBloc1C = sym.getSymbol("bloc1C");
        switch (LANG.flag)
          case 'NL':
            symBloc1A.$('b1A_tit').html("Montagne");
            symBloc1A.$('b1A_txt').load('text/b1A_FR.html');
            symBloc1B.$('b1B_tit').text("Peinture");
            symBloc1B.$('b1B_txt').load('text/b1B_FR.html');
            symBloc1C.$('b1C_tit').text("Maison d’hôtes");
            symBloc1C.$('b1C_txt').load('text/b1C_FR.html');
            LANG.flag = 'FR';
            break;
          case 'FR':
            symBloc1A.$("b1A_tit").text("Montagne");
            symBloc1A.$('b1A_txt').load('text/b1A_NL.html');
            symBloc1B.$("b1B_tit").text("Schilderen");
            symBloc1B.$('b1B_txt').load('text/b1B_NL.html');
            symBloc1C.$("b1C_tit").text("Bed & Breakfast");
            symBloc1C.$('b1C_txt').load('text/b1C_NL.html');
            LANG.flag = 'NL';
            break;
    LANG.switchLang();
    The drapeau > click event handler is a single call to LANG.switchLang();
    Download the example file here : https://app.box.com/s/f8boa2oswnowyl3ehb2o
    Gil

  • Creating an Incremental Unique Key in Transfer Rules Routine

    Hello Experts,
    In my Infosource, I have created a routine in the transfer rules on my infoobject.  I am trying to load my data from a flat file and create a unique key by autonumbering a field in my infosource/datatarget. 
    I am new to ABAP and can not figure out why my code will not return a value...
    Under "Use of Transfer Structure Fields" I chose my field to change only, and entered the following code:
    Under Global Code I declared my counter because I want it to maintain its value during the entire load:
      DATA: COUNTER TYPE I VALUE 0.
    Then in my routine I have the following code:
      COUNTER = COUNTER + 1.
      RESULT = COUNTER.
      RETURNCODE = 0.
      ABORT = 0.
    I expect this to return 1 for the first record, 2 for the second, and so on - therefore giving me a unique key.  Any assistance in my code or other ways to automate this process in BW would be greatly appreciated.
    Thank you.

    Sean,
    It looks like your routine is basically correct.  Have you tried using single quotes around the S instead?  Also - you may want to add a statement to indicate what 0AMOUNT should be in the instance where your condition isn't true.  Something like this:
    IF tran_structure-shkzg  = 'S'.
    RESULT = tran_structure-wrbtr * -1.
    ELSE.
    result = ???
    ENDIF.
    Good luck!  The syntax check in the transfer rules leaves a bit to be desired, doesn't it?

  • Transfer Rule Routine: Assign Date Value into Blank Field

    Can anyone help me with regards to writing some ABAP code in a transfer rule so that I can assign "99991231" value into a date characteristics if it is blank?
    Many thanks for advance.

    I would like to check if the value of EXPIRYDATE is blank in data source. If its value is blank, assign '99991231' to it. Otherwise, it will get the value of EXPIRYDATE in transfer rule. I have rewritten the routine as follows. But there is no effects on the result.
    if TRAN_STRUCTURE-EXPIRYDATE IS INITIAL.
      RESULT = '99991231'.
    else.
      RESULT = TRAN_STRUCTURE-EXPIRYDATE.
    endif.
    Many thanks in advance.

  • Transfer Rule Routine: Change date format

    Can anyone help me with regards to writing some ABAP code in a transfer rule so that I can change the format of a date (from 04/01/06 in the PSA) so that it's wrtitten as 01.04.06 into the cube?
    Many thanks in advance,
    Matt
    Message was edited by:
            Matt Potts
    Message was edited by:
            Matt Potts

    Hi Matt,
    so you are not using a standard date field or any other characteristic that refers to 0date, aren't you? If that is the case, just do the following in a routine:
    replace all occurrences of '/' in tran_structure-<your date field> with '.' into result.
    If you are using a standard date field which is always displayed as dd.mm.yy you need to convert it into the internal sap value which is yyyymmdd. You can achieve that by calling the fm CONVERT_DATE_TO_INTERNAL in a routine:
    call function 'CONVERT_DATE_TO_INTERNAL'
    exporting date_external = tran_structure-<your date field>
    importing date_internal = result
    exceptions date_external_is_invalid = 1.
    if sy-subrc <> 0.
    a action needs to be done, because the date was not valid.
    clear result.
    endif.
    kind regards
    Siggi

  • Returncode in transfer rules routine

    In every transfer routine template there is such interesting line of comment:
    * returncode <> 0 means skip this record
    I've tried to set the returncode to 1, was a certain condition encountered. However the record isn't ignored at all, and I get this error message in the monitor:
    <i>Record 1 :Returncode 1 with the conversion for the field SOLD_TO</i>
    How does the returncode function?
    Thanks, <a href="https://wiki.sdn.sap.com/wiki/display/profile/Davide+Cavallari">Davide</a>

    hi Davide,
    checked sap help say ?
    http://help.sap.com/saphelp_nw70/helpdata/en/0d/54a2a4705c3c4d9a3726773d741392/frameset.htm
    have you set the option for error handling in infopackage ?
    hope this helps.

  • "Assertion failed" error in Transfer rule routine

    Hello Experts,
    I am new to BW. I am writing small abap routine in Transformation.
      IMPORTING
        request     type rsrequest
        datapackid  type rsdatapid
        SOURCE_FIELDS-DIVISION TYPE /BI0/OIDIVISION
        SOURCE_FIELDS-/BIC/ZDIVNAME TYPE /BIC/OIZDIVNAME
       EXPORTING
         RESULT type tys_TG_1-/BIC/ZDIVNAME
         Data: wa_Division type /BI0/TDIVISION.
         select single * fROm /BI0/TDIVISION into wa_division where DIVISION
         = SOURCE_FIELDS-DIVISION.
         IF SY-SUBRC = 0.
         RESULT = WA_DIVISION-TXTSH.
         ENDIF.
    My aim here is that I have a Division Infoobject and I want to get its text(name) from text table /BI0/TDIVISION but this code doesnot work.
    Any suggestions!!
    Regards,
    DNP

    Hi Jerry,
    Please find below the details of dump. Thankyou very much for your help.
    Short text
        The ASSERT condition was violated.
    What happened?
        In the running application program, the ASSERT statement recognized a
        situation that should not have occurred.
        The runtime error was triggered for one of these reasons:
        - For the checkpoint group specified with the ASSERT statement, the
          activation mode is set to "abort".
        - Via a system variant, the activation mode is globally set to "abort"
          for checkpoint groups in this system.
        - The activation mode is set to "abort" on program level.
        - The ASSERT statement is not assigned to any checkpoint group.
    What can you do?
        Note down which actions and inputs caused the error.
        To process the problem further, contact you SAP system
        administrator.
        Using Transaction ST22 for ABAP Dump Analysis, you can look
        at and manage termination messages, and you can also
        keep them for a long time.
    Error analysis
        The following checkpoint group was used: "No checkpoint group specified"
        If in the ASSERT statement the addition FIELDS was used, you can find
        the content of the first 8 specified fields in the following overview:
        " (not used) "
        " (not used) "
        " (not used) "
        " (not used) "
        " (not used) "
        " (not used) "
        " (not used) "
        " (not used) "
    How to correct the error
        Probably the only way to eliminate the error is to correct the program.
        If the error occures in a non-modified SAP program, you may be able to
        find an interim solution in an SAP Note.
        If you have access to SAP Notes, carry out a search with the following
        keywords:
        "ASSERTION_FAILED" " "
        "CL_RSTRAN_GEN=================CP" or "CL_RSTRAN_GEN=================CM00H"
        "GET_SOURCE_PARAMETER"
        If you cannot solve the problem yourself and want to send an error
        notification to SAP, include the following information:
        1. The description of the current problem (short dump)
           To save the description, choose "System->List->Save->Local File
        (Unconverted)".
        2. Corresponding system log
           Display the system log by calling transaction SM21.
           Restrict the time interval to 10 minutes before and five minutes
        after the short dump. Then choose "System->List->Save->Local File
        (Unconverted)".
        3. If the problem occurs in a problem of your own or a modified SAP
        program: The source code of the program
           In the editor, choose "Utilities->More
        Utilities->Upload/Download->Download".
        4. Details about the conditions under which the error occurred or which
        actions and input led to the error.
    User and Transaction
        Client.............. 001
        User................ "USNDIPA"
        Language key........ "E"
        Transaction......... "RSA1 "
        Transactions ID..... "498AF810CE1C0214E10080000AF00ED9"
        Program............. "CL_RSTRAN_GEN=================CP"
        Screen.............. "SAPLSPO4 0300"
        Screen line......... 19
    Information on where terminated
        Termination occurred in the ABAP program "CL_RSTRAN_GEN=================CP" -
         in "GET_SOURCE_PARAMETER".
        The main program was "RSAWBN_START ".
        In the source code you have the termination point in line 39
        of the (Include) program "CL_RSTRAN_GEN=================CM00H".
    Source Code Extract
    Line  SourceCde
        9     lr_rule           TYPE REF TO cl_rstran_trfn_rule,
       10     l_posit_source_ex TYPE rsposit,
       11     l_seg_source      TYPE rstran_segid.
       12
       13
       14   lr_rule = i_r_rule->get_model_rule( ).
       15 *-- GET POSIT pointer to segment field of source.
       16   CALL METHOD lr_rule->get_posit_ext
       17     EXPORTING
       18       i_paramtype = cl_rstran_stat=>paramtype_importing
       19       i_ruleposit = i_posit
       20       i_rulesegid = i_segid
       21     IMPORTING
       22       e_segid     = l_seg_source
       23       e_posit     = l_posit_source_ex.
       24
       25   ASSERT l_seg_source = i_segid.
       26
       27 *-- Get component name from seg
       28   READ TABLE i_t_segment_m ASSIGNING <ls_s_seg>
       29     WITH KEY segid = i_segid.
       30   ASSERT sy-subrc = 0.
       31
       32 *-- Get field name from source field with extern posit.
       33   READ TABLE i_t_seg_source ASSIGNING <ls_s_seg_source>
       34     WITH KEY segid = i_segid.
       35   ASSERT sy-subrc = 0.
       36   IF sy-subrc = 0.
       37     READ TABLE <ls_s_seg_source>-t_field ASSIGNING <ls_s_field>
       38       WITH KEY position = l_posit_source_ex.
    >>>>>     ASSERT sy-subrc = 0.
       40   ENDIF.
       41
       42 *--  r_s_parameter-param_id has to be set out side due to type inheritance of RuleStepMappin
       43
       44   CONCATENATE '<' <ls_s_seg>-y__nm '>' INTO
       45   c_s_connector-s__nm.
       46   c_s_connector-f__nm = <ls_s_field>-fieldname.
       47
       48 ENDMETHOD.
    Regards,
    DNP

  • Global Variable in Oracle Forms 6i

    Hi,
    How & where to define global variable in Oracle form 6i and also let me know how to access it.
    Thanks in advance
    Regards,
    Sanket

    hi
    Global variable are forms specifice variable.
    it can store character value upto 255 for all usages.
    We can initialize it when we declare otherwise give error if we did not assign it any value.
    Oracle 10g it can take upto 4000 bytes
    GLOBAL.ur_globalvar := TO_CHAR(15);
    or
    :GLOBAL.ur_globalvar:= '15';
    or
    Remmber numeric values are implicitly converted by oracle 2 character
    :GLOBAL.ur_globalvar:= 15;
    -- which can then subsequently be accessed using...
    :GLOBAL.ur_globalvar;
    -- To destroy a global variable and release its memory, use the ERASE built-in procedure:
    Erase('GLOBAL.my_var'); Regards,
    Abdetu...

  • Global Variable in Essbase unable to pull up dimension structure

    Hi!
    I have created a global variable in Essbase using which I want to select a dimension member in a Business rule. While trying to create the global variable in Essbase though, I cannot pull up the dimension structure in the Limits or Default value fields to view them. So even if I leave them blank and validate the business rule that uses this global variable, and if I try to select a member from the dimension that this variable references, I get this error "Null child not allowed".
    In the global variable settings, even if I type in a value manually in the default value field and use this global variable in a business rule, I get the same error.
    This global variable itself can pull up the structure of other dimensions. It is only this one dimension that is giving me trouble. Do I have to make any dimension setting changes? I have checked the settings/security and they seem to be identical to the other dimensions that work fine.
    This is the 9.3.1. world and I am doing these changes in the EAS console client (not the web version).
    Any pointers will be appreciated.
    Thanks!
    NJ

    It looks like global variable cannot handle a hierarchy that is about 1800 members strong directly under the root. So I had to move the members under a 'dummy' rollup member under the root and now the business rule can bring up the hierarchy wrt the global varaible.

  • Forms Personalization:Global variable Error

    Hi,
    Two Forms one is AR transactions and 2nd is AR TO AP,
    navigating from ACTIONS menu in Transactions window to call AR TO AP form
    Have defined Global Variable for Transaction Number in AR R12, AS,
    Object Type - Global variable
    Target object - MAIN_TRX_VALUE
    Property name - Value
    Value - :TGW_HEADER.TRX_NUMBER_MIR
    And want to use this global variable in another calling form AR TO AP but not getting value of generated transaction Number in my form field TRANSACTION_NUMBER which is defined as in personalization
    Object Type - ITEM
    Target object - BLK_CTRL.Transaction_number
    Property name - Value
    Value - :GLOBAL.MAIN_TRX_VALUE.
    Any Syntax error?have done all trial n error menthod.
    Using followin syntax in form 10g WHEN NEW FORM INSTANCE,
    :Blk_Ctrl.Transaction_Number := :global.MAIN_TRX_VALUE ;
    Any other way to fetch TRX_NUMBER_MIR value?
    On Priority.THANKS.

    hi
    u did not mention error and u r forms version?
    sarah

  • Forms personalization and global variable

    Hi,
    I'm trying to call a procedure in forms personalization and using a defined global variable. The data in the global variable is number. In the procedure, some of the parameter has a number datatype and I'm converting the global variable using to_number eg (to_number(:global.XX_LINE_NUM). This fails with error message ora-01403 no data found. I've tried putting the above into a variable with datatype number in the declare statement, and it errors as well.
    Does anyone knows the syntax to convert the global variable to number datatype in personalization.
    Thanks

    Ask in this forum : OA Framework

  • Any way to set global variables except EAS console?

    Hi pros,
    I am searching for a way to set global variables (used by business rules) automatically.
    I got several variables which should change each month. I know the rule to set them.
    However, I cannot find any way to set them through scripting or something else.
    I tried to research EAS repository. The one that I found relevant is HBRVariables table.
    I cannot find any tool can help this.
    Any one knows how?
    Appreciated......
    Casp Huang

    Yes you can use substitution variables in business rules and they are widely used, it is relatively easy to automate the changing of values for subtitution values.
    You can also put a sub var into the default value for a global variable in business rules.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • How use global variable in other form

    hi master
    sir i define global variable abc in form1
    sir can i use use this global variable abc in form2
    form2 i call from from 1
    please give me idea

    thank's for your reply
    sir i use this method
    i form1
    :global.fatherstatus :=0;
    form2
    :global.fatherstatus :=:accountcode0;
    thanking you

Maybe you are looking for

  • Can't drag and drop music from itunes to Iphone

    my brother recently updated to a newer version of itunes and i can no longer drag and drop music from my itunes to my iphone! ive tried everything that i know and nothing is working! i tried checking the 'manually manage music' box, but everytime i d

  • Disk Image/CD-R Confusion

    I'm trying to figure out how to do one simple thing, or at least I hope it's more simple than what I know so far. I want to burn a copy of my Quicken data file to the same CD-R two or three times a month as backup. I've created a disk image of the fo

  • Combining two reports with headings and body into one

    I currently have two seperate XML reports for Oracle projects. One report prints out all the Labor information. One prints out Expense information. The users want those two reports married into one. So if there was Labor data in the XML that would re

  • How to set up a pro headphone mix  in logic express 8

    using logic express 8 software, avalon tube amp, 4 channel head phone mixer, yamaha O1V digital mixer and running through a line 6 toneport UX2 unit cant figure out how to get a nice individual headphone mix for vocals with effect inserts inside logi

  • Creative cloud desktop won't load any apps

    The apps tab in my creative cloud desktop reads download error. Help!