Changing Variable values and saving it across sessions.

Hi,
I've have an requirement like counting the number of times a form is opened and number of times a button is clicked.For this I tried to use global variables.I tried to increment the value of the variable each time a form is opened or a button is clicked.
opencount.value += 1;
But it didnt work for me.I tried to hardcode a value like
opencount.value = 5;
Even this is also not working.Do I need change any settings or extend rights.Is it possible to save the values that are persistent across the sessions.
Please help

I have another apporach using an extras object.
What you is a script object 'Actions' with this script, to create a counter in the extras object in any form object.
function initOpenCounter(targetObject) {
    if (targetObject.extras.nodes.namedItem("OpenCounter") === null) {
        targetObject.extras.nodes.append(xfa.form.createNode("extras", "OpenCounter"));
        targetObject.extras.OpenCounter.nodes.append(xfa.form.createNode("integer", "state"));
        while (targetObject.extras.OpenCounter.nodes.length > 0) {
            targetObject.extras.OpenCounter.nodes.remove(targetObject.extras.OpenCounter.nodes.item(t argetObject.extras.OpenCounter.nodes.length - 1));
        var newState = xfa.form.createNode("integer", "OpenCounter");
        newState.value = 0;
        targetObject.extras.OpenCounter.nodes.append(newState);
Then you need another script, to call the function in the script object and raise the counter, when the form opens.
I used a floating field in a text on a master pager and put this script into its initialize event.
Actions.initOpenCounter(this);
var cCount = parseInt(this.extras.OpenCounter.nodes.item(0).value, 10);
          cCount += 1;
this.extras.OpenCounter.nodes.item(0).value = cCount;
this.rawValue = cCount;
Here's a sample form with an open and save counter.
https://acrobat.com/#d=C90OHrJKx52LHrtbtahWzQ

Similar Messages

  • BEx crashes when changing variable values

    Hi all,
    We're having a problem with BEx.
    It crashes when trying to change variable values.
    We've been looking into syslogs and dev logs and so on,
    and found that the cpic connection has been disconnected
    before the crash. BUT we cannnot find out what is actually
    disconnecting the session.
    Well, at least F/W wasn' the cause. Have check the logs.
    Any ideas? Thx in advance!
    Yuko
    Below is our info.
    BEx: BI 7.10 sp7
    BI: BI 7.0 SAPKW70017
    <BI syslog at the time of BEx crash>
    15:40:36 RD                                 Q0  I Operating system call recv failed (error no. 232 )
    15:40:36 RD                                 S2  3 Connection to CPI-C client 586 was closed
    15:40:36 RD                                 S7  4 > Partner LU name:
    15:40:36 RD                                 S0  R > Host: 172.19.xx.xxx
    15:40:36 RD                                 S0  I > Partner TP Name: EXCEL
    15:40:36 DIA  000 500 BIB103                R4  9 Communication error, CPIC return code 020, SAP return code 223
    15:40:36 DIA  000 500 BIB103                R5  A > Conversation ID: 82142217
    15:40:36 DIA  000 500 BIB103                R6  4 > CPI-C function: CMSEND(SAP)
    <dev_rd log trace level 3>
    GWRD LOOP **********
    I'm in GwReceive
    SiSelPSelect: start select (timeout=20000)
    Thu Apr  9 15:40:36 2009
    SiSelPNext: an error occurred in sock 31
    NiSelISelectInt: error detected on hdl 18 / sock 31
    NiSelIListInsert: add hdl 18 [17] to sel-list (0) of set0
    NiSelISelectInt: 1 handles selected (0 buffered)
    main: NiSelNext (ni_hdl=18, read=1, write=0, connect=0, hdl_info=0x6000000000587400)
    request from CLIENT
    GwRequest: request from client 586
    GwGetMemory: allocated 0x600000000089bee0 (len=34615)
    NiHsLGetHostName: found address 172.19.xx.xxx in cache
    ***LOG Q0I=> NiIRead: recv (232: Connection reset by peer) [nixxi.cpp 4423]
    ERROR => NiIRead: SiRecv failed for hdl 18 / sock 31
        (SI_ECONN_BROKEN/232; I4; ST; 172.19.xx.xxx:1097) [nixxi.cpp    4423]
    Adresse   Offset  bad request
    GwSaveErrInfo2: save err info (225)
    ***LOG S23=> GwIDisconnectClient, client disconnected (586) [gwxxrd.c     11657]
    ***LOG S74=> GwIDisconnectClient, client disconnected ( SY08472) [gwxxrd.c     11665]
    ***LOG S0R=> GwIDisconnectClient, client disconnected () [gwxxrd.c     11704]
    ***LOG S0I=> GwIDisconnectClient, client disconnected ( EXCEL) [gwxxrd.c     11713]
    LOCATION    SAP-Gateway on host mxxx112 / sapgw01
    ERROR       connection to partner '172.19.xx.xxx:1097' broken
    TIME        Thu Apr  9 15:40:36 2009
    RELEASE     700
    COMPONENT   NI (network interface)
    VERSION     38
    RC          -6
    MODULE      nixxi.cpp
    LINE        4423
    DETAIL      NiIRead
    SYSTEM CALL recv
    ERRNO       232
    ERRNO TEXT  Connection reset by peer
    COUNTER     790

    Just FYI.
    After all, we ended up applying BEx addon patch 9.
    The problem about the BEx crash seemed to be fixed in patch 8, but another problem (I heard it was about something to do with report jump function) was not fixed. As a result, we skipped patch 8 and applied 9.
    Both problems were fixed in patch 9.
    Many thanks to SDN informations.
    Yuko

  • How to change variable values ?

    Dear friends,
    How to change variable values when we are broadcasting the Queires ?
    Do we need to change them everytime ?
    Thanks,
    N

    Hi,
    Please go through it.
    /people/ramkumar.ghattamaneni/blog/2008/02/25/using-variables-while-broadcasting-queries-to-the-portal-in-bi-7
    Regards,
    Ramkumar.

  • How to change variable values dynamicly  in broadcasting

    Dear Friends i am scheduling workbooks using broadcasting feature.
    i want to know how can i change the variable values of report in broadcasting dynamically.
    becuase i dont want to schedule report again and again after changing the variable values.
    Regards
    Malik

    i did the same but its not working.
    i create one variant for the query ABC  using RSRT now if i look into table RSRVARIANT we can see that variant
    entry in this table. Now i create variant by bex on this query with the same name.
    now i schedule it using broadcasting but its not takeing the values of RSRVARIANT table.
    Its taking the value of variant which i save in bex.
    By default variant which is save in bex not appear in RSRVARIANT table.
    But i f you make a variant in RSRT you can see those entries in Table RSRVARIANT.
    But RSRT variant is not showing in Broadcast scheduling. Only Bex variant are showing.
    Where should create the variant in Workbook, in Bex web analyzer, or in RSRT.
    Regards
    Malik
    Edited by: Malik Naeem on Jun 9, 2010 2:05 PM

  • Change variable values in a class without acessing it's methods?

    I have the following scenery, a main class with:
    -ArrayList of strings.
    -Class frame (with textfield and button) supposed to add strings to that Array.
    Ok, in main class i set the frame to run, but how to make the frame to change the ArrayList of the main class in a easy way? What is the easiest solution and the best without hurting the paradigm?
    1-One solution would be to make a method in frame that returns the string and IN MAIN CLASS add it. But is this too straightforward? Like, if i had to manage 7,8 frames that must acess 7, 8 ArrayLists of main class as well as other frames recursively (Example: main class start running frame 1, then if button1 pressed go to frame 2, if button 2 pressed get textfield and chang ArrayList)
    2-Another solution would be to set all ArrayLists as static variables so i can change them freely? Is this a good paradigm?
    3-Pass the own main class as parameter throughout the frames? Is it possible? If so please post a 10, 15 line code in which i could do that.
    4- Put the main class as mother and all frames as son and put all arraylists as protected?
    I feel like im lacking one good paradigm, it should exist some concept in which the created object could change the value of the variable passed as parameter in the class that created it.
    Thank you very much.

    Thank you for your reply Kayaman, but i think you should help me.
    I tried to pass a simple variable (a string) as parameter through the constructor to one frame, like any other class.
    public class TelaLogin extends javax.swing.JFrame {
    String a;
    public TelaLogin(String a) {
    this.a=a;
    initComponents();
    But it returns a compilation error, maybe is something in it's main method? I didn't change it:
    public static void main(String args[]) {
    java.awt.EventQueue.invokeLater(new Runnable() {
    public void run() {
    new TelaLogin().setVisible(true);
    The main class has a 'new TelaLogin' that looks very suspicious. Is it that?
    This looks very simple.
    What must i change here? Please Kayaman help me.

  • Changing variable values in query navigation

    Hello,
    We used to use the functionality of a user exit variable for a web template query and could enter a default value for a query, like yesterday's date. This allowed the web template to be presented without a user having to enter variables in order to initially see data. Then either dropdowns or the navigation block objects could be used to navigate the query. To do this the, "Can be changed in query navigation", was set to on. In BI 7.0 this functionality has been removed. Is there a way to provide a default value to a characteristic that can still be changed during query navigation?
    According to documentation this functionality has been enhanced with default values in the variables but there does not seem to be a way to enter a non-fixed value and still change it during navigation.
    Any assistance would be appreciated.
    Thanks,
    Rick

    This can be done by changing the variable to be processed with user exits and changing the user exit for variables to populate the variable value at runtime.

  • Changing Item Values before saving Purchase Requisition in me51n, set_data function

    Hello,
            I have written a user exit, which is called whenever changes are made to a purchase requisition. User Exit is MEREQ001 , function module EXIT_SAPLMEREQ_010 . My requirement here is that the Requisitioner should be 135 for every PR item under certain conditions. Therefore whenever there is any change made to the PR, before saving the PR item, I need to set the Requisitioner to 135, give a status message saying that the Requisitioner is set to 135 and save the Pr with the changed values. Following is the code I have written in EXIT_SAPLMEREQ_010. However, the set_data function called below does not change the PR values. Pls help
    data: lt_item type mmpur_requisition_items,
           wa_item type mmpur_requisition_item,
           wa_itemdet type mereq_item,
           wa_itemref type ref to if_purchase_requisition_item,
           w_message type i.
    constants: c_135 type afnam value '135'.
    call method im_req_header->get_items
         receiving
                 re_items = lt_item.
        loop at lt_item into wa_item.
         wa_itemref = wa_item-item.
         wa_itemdet = wa_itemref->get_data( ).
         if wa_itemdet-afnam ne c_135.
           w_message = 1.
           wa_itemdet-afnam = c_135.
           call method wa_itemref->set_data( wa_itemdet ).
         endif.
       endloop.
      IF w_message = 1.
        MESSAGE 'Requisitioner defaulted to 135 for all items' TYPE 'I'.
      ENDIF.

    Hi Sachin,
               I am able to get a reference to if_purchase_requisition_item in my code (wa_itemref ) and am also able to access each of the line items in the PR in the work area wa_itemdet.
    At this point in the code ( wa_itemdet-afnam = c_135 ) , the work area value is set to '135', However, call method wa_itemref->set_data( wa_itemdet ), does not change the values of the work area wa_itemdet . Pls help

  • How to changing char. values and create new lines in C_TH_DATA

    Hi experts,
    we need to distribute the cost of some sender costcenters to the corresponding receiver costcenters.
    We have already created a DSO and maintained this with the sender and receiver costcenter. We use this lookup table later in the execute method of our created planning function type to take the sender costcenter and distribute this to the corresponding receiver costcenters.
    I've already implemented an IP planning function based on planning function type for this process.
    At the end when I debug the method I see that this works fine. I give you an example:
    I have in my lookup table the following record:
    sender costcenter           receiver costcenter            distribution percent
    4711                                    4712                                    75
    4711                                    4713                                    25
    Based on those records in the lookup table I've to distribute the cost of sender costcenter to the receiver costcenters.
    Just imagine I would get this record from c_th_data:
    sender costcenter    costelement     value
           4711                 3000111         100
    I have to have the following result after running the exit planning function:
       costcenter    costelement     value
           4711                 3000111         100                   -> without changing
           4711                 8000111        -100
           4712                 8000111           75
           4713                 8000111           25
    When I debug the exit function I see in the execute method that c_th_data will be filled correctly. I see exactly the records that I want to see.
    But once the function is finished I don't see this result. I also checked the conversation
    Changing Char Value in IP C_TH_DATA
    but I can't understand what happens after my coding yet.
    Can anyone help me or give me an advice what could be the problem here?
    Thank you all in advance for your support.
    Kind regards,
    Ali

    Hi Ali,
    The planning function generates the records in delta mode. I am explaining the concept taking your example only:
    Records in cube before running PF:
    sender costcenter           receiver costcenter            distribution percent
    4711                                    4712                                    75
    4711                                    4713                                    25
    sender costcenter    costelement     value
           4711                 3000111         100
           4712                 3000111         100
           4713                 3000111         100
    The records that you need to generate from code(Previous ones need to be changed):
    sender costcenter    costelement     value
           4711                 3000111         000
           4712                 3000111         175
           4713                 3000111         125
    **Please note that you dont need to generate any corrections(delta records), you only need to generate the final values in the records and the PF will generate the delta's on its own. Also in this case you should see 3 Records Read, 0 Deleted, 3 Changed.
    Please let me know if you need any more clarification,
    Thanks,
    Puneet

  • Changing  Condition values and Condition currency of PO to local currency.

    Dear Friends,
    I have a weird request.
    I have  a PO which has been created in USD. My local currency is INR.
    Normally, when i display the PO, under conditions tab, the condition values and currency will be displayed in USD.
    My requirement is like, i want to change and simulate the condition values in USD to local currency (INR) based on current exchange rate.
    Is there any way i can simulate the same. Kindly help.
    Thanks and Regards
    Sandeep Sivan

    I am not sure that it can be done through the config. You can change the values with the correct user exit and change the values accordingly before the values are displayed.
    Regards,
    FS

  • Persist saved query across sessions

    I have an Query Panel with Table, built from a View Object. The panel has a "Save" button that allows users to save queries, but it works only for a single session. Is it possible to make it work across sessions?
    I'm using JDeveloper 11.1.1.5.0

    Yes you can save it across sessions - for this you'll need to enable MDS on your system.
    http://andrejusb.blogspot.com/2009/09/persisting-query-criteria-results.html

  • Producing a line graph of int values and saving as an image

    Hi,
    I wonder if anyone could help me with this. I have 2 arrays of integer values that I would like to plot as a line graph (e.g. X[ ] and Y [ ]) and then have this line graph saved as an image (the format isn't too important but PNG would be preferred).
    Could somone point me in the right direction of an easy way to do this?
    Thanks,
    Pete

    Have a look at the following classes :
    java.awt.Graphics (drawLine method)
    java.awt.Image
    java.awt.BufferedImage
    javax.imageio.ImageIO (jdk 1.4+)

  • Save variable value and locking the code

    Hi,
    I want to save some values of indicator on front panel in place of typing them each time. e.g,
    maximum velocity 1 mm/sec
    maximum accel .....
    Each time, while opening I want the values used in last experiment as default.
    I do not want to set a fixed default value, it should be from last experiment.
    Also, I have to lock the code so as no bady else can change it. But I do not know how.
    Any help is appreciated,
    Dushyant

    There is a VI method that will set all the values as default. However a VI can not call on itself, while it is running. So take a look at the attached code.
    The Main Project VI represents your code, and I added a password 123
    You would need to put that code at the very end of your code. Notice that I call the other VI and then finish. The other VI loads your VI, with password, and then sets the values to default once it stops running.
    Let me know if you have any questions.
    Attachments:
    Set Defaults.zip ‏20 KB

  • Restricting variable values and booleans

    When you see a class diagram and one of the attributes is like the example below:
    Status (Professional, Semi-pro, Amateur)
    Is it possible to create this variable and restrict construction of objects using this variable to one of the 3 specified values. If so how is it done, been looking but can find no standard way to perform such a task.
    Also when you use a variable that is a boolean, instead of printing out false or true in my toString () method, how can I make it more effective!!! It is always initially false indicating that no lessons have been received and if true indicates lessons have been taken. It would be far more useful to display 'Lessons Not Take' or 'Lessons Taken'. Again any suggestions are welcome!!!
    Regards

    Yes, you can do it with an enumeration.
    Joshua Bloch shows how to do it in his "Effective Java":
    http://java.sun.com/developer/Books/shiftintojava/page1.html
    MOD

  • How can I disable Google Instant in Firefox 6 without saving cookies across sessions??

    I'm currently using Firefox 3.6.22 & clear all history including cookies, etc. whenever I close Firefox. I can disable Google Instant by changing general.useragent.extra.firefox in about:config to Fx/3/6/22. When I tried Firefox 6, with the same history settings & config setting, Google Instant kept rearing its ugly head. Is there a setting in Firefox 6 that will allow me to disable Google Instant without having to set a preference each time I open Firefox 6?? I find Google Instant to be extremely annoying. Please help.
    Thanks,
    Steve W.

    [https://addons.mozilla.org/en-US/firefox/addon/switch-google-instant/ https://addons.mozilla.org/en-US/firefox/addon/switch-google-instant/] is a pretty good addon, which seems to address your problem.

  • Read Instrument Value and Saving Data

    Hi Everyone,
    I have DSOX3014A Oscilloscope and  33521AQ Function / Arbitrary Waveform Generator . I want to make program that read oscilloscope and waveform generator data and send to tax file.
    What should ı do ?
    Thank for your time and attention.
    Solved!
    Go to Solution.

    I am really beginner.I never tried something so far.I have oscilloscope and arb generator. Also ı have piezoelectric bender(been attach) actuator resonance impedance.I connected oscilloscope and arb waveform generator to my computer. I want to record oscilloscope and arb waveform generator's data to tex file.
    Actually ı don't have impedance analyzer therefore ı calculate piezo bender's resonance impedance this way.
    Seem http://www.ni.com/try-labview/instrument-control/    first video but ı have to convert data to tex file. 
    What should ı do? 
    Thank You for your attention.
    Attachments:
    20150203_231732_Richtone(HDR).jpg ‏840 KB
    Capture.PNG ‏970 KB

Maybe you are looking for

  • Slingbox and Ipad to TV

    I would like to connect my Ipad2 to my TV and watch content via my slingbox. Do I need an HDMI Adapter HD TV Connector AV Converter Cable for Ipad?

  • Group messages in iOS 8 updated not working on my iphone 5

    i updated to the new iOS 8 this morning on my iphone 5 and now the group messaging isn't working. no group message option in setting neither. help please.

  • ASN is blocked in R/3

    One ASN is blocked in R/3 and that too of past date but still coming to APO when IM is activated. How can i stop this ASN coming into APO once i activate the IM?

  • Premiere Elements 4.0 burn issue

    Premiere Elements 4.0 with Windows XP (both pre-loaded on a Dell computer purchased new in 2007).  I am able to create *.prel files with no problem and I had been able to burn projects up to 5-hr length to DVD with no problem until recently.   Starti

  • Time field support

    Hi, I see that a bunch of other people have asked about time fields in previous questions and that the answer has been that time fields are not supported at this time. Seems like people have been asking for a couple of years now - is it something For