Global variables in transformation routines

Hi
Where would I declare a global variable in my characteristic transformation routines?
There's a spot that says:
$$ begin of global - insert your declaration only below this line  -
... "insert your code here
$$ end of global - insert your declaration only before this line   -
Is that it?
Then what's the difference with:
$$ begin of 2nd part global - insert your code only below this line  *
... "insert your code here
$$ end of 2nd part global - insert your code only before this line   *
Corne

What for? (2nd part global declaration in transformation)

Similar Messages

  • Global part in transformation routine

    .

    In the global part you define global data declarations 'CLASS DATA'.
    http://help.sap.com/saphelp_nw04s/helpdata/en/e3/732c42be6fde2ce10000000a1550b0/frameset.htm
    Regards
    Andreas

  • Global variable declaration in form routines

    Hi All,
    i am new of the smartforms, i have a small problem in smartforms.
    i need to display the one text based on the condtions, already i have putted the condtions in the condition tab for the text, i need to compare the one more condtion, the condtion is TB_INFORMATION IS NOT INITIAL.
    the code was devaloped in the formroutines , i need to implement the one condtion in the form routines,
    the condition is if TB_INFORMATION IS NOT INITIAL is not initial
                                  va_information = x.
                                endif.
    already i declared the variable in the global defination ,but i am getting the error.
    where can i declare the global variable in form routines.
    Please help me,
    Thanks & Regards
    charan

    declare in global data and it will be visible and available in form routines too.

  • Use of global data in transformation with parallel processing

    Hi,
    In an upgrade I have a global variable in a routine in 3.5 in a transfer rule. The global variable keeps count of an ID.
    The global variable is used in every data package,because the corrsponding infopackage is set to PSA only, where help says:
    "If you select this processing option and then request processing is done serially during loading, the global data are maintained as long as the process with which the data were processed remains.
    In 7.0 I also use a global variable to do the same thing, but an Infopackage is no longer available, because we use DTP´s now.
    How can I store my global variable so that all parallel processing of the data packages use the same global variable? or can I set an option so that the DTP does serial processing, similar to the infopackage setting in 3.5?
    As a workaround I increased the package size to a very large figure, but I would be more comfortable with a sounder solution.
    thanks

    Hi Max,
      Try to declare your global variable in start routine. Among the lines:
    $$ begin of global - insert your declaration only below this line  -
    $$ end of global - insert your declaration only before this line   -
    Best Regards.
    Javier Gómez

  • Using Global Variables in Data Quality Address Cleanse Transforms

    I am currently developing in Data Services 12.2.
    I am trying to dynamically populate the List Owner information in the option tabs of the USA Regulatory Address Cleanse by using global variables.  It populates the 3553 with the variable name instead of the value assigned.
    According to the Technical Manual, it is possible to use global variables in Data Quality Address Cleanse transforms:
    However, you can use substitution parameters in all places where global variables are supported, for example:
    Query transform WHERE clauses
    Mappings
    SQL transform SQL statement identifiers
    Flat-file options
    User-defined transforms
    Address cleanse transform options
    Matching thresholds
    Does anyone know if it is possible to use global variables in the option tab of the Address Cleanse; if so, can you describe how it is done?
    Thanks in advance,
    Rick

    Hi,
    U can refer to the following links in help.sap.com
    GlobalContainer Object
    http://help.sap.com/saphelp_nw04/helpdata/en/75/8e0f8f3b0c2e4ea5f8d8f9faa9461a/content.htm
    Container Object
    http://help.sap.com/saphelp_nw04/helpdata/en/78/b4ea10263c404599ec6edabf59aa6c/content.htm
    Also some of the RUN TIME CONSTANTS are available in your BPM. So if you are trying to retrieve those variables in your Mapping(that is used in BPM), also read the following thread.
    Re: Message id in BPM
    Cheers,
    Siva Maranani.

  • ESB - Global Variables? access of the variables outside the transformation

    I am working on one of the ESB services for my project(not looking for BPEL).
    1. Database adapter polls the data table (Say X and Column C1, C2, C3....Cn,CountofRecordsof Other table Y)
    2. Routing Service calls other database adapter for pulling the data from other table(Say Y) in another schema based on the C1,C2,C3 from X.
    3. After getting the count(i only need the count of records based on the C1, C2 and C3 conditions from Y table), I have to update the table X which corresponds to the row C1.
    The trouble what I have is
    1. How do I update the records which is for the C1 as the return of the value (which is the count) from the second adapter gives only the record count but it doesn't store the identifier from the first table.
    2.Is there anything called global variable concept in the ESB?
    3.How to access the varilable which are outside the schema in the current transformation. i.e, consider I have two schemas, Schema A and Schema B,where I am mapping the variables in the transformation, and considering I need a variable which is the schema which was populated with values during runtime in Schema C.
    Let me know if needs more clarification!
    thanks,
    Prashanth

    Hi,
    >>
    1. Database adapter polls the data table (Say X and Column C1, C2, C3....Cn,CountofRecordsof Other table Y)
    2. Routing Service calls other database adapter for pulling the data from other table(Say Y) in another schema based on the C1,C2,C3 from X.
    3. After getting the count(i only need the count of records based on the C1, C2 and C3 conditions from Y table), I have to update the table X which corresponds to the row C1.
    >>
    I suppose your RS at step 2 gives C1, C2, C3 as input and you invoke DB adapter to get count and forward response to other service.
    >>
    The trouble what I have is
    1. How do I update the records which is for the C1 as the return of the value (which is the count) from the second adapter gives only the record count but it doesn't store the identifier from the first table.
    >>
    If I understand your task correctly, try to use ESBREQUEST to accomplish your task.
    >>
    2.Is there anything called global variable concept in the ESB?
    >>
    No, there are no global variables in ESB, such in BPEL.
    I think, this should be known when you first starting a design your ESB processes.
    You can accomplish your task in next way:
    add global variable to your XML payload.
    For example, your XML payload looks like:
    <payload><some content/></payload>
    You can extend your XML schema to include global variable, so you payload may looks like:
    <payload><some content/><global_var>value</global_var></payload> (I think this's the best way, if you really need something that can be accessed in many parts of your ESB process)
    >>
    3.How to access the varilable which are outside the schema in the current transformation. i.e, consider I have two schemas, Schema A and Schema B,where I am mapping the variables in the transformation, and considering I need a variable which is the schema which was populated with values during runtime in Schema C.
    >>
    Sorry, I didn't understand. What schema do you mean? XML schema or DB schema?

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

  • How do you override global variable values when calling oraxsl or xsl.exe?

    I am a newbie to oracle xslt.
    I have down loaded the latest version of xdk (10.1.0.2...). (Jan 2, 2009).
    In the past I haveI used micorsoft's "msxsl.exe" to perform my transformations.
    I am looking for a more up-to-date transformation tool.
    I found Oracle's version, and thought I would try it out.
    I have run the "bin/xsl.exe -hh" command.
    I read its help data. It states that variables are
    passed by coding a pramater "-V <var> <value>".
    I have also examined the oraxls.bat file.
    I found the documentation on "oracle.xml.parser.v2.oraxsl" class.
    It states that parameters are passed after the "-p" switch.
    It says the value of the -p parameter is "a list of paramemters".
    I don't find this sufficient information to be useful.
    I can spend days guessing, and I might get lucky.
    I thought it my be better to ask for help.
    I need to pass in (override) values for 3 global variables.
    I saw the method
    "setParam(namespace, variable, value)",
    near the documentation for the "oraxsl" class.
    How do you format the options string to communicate more than one param statement?
    (in either xsl.exe and/or oraxsl class).
    Suppose I have an xslt stylesheet as follows:
    ==================================================
    <?xml version="1.0" ?>
    <xsl:stylesheet version="1.1" xmlns:xsl='http://www.w3.org/1999/XSL/Transform' >
    <xsl:param name='a' select='"default_a"' />
    <xsl:param name='b' select='"default_b"' />
    <xsl:param name='c' select="'default_c"' />
    <xsl:template match='/'>
    this is value for a: <xsl:value-of select='$a' />
    this is value for b: <xsl:value-of select='$b' />
    this is value for c: <xsl:value-of select=$c' />
    <xsl:apply-templates />
    </xsl:template>
    </xsl:stylesheet>
    ========================================================
    Now as part of the calling of the XSL processor I want to change the value of these
    three global parameters.
    I want:
    a="current_a",
    b="current_b",
    and c="current_c"
    How do I express this using xsl.exe and its paramter string (-V ????).
    and/or how do I express it to the oraxsl class ( -p (xsl, a,"current_a"), (....) )???
    The syntax for specifying this information is not very clear in either situation.
    Of course I am making the "assumption" that by "param" they are
    refering to "global parameters" (as in my stylesheet), rather than some other global parameters of XLST.
    As an aside inquiry:
    I had hopped that the Oracle's xsl Verion 2 routine could handle xslt 2.0 commands
    such as "xsl:for-each-group", since it handled multiple xsl:outputs.
    From reading some of the documentation it seems it only handles xslt 1.0 syntax/commands.
    Is this true? (or is the documentation not up-to-date?).
    Any help on passing param values to xsl.exe and/or "oraxsl" class is appreciated.
    Thanks.

    Here is the line from one of my testing .bat files that passed in one parameter. I can't recall if I've passed in two, but this will give you a starting point for passing in multiple
    java -cp %CPath% oracle.xml.parser.v2.oraxsl -p show_image='yes' %ValXML% %ValXSLT% As for XSLT 2.0 support, it appears it does per {thread:id=503445}

  • What for? (2nd part global declaration in transformation)

    Hi Experts,
    does anybody know, what for is the 2nd part global declaration in a routine of a transformation?
    Myself I'm a developer, so I can differ between global and local declaration in a class-definition. But the second possibility to declare variables is outside of class-definition and class-implementation.
    I checked start routine, end routine and character/ keyfigure routine. I can see both of the declaration. Does it makes any sence to use this declaration?
    $$ begin of global - insert your declaration only below this line  -
        ... "insert your code here
    $$ end of global - insert your declaration only before this line   -
    $$ begin of 2nd part global - insert your code only below this line  *
    ... "insert your code here
    $$ end of 2nd part global - insert your code only before this line   *
    Thanks in advance.
    Greets Nico

    Hi Lijo,
    first, thank you for you answer.
    I'm not sure if I got it.
    If you want to use a global variable for all packages that will be processed, I have to declare a CLASS-DATA. That means the instance of the class won't be deleted the whole data package.
    If I want to use a global variable that will be used in character/ keyfigure routine it's sufficient to declare DATA in 1st or 2nd part of declaration.
    I understand it in a way, that the second declaration part is redundant. Is it right?
    Thanks in advance.
    Greets Nico

  • Java Threads vs. Native Global Variables

    A brief description of the problem:
    I am trying to integrate a multi-threaded Java app with legacy Fortran code. The Fortran code in question makes extensive use of global variables in the form of Fortran's Common Block data structure.
    If multiple threads were allowed access to a native routine, they would over write each others data which is stored in global variables.
    If only one thread at a time can have access to the native routine for the duration of the native routine, the whole advantage of using threads is completely nullified.
    These native routines cannot be rewritten (3rd party code) and must be used.
    One solution I envisioned was to load a new copy of the native shared object code for each Java object that used the native code. However, it seems System.loadLibrary() can only be used in a static context.
    Is there any known solution to this problem?

    Here is an elaboration on the earlier suggestions. It's a high overhead solution, because you have to start a bunch of JVMs.
    1. You have a java control program, which will start up a pool of "services", make requests to them, and gather the results.
    2. Each service is a small java program with a native method:
    o java communications front-end.
    o native method declaration.
    o native - in your case fortran - method implementation.
    3. Each service is started using "exec". That puts it in a separate process.
    4, Since each service is a java program, you can use java to do communications between the control program and the service.
    o You could use RMI.
    o You could - perhaps - use java Process communications, i.e., have the services write to stdout, and have the control program capture the output.
    o You could use socket communications.

  • How can I pass a value field to a global variable?

    I have a doubt,
    I wnat to know if is possible to pass a value field to a global variable inside of DataFlow?
    That a try to do is at the time to execute a JOB on line (real time), depending of the value field that i receive, only certain DATAFLOWS will be executed  depending of the value field.
    I hope you can help me.
    Kind regards!!!

    It can be done via various ways, your approach is kind of odd, though.
    You are saying you have one kind if Input message, depending on the flag you want to do different transformations. The way you envision that is by loading that flag into a global variable and use different dataflows then.
    Can you use different dataflows within one Realtime Job? Yes, usually the first loads an in-memory datastore.
    Can you write into a global variable? Yes and No. Not directly, but you can write the value into e.g. a database and using the sql() function read it from there. But why would you. You could write it into the in-memory datastore. And then you run your n dataflows, each has a filter. So only one of these dataflows will actually process the data.
    Are there other approaches? I would have a Case transform at the beginning and route the data into different queries depending on the data. So all in one dataflow. Your approach is fine for a batch dataflow where a dataflow is started, does something and then ends. But that's not how it works in Realtime!

  • Global variable in XSLT

    Hi,
    I have a requirement in XSLT mapping where i sum up all the data related to amount field and then want to display total that i have added in the another node
    eg.
    <Detail>
    <xsl:variable name="<b>etotal</b>" select="sum(ns0:pay/ns0:checkList/ns0:check/ns0:deductionList/ns0:adjustment/ns0:amount/ns0:amount)"/>
    </Detail>
    <Trailer>
    <TotalDeductionAmount><xsl:value-of select="<b>$etotal</b>"/>
    </TotalDeductionAmount>
    </Trailer>
    how to do ?
    since the above example the scope of the variable is local and cannot be accessed globally. how to declare a global variable and then assign value to the variable
    or is there any other method to do this in XSLT
    Thanks in advance
    With Regards
    Pradeep N

    Hi,
    Please see below sample code is solving your problem. Global variable can not solve the problem, you need to use templates and call then appropriately.
    -Kavita
    Sample Input
    <?xml version="1.0" encoding="UTF-8"?>
    <root>
    <Test>23</Test>
    <Test>34</Test>
    <Test>90</Test>
    </root>
    Sample Output
    <?xml version="1.0" encoding="UTF-8"?>
    <Mt_test>
         <Header>"create the header data according to req"</Header>
         <Details>
              <DetailsCol>23</DetailsCol>
         </Details>
         <Details>
              <DetailsCol>34</DetailsCol>
         </Details>
         <Details>
              <DetailsCol>90</DetailsCol>
         </Details>
         <Trailer>
              <TotalSum>147</TotalSum>
         </Trailer>
    </Mt_test>
    XLST:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
    <xsl:template match="/">
    <xsl:element name="Mt_test">
    <xsl:element name="Header">"create the header data according to req"</xsl:element>
              <xsl:variable name="checkNext" select="//Test[1]"/>
    <xsl:call-template name="GenerateTest">
    <xsl:with-param name="currNode" select="//Test[1]"></xsl:with-param>
    <xsl:with-param name="Sum" select="0"></xsl:with-param>
    </xsl:call-template>
    </xsl:element>
    </xsl:template>
    <xsl:template name="GenerateTest">
    <xsl:param name="currNode"></xsl:param>
    <xsl:param name="Sum"></xsl:param>
    <xsl:element name="Details">
    <xsl:element name="DetailsCol"><xsl:value-of select="$currNode"></xsl:value-of></xsl:element>
    </xsl:element>
    <xsl:variable name="Sum1" select="$Sum + $currNode"></xsl:variable>
    <xsl:variable name="checkNext" select="$currNode/following-sibling::*[1]"/>
    <xsl:choose>
         <xsl:when test="$checkNext">
    <xsl:call-template name="GenerateTest">
    <xsl:with-param name="currNode" select="$checkNext"></xsl:with-param>
    <xsl:with-param name="Sum" select="$Sum1"></xsl:with-param>
    </xsl:call-template>     
         </xsl:when>
         <xsl:otherwise>
         <xsl:call-template name="GenerateTrailer">
    <xsl:with-param name="currNode" select="chkeckNext"></xsl:with-param>
    <xsl:with-param name="Sum" select="$Sum1 "></xsl:with-param>
    </xsl:call-template>
         </xsl:otherwise>
    </xsl:choose>
    </xsl:template>
    <xsl:template name="GenerateTrailer">
    <xsl:param name="currNode"></xsl:param>
    <xsl:param name="Sum"></xsl:param>
    <xsl:element name="Trailer">
    <xsl:element name="TotalSum"><xsl:value-of select="$Sum"></xsl:value-of></xsl:element>
    </xsl:element>
    </xsl:template>
    </xsl:stylesheet>

  • REGEX statement not working in transformation routine?

    hi,
    I need to include the REGEX ABAP key word in transformation routine for one of the fields--
    FIND all OCCURRENCEs OF REGEX
    But when i include this statement it says:
    E: statement "REGEX" is not defined.check your spelling--
    but same statement when i copy in SE38 ABAP editor it works very fine--
    May i know what is the reason?
    i had tried with all possible single quotes before posting here

    Is that the entire statement?  It looks like it is interpeting REGEX as a variable.  It should look something like this:
    FIND all OCCURRENCEs OF REGEX '(\b\S+\b)(-?)' IN g_result

  • Global variable in Mapping

    Hi,
    Is there a way to declare a global variable in a mapping? e.g if I want to use a counter variable...
    Zahid

    Hi again,
    I've previously used the mapping input parameters successfully to bind a name (read-only) to the value of an expression, which is particularly effective when you want to filter an ODBC source with a non-trivial expression, which otherwise means the filtering is done on the target side (expensive).
    Unfortunately, Zahid wants to change the global variable within a transformation, and that is a side effect I believe is not allowed in SQL (set mode). Also, transformations live in a separate PL/SQL package, which means that the transformations have no access to the mapping input parameters. Hence my (untested) suggestion that using row mode and developing a separate "global variable" package might do the trick.
    Regards, Hans Henrik

  • PI Global Variables

    I have been looking for ways to support global variables (across maps, not within a single map) and cannot find anything.
    My scenario is a synchronous RFC out of R3, through PI, and out to a vendor's product lookup service...all synchronous.  The issue is that I need to log values from the RFC request as well as values from the vendor response.
    I can get the process working with a sync/async bridge in a BPM (the async part being to write out vendor response to the log file).  What I need is some way to store RFC request values and map them into my log file too.
    Unless there is some Global variable method that spans across an entire process, I figure I need to do something special in the BPM.  Can I achieve this by creating a split/copy of my request message, sending one out to the vendor and holding the other in a BPM wait of some sort.  Then when the response comes back, split/copy it also and let one copy respond to SAP and the other merge up with the waiting request?  Or something like this? 
    Thanks for any suggestions.
    Keith

    Hi Keith,
    I think you can achieve your requirement using a combination of Lookup & BPM (Sync Async bridge)  techniques. May be you can try the following;
    Integration process design:
    START
    ^^
    ReceiveStep(Open SyncAsyncBridge)
    ^^
    Transformation (MultiMapping with lookup)
    ^^
    SendStep(Send RFC Resp &Close SyncAsyncBridge)
    ^^
    SendStep(Send Log message)
    ^^
    STOP
    Details:
    Step1: Use Receive step to receive the sync RFC message and ope n S/A bridge.
    Step2: In Mapping (Transformation step) use Mapping lookups (RFC/DB/SOAP) to get the Vendor response and in same mapping generate both the Log message and RFC response as output messages (Multi-Mapping)
    Step3:Send RFC Response message and close S/A bridge
    Step4:Send Log message
    Hope this helps.
    Regards,
    Ananth

Maybe you are looking for

  • Exit out of video and return to stage frame 1

    Ive manged to create a flash player that incorporates a video using a online tutorial with the code below. All is working well but at the end of the video I want to exit out of the video and return to the stage at frame 1. The reason being is; before

  • HP Deskjet F4200 All-in-One-series printer

    My printer shows an E in the start copy window and it says by black ink is low, which I just replaced brand new last week and it was printing great until last night. What do I do?

  • How to handle Events in Blocked ALV report

    Hi All, I have a Blocked ALV report, I have a requirement where if I double click a row in blocked ALV report, it should branch off to MM01 transaction code and the material number and change number should get populated with the material number and c

  • Messages window does not pop up when a chat is received

    Help! In the Messages app, when a chat is received, the Messages window does not pop up!  (Like it did with the old ichat.)  When a chat is received, it makes the noise, the icon bounces in the dock, and a red bubble is on the icon with the number of

  • Aperture not recognizing keywords for smart album

    Friends, I've set up a smart album that contains images with a particular keyword. The smart album contains family pictures and I use it for my screensaver. I've done this for several years without incident. Today, I noticed that the album only conta