Creating a global variable for a counter.

All,
we have the following scenario - we are getting a flat file into XI. The file is converted into an xml message (<source> message) in content conversion with the records/message setting as 1000. So, the input file is split into messages with 1000 records/each. (except for the last one).
Now - we map these messages into another message (<sourceIdx> message) to add a counter node to the record structure (rest of the structure is the exact same). The question is we need to maintain the counter across the messages.
Meaning - if there are 100 <source> messages that are mapped to 100 <sourceIdx> messages. The first record in the first message will have the counter as 1 and the last one as 1000. we want the first record in the second message to start at 1001 and not 1 again.
How can we do this? Also - is there a way - where you can add this counter during the content conversion itself. That will save us this mapping.
Thanks,

It might be possible to use a java pointer and point it at a reserved memory location in the XI box, then just modify and call this pointer in a UDF.  Another possibility is to write a file with your number directly from the UDF to a place on the XI box and just call and modify this file with the UDF.  I don't know if the second would actually work, but those are the non-XI involved way of doing it.
Another option would be to explore using a BPM that would have your variable in it.

Similar Messages

  • How to create a global variable in forms 6i

    How to create a global variable in forms 6i

    :GLOBAL.my_var := 15; Well, this statement is not correct! Global variables
    stores a character string of up to 255 characters in
    length. Thus, valid statement for Khurram example
    is:
    :GLOBAL.my_var := TO_CHAR(15);
    or
    :GLOBAL.my_var := '15';
    But numeric values are implicitly converted by oracle so there's nothing in fact wrong with the statement...
    :GLOBAL.my_var := 15;
    ;)

  • Business Rules : Unable to create a global variable (Fixed)

    Hello all,
    I try to create a global variable in order to use it in a business rule;
    I selected an outline.
    I chose the type "Member"
    I chose the dimension "Period"
    I clicked on the lookup button in front of the default value and chose the member "January"
    Finally, I chose the usage type "Run-Time prompt" and type in a prompt string.
    Unfortunately, when I click on save, I get an error message : Variable value ["January"] is invalid.
    If I try to do not specified a default member, it is possible to save.
    But when I launch the business rule and specified a member in the the prompt message, I get an error 1060120 : OLAP error.
    I cannot figure out what's going wrong, so any help is welcomed.
    Thanks,
    DLP
    Message was edited by:
    user639769
    Message was edited by:
    user639769

    Thanks for your answer,
    I finally figure out what's going wrong.
    This issue is due to the fact that the outline is configured to accept duplicated names.
    When I create the same outline but with duplicated names turn off, every thing goes perfectly.
    I don't know why the outline accepts duplicated name.
    In fact, I do not understand what are the reasons for using duplicate name...

  • 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

  • How to auto create a global variable with specific variable name in a global vi ?

    how to auto create a global variable with specific variable name in a global vi using lv ? Because i need to add a lot of global variable in this global vi. But you know, if  i manually add them , it will be a much time-costing work. So i want to use someway to auto generate ? Can i ?? Thanks a lot !

    Hi
    what aartjan is saying is the way for you. but you can develop an utility which will actually help you create global variables. To get the details on this just have a look at VI Scripting section on LAVA forum.
    But i would like you to suggest few things
    1. If your programs have so many global variables (Thats why u want utility) then you should take out some time to read about LabVIEW design patterns. I think if programmer follows these practicess he dont need a single global variable.
    2. Their are some other ways to achieve similar functionality as of global variables (Uninitialized Shift Registers, Single Element Qs and so on) but they are much faster than global variables.
    I am Attaching Whatever Resources i am having I will also attach the template of the design pattern i generaly use in short duration
    Message Edited by Tushar Jambhekar on 10-06-2005 07:33 PM
    Message Edited by Tushar Jambhekar on 10-06-2005 07:36 PM
    Tushar Jambhekar
    [email protected]
    Jambhekar Automation Solutions
    LabVIEW Consultancy, LabVIEW Training
    Rent a LabVIEW Developer, My Blog
    Attachments:
    LabVIEWDesignPatterns.zip ‏1505 KB
    Large_Code_Implementation.zip ‏522 KB
    Database Tests.zip ‏868 KB

  • "global"  variables for data slices

    Hello experts,
    Can someone tell me how to create a global variable which can be set for all user of a planning application?
    I want to use this variable to be used by one or two users, so that they can lock the planning data by setting the variable. The variable will be used in a data slice and by changing the value of the variable, they are also able to change the range of the data slice. I thought that I found the solution, but in the end I remembered that variables are user specific and therefore has to be set for each user.
    I hope that one of you has a solution (not using STS) for this problem.
    Kind regards,
    Harald van der Meij

    Hallo Harald
    I see your point and i hope this can help you.
    Create a Variable of type exit which get the values for data freezing.
    For example: Calmonth.
    then in the Function Module, derive Calmonth making the Select from a custom table. give the rights to the two user to maintain the table for lock and unlock the planning.
    Based on entries on the tables, then you can have the value for Calmonth. based on it you freeze or unfreeze the data.
    of course you can use any Characteristic.
    for example:
    you want to freezee from 01.2005 to 10.1005. pass these values to the variable making a select from the custome table (Zfreezing) where you maintain 01.2005 to 10.2005.
    if you need then to reopen the planning, then cahnge the values in the tables and consequentely to the variables.
    the user can maintain entries in the tables.
    When you create the table assign an authorization group and then create a role with it and assing these the two users.
    Regards
    Mike

  • How do I set global variables for use by ALL form1.#subform[0] items?

    Hi All,
    I know how to code javascript but am new to Adobe LiveCycle.  When I open script editor, I have the following code (all code is in un-bolded):
    ----- form1.#subform[0]::initialize: - (FormCalc, client) ------------------------------------------
    // BEGIN: SET GLOBAL PRICES //
    var Cityscope_Sydney_CostUser1 = 60.39;
    var Cityscope_Sydney_CostUsers2to5 = 3.02;
    var Cityscope_Sydney_CostUsers6to20 = 1.21;
    var Cityscope_Sydney_CostHardCopyWithOnline = 14.59;
    var Cityscope_Sydney_CostHardCopyWithoutOnline = 54.67;
    var Cityscope_Sydney_CostHardCopyAdditional = 14.59;
    var Cityscope_NorthSydney_CostUser1 = 48.40;
    var Cityscope_NorthSydney_CostUsers2to5 = 2.42;
    var Cityscope_NorthSydney_CostUsers6to20 = 0.97;
    var Cityscope_NorthSydney_CostHardCopyWithOnline = 14.59;
    var Cityscope_NorthSydney_CostHardCopyWithoutOnline = 43.54;
    var Cityscope_NorthSydney_CostHardCopyAdditional = 14.59;
    // END: SET GLOBAL PRICES //
    ----- form1.#subform[0]::enter: - (FormCalc, client) -----------------------------------------------
    ----- form1.#subform[0]::exit: - (FormCalc, client) ------------------------------------------------
    ----- form1.#subform[0]::calculate: - (FormCalc, client) -------------------------------------------
    ----- form1.#subform[0]::validate: - (FormCalc, client) --------------------------------------------
    ----- form1.#subform[0]::preSave - (FormCalc, client) ----------------------------------------------
    <<======= etc etc etc =======>>
    ----- form1.#subform[0].Item1Cost::initialize: - (JavaScript, client) ------------------------------
    ----- form1.#subform[0].Item1Cost::enter: - (FormCalc, client) -------------------------------------
    ----- form1.#subform[0].Item1Cost::exit: - (FormCalc, client) --------------------------------------
    ----- form1.#subform[0].Item1Cost::calculate: - (JavaScript, client) -------------------------------
    //Store form values in user-friendly names.
    var AreaSelected = Item1Area.rawValue;
    var NumberOfUsersSelected = Item1Users.rawValue;
    //Declare other vars.
    var Users1Calculation;
    var Users2to5Calculation;
    var Users6to20Calculation;
    //Calculate individual User Cost "components" based on number of users selected for the area.
    switch(true)
    case (NumberOfUsersSelected < 2):
      Users1Calculation = NumberOfUsersSelected * Cityscope_Sydney_CostUser1;
      Users2to5Calculation = 0.00;
      Users6to20Calculation = 0.00;
      break;
    case (NumberOfUsersSelected > 1 && NumberOfUsersSelected < 6):
      Users1Calculation = Cityscope_Sydney_CostUser1;
      Users2to5Calculation = (NumberOfUsersSelected - 1) * Cityscope_Sydney_CostUsers2to5;
      Users6to20Calculation = 0.00;
      break;
    case (NumberOfUsersSelected > 5):
      Users1Calculation = Cityscope_Sydney_CostUser1;
      Users2to5Calculation = 4 * Cityscope_Sydney_CostUsers2to5;
      Users6to20Calculation = (NumberOfUsersSelected - 5) * Cityscope_Sydney_CostUsers6to20;
      break;
    default:
      alert("BROKEN: Calculate individual User Cost components based on number of users selected for the area.");
    //apply total cost for this item
    Item1Cost.rawValue = Users1Calculation + Users2to5Calculation + Users6to20Calculation;
    ----- form1.#subform[0].Item1Cost::validate: - (FormCalc, client) ----------------------------------
    ----- form1.#subform[0].Item1Cost::mouseEnter: - (FormCalc, client) --------------------------------
    ----- form1.#subform[0].Item1Cost::mouseExit: - (FormCalc, client) ---------------------------------
    ----- form1.#subform[0].Item1Cost::change: - (FormCalc, client) ------------------------------------
    ----- form1.#subform[0].Item1Cost::full: - (FormCalc, client) --------------------------------------
    ----- form1.#subform[0].Item1Cost::mouseUp: - (FormCalc, client) -----------------------------------
    ----- form1.#subform[0].Item1Cost::mouseDown: - (FormCalc, client) ---------------------------------
    ----- form1.#subform[0].Item1Cost::click: - (FormCalc, client) -------------------------------------
    ----- form1.#subform[0].Item1Cost::preSave - (FormCalc, client) ------------------------------------
    ----- form1.#subform[0].Item1Cost::postSave - (FormCalc, client) -----------------------------------
    ----- form1.#subform[0].Item1Cost::prePrint - (FormCalc, client) -----------------------------------
    ----- form1.#subform[0].Item1Cost::postPrint - (FormCalc, client) ----------------------------------
    ----- form1.#subform[0].Item1Cost::preSubmit:form - (FormCalc, client) -----------------------------
    ----- form1.#subform[0].Item1Cost::docReady - (FormCalc, client) -----------------------------------
    ----- form1.#subform[0].Item1Cost::docClose - (FormCalc, client) -----------------------------------
    ----- form1.#subform[0].Item1Cost::ready:form - (FormCalc, client) ---------------------------------
    ----- form1.#subform[0].Item1Cost::ready:layout - (FormCalc, client) -------------------------------
    ----- form1.#subform[0].Item1Users::initialize: - (FormCalc, client) -------------------------------
    ----- form1.#subform[0].Item1Users::enter: - (FormCalc, client) ------------------------------------
    ----- form1.#subform[0].Item1Users::exit: - (FormCalc, client) -------------------------------------
    ----- form1.#subform[0].Item1Users::calculate: - (FormCalc, client) --------------------------------
    ----- form1.#subform[0].Item1Users::validate: - (FormCalc, client) ---------------------------------
    ----- form1.#subform[0].Item1Users::mouseEnter: - (FormCalc, client) -------------------------------
    ----- form1.#subform[0].Item1Users::mouseExit: - (FormCalc, client) --------------------------------
    ----- form1.#subform[0].Item1Users::change: - (FormCalc, client) -----------------------------------
    ----- form1.#subform[0].Item1Users::full: - (FormCalc, client) -------------------------------------
    ----- form1.#subform[0].Item1Users::mouseUp: - (FormCalc, client) ----------------------------------
    ----- form1.#subform[0].Item1Users::mouseDown: - (FormCalc, client) --------------------------------
    ----- form1.#subform[0].Item1Users::click: - (FormCalc, client) ------------------------------------
    ----- form1.#subform[0].Item1Users::preSave - (FormCalc, client) -----------------------------------
    ----- form1.#subform[0].Item1Users::postSave - (FormCalc, client) ----------------------------------
    ----- form1.#subform[0].Item1Users::prePrint - (FormCalc, client) ----------------------------------
    ----- form1.#subform[0].Item1Users::postPrint - (FormCalc, client) ---------------------------------
    ----- form1.#subform[0].Item1Users::preSubmit:form - (FormCalc, client) ----------------------------
    ----- form1.#subform[0].Item1Users::docReady - (FormCalc, client) ----------------------------------
    ----- form1.#subform[0].Item1Users::docClose - (FormCalc, client) ----------------------------------
    ----- form1.#subform[0].Item1Users::ready:form - (FormCalc, client) --------------------------------
    ----- form1.#subform[0].Item1Users::ready:layout - (FormCalc, client) ------------------------------
    ...and so on and so forth....
    In short, I want the code within:
    ----- form1.#subform[0].Item1Cost::calculate: - (JavaScript, client) -------------------------------
    ...to be able to access the variables I have created in:
    ----- form1.#subform[0]::initialize: - (FormCalc, client) ------------------------------------------
    (I have assumed that this is where I would store Global variables)
    At this stage, the global variables cannot be accessed with the configuration above.  The only was I can get this to work is to cut and paste the global vairables into each form1.#subform[0] item, which of course defeats the purpose of global variables!  I plan to have many more items so would not want to duplicate the global variables for all of them!
    Can somebody show me how to do this?
    Any help is very much appreciated!
    Thanks
    Stanbridge
    Message was edited by: stanbridgej - colors and or fonts won't save.  Have bolded my question to make code (non-bolded) easier to read (I hope).

    Hi MorisTM,
    Thanks for the reply!
    Yes, I saw that option (I should have mentioned I already knew about it), but was wondering if there is a way I can do this via code.
    There are two reason I want to be able to do it via code (only one of which may be valid):
    1) I can automatically generate my pricing code form another inhouse app.
    2) I am hoping that later on once I get this working I will be able take it a step further and get the data directly from a MySQL database!
    Cheers though!
    Any other suggestions?
    Regards,
    Stanbridge

  • DIAdem create an user variable for Report

    Hi,
    I know that i can display in a DIAdem report some pre-defined DIAdem vairiable (such as CurrDate) using @@Variable@@. 
    I would like to create a DIAdem user variable (from a DIAdem script) to be used in DIAdem report.
    1) I have created a variable in my script
                      Dim myvariable
                      myvariable = "hello"
    2) I have run the scirpt
    3) I have put @@myvariable@@ in a Text
     But a error message appears : Variable is undefined : 'myvariable'
    How could a create a user varaible to be displayed in my report?
    Thank
    Solved!
    Go to Solution.

    Hi malexman,
    The other option is to create a global variable from a normal (non-user-command) VBScript.  There are several ways to do this, but the one we instruct new users to implement is the "GlobalDim" command, like this:
    GlobalDim "UserVariable"
    UserVariable = "hello"
    You will notice that after this short VBScript runs the "UserVariable" changes color to show that it has become a global variable-- at that point you can use it in REPORT (and everywhere else in DIAdem, thus the name "global" variable).
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments

  • Create a Global Layout for Embargo Report

    Hi,
    Kindly advise on the below.
    I am attempting to create a Global Layout for the "Export Embargo Report for BP" .
    However, while attempting to save the same , the "user-specific" checkbox is turned on and grayed out.
    Kindly advise on how to go about to save a Global Layout.
    Thanks
    Jasmit

    Thanks Sameer , your understanding is correct.
    However, even if I save the layout as a default one ( Default checkbox set) , it will be applicable only for my id.. I am looking to create a layout, which everyone will be able to access the layout as well..
    Thanks
    Jasmit Kohli

  • Use global Variable for Formatstring

    Hello
    I wanna use a global variable for a format string. see picture. But I don't work.
    Can anybody give me an idea, why it won't work?
    Thanks a lot!!!
    Attachments:
    GlobalVariable.jpg ‏61 KB

    As others said, the problem is not the global.
    See attached a picture of how to do what you want. Since the Format String is unknown at edit time, you must provide the types to all inputs that are not DBL.
    From your example, the while loop has been coded exactly like a for loop. It can be replaced with a for loop with auto-indexing, unless you really want the local variable to be update at each iteration every 50 ms. This delay is not necessary unless the computed array is huge and you want to leave some CPU time to other code in your application. Even then you can enter a delay of 0ms to force to swap to other tasks.
    I don't know what your INT>BOOL VI does but using Scan from String you can read a number directly into a boolean. The number i
    s rounded to an unsigned integer and 0 is False and >0 is True.
    For example you scan a string for a boolean with format string %d.
    "0" --> False
    "24" --> True
    "-18" -- False (coerced to unsigned = 0)
    You scan a string for a boolean with format string %f:
    Negative number up to "0.5" --> False (coerced and rounded to 0)
    Number greater that 0.5 --> True
    LabVIEW, C'est LabVIEW
    Attachments:
    diag.jpg ‏15 KB

  • How to create a custom variable for a Label?

    i need my label to store a string variable in it, do you know i can create a custom variable for it.
    i mean for example if it's name is "StoredString" i can access it in my code by "label1.StoredString" just like "Label1.text" or something like that.

    Thanks for pvdg42's help.
    Hi soorena12,
    Based on your issue, I suggest you can try the pvdg42's suggestion check your issue in your side.
    If it still could not help you solve this issue, I suggest you can tell me which kind of application you create the label in the VS IDE?
    What language you use to create for your application?
    If you have any update message about your issue, please tell us.
    Best Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to create a 0FISCPER variable for [last period of current year]

    Hello,
    Can anybody tell me how to create a (exit) variable for the last period of the current year, based on 0FISCPER ?
    Based on a single value, user entry variable based on 0FISCPER.
    I did not find any standard (business content) variables for this.
    Can anybody tell me whether the following alternative works:
    variable 0P_BA102 (last period pervious year) with offset of +12 
    Kind regards.

    Hi,
    It should work.
    You can refer to the following link:
    http://help.sap.com/saphelp_sm32/helpdata/en/3f/89533e5ff4d064e10000000a114084/content.htm
    Regards,
    Amit

  • How to  Create  a selection variable for Fiscal period/year range

    How to  Create  a selection variable for Fiscal period/year range. The idea is to filter the query results using a fiscal period/year range user input rather than a full fiscal year input.

    Hi Priya,
    Open the query in a query designer -> in the left hand side you would find the fiscal year period under the time dimension -> right click -> create variable -> create the variable.
    The better option would be use any of the SAP provided variable. You would find them under the Fiscal year period in the left hand side in the query designer.
    Bye
    Dinesh

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

  • Global Variable for selection screen variable

    Hi All,
    We need to create a report where calendar day has to be included in the selection screen.Later after executing the report we should be able to retrieve the selection screen input for calendar day and modify it and use the modified one for other calculations.Can somebody help me out in finding the global variable in the variable exit where we find all the inputs for selection screen variables....
    Regards,
    Shravani

    shravani,
    I_vnam will store the varaible names...if you have varaible in the query...
    please use this code for ur help...
    DATA: ww_der_date LIKE sy-datum,
            wzdate LIKE sy-datum,
            wzact_gi_dte TYPE /bi0/oiact_gi_dte.
      wzact_gi_dte = sy-datum.
      IF i_step = 2.
        READ TABLE i_t_var_range INTO wa_i_t_var_range WITH KEY vnam =
        'ZNODAYS'.
        ww_der_date = sy-datum - wa_i_t_var_range-low.
            CLEAR wa_i_t_var_range.
        IF i_vnam = 'ZVAGIDCUSTEXIT'.
          CLEAR l_s_range.
          l_s_range-low    =  ww_der_date .
          l_s_range-high   =  wzact_gi_dte.
          l_s_range-sign   = 'I'.
          l_s_range-opt    = 'BT'.
          APPEND l_s_range TO e_t_range.
          CLEAR l_s_range.
        ENDIF.
      ENDIF.
    in this case user will enter no.of days in ZNODAYS and that being is used in calculation and used in the next varaible....

Maybe you are looking for

  • Sending Mail Content as Input to Java WebService through SOA

    Hi Experts, I am working on a SOA project in 11.1.1.6 My project requirement is to send Mail Content (a paragraph with 3 lines with new lines in middle of statements) as input to the Java API which is deployed as webservice. To one of the arguments o

  • Watch movies

    when I hook up to tv with the apple cables I get sound but no picture it says on the screen no signal what is wrong thanks all

  • Send email alerts to multi email addresses

    Hi Guys I have configured my alert on TCode: ALRTCATDEF, SCOT, SU01 and Iu2019me able to get the email alerts but the requirement is to send to other member on the team thought they donu2019t have User Ids in SAP PI. I need to know whether is possibl

  • External Hard Drive File System

    I am backing up my iMovie files to a Network Attached Storage device that is formated with the ext3 filesystem. I am only backing them up to this device, and I am not trying to use the files from within iMovie from this device. The working files are

  • My Apple ID disable for some region so what can I updates my apps

    My Apple ID disable for some resion so now what can I updates my apps plz help