Global Variable in Single View

Hello All,
Can anyone help me out .
How to decalre a variable which can be available in all methods in a same view,without using context attribute .As I have a view and I have to pass value between methods of a single view.
Thanks in Advance
Regards,
Kiran

Hi ,
Instead of context attribute , you can declare the variable in the the ' Attributes ' tab 
suppose
a variable LV_CLASSIFICATION1  and you can give the type associated with it .
You can acess the variable in methods of view like this
   lv_classification = wd_this->lv_classification1.
where lv_classification is a variable used in the method .
Hope this would sort your problem.

Similar Messages

  • 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

  • Can i pass parameter or global variable in view from 6i form

    hi master
    sir can i pass parameter or global variable in view from 6i form
    i use view for some diff column calculation within the date then i use
    where date between data1 and date2
    in view but view not create
    please give me idea how i pass external value in view
    thank
    aamir

    Hi Antony!
    I feel it may not produce the right results if you
    dont include the where clause and using only group by
    in view.You felt? Please clear, logical thoughts put here, not feelings.
    (It may very well have all the Debit, Credit
    for all the Accid where as the user wants only for
    r some date range)Data range is determinated in Form by user, so if view should give final data set then you must back
    on Ranjana first question: How to pass parameter or global variable to view from 6i form?
    And also as Ranjit pointed out, If you have only
    accid, sum(debit), sum(credit) in View, wheres this
    enddate ??Of course, column entdate (or enddate?) must be included in view...
    Cheers!

  • Problem with view object for global variables

    Hi,
    I'm using jdeveloper 11.1.2.3.0
    We are using view object with transient attributes for global variables.
    we defined the view as explained here:
    http://docs.oracle.com/cd/E14571_01/web.1111/b31974/bcstatemgmt.htm#ADFFD19610
    also we defined one of the attributes as primary key.
    When we start to test our application with disable connection pooling we got some problems.
    sometimes the row in the global view object is deleted.
    (for example after using executeEmptyRowSet on other view object).
    it looks strange, we couldn't fוnd why does it happen.
    Any idea?

    As Timo said, it is very hard to help without source.
    Are you sure that you do the next step:
    After the call to super.prepareSession(), add code to create a new row in the transient view object and insert it into the view object.

  • Find and replace a single global variable

    Hello,
    I have a GUI which needs to be replicated 10 times. the variables in the global file also needs to be replicated ten times. ex: if GUI1 is using global variables GUI1_TestMode, GUI1_Result etc,  GUI2 should use GUI2_TestMode, GUI2_Result and GUI3 should use GUI31_TestMode, GUI3_Result etc.  So, once I have saved GUI1 as GUI2, I need a way to select all GUI1_TestMode in GUI2 and replace it with with GUI2_TestMode.
    I tried find and replace in the edit menu, but it finds all the global variables together. 
    there are about 40 such global variables associated with each GUI and I dont think it will be sane to sit down, rename all of them in the global file, click on each variable and change them.  I really hope I dont have to do that.
    I am using Labview 8.6
    Thanks.

    Hi pcs,
    instead of using 40 globals per GUI with upto 10 different GUIs you really should redesign your program.
    I would suggest a FGV/AE handling those global data for all of those GUIs…
    The quick & dirty way would be to use LabVIEW's VI linking scheme:
    - Create your global VI with all needed variables. Create your "GUI" and connect it with that global VI.
    - Now you copy your GUI to create a new one, this will still be linked to your "global VI".
    - Then copy the global VI to create a new instance with a different name ("global2.vi") and ZIP (and remove) the original one.
    - When you now open the global2.vi it will search for your orginal "global.vi". Then you simply direct it to use "global2.vi" instead…
    - Repeat those steps for all other GUI-VIs…
    As said before: QUICK & DIRTY!
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Creating single executible with global variables

    I am trying to create an executible with global variables. I dynamically load the source file but when I run the indicator does not update unless I run both VI's together. Is the executible require different inputs during creation?

    Hello,
    It's not the fact that you are creating an executable that is causing the issue. What you are experiencing is expected behavior. Please see this KnowledgeBase" for some solutions.
    Nicholas C
    National Instruments
    Applications Engineering

  • Using a variable in a view?

    I know that it may not be possible to use a variable within a view, but I'm wondering if there isn't a work-around? If there is a single value---pulled from another table---you wish to reuse in a view that does not use dynamic SQL, how do you do so? I've been toying around with WITH statements, but that's getting me nowhere. I'm using 11r2.
    BTW, please do not ask me the standard litany of angry-dba questions (why are you doing this? your database is f*****, RTFM, etc.), this is just for my own curiosity. :)
    Thank you
    Example for demo purposes only (I know it's not syntactically correct):
    variable var_value varchar2(30)
    begin
    select this_is_just_one_value
    int :var_value
    from tableX where column1 = 'BOB';
    end;
    select
    numerous_columns
    from tableY
    where
    column5 = :var_value;

    893968 wrote:
    BTW, please do not ask me the standard litany of angry-dba questions (why are you doing this? your database is f*****, RTFM, etc.), this is just for my own curiosity. :)Why are you doing this? your database is f*****! RTFM! Etc!! ;-)
    SQL is not a procedural language - so you cannot create a view for example that has a parameter signature. E.g. this is possible in a procedural language:
    declare
            cursor c( deptID number ) is
                    select * from emp where deptno = deptID;
    begin
            open c( 1234 ); --// open SQL cursor using a parameter/variable
            --// etc..
            close c;
    end;This is not possible using a SQL object like a view. As a view is not a procedure. So the same approach as the above using SQL (silly example, but do demonstrates the basics):
    // define
    create or replace view emp_view as select * from emp;
    // use
    select * from emp_view where deptno = 1234;The CBO is clever - and it will likely push such a predicate into the emp_view SQL statement.
    To parameterise such a view, is ugly. And should only be considered when dealing with issues such as security and data restrictions. A context is created - this can contain a number of name-values. The view can then use a name-value from the context. Oracle's data dictionary views use this approach.

  • Can LabVIEW global variables be shared between UUT sequence steps in the parallel sequence model?

    Sorry for this simple question,  I'm having a hard time finding this answer.
    If I launch a sequence to run on two UUTs in the parallel sequence module,   can I get both UUTs to run LabVIEW vis that use global variables such that :
    1) UUT 0  executes 20 LabVIEW Vi  steps asynchronously,  5 of which access data from LabVIEW global variables A, B, C (Strings)
    2) UUT 0 executes the same 20 LabVIEW based steps asynchronously  5 of which access data from then same LabVIEW global variables A, B, C (Strings)
    I am a little worried that using file globals may have some delays or more of a race condition than using native LabVIEW global variables like in a single labview application perform.  
    QUESTION 2:  Are file globals actually written to the hard drive and shared between parallel sequences through file transfer?  OR  are they in memory?
    Brad Whaley
    LabVIEW Certified Engineer

    Hi bdwhaley,
    Are your parallel sequences only reading from the global variable? Or are they writing to the variable as well? If it is just reading, then you should be okay. File globals are read from memory. Every time they are read, a copy of the data is made in memory.
    Humphrey H.
    Applications Engineer
    National Instruments

  • How to use a global variable for reading a query resultset in JDBC lookup?

    Hi Friends,
    Using JDBC lookup, I am trying to read from a table Emp1 using a user defined function. In PI 7.0, this function returns values of a single column only even if you fire a " Select * " query. I am planning to use a global variable(array) that stores individual column values of the records returned by a "select *" query. Need pointers on as to how a global variable can be declared and used to acheive the above scenario. Kindly explain with an example. Any help would be appreciated.
    Thanks,
    Amit.

    Hi Amit,
    Sounds like a good idea but then you would need an external db and update the table in a thread safe way !.
    Regarding your question as to how to work with global variable please refer https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/1352. [original link is broken] [original link is broken] [original link is broken]
    Rgds
    joel

  • Moment global variable values

    In ISF/Javascript, what are all the values for the Moment global variable?
    For example, (Moment == "ordering") can be used to check if the current moment is Ordering moment. What are the values for all other moments, specifically Service Group Review and Service Group Authorization moments?
    Thank you.

    The values for Service Group Review moment is "streviews" and Service Group Authorization moment is "stauthorizations". 
    You are correct that these are not in the designer documentation.  One way you can find them is through view page or frame HTML source when the service form is in that particular moment, and look for the word "Moment".

  • What is the best way to retrive data from a Global Variable?

    Here is what I want to do,
    I have several PC's that run different types of tests. I want to use a global variable, running on a single PC, that acts like a sever that can be accessed by the other PC's in my lab. This Global variable will store the hostnames of the different PC's that are currently running each test, along with a description of the test.  Then, a user can access this Global variable to read the different values and select the PC and connect to it's desktop using Remote Desktop in Windows.
    Is it possible to write data to the Global variable that is running on the single PC?
    What is the best way to do this? Does anyone have a sample VI?
    What is the best way to then read the data from the Global variable?
    (I will probably use an array\cluster to store the hostnames.) 

    Another pre-LV8 idea...
    A functional global can be accessed using VI-Server and called using "call by reference".
    This approach harnesses the TCP functionality built into the VI-Server to manage the conncetion.
    This can be pretty quick and (if the functional global is written correctly) will support buffered- mixed data types. (Try to do that with the Shared Variable  ).
    Just another idea,
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

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

  • How to creat a global variable?

    I want to creat a start button of global variable to control different programs in the sequence structure. But I do not know how to creat it. Thanks for answering.
    Solved!
    Go to Solution.

    Perry Liu wrote:
    Thanks for answering. I attached the code below.
    What I want to do is to combine Get Voc/Isc and GO buttons (shown in the front panal) to one button, and also combine Setup Linear Stair Sweep and start sweep together. I do now find a good way to do that. Thanks so much for your kind help.
    There is no "Get Voc/Isc" or "GO" button anywhere on the front panel, and I have no idea what you mean by "Setup Linear Stair Sweep" and "start sweep". Are you sure you uploaded the correct code?
    Other VI comments:
    You are abusing/misusing global variables. 
    You already have a state machine, so you can actually code this using just the state machine without actually needing the separate event structure loop. Even if you do keep it, that still does not require you to use global variables.
    Why do you have a loop around the Write to Spreadsheet File? This serves no purpose and actually stops your code in that loop until the Stop global is set. This doesn't make much sense.
    Since you do not have a path wired to the Write to Spreadheet File VI, you will be asked for a path each time the loop iterates. Use a shift register to hold the value of the path from iteration to iteration.
    Get rid of the Build XY Graph Express VI and those Convert to Dynamic Data functions. Replace with a single Bundle function.

  • How to declare a global variable from a PL/SQL package

    Hi All,
    Using a global variable is a bad practise for all language. However, in my case, I have a PL/SQL package defines all constants, and I want to use them directly via SQL statement, for instance,
    PACKAGE my_const
    IS
         DEFAULT_ZIP_CODE CONSTANT VARCHAR2(5) := '00000';
    END;And I cannot referrence this variable from my select statement as
    SELECT my_const.DEFAULT_ZIP_CODE from dual;I have to create a function via my package, as,
    FUNCTION get_default_zip_code RETURN VARCHAR2
    IS
    BEGIN
         RETURN DEFAULT_ZIP_CODE;
    END;and
    SELECT my_const.get_default_zip_code from dual;I don't want to create functions to referrence the default varaibles. Does anyone have any clues?
    thanks
    Edited by: user4184769 on Jul 19, 2010 8:36 AM

    riedelme wrote:
    thanks for the info. Your scope explanation makes sense even though it is not intuitive to me. I think the usage of package variables should be supported by SQL (they're just values to be copied) Maybe look at it from another language's perspective. You want to use a global PL package variable in Java/C#/Delphi/VB/etc. How would you do it?
    None of these languages can crack open the data segment of a PL code unit, inspect the variables in it, and extract a value from it. Instead, it needs to be done as follows:
    Using sqlplus as the client illustrates how all these languages will need to do it:
    SQL> var value varchar2(20);
    SQL> begin
      2>     :value := SomePackage.someVar;
      3> end;
      4> /So why should SQL behave differently? It is not the same as the PL language. It is not a subset of the PL language. Yeah, PL/SQL blurs the line between these 2 languages making it very simple for us to mix their source code. But PL/SQL is SQL integrated with PL - not PL integrated with SQL. PL has tight hooks into SQL, creating cursors for you, defining bind variables, binding variables and doing the whole Oracle Call Interface bit for you.
    But SQL has no need for PL code, just as it has no need for Java code, or Delphi code or VB code. Yes, it is possible for it to call Java stored procs. As it is possible for it to call PL procs. But these are via the formal call interface of those languages - not via tight integration hooks that blur the languages and make SQL and Java, or SQL and PL, look like a single integrated source code unit.
    Thus SQL has the pretty much the same constraints in calling the PL language as other languages do. What SQL can do is use the PL engine's call interface and tell it "+execute this function and return the result of the function+".

  • Reg Global Variable in PI 7.1

    Dear All
    We have a scenario where we need to validate contents of variuos fields in an xml file. As the validations are complex we want to store the exceptions inside a global variable so that all the exceptions can be segregated at a single point.
    Consider the following source structure
    Vendor No.
    Order No.
    Invoice No.
    Claim No.
    Customer No.
    CustomerName
    Needs to be maaped to following target structure
    Vendor No.
    Order No.
    ClientName
    Exception
      Text
    if in the Sender side, Vendor no/orderno/invoice no is not there then the text fied should be populated in the  Reciever side with the exception ,  this challenge has to to be achived using the Global Variable.
    Regrads,
    Sourabh

    Hi Nirmal,
    The exception you are going to send is a Type of Text message or its like java exceptions??
    If you are validating 5 or 6 fields then its better to do it at Message mapping level,use Global variale ,first create a global variable and check the condition if Vendor  not exists pass exception message to Global Variable.
    Then map this global variable to Text message segment in Receiver side.
    I had done validating Two CIDX Orderchange documents using JAVA Mapping,its worked perfectly for my requirement(bit complex requirement).
    Regards,
    Raj

Maybe you are looking for