Global Variable  or Container

Hi Gurus,
                 For me there is a requirement that is in XSLT mapping,  I have to count the number of records based on certain conditions in a for loop .
I think using varibales in XSLT it cant be achevied,
I thought of calling a java function using GlobalContainer but not able to count the records .
I am able to see examples using UDF in forums But not by using XSLT
Please  can any one help to solve this issue
Rams

hi michal ,
               Please can you brief it, see i am using XSLT mapping.
the way I tried is I try to call the java function like this from XSLT ....
XSLT----
<xsl:if test="function-available('ChkCounter:addCounter')">
   <xsl:value-of select="ChkCounter:addCounter()" />
</xsl:if>
JAVA----
public static String addCounter()
GlobalContainer gc = container.getGlobalContainer();
          Object o =gc.getParameter("counter");
              try{
          Integer i;
          if(o==null) i = new Integer(0);
          else
                                i = (Integer)o;
          i = new Integer(i.intValue() + 1);
          gc.setParameter("counter",i);
another way I tried was  in XSLT itself
<xsl:value-of select="count(ns0:Source/row/field1[text() = ns0:Source/row/field2[text()]])"/>
Can u please guide me in specific
thanks
rams

Similar Messages

  • Pass the value of the current case in a case structure to a global variable for use in VIs.

    I have built a large queued state machine (>100 cases).  In each state, I run a VI that I have created.  These VIs are usually not very different from one another.  In many cases, I could simply use the same VI over and over again.  There is only one problem with that.  None of these VIs know which case to send the program to next.  I have to change the value of the "NEXT_CASE" constants in the VI and save it under a new name to be inserted into each new case.  Now my program consists of hundreds of VIs whose only difference is the value of their "NEXT_CASE" constants.  This causes all kind of headaches when I have to insert new cases into the state machine, and it is just too much for me to deal with.
    I need to be able to use a global variable to keep track of the current case within my VIs.  I could change it from a string to a number and add or subtract from it to determine which case the program should go to next.  Since I'm usually only skipping from one case to the next (or the previous) I could use the exact same VI in most cases.  Can anyone tell me how to create a global variable that contains the value of the case in my case structure that I could use within my VIs to keep track of the current case?  Let me know if you have any questions.

    Instead of defining the next state inside the subvi, why not do it in the main vi inside each state case?  An output from the subvi could be used with a case structure to determine the next state.  Sort of like, if the subvi returns 0 then next state is State3, else if the subvi returns 1 then next state is State4.
    Message Edited by tbob on 08-19-2005 03:15 PM
    - tbob
    Inventor of the WORM Global
    Attachments:
    NextState.PNG ‏5 KB

  • Import/export to memory and global variables

    Hi,
    Im working on some functionality using import/export to memory. One of the statements is:
    import gf_memid_exit = g_exit_flag gf_memid_result = t352r from memory id 'ZREV_EXT'.
    Im using global variables to contain the cluster names. But this is not working. When I change the global variables into local variables, it works. It this normal? Because I would like to have global variables (even better I would like to have global constants) to declare in order to use them within the program.
    Any ideas?
    With regards,
    Mike

    Hi Mike...
    I think with import u can use global or local variables..in debug mode pl. check when u r using global variables..whether it is getting cleared or overwritten by some other values or not. Or try with global constants..it should work...
    Regards,
    Joy.

  • Making dll from VI containing labview global variable ?

    I've made dll from VI containing labview global variable.
    But, when I write a c program calling a function from the dll, it returns just error.
    The goal is to read a labview global variables from c program. What can i do for it ?

    Hi
    If you don't use the dll in your LV app, it will be difficult, because it will be in the adress-range of you c app. So any writing of values to the global variable in LV, won't affect the variable in the dll.
    What you can do is some kind of client-server architecture. You need a third app, which just does the data exchange - so you should be able to write a value from LV and read it from c.
    There already have been discussions about similar topics - just search the forum.
    Thomas
    Using LV8.0
    Don't be afraid to rate a good answer...

  • Control global variable used in sub vi

    Hi,
    I've created a vi to read an instrument and to initiate its calibration with labview. This VI stores data in a global variable containing measurments and status of the instrument.
    Now what I'm trying to do is create a sub vi with this to read&write 2 exactly identical instruments so I can finally create a VI that read all 3 instruments simultaneously.
    How could I create a control on the global variable used by the sub VIs since it is the only thing that will change along with its COM port ?
    I included a screetshot of the current VI.
    Thanks,
    Attachments:
    Read_Calibrate.PNG ‏61 KB

    I would make an array of values and then you just pass in which value to update.  I would actually take it a step further and make an Action Engine that can update the data and return the data.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How to Use Transient View Objects to Store Session-level Global Variables

    hi
    Please consider section "40.8.5 How to Use Transient View Objects to Store Session-level Global Variables"
    at http://download.oracle.com/docs/cd/E14571_01/web.1111/b31974/bcstatemgmt.htm#ADFFD19610
    Based on this documentation I created the example application
    at http://www.consideringred.com/files/oracle/2010/ProgrammaticalViewObjectAndRollbackApp-v0.01.zip
    It behaves as show in the screencast at http://screencast.com/t/qDvSQCgpvYdd
    Its Application Module has a Transient View Object instance "MyEmployeesContextVOVI", as master for the child View Object instance "EmpInCtxJobVI".
    On rollback the Transient View Object instance keeps its row and attribute values.
    Also when passivation and activation is forced (using jbo.ampool.doampooling=false ) the Transient View Object instance seems to keep its row and attribute values.
    questions:
    - (q1) Why does the expression #{bindings.MyEmployeesContextVOVIIterator.dataControl.transactionDirty} evaluate as true when a Transient View Object instance attribute value is changed (as shown in screencast at http://screencast.com/t/qDvSQCgpvYdd )?
    - (q2) What would be a robust approach to make a Transient View Object instance more self-contained, and manage itself to have only one single row (per instance) at all times (and as such removing the dependency on the Application Module prepareSession() as documented in "5. Create an empty row in the view object when a new user begins using the application module.")?
    many thanks
    Jan Vervecken

    Thanks for your reply Frank.
    q1) Does sample 90 help ? http://blogs.oracle.com/smuenchadf/examples/
    Yes, the sample from Steve Muench does help, "90. Avoiding Dirtying the ADF Model Transaction When Transient Attributes are Set [10.1.3] "
    at http://blogs.oracle.com/smuenchadf/examples/#90
    It does point out a difference in marking transactions dirty by different layers of the framework, "... When any attribute's value is changed through an ADFM binding, the ADFM-layer transaction is marked as dirty. ...".
    This can be illustrate with a small change in the example application
    at http://www.consideringred.com/files/oracle/2010/ProgrammaticalViewObjectAndRollbackApp-v0.02.zip
    It now shows the result of both these expressions on the page ...
    #{bindings.MyEmployeesContextVOVIIterator.dataControl.transactionDirty}
    #{bindings.MyEmployeesContextVOVIIterator.dataControl.dataProvider.transaction.dirty}... where one can be true and the other false respectively.
    See also the screencast at http://screencast.com/t/k8vgNqdKgD
    Similar to the sample from Steve Muench, another modification to the example application introduces MyCustomADFBCDataControl
    at http://www.consideringred.com/files/oracle/2010/ProgrammaticalViewObjectAndRollbackApp-v0.03.zip
    public class MyCustomADFBCDataControl
      extends JUApplication
      @Override
      public void setTransactionModified()
        ApplicationModule vApplicationModule = (ApplicationModule)getDataProvider();
        Transaction vTransaction = vApplicationModule.getTransaction();
        if (vTransaction.isDirty())
          super.setTransactionModified();
    }Resulting in what seems to be more consistent/expected transaction (dirty) information,
    see also the screencast at http://screencast.com/t/756yCs1L1
    Any feedback on why the ADF Model layer is so eager to mark a transaction dirty is always welcome.
    Currently, question (q2) remains.
    regards
    Jan

  • Function module Global variables not cleared from memory?

    Hi,
    This is may be simple & stupid question ( after posting  4242 posts ):)
    " Declaration in TOP
    data : begin of i_y1yatt occurs 0.
            include structure y1yatt.
    data : end of i_y1yatt.
    types: begin of t_yatt71.
           include structure yatt71.
    types: tcode like sy-tcode.
    types: dflag type c.
    types: end of t_yatt71.
    data : i_yatt71 type standard table of t_yatt71
                   with default key  with header line  initial size 0.
    This is code in the function module.
      loop at i_y1yatt.
        move-corresponding o_y1yatt to i_yatt71.
        if i_y1yatt-werks eq 'N501'.
           move space to i_yatt71-werks.
        endif.
        append i_yatt71. 
        " Here this internal contains the previous entry
        clear i_yatt71.
      endloop.
    This function module is called 25 times in a minute.
    My problem is this
    For example : 1st tranmission is called this fm with 50 records,
    and 2nd tranmission is called fm with 10 records.
    My results are showing
    last record in the 1st transmission is still on the memory while calling 2nd transmission.  ( Here in int table I_YATT71 still contains the 1st transmission's last records during the 2nd tranmission call)
    As per my knowledge if each time calls comes in to fm all gloabl variables get cleared. but some how this not happening.
    Anybody come across this scenario.
    PS. I know i need to use clear statement within the loop as first statement.

    You must understand that when calling a FM, you load the entire function group into memory. IF there are global variables, then they are "alive" for the entire duration of the program execution. Meaning if you call the function numerious times, or even if you call another function within the same function group, the functions still have access to that same global variable space, so it must always be cleared manually by the developer at the required points.  You can not rely on the runtime to clear the global variables at the end of the function call.  So you should clear all you globals as the first operation in your function module call, if that is what is required.
    Is this clear?
    Regards,
    Rich Heilman

  • Can I use the timestamp of a Network published global variable to reduce network traffic?

    I would like to use a couple of network-published global variables that will contain large clusters of data.  I want to host them on one device but read them from several - consider a distributed control system.  The data will update very infrequently, but, when it does, I want all my HMIs to know quickly.  I can have all the HMIs just read the data 4x/second (that would be fast enough) but I was wondering if there is a more elegant solution (still using global variables).  If I read only the timestamp 4x/second from each of the HMIs, compare it to the last read, and then poll the whole variable only if the timestamps are different, will that require less resources than just grabbing the whole variable every time?  In other words, does reading the timestamp use the same amount of resources as reading the whole variable?
    With really simple code, assuming the "Setup Data" cluster is quite large, does....
    ...get me any advantage over...
    Solved!
    Go to Solution.

    mark3545 wrote:
    So that means they are already doing what I want anyway, right?  If the reader only gets updated when the writer changes it, I can poll it as often as I want without increasing traffic, correct?
    That is correct.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Dynamic call of a vi with a reference stored in a global variable

    Hello,
    I am trying to program a VI which calls DAQmx functions in some cases, in other cases DAQmx may not even be installed. To prevent a broken arrow on machines where DAQmx is not installed, I want to use a sub-VI containing the DAQmx function calls which is called dynamically by a main VI. For speed I want to prevent continuous opening and closing the VI reference, so I want to store the reference to the sub VI in a global variable. In this variable I also want to store the Analog Input Task. I want to use an initialization VI to write the VI reference of the sub VI and to configure and start the Analog Input Task and write the Task ID to that Global, too. In that way I was hoping to be able to improve the performance of the dynamic calls and the Task calls. BUT - when I write the refererence and task to the Global and read it out from another VI, the reference is not valid anymore and the Analog Input task is also not valid, even if both the initialization VI and the Global are still open (but not running). Does somebody have an idea how to solve that? It is a bit difficult to describe, so here is what I want to do in a shorter description :
    - run a initialization VI which
      defines a reference to a sub VI which will be called dynamically later on
      and a AI task ID definining a DAQmx physical channel configuration to use for subsequent read cycles
      and writes both (VI reference and AI task) to a global variable
    - run another VI which
      reads the VI reference of the VI to call dynamically from that global
      runs the corresponding VI dynamically
      the dynamically called VI performs an AI task corresponding to the DAQmx task ID read from that global (it reads an analog value for instance from the  
      physical channel configured by that AI task) 
    Why all that? To prevent creating and destroying the VI reference for each call of the sub VI for speed. And to use the configured DAQmx channel for subsequent read tasks only if the subVI is called dynamically - if it is not, then the application will not see the DAQmx calls and therefore no broken arrow will occur if no DAQmx is installed on the machine.
    Can somebody help me with this? Why can't I store and read out the reference to the sub VI to/from a global, and why is the AI task not valid when read out from the dynamically called sub VI? I am somewhat lost with all that...
    Thanks in advance,
    Gabs

    Uh - I am almost getting crazy with that
    Kevin, that solution is the right one for programming an application. In that case everything will work fine. But during testing, it is more convenient to call all VIs from their front panels one after another. That's how I'm doing it for everything that needs to be exchanged between such VIs: store them either in a global or in a functional global variable. In that way the user can "play around" with the VIs without wiring them together in a main VI. Therefore, after some thinking I liked Davids idea with that daemon VI (I solved that by adding a boolean in the initialization VI to choose if that daemon is necessary - during testing phase - or not - when using the VIs in a main application). BUT:
    David: It does not work!!! I have exactly done what you proposed and this daemon VI is really running, having a True/False frame with a constant of False wired to the selector and holding both the functional global and the dynamically to call VI in the True frame. In that way, after initialization is finished, both VIs are still running but idle. Anyway, when I read back the value of the reference or the DAQmx task, it is invalid again!
    That really costs just too much time. Does anybody have any idea what to do now? David, I was hoping that your suggestion would solve the problem, because it would be logical that it would - why then is LabVIEW destroying the reference and task anyway even if that daemon VI containing the functional global is still running???
    Regards,
    Gabs

  • Call function in LabView from a DLL, then access global variable from DLL

    I have created a DLL in LabWindows with a function and a structure.  I want to call the function from within LabView and then access the global structure.  I am able to call the function from the DLL with a "Call Library Function Node" and can access the return value, but I cannot figure out how to access the global structure.  The structure is declared in the DLL header file with __declspec(dllimport) struct parameters.
    Is there any way of accessing this structure without using the Network Variable Library?
    Solved!
    Go to Solution.

    dblok wrote:
    When you say "access to" or "the address of" the global variable, do you mean to pass the variable as an argument to the function call in the DLL?  If so, then I was not really sure how to pass a cluster from LabView by using the "Call Library Function Node".
    Yes, that's exactly right.  I would include a pair of helper functions in the DLL to read and write the global variable.  Alternatively you might write separate helper functions for each field inside the global structure, depending on the number of fields and whether you want to do any validation on the values.
    You can pass a cluster by reference to a function that expects a struct by setting the parameter to Adapt to Type, so long as the cluster does not contain any variable-length elements (strings or arrays).  The cluster needs to match the struct exactly, and sometimes that involves adding extra padding bytes to make the alignment work.  Variable-length elements in LabVIEW need to be converted to clusters containing the same number of elements as the struct definition (for example, if your struct contains char name[12], you would create a cluster of 8 U8 values, and you could use String to Array of Bytes followed by Array to Cluster to convert a LabVIEW string into that format).  If the struct contains pointers it gets more complicated, and it may be easier to write functions in the DLL to access those specific elements individually.
    If you can't get this working or need help, post your code and an explanation of the error or problem you're seeing.
    EDIT: it is also possible to include a single function in the DLL that returns the address of the global variable, which LabVIEW can then use to access and modify the data, but that's more complicated and likely to lead to crashes if you don't get the memory addressing exactly right.

  • Global variable in servlet & DBPooling questions

    Hello guys,
    I used to develop PHP/ASP, and am new to servlet. I have been searching around for a solution ...
    With Php, we can get the reference of a global variable in any classes->functions...
    How do I do this with servlet ?
    And second..I have developed the DB class as below... I set the datasource to be static, so it initializes only once. Is it a good idea? How would you like to improve this class? any comments?
    package shop.database;
    import javax.sql.DataSource;
    import java.sql.*;
    import org.apache.commons.dbcp.BasicDataSource;
    import org.apache.log4j.Logger;
    import shop.admin.exception.GeneralException;
    public class DdManager {
         static protected Logger logger = Logger.getLogger(DdManager.class);
         private String userName = "root";
    private String password = "";
    private String hostName = "jdbc:mysql://localhost:3306/shop";
    private String database="shop";
         static private DataSource ds;     // set this to be static so all threads share the same job in JVM
         private Statement stmt;
         private Connection conn;
         private ResultSet rs;
         private CallableStatement cs;
    public DdManager() {}
    * setup the data source and return it
         public static DataSource getDataSource(
              String sDrvName,
              String sUserName,
              String sPwd,
              String connectURI) {
              BasicDataSource ds = new BasicDataSource();
              ds.setDriverClassName( sDrvName );
              ds.setUsername( sUserName );
              ds.setPassword( sPwd );
              ds.setUrl( connectURI );
              ds.setMaxActive( 15 );
              ds.setMaxIdle( 10 );
              ds.setMaxWait( 10000 ); // 10 seconds
              return ds;
         * static init of the class
         * this class is will be called only once to initialize the DataSource
         static {
              try {
                   Class.forName( "com.mysql.jdbc.Driver" );
                   ds = getDataSource(     "com.mysql.jdbc.Driver",
                                            "root",
                                            "jdbc:mysql://localhost:3306/shop" );
                   if (ds == null) {
                        String msg = "Connection Pool error";
                        logger.error(msg);
                        throw new GeneralException(msg);
                   logger.info("DataSource has been initialized");
              } catch(Exception exception) {
                   logger.error(exception.toString());
                   try {
                        throw new GeneralException(exception.toString());
                   } catch (GeneralException e) {
                        logger.error(e.toString());
         * get the connection from the pool (DataSource)
    public void openConnection() throws GeneralException {
    try {
         BasicDataSource bds = (BasicDataSource) ds;
         logger.info("NumActive: " + bds.getNumActive() + ", " + "NumIdle: " + bds.getNumIdle());
    conn = ds.getConnection();
    logger.info("Connection of " + database + " has been established");
    } catch(Exception exception) {
         logger.error(exception.toString());
         throw new GeneralException(exception.toString());
    * close the connection will actually return the connection to the pool (Must)
    public void closeConnection() throws GeneralException {
         initResource();
    try {
         if (conn != null){
                   conn.close();
                   logger.info("Connection of " + database + " has been closed");
    } catch(SQLException exception) {
         logger.error(exception.toString());
         throw new GeneralException(exception.toString());
    * prepare the calling stmt
    public void prepareProcedure(String callStatement) throws GeneralException {
         initResource();
    try {
         cs = conn.prepareCall(callStatement);
    } catch(SQLException exception) {
         logger.error(exception.toString());
         throw new GeneralException(exception.toString());
    * set the pass-in parameter for "String"
    public void setParameter(int position, String parameter) throws GeneralException {
    try {
         cs.setString(position, parameter);
    } catch(Exception exception) {
         logger.error(exception.toString());
         throw new GeneralException(exception.toString());
    * set the pass-in parameter for "Integer"
    public void setParameter(int position, int parameter) throws GeneralException {
    try {
         cs.setInt(position, parameter);
    } catch(Exception exception) {
         logger.error(exception.toString());
         throw new GeneralException(exception.toString());
    * execute the procedure and return the resultset
    public ResultSet execProcedure() throws GeneralException {
    try {
         rs = cs.executeQuery();
    } catch(SQLException exception) {
         logger.error(exception.toString());
         throw new GeneralException(exception.toString());
    return rs;
    * close the statment and resultset
         private void initResource() throws GeneralException {
         try {
              if(rs != null) {
                   rs.close();
              if(stmt!= null) {
                   stmt.close();
              logger.info("Statement & Resultset have been free");
         } catch(Exception exception) {
         logger.error(exception.toString());
         throw new GeneralException(exception.toString());
    Thanks mates!
    myy

    Thanks Saish,
    Your response is really appreciated. Sorry about that
    as i didnt know there is 'code' formatting button,
    and I will look into the Singleton pattern.
    As I'm still in the learning stage. Therefore, i
    still have a lot of thing do not understand.
    ... use it in a method signature ...What is "a method signature" ?
    A method signature is basically the method's parameters, return value, name and any access or other modifiers. The following is a method signature:
    static final public void main(final String[] args)Between the braces of the method body is the implementation (or as I already alluded to, the method body).
    Consider using an already-developed connection poolimplementation, such as Jakarta Commons DBCP ...
    I'm trying to implement the Jakarta DBCP. Did I go
    into the wrong way?
    Sorry, did not read the imports. Yes, you are. However, I am confused about what you are trying to implement. You have a static method getDataSource(). You also have a static variable 'ds'. Use one or the other. I would be that there are seemingly random errors cropping up based on whether you remember to call getDataSource() or not.
    You do not, generally, want the data source to be static. Multiple threads might use the class. And if there is only a static data source, you will either need to synchronize the methods that use the data source (resulting in a scaling bottleneck) or not synchronize them (which will totally destroy any concept of a logical unit of work or database transaction).
    .. A static datasource, as in your class, can onlysafely be used by one thread at a time, potentially
    introducing scaling bottlenecks (or race conditions)
    in your system ...
    So, you mean there is no need for the DataSource to
    be static ?
    No, in fact, IMO, it should not be. That is why you are pooling. Use instances. The pool will manage the connections and their availabilty for you.
    Why are you throwing GeneralException everywhere?Here's a question: can someone using your class (a
    caller) realistically be expected to handle a
    database exception?
    When there is a database error, I just want to stop
    the process and redirect the user to an error page. I
    will look into the unchecked exceptions. Thanks.
    Unchecked exceptions do not need to be declared in a method signature or caught within the method body. Checked exceptions do. As such, an added benefit is that unchecked exceptions de-clutter your code.
    In your initResources() method, what happens if theclose() on ResultSet throws an exception
    Oh, yes. I'm so stupid.
    Now I only have ...
         private static DataSource ds;     // set this to
    be static so all threads share the same obj in JVM
         private Connection conn;
         private CallableStatement cs;
    private void initResource() throws GeneralException
    n {
         try {
              if(cs != null) {
                   cs.close();
    logger.info("CallableStatement has been
    as been free");
         } catch(Exception exception) {
         logger.error(exception.toString());
    throw new
    throw new GeneralException(exception.toString());
    You still have issues.
    public void initResources() {
       if (rs != null) {
         try { rs.close(); } catch (SQLException ignore) { ignore.printStackTrace(); }
       if (stmt != null) {
         try { stmt.close(); } catch (SQLException ignore) { ignore.printStackTrace(); }
    }Normally, this type of method would not be called initResources() but rather closeResources() or freeResources(). It would be called from within the 'finally' block of another method using the CallableStatement or ResultSet.
    This is really is problem, would you mind to tell me
    how to handle this(close the connection) if the
    close() on either CallableStatement or Resultset
    throws an exception ?
    See above. Simply log the exception (there is usually nothing meaningful you can do if a close() fails, and it is up to you as a developer if this is an error or just a warning). Another option is to 'chain' exceptions. In your own exception, add a method 'addException(Throwable)'. This would add another exception to a List of exceptions. When you print the stack trace, iterate through the chained exceptions to print them all out. One place where I find this useful is rollback() code. If the original SQL statement fails AND the rollback fails, I definitely want to see that rollback() exception as well in my logs.
    The DB thing makes me headache. What I actually
    wanted is a solution for:
    Let say I have a class "HelloAction.class" contains
    the code:
    public ActionForward XXX() {
         DbManager DB = new DBManager();
         ... do some DB thing here...
         SecondClass SC = new SecondClass();
         SC.doSomeOtherDbThing();
         ... do something else...
         ThirdClass TC = new ThirdClass();
         SC.doMoreOtherDbThing();
    }There are some functions in SecondClass.class and
    ThirdClass.class that will need database connection.
    I consider 'global variable' is because I want these
    two classes are able to use the same
    connection(DbManager) from the function -
    ActionForward XXX().
    What is the best way to implement the above situation
    (sharing the same connection in different classes &
    sub-classes?
    I also just realize that the problem of multi-threads
    with these two class variables..
         private Connection conn;
         private CallableStatement cs;Really headache. I really appreciate any comments.
    Thanks.
    - myyPass the Connection or DataSource to each method or constructor. Call commit() or rollback() from the method that created the transaction.
    - Saish

  • How to pass the global variable in enter_query mode

    Dear Friends
    I am calling the form and in enter_query mode ,but my global variable is not pass to the form when it is in enter_query mode , me be the field is clear after the enter_query is called ,in which triger do I have to keep my variable
    :H_DOC_CODE := :global.offer_no ; so that it will be assign to the field
    :H_DOC_CODE this my script is keept in
    WHEN-NEW-FORM-INSTANCE.
    waiting for your valuable answer.
    best regards
    Jamil Alshaibani
    -- this my script
    DECLARE
         V_STATUS NUMBER;
    BEGIN
         :system.MEssage_level := 25;
         :GLOBAL.V_STATUS := 0;
         CLEAR_FORM(NO_VALIDATE);
         enter_query ;
    :H_DOC_CODE := :global.offer_no ;     
    END;

    I'm not quite sure what you mean with
    But the document number is not pass to the called form field and : H_DOC_CODE is a field in the called form.Do you want that the form is in ENTER-QUERY-mode and the field H_DOC_CODE contains the field of the GLOBAL?
    Or do you want to automatically execute a query with that H_DOC_CODE.
    For the first, you have to assign the global in the WHEN-NEW-RECORD-INSTANCE-trigger instead of the PRE-QUERY:
    IF :SYSTEM.MODE='ENTER-QUERY' THEN
      :H_DOC_CODE :=:global.offer_no ;
    END IF;For doing an automatic query the suggested solution with the PRE-QUERY-trigger is right, but you would have to issue an EXECUTE_QUERY in the WHEN-NEW-FORM-INSTANCE instead of an ENTER-QUERY.

  • Need features of global variables but want to avoid re-writing to memory

    I am making a program with a number of simultaneous loops that will be sharing several variables. Most of the variables are of size 1 or small arrays, so I am not too concerned about the constant re-writings involved. However, I have one rather large data buffer (3D array containing 200Kb+ of data). The buffer will be of a set size. In the various loops, the buffer will be accessed for updates (generally with Replace Array subset), and read from to get average values and such. I'm using semaphores so that none of the loops interact negatively and lose data. In other programs I'd set this up with a shift register in the loop, but since the data is being used in separate simultaneous loops, it's no
    t really possible to wire it up that way. I need some sort of memory-space that can be accessed from the various loops.
    I guess in sorts, I need to be able to have global variable 'pointers', but of course I was told a couple of years ago at a LabView seminar that pointers was a bad word.

    tbob wrote:
    > As long as Labview is running, the LV2 style global will automatically
    > retain its last value. Of course the very first time it is run, the
    > value is undefined, so you should write to it before attempting any
    > read.
    I have one correction to make. The value of an unitialized shift
    register on first load is not undefined but rather contains the
    datatype's default default value. This would be False for booleans, 0
    for numerics and empty arrays or strings.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Reading a global variable from tomcat with JNDI. Example not working

    Hi you can help me to make this example work?
    Context initCtx = new InitialContext();
    Context envCtx = (Context)initCtx.lookup("java:comp/env");
    Object o = envCtx.lookup("testvariable");
    <GlobalNamingResources>
    <Environment name="testvariable" type="java.lang.Boolean" value="false"/>
    Nice greetings Christian

    I found out that in addition to having the JNDI lookup code, you have to
    - have the environment variable declared in the app server configuration
    - have a resource-env-ref entry in your webapp module
    - have the application container bind your named variable with the global variable
    I am using tomcat 5.5, and have done the following. with success.
    the following example uses the default sample environment variable in the tomcat server.xml
    in tomcat server.xml:
    <GlobalNamingResources>
    <Environment
    name="simpleValue"
    type="java.lang.Integer"
    value="30"/>
    </GlobalNamingResources>
    in my application's web.xml:
    <resource-env-ref>
    <description>Test read resource environment variable</description>
    <resource-env-ref-name>simpleValue</resource-env-ref-name>
    <resource-env-ref-type>java.lang.Integer</resource-env-ref-type>
    </resource-env-ref>
    in my META-INF/context.xml (or otherwise, in tomcat's context deployment configuration)
    <ResourceLink name="simpleValue" global="simpleValue"
    type="java.lang.Integer"/>
    Note: in theory, the named resource by your web app could be different from the global environment variable, but here they are the same 'simpleValue'
    This is the really important step, that with out it, nothing works.,
    the context.xml is known to work with tomcat when it exists in META-INF/context.xml inside the .war file (i use war files to deploy, but you should be able to create META-INF/context in an unpacked webapp directory too, and tomcat will find it.,
    I can not say what it is like for other app servers, but this mapping step is the critical point that i discovered after A LOT of hair pulling.
    then, make use of it, i created a jndiTest.jsp:
    <%@ page import="javax.naming.Context" %>
    <%@ page import="javax.naming.InitialContext" %>
    <%@ page import="javax.naming.NamingException" %>
    <%
    try {
    Context initCtx = new InitialContext();
    Context ctx = (Context) initCtx.lookup("java:/comp/env");
    Object o = ctx.lookup("simpleValue");
    %>
    <%=o%><br>
    <%
    catch (NamingException ex) {
    System.err.println(ex);
    %>
    since my server.xml defines the value for 'simpleValue' to be 30, this page displays 30

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

Maybe you are looking for

  • Create PDF From a backend web page

    Hello, this is my first post on the Adobe Forums I am trying to get a capture of a web page using Adobe Acrobe "Create PDF from Web Page" However, I cannot figure out how to capture a page after I have logged into the site. I thought that Adobe Acrob

  • Is it possible to determine if a program is installed on the PC running the flash?

    Hi, I use Flash to develop a movie that runs when a user installs a new version of my companies software, and allows the user to access the user documentation and software installations at the click of a button.  I use ActionScript to control the flo

  • User property  from realm in ADF form or in BPM variables

    I want use the user property of realm to set BPM variable (for example set variable name with the corrisponding user property of the realm) or ADF component (for example insert e-mail in af:inputText) Someone can tell me where there is specific docum

  • - Does ODI 10.1.3.5 work with Hyperion 11.1.1.1.3?

    Hello Friends, We don't see any separate ODI download as part of Oracle EPM (Hyperion) 11.1.1.3. Currently, we are using ODI 10.1.3.5 for Hyperion(Ess, Pln) 9.3.1. Planning to upgrade Hyperion to 11.1.1.3. Just wondering, does ODI 10.1.3.5 still work

  • HELP!! i need a driver

    sound blaster li've 5. (se)i need a driver for windows vista i don't know what 2 doany body can help me?