What is dynamic user variable??/

how can I can get some information regarding this??????

I would think it is pretty much the same thing, it being dynamic probably just means that you can change it say on a form
Cheers
John
http://john-goodwin.blogspot.com/

Similar Messages

  • What's user variable name using Smart View POV function (ex:HypGetActiveMember)?

    Hi,
    We want to use Smart View POV function (ex:HypGetActiveMember) to get the active member of user variables from HFM forms selected into Excel, but we don't know the user variable name in the following paragraph of Smart View developer guide:
    "To uniquely identify the user variable, provide the user variable name rather than the dimension name."
    For example, what's the user variable name of Year dimension? How to get the user variable name?
    Any information would be appreciated. Thank you!

    Hi,
    I guess user variable name is set by users/developers. I am not very clear on your question. If you have defined some variables to select any members from a dimension then it will be in HFM only. In planning we have two kinds of variables User Variables (we set it from Planning Preferences) and Substitution variable (we set it from Essbase Consol in the backend). Without looking into your application it is difficult to say the user variable name. Like for Year the user variables can be "PreviousYear", "CurrentYear", or "NextYear" etc.
    Soumya

  • Multiple members for single user variable???

    Hi,
    Can I select multiple members or a hierarchy for a single user variable?
    My requirement is to use a dimension which consist of more than 100 members but the user will not enter data for 100 members
    at the same time so I want to give user an option to select the members for which he wants to enter data.
    I was thinking of using user variable but it is allowing me to select only one member for user variable created for that dimension,
    that means if he has to enter data for 10 members he has to change that variable 10 times or I have to use 10 different user variable for that dimension.
    what if any user wants 20 members, at that time I have only 10 user variables.
    Please help..
    Thanks in advance..

    Hi,
    Can I select multiple members or a hierarchy for a single user variable?Are the required members descendants of any particular member(hierarchy )?
    If so, you can use IDescendants<user variable> in the form's page. And you can also use dynamic user variable option.
    Regards
    -Samrat Mane
    Edited by: 918547 on Aug 22, 2012 4:54 PM

  • Is it possible to dynamically create a user variable at runtime from within a Widget?

    I'm trying to develop a custom Interactive Widget. This widget will allow the user to take multiple attempts, and needs to store information about previously completed attempts so they can (hopefully) see their improvements over time.
    I'm trying to figure out the best way to store the data about the previously completed attempts across multiple sessions in a LMS. It seems that the data stored in user variables is automatically stored/restored in suspend_data, which would be perfect. The issue is that I can't find a way to dynamically create a new user variable from within a Widget. It looks like I can only access user variables that the author has explicitly defined in the Captivate interface. I'd rather not have to force the author to define an empty User Variable that they'll never knowingly use, just to give the Widget a bucket to store its data.
    Does anyone have any ideas for what might be the best way to accomplish this? I'd like to stick to standard, "approved" APIs as much as possible, but I'd be willing to bend some rules if necessary.
    Thanks!

    Ryan,
    I assume you've asked this question here:
    https://groups.google.com/forum/?fromgroups#!topic/elearning-technology-and-development/e5 vWZfJ6X8I
    I asked a similar question here:
    https://groups.google.com/forum/?fromgroups#!searchin/elearning-technology-and-development /leichliter/elearning-technology-and-development/Au88bu7LB5o/TC7xlo8iBpQJ
    Philip gave you sound advice.  You'll have to hijack/re-purpose the comments or the suspend data.  I was successful in using SCORM comments in a Moodle system to store extra data I needed for a customer.  It's not ideal, but it gets the job done. Here's a thread about that:
    https://groups.google.com/forum/?fromgroups#!topic/elearning-technology-and-development/Yg YAMGfXQNw
    If you use suspend data, you have to watch out for a few things:
    1.  It's base 64 encoded... so any data you append to what Captivate outputs will need to be in base 64 (that's a good practice anyway since the data has to be serialized).
    2.  On course re-entry, you'll need to capture the suspend data before it hits Cp to strip off / read your needed data.  If the suspend data isn't in the format Cp expects, you'll get a nice white screen of death.
    Ideally, it would be nice to be able to dynamically create user variables for purposes like this... and it's been requested in Cp 6.... we'll see if it gets added (not holding my breath).  Until then, I'd use cmi.comments.
    Jim Leichliter

  • What is the best approach to store "dynamic" user accessibility ?

    Hi all,
    We are implemennting security in our ADF BC + Faces application. There is always requirement to hide/disable functionalities that a user is not allowed / authorized to access.
    Usually we do this during development time, based on what role the user is in. Using this approach, there is no way to change that , or give access to new role during runtime (after the deployment). This is what I call "static accessibility".
    In our apps, we need the give / revoke access to some functionalities during runtime. This is what I call "dynamic accessibility".
    One approach that comes to my mind is :
    We define the accessibility to each function that we want to protect (hide/unhide) in database tables. Then every time a use enter a page, read these tables through JDBC calls then store tha data in Managed Bean.
    Has anybody here implement this "dynamic accessibility" ?
    Is there a better approach ?
    Thank you very much,
    xtanto

    Saeed,
    SRDemo uses a managed bean that checks is user in role when called and returns true or false. Another approach - more elegant - is the use of a security property resolver as available
    http://jsf-security.sourceforge.net
    Regarding dynamic permissions, the use of JAAS seems to be a good solution. ADF Security uses JAAS permissions to assign component access to users.
    E.g. if the user role manager has access to edit the salary column, then the security constraint added to the update button could be
    #{!bindings.<attribute binding>.updateable}
    Note that ADF Security sets the updateable flag on an attribute.
    Or you use
    #{bindings.<iterator binding>.permissionInfo.create}
    #{bindings.<attribute binding>.permissionInfo.update}
    #{bindings.permissionInfo['pageDefName'].view}
    etc. to determine what a user can do or can't.
    Note that I haven't tested if the permissions are cached for a specific application or if they are checked each time again. If they are checked each time then this would be a performance penalty but allows to dynamically set permissions to user groups as obviously needed in your applications.
    No, we don't have tutorial for this. But a Oracle By Example for end-to-end security implementation is on my collateral plan for JDeveloper 11 (just need to write a doc writer ;-) )
    Frank

  • Whats the best way to create USER variable in BI Apps?

    I have just installled BI Apps and am trying to integrate EBS R12 with OBIEE 11g
    We have USER variable already defined in the BI Apps rpd.
    In EBS Security context init block i need to define USER variable, but when i define it... it says *'USER' has already been defined in the variable "Authentication"."USER"*
    Whats the best way to create USER variable for EBS Security Context init block?
    1) Delete the existing USER variable and then define a new one ( in this case all the places where USER variable is getting used in the rpd would become <missing>)
    And i was told that it should not be done.
    Let me know how can it be done.
    Thanks
    Ashish

    Disable existing Init block and then double click on USER variable and hit on NEW... button to create new Init block
    Thanks
    Edited by: Srini VEERAVALLI on May 1, 2013 4:18 PM

  • Creation of Dynamic Date Variables to be used in WebI reports

    What we are trying to achieve is to create 4 optional filters (Current Day, Current Week, Last Week, Last Month) on 4 different dates which will allow the users to use them in WebI reports.
    When using an optional SAP Customer Exit variable in BEx and creating a Universe on top, the filter becomes mandatory (i.e. the whole Universe is filtered by the SAP Exit, irrespective of whether the filter is used in the WebI report). Even if the filter is flagged as optional at the Universe level, it still behaves as mandatory.
    If each filter becomes mandatory then we'll have to create 16 different Universes (for each optional filter and date combination)! This is not feasible.
    I've seen in other posts that MDX Statements are not currently supported for Universes base on BW and SAP Exit should be utilized.
    So with the existing BO version, is it possible to create optional dynamic date variables or is that a product limitation?
    We are on XI3.1 SP3 FP3.1
    Thanks

    Hi Adam,
    In BEx, I would create this query very easily using the "Amount" key figure twice in my results and restricting each with a different SAP standard out-of-the-box delivered variable. For your reference, the variables in BEx are: 0FPER and 0FYTLFP.
    If I expose these variables in my OLE DB for OLAP query, they are not transfered into the universe, but rather act as filters on the entire universe. I've seen in documentation that only "Ready for Input" variables can be transfered as options into the universe which is not something that I have seen mentioned in this thread.
    >> In the BEx Query you have the option to either make the variable "ready for input" or not. The behavior is the same in Bex or in the Universe / Web Intelligence. "Ready for input" means the user can actually provide an input and without the flag the user can not provide an input. Yes those variables are supported in the Universe.
    Why this is a problem: I can't create separate universes based on potential variable periods that users might want to see. Additionally, many financial reports require concurrent use of these measures in the same report. Also, in reality it's not 2 variables, but dozens.
    >> Which is a decision you make already on the BEx query level. if you decide that the variable is not ready for input then the user can change the timeframe in BEx either.
    Also, I don't have a good way to mimic the standard out-of-the-box functionality given with BEx in BO. If I custom create all my variables in the universe, how do I do a lookup from the system date to the fiscal calendar that is stored on the BW server? In other words, how does BO know which date belongs in which period? (the same would be true with factory calendars for a different functional area).
    >> Variable are created in the BEx query and the Universe will leverage those.
    If you want a dynamic date range then EXIT variable as part of the BEx query - ready for input or not - is the solution.
    regards
    Ingo Hilgefort
    The only work around I can see is to require users to enter the current fiscal period and have the BO reports filter based off that user entered value. This is unfortunate as the entire purpose of SAP Exit variables is to avoid having to require user input at report time.

  • HELP: SSIS 2012 - Execute SQL Task with resultset to populate user variables produces DBNull error

    I am experiencing an unexplainable behavior with the Execute SQL Task control in SSIS 2012. The following is a description of how to simulate
    the issue I will attempt to describe:
    1. Create a package and add two variables User::varTest1 and User::varTest2 both of String type with default value of "Select GetDate()"
    for each, have shown this to not matter as the same behavior occurs when using a fixed string value or empty string value.
    2. Add a new Execute SQL Task to the control flow.
    3. Configure an OLE DB connection.
    4. Set SQLSourceType = "Direct Input"
    5. Set the ResultSet property of the task to "Single Row"
    6. In the ResultSet tab add two results as follows: 
    Result Name: returnvalue1, Variable Name: User::varTest1
    Result Name: returnvalue2, Variable Name: User::varTest2
    7. Set an expression for the SqlStatementSource property with a string value of "Select 'Test' returnvalue1, 'Testing' returnvalue2'"
    The idea is that the source would be dynamically set in order to run a t-sql statement which would have dynamic values for database name
    or object that would be created at runtime and then executed to set the user variable values from its resultset. Instead what occurs is that a DBNull error occurs.
    I am not sure if anyone else has experienced this behavior performing similiar actions with the Execute SQL Task or not. Any help would be
    appreciated. The exact message is as follows:
    [Execute SQL Task] Error: An error occurred while assigning a value to variable "varRestoreScript": "The type of the value
    (DBNull) being assigned to variable "User::varRestoreScript" differs from the current variable type (String). Variables may not change type during execution. Variable types are strict, except for variables of type Object.
    User::varRestoreScript is the first return value. And even with the a dummy select the same result occurs. I have narrowed the issue down
    to the T-SQL Statement structure itself. 
    The following works just fine within the execute sql task control as long as no resultset is configured for return:
    "Declare @dynamicSQL nvarchar(max)
    Select @dynamicSQL = name 
    From sys.databases 
    Where name = 'master'
    Select atest_var1=@dynamicSQL, atest_var2='static'"
    I have tried various iterations of the script above with no success. However, if I use the following derivative of it the task completes
    successfully and variables are set as expected.  This will not work for my scenario however as I need to dynamically build a string spanning multiple resultsets to build one of the variable values.
    "Select atest_var1=name, atest_var2='static'
    From sys.databases
    Where name = 'master'
    I have a sample package which can reproduce this issue using the above code.  You can get to that through the post on www.sqlservercentral.com/Forums/Topic1582670-364-1.aspx
    Scott

    Arthur,  the query when executed doesn't return a null value for the @dynamicSQL variable.  It returns "master" as a string value.  Even the following fails which implements that suggestion:
    Declare @dynamicSQL as nvarchar(max)
    Select @dynamicSQL = name
    From master.sys.databases 
    Where name = 'master' -- (or any other DB name)
    I believe I have found the cause of the issue.  It is datatype and size related.  The above script will properly set the variables in the resultset as long as you don't use nvarchar(max) or varchar(max).  This makes the maximum data size for
    a String variable 4000 characters whether unicode or non-unicode typed.

  • Bizarre CFIF issue with dynamic form variables? Very strange...

    I can't figure out what I'm doing wrong here.  Here's my code.  Issue explained below.
                <cfquery name="reviewconfigloader" datasource="MOLMS">
                SELECT *
                FROM dbo.BaseModel
                WHERE dbo.BaseModel.AccountID = #molmsAccountID# AND.dbo.BaseModel.basemodelActive = 1
                </cfquery>
          <table width="100%" border="0" cellspacing="0" cellpadding="3">
            <cfloop query="reviewconfigloader"><cfif isdefined("form.baseconfig#reviewconfigloader.basemodelID#") AND ("form.baseconfig#reviewconfigloader.basemodelID#") NEQ "" AND ("form.baseconfig#reviewconfigloader.basemodelID#") NEQ 0><cfoutput><tr>
              <td width="40%" bgcolor="##F7F7F7" class="basemodelsub">     #form['baseconfig#reviewconfigloader.basemodelID#']#  #reviewconfigloader.basemodelName# #reviewconfigloader.basemodelSubName#</td>
              <td width="15%" bgcolor="##F7F7F7" class="basemodelsub"><div align="center">x 14 </div></td>
              <td width="15%" bgcolor="##F7F7F7" class="basemodelsub"><div align="center">$486/yr</div></td>
              <td width="15%" bgcolor="##F7F7F7" class="basemodelsub"><div align="center">$1444/yr</div></td>
              <td width="15%" bgcolor="##F7F7F7" class="basemodelsub"><div align="center">$1444/3 yr</div></td>
            </tr></cfoutput></cfif></cfloop>
          </table>
    What I'm doing here is fairly basic.I'm running a query with a number of configs in it...and then creating a loop to output them.  Ultimately, I only want the configurations that didnt have 0 submitted in the form on the previous page.  Each one of the configs in the config query has a dynamic form variable on the previous page with a quantity tied to it.  I am trying to eliminate all quantities past that aren't 0 (or not eliminate, just not show)...as you can see from the cfif statement.
    Here's where it gets weird.  You'll notice I output #form['baseconfig#reviewconfigloader.basemodelID#']#, just for testing, which shows me the quantity as it should.  I ran a test and put in a couple of 1s, 0s, 12s, 6s, etc in the form fields on the previous page.  If this thing worked, it wouldnt show anything for any of the records with their basemodelID value being submitted as 0.  Not the case.  It shows all records.  What is more hilarious is that it outputs perfectly in my test #form['baseconfig#reviewconfigloader.basemodelID#']#, showing the correct numbers entered in the previous form, the 1s, the 0s, etc, tied to each record.  But for whatever reason, the cfif code isn't catching it.
    What's even more bizarre...I replaced the cfif ("form.baseconfig#reviewconfigloader.basemodelID#") NEQ 0 with GT 12 (12 was the highest number that I put in the form) and it still showed all records.  Then I put it in as LT 12 and it showed nothing.  I decided  to take it one step further and put it in for GT 1231243242343 (random massive number), which it still showed all of the records.  So somehow, my CFIF statement thinks that  ("form.baseconfig#reviewconfigloader.basemodelID#") is a incredibly large number, although when I output it in the row below, it is the number it should be.
    I'm stumped.  Any ideas?  Thanks in advance!!

    Hey Dan...thanks....unfortunately...with the cfif testing, thats kinda what I'm
    doing because I dont have an "expected" value.  My expected value is anything a user inputs thats greater than zero, hence NEQ 0 and NEQ "". The real problem is taht what I'm outputting works and what the cfif clause is seeing is obviously very different.
    As far as your comment about looping out the variables and then setting a query equal to the value in a cfquery, remember...these are form objects and therefore nothing can be tied back to the database.  The result from the code is establishing a form variable (example.... form.basemodel1 (if 1 was the basemodelID from the database query) so it can capture whatever data the user has passed from the previous page in a text input.  So that input could have been 23, it could have been 1053.
    So really the only way to do it is create a query and loop out the variables.... and attach them to form objects (basemodel1, basemodel2, basemodel3 etc where the 1,2 and 3 are the unique ID's for those models in the database), and then look for where those form objects may have been filled in in the previous page by stating IF this form object not equal to 0 or "", output the data.
    Does that make sense?  Thanks for the help guys I'm completely stumped by this.  I've done this a million times with CFIF and I'm really struggling with why this isnt working....
    JE    

  • Acces dynamic configuration variable (e.g. filename) in ABAP mapping class

    Hi experts
    I am searching for a possibility to acces a dynamic configuration variable (DCV) in an ABAP mapping class. Since I could not find a solution in SDN and other sources, I hope somebody in this forum can help me.
    What I already found is the following code which can be used to set a DCV, but what I would be interested in is how to read a DCV.
    Any help is appreciated.
    Markus
    METHOD if_mapping~execute.
    DATA l_record type mpp_dynamic.
    * copy payload
    result = source.
    * add an adapter specific attribute
    l_record-namespace = 'http://sap.com/xi/XI/System/File'.
    l_record-name = 'FileName'.
    l_record-value = 'test.xml'.
    dynamic_configuration->add_record( l_record ).
    ENDMETHOD.

    Hi Markus,
    you can find everything in my blogs
    /people/michal.krawczyk2/blog/2007/04/26/xipi-throwing-generic-exceptions-from-any-type-of-mapping
    Regards,
    michal

  • User Variable Options: How can I use them in a Business Rule?

    How can I use a "User Variable" set in File / Preferences in a Business Rule? It doesn't seem to appear as an Essbase Substitution Variable or as a Global Variable of Business Rules. The only way I know how to use it is to place the dimension on the POV or Page dimension of a data form, then use a Global Variable in a run time prompt to pick the member and run a BR against it, or some function of it.
    What do I do if I want to have that dimension in Columns or Rows? How can I set a BR to directly reference the member chosen under User Variable Options?
    J

    Thanks Alp, but I can't seem to reproduce what you are writing below. I want to refer my Business Rule to address the value set in File / Preferences / User Variable Options; no matter what members I show elsewhere in the data form.
    My other workaround is through a run time prompt and hope the user selects the appropriate user variable at the very bottom of the selection list in order to calculate the appropriate list of members.
    J

  • Display selection of user variables later on in project - can't get advanced action to work

    Hi all,
    I'm working on a sales training with Captivate 5, based on PPT. I want to do the following, but can't figure out how to design the advanced actions to do it:
    The learner is asked to choose 1 of 3 products he wants to work with (ok, that's easy).
    For that product he's asked to provide 10 features in TEBs (so far so good, 10 user variables created for each feature).
    As a next step, he needs to choose the top 3 features with which he wants to work further. The chosen 3 display a check mark when the respective clickbox is clicked, when he chooses the 3rd, a 'done' button & a caption 'click here...' appear. Advanced actions working ok, see below what they look like. If there's an easier way to do that, please let me know - took me hours to get this to work!
    One issue I face is, that I don't know how I could allow the user to change his choice, i.e. 'un-check'. Currently, checked is checked - no way for the learner to change his mind.
    But even more importantly:
    I need to display the content of the 3 checked/selected variables at a later stage in the project. So, say the learner choses feature 2, 3 & 6 as the most important by checking the respective clickboxes behind the displayed variables (v_neo_f1 to f10) - how do I need to change my advanced action, so that I can generate variables v_neo_chosen1 - 3?
    As you see in the screenshots above, I've tried to do that by creating an additional variable for each of the 10 features and assigning the value 1 when it's checked. That way I could check later in the project, which of those variables has the value 1 - but I don't know how to link this variable (v_neo_f1_check) then to the variable for the feature in which the text I need to display is stored (v_neo_f1).
    This got me a major headache & hours of frustration already - can any of the guru's help me out here?
    If anybody is interesting in creating the necessary actions for me at a reasonable rate, please let me know. I'm bordering desperation.
    Happy new year,
    Anja

    I'm not sure I fully followed exactly what you are trying to do, but essentially what I got from your post is that its pretty complicated and you want to create new variables on the fly.
    For that sort of thing I would suggest that advanced actions may not be advanced enough for what you are trying to achieve and that you should go for a Flash Widget instead.
    For anybody getting started on widgets, I throughourly recommend the Widget Factory by the Widget King, which can be found at:
    http://www.infosemantics.com.au/widgetking/
    I also strongly recommend the following video:
    http://www.adobe.com/cfusion/event/index.cfm?event=register_no_session&id=1719643&loc=en_u s
    Alternatively, as Lilybiri suggests, there may already exist a widget that does what you want it to do.

  • What are the User Exits for Sales Order creation process?

    Hi,
    what are the User Exits for Sales Order creation process? how can I find them?
    thanks in advance,
    will reward,
    Mindaugas

    Please check this info:
    User Exits In Sales Document Processing
    This IMG step describes additional installation-specific processing in sales document processing. In particular, the required INCLUDES and user exits are described.
    Involved program components
    System modifications for sales document processing affect different areas. Depending on the modification, you make the changes in the program components provided:
    MV45ATZZ
    For entering metadata for sales document processing. User-specific metadata must start with "ZZ".
    MV45AOZZ
    For entering additional installation-specific modules for sales document processing which are called up by the screen and run under PBO (Process Before Output) prior to output of the screen. The modules must start with "ZZ".
    MV45AIZZ
    For entering additional installation-specific modules for sales document processing. These are called up by the screen and run under PAI (Process After Input) after data input (for example, data validation). The modules must start with "ZZ".
    MV45AFZZ and MV45EFZ1
    For entering installation-specific FORM routines and for using user exits, which may be required and can be used if necessary. These program components are called up by the modules in MV45AOZZ or MV45AIZZ.
    User exits in the program MV45AFZZ
    The user exits which you can use for modifications in sales document processing are listed below.
    USEREXIT_DELETE_DOCUMENT
    This user exit can be used for deleting data which was stored in a separate table during sales document creation, for example, if the sales document is deleted.
    For example, if an additional table is filled with the name of the person in charge (ERNAM) during order entry, this data can also be deleted after the sales order has been deleted.
    The user exit is called up at the end of the FORM routine BELEG_LOESCHEN shortly before the routine BELEG_SICHERN.
    USEREXIT_FIELD_MODIFICATION
    This user exit can be used to modify the attributes of the screen fields.
    To do this, the screen fields are allocated to so-called modification groups 1 - 4 and can be edited together during a modification in ABAP. If a field has no field name, it cannot be allocated to a group.
    The usage of the field groups (modification group 1-4) is as follows:
    Modification group 1: Automatic modification with transaction MFAW
    Modification group 2: It contains 'LOO' for step loop fields
    Modification group 3: For modifications which depend on check tables or on other fixed information
    Modification group 4: is not used
    The FORM routine is called up for every field of a screen. If you require changes to be made, you must make them in this user exit.
    This FORM routine is called up by the module FELDAUSWAHL.
    See the Screen Painter manual for further information on structuring the interface.
    USEREXIT_MOVE_FIELD_TO_VBAK
    Use this user exit to assign values to new fields at sales document header level. It is described in the section "Transfer of the customer master fields into the sales document".
    The user exit is called up at the end of the FORM routine VBAK_FUELLEN.
    USEREXIT_MOVE_FIELD_TO_VBAP
    Use this user exit to assign values to new fields at sales document item level. It is described in the section "Copy customer master fields into the sales document".
    The user exit is called up at the end of the FORM routine VBAP_FUELLEN.
    USEREXIT_MOVE_FIELD_TO_VBEP
    Use this user exit to assign values to new fields at the level of the sales document schedule lines.
    The user exit is called up at the end of the FORM routine VBEP_FUELLEN.
    USEREXIT_MOVE_FIELD_TO_VBKD
    Use this user exit to assign values to new fields for business data of the sales document. It is described in the section "Copy customer master fields into sales document".
    The user exit is called up at the end of the FORM routine VBKD_FUELLEN.
    USEREXIT_NUMBER_RANGE
    Use this user exit to define the number ranges for internal document number assignment depending on the required fields. For example, if you want to define the number range depending on the sales organization (VKORG) or on the selling company (VKBUR), use this user exit.
    The user exit is called up in the FORM routine BELEG_SICHERN.
    USEREXIT_PRICING_PREPARE_TKOMK
    Use this user exit if you want to include and assign a value to an additional header field in the communication structure KOMK taken as a basis for pricing.
    USEREXIT_PRICING_PREPARE_TKOMP
    Use this user exit if you want to include or assign a value to an additional item field in the communication structure KOMP taken as a basis for pricing.
    USEREXIT_READ_DOCUMENT
    You use this user exit if further additional tables are to be read when importing TA01 or TA02.
    The user exit is called up at the end of the FORM routine BELEG_LESEN.
    USEREXIT_SAVE_DOCUMENT
    Use this user exit to fill user-specific statistics update tables.
    The user exit is called up by the FORM routine BELEG-SICHERN before the COMMIT command.
    Note
    If a standard field is changed, the field r185d-dataloss is set to X. The system queries this indicator at the beginning of the safety routine. This is why this indicator must also be set during the maintenance of user-specific tables that are also to be saved.
    USEREXIT_SAVE_DOCUMENT_PREPARE
    Use this user exit to make certain changes or checks immediately before saving a document. It is the last possibility for changing or checking a document before posting.
    The user exit is carried out at the beginning of the FORM routine BELEG_SICHERN.
    User exits in the program MV45AFZA
    USEREXIT_MOVE_FIELD_TO_KOMKD
    Use this user exit to include or assign values to additional header fields in the communication structure KOMKD taken as a basis for the material determination. This is described in detail in the section "New fields for material determination".
    USEREXIT_MOVE_FIELD_TO_KOMPD
    Use this user exit to include or assign values to additional item fields in the communication structure KOMPD taken as a basis for the material determination. This is described in detail in the section "New fields for material determination".
    USEREXIT_MOVE_FIELD_TO_KOMKG
    Use this user exit to include or assign values to additional fields in the communication structure KOMKG taken as a basis for material determination and material listing. This is described in detail in the section "New fields for listing/exclusion".
    USEREXIT_MOVE_FIELD_TO_KOMPG
    Use this user exit to include or assign values to additional fields in the communication structure KOMPG taken as a basis for material determination and material listung. This is described in detail in the section "New fields for listing/exclusion".
    USEREXIT_REFRESH_DOCUMENT
    With this user exit, you can reset certain customer-specific fields as soon as processing of a sales document is finished and before the following document is edited.
    For example, if the credit limit of the sold-to party is read during document processing, in each case it must be reset again before processing the next document so that the credit limit is not used for the sold-to party of the following document.
    The user exit is executed when a document is saved if you leave the processing of a document with F3 or F15.
    The user exit is called up at the end of the FORM routine BELEG_INITIALISIEREN.
    User-Exits in program MV45AFZB
    USEREXIT_CHECK_XVBAP_FOR_DELET
    In this user exit, you can enter additional data for deletion of an item. If the criteria are met, the item is not deleted (unlike in the standard system).
    USEREXIT_CHECK_XVBEP_FOR_DELET
    In this user exit, you can enter additional data for deletion of a schedule line. If the criteria are met, the schedule line is not deleted (unlike in the standard system).
    USEREXIT_CHECK_VBAK
    This user exit can be used to carry out additional checks (e.g. for completion) in the document header. The system could, for example, check whether certain shipping conditions are allowed for a particular customer group.
    USEREXIT_CHECK_VBAP
    This user exit can be used to carry out additional checks (e.g. for completion) at item level.
    USEREXIT_CHECK_VBKD
    The user exit can be used to carry out additional checks (e.g. for completion) on the business data in the order.
    USEREXIT_CHECK_VBEP
    This user exit can be use to carry out additional checks (e.g. for completion) on the schedule line. During BOM explosion, for example, you may want certain fields to be copied from the main item to the sub-items (as for billing block in the standard system).
    USEREXIT_CHECK_VBSN
    You can use this user exit to carry out additional checks (e.g. for completion) on the serial number.
    USEREXIT_CHECK_XVBSN_FOR_DELET In this user exit, you can enter additional criteria for deletion of the serial number. If the criteria are met, the serial number is not deleted (unlike in the standard system).
    USEREXIT_FILL_VBAP_FROM_HVBAP
    You can use this user exit to fill additional fields in the sub-item with data from the main item.
    USEREXIT_MOVE_FIELD_TO_TVCOM_H
    You can use this user exit to influence text determination for header texts. For example, you can include new fields for text determination or fill fields that already exist with a new value.
    USEREXIT_MOVE_FIELD_TO_TVCOM_I
    You can use this user exit to influence text determination for item texts. For example, you can include new fields for text determination or fill fields that already exist with a new value.
    User-Exits for product allocation:
    The following user exits all apply to structure COBL, in which the data for account determination is copied to item level.
    USEREXIT_MOVE_FIELD_TO_COBL
    Option to include new fields in structure COBL.
    USEREXIT_COBL_RECEIVE_VBAK
    Option to assign values from the document header to the new fields.
    USEREXIT_COBL_RECEIVE_VBAP
    Option to supply values from the item to the new fields.
    USEREXIT_COBL_SEND_ITEM
    A changed field can be copied from the structure into the item. You could use the user exit to display a certain field in the account assignment block (see also MV45AFZB).
    USEREXIT_COBL_SEND_HEADER
    A changed field can be copied from the structure to the header (see source text MV45AFZB)
    USEREXIT_SOURCE_DETERMINATION
    You can use this user exit to determine which plant will be used for the delivery. In the standard system, the delivering plant is copied from the customer master or the customer-material info record. If you want to use a different rule, then you must enter it in this user exit.
    USEREXIT_MOVE_FIELD_TO_ME_REQ
    With this user exit you can include additional fields for the following fields:
    EBAN (purchase requisition)
    EBKN (purchase requisition-account assignment)
    USEREXIT_GET_FIELD_FROM_SDCOM
    Option to include new fields for the variant configuration. Fields that are included in structure SDCOM can be processed and then returned to the order.
    USEREXIT_MOVE_WORKAREA_TO_SDWA
    You can use this user exit to format additional work areas for the variant configuration. You will find notes on the user exit in MV45AFZB.
    User-Exits for first data transfer:
    The following user exits can only be used for the first data transfer.
    Note
    Only use the user exits if the names/fields do NOT have the same name.
    USEREXIT_MOVE_FIELD_TO_VBAKKOM
    Option to include additional fields in structure VBAKKOM (communiction fields for maintaining the sales document header)
    USEREXIT_MOVE_FIELD_TO_VBAPKOM
    Option to include additional fields in structure VBAPKOM (communication fields for maintaining a sales item)
    USEREXIT_MOVE_FIELD_TO_VBEPKOM
    Option to include additional fields in structure VBEPKOM (communication fields for maintaining a sales document schedule line)
    USEREXIT_MOVE_FIELD_TO_VBSN
    You can use this user exit to include fields in structure VBSN (scheduling agreement-related change status).
    USEREXIT_MOVE_FIELD_TO_KOMKH
    You can use this user exit to include new fields for batch determination (document header).
    USEREXIT_MOVE_FIELD_TO_KOMPH
    You can use this user exit to include new fields for batch determination (document item).
    USEREXIT_CUST_MATERIAL_READ
    You can use this user exit to set another customer number in the customer material info record (e.g. with a customer hierarchy)
    USEREXIT_NEW_PRICING_VBAP
    Option for entry of preconditions for carrying out pricing again (e.g. changes made to a certain item field could be used as the precondition for pricing to be carried out again). Further information in MV45AFZB.
    USEREXIT_NEW_PRICING_VBKD
    Option for entry of preconditions for carrying out pricing again (e.g. changes to the customer group or price group could be set as the preconditions for the system to carry out pricing again). Further information in MV45AFZB.
    User-Exits in Program MV45AFZD
    USEREXIT_CONFIG_DATE_EXPLOSION
    The BOM is exploded in the order with the entry date. You can use this user exit to determine which data should be used to explode the BOM (explosion with required delivery date, for example).
    User exits in the program FV45EFZ1
    USEREXIT_CHANGE_SALES_ORDER
    In the standard SAP R/3 System, the quantity and confirmed date of the sales document schedule line is changed automatically if a purchase requisition is allocated, and it or the sales document is changed (for example, quantity, date).
    If you want to change this configuration in the standard system, you can define certain requirements in order to protect your sales orders from being changed automatically. Use this user exit for this purpose. Decide at this point whether the schedule lines are to be changed.
    User-Exits in Program RV45PFZA
    USEREXIT_SET_STATUS_VBUK
    In this user exit you can you can store a specification for the reserve fields in VBUK (header status). Reserve field UVK01 could, for example, be used for an additional order status (as for rejections status, etc.).
    The following workareas are available for this user exit:
    VBUK (header status)
    FXVBUP (item status)
    FXVBUV (Incompletion)
    USEREXIT_SET_STATUS_VBUP
    In this user exit you can you can store a specification for the reserve fields for VBUP (item status).
    The following workareas are available for this user exit:
    FXVBAP (Item data)
    FXVBAPF (Dynamic part of order item flow)
    FXVBUV (Incompletion)
    USEREXIT_STATUS_VBUK_INVOICE
    You can use this user exit to influence billing status at header level.
    User exits in the screens
    Additional header data is on screen SAPMV45A 0309, additional item data on screen SAPMV45A 0459. These screens contain the Include screens SAPMV45A 8309 or SAPMV45A 8459 as user exits.
    Fields which are also to be included in the sales document for a specific installation should be included on the Include screens for maintaining. If an application-specific check module is needed for the fields, this can be included in the Include MV45AIZZ. The module is called up in the processing logic of the Include screens.
    For field transports, you do not have to make changes or adjustments.
    Example
    A new field, VBAK-ZZKUN, should be included in table VBAK.
    If the check is defined via the Dictionary (fixed values or check table) the field must be included with the fullscreen editor in the Include screen SAPMV45A 8309. In this case, no change has to be made to the processing logic.
    User Exits in Program MV45AFZ4
    USEREXIT_MOVE_FIELD_TO_KOMK
    You can use this user exit to add or edit additional header fields in the communication structure - KOMK- for free goods determination. For more information, see the New Fields for Free Goods Determination IMG activity.
    USEREXIT_MOVE_FIELD_TO_KOMP
    You can use this user exit to add or edit additional item fields in the communication structure KOMP for free goods determination. For more information see the New Fields for Free Goods Determination IMG activity.
    User Exits in the SAPFV45PF0E and SAPFV45PF0C Programs
    EXIT_SAPFV45P_001
    You can use this user exit to decide whether intercompany billing data is used in the profitability segment for cross-company code sales, or whether the data comes from external billing (external customer, sales data from the selling company code.
    Regards
    Eswar

  • Help needed, Createing Dynamic User input

    Hello,
    I am attempting to create some dynamic user input by "predicting" what the user requires in a text box.
    For example if the user enters "Smi" I have a select list pop up which gives the user all options that begin with "Smi".
    I am able to achieve the popups but the interface is quite jerky and not terribly responsive I am trying to solve this by using a thread which starts and stops when new input is received but it is still not quite right.
    The program uses a Sorted TreeSet to hold the data (I thought this would give me a quick search time) and a simple interface at this stage.
    Any help would be fantastic
    Thanks in advance :P
    import java.io.*;
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import javax.swing.event.*;
    import java.text.*;
    import java.util.*;
       /** This program represents part of a larger user interface for allowing the
       user to select data from a file or database.
       <p>
       When the program starts up, it will read in data from a given file, and hold
       it in some type of container allowing rapid access.
       <p>
       The user may then type in the first few letters of the surname of a person,
       and this program should immediately present in a popup dialog the names which
       match.  The user will be able to click on one of the names in the popup and
       that will cause all data about that person to be displayed in the JTextArea
       at the bottom of the window.
       <p>
       This program requires the FormLayout.class, FormLayout$Placement.class, and
       FormLayout$Constraint.class files in the same directory
       (folder) or in its classpath.  These is provided separately.
    class PartMatch extends JFrame implements Runnable
                        /** Close down the program. */
       JButton quitbtn;
                        /** Field for the surname. */
       JTextField namefld;
                        /** Full details of the person(s). */
       JTextArea  results;
                        /** Popup dialog to display the names and addresses which
                        match the leading characters given in namefld. */
       Chooser matches;
                      /** Default background color for a window. */
       final static  Color            defBackground = new Color(0xD0C0C0);
                      /** Default foreground color for a window. */
       final static  Color            defForeground = new Color(0x000000);
                      /** Default background color for a field */
       final static  Color            fldBackground = new Color(0xFFFFFF);
                      /** Default background color for a button */
       final static  Color            btnBackground = new Color(0xF0E0E0);
       final static  Color            dkBackground = new Color(0xB0A0A0);
                      /** Larger font */
       final static  Font bold = new Font("Helvetica", Font.BOLD, 30);
       TreeSet members;
       String input;
       String[] found;
       public static void main(String arg[])
          UIManager.put("TextField.background",fldBackground);
          UIManager.put("TextField.foreground",defForeground);
          UIManager.put("TextField.selectionBackground",btnBackground);
          UIManager.put("TextArea.background",fldBackground);
          UIManager.put("TextArea.foreground",defForeground);
          UIManager.put("TextArea.selectionBackground",btnBackground);
          UIManager.put("Panel.background",defBackground);
          UIManager.put("Label.background",defBackground);
          UIManager.put("Label.foreground",defForeground);
          UIManager.put("Button.background",btnBackground);
          UIManager.put("Button.foreground",defForeground);
          UIManager.put("CheckBox.background",defBackground);
          UIManager.put("ScrollBar.background",defBackground);
          UIManager.put("ScrollBar.thumb",btnBackground);
          UIManager.put("ComboBox.background",btnBackground);
          UIManager.put("ComboBox.selectionBackground",dkBackground);
          PartMatch trial = new PartMatch(arg);
       public PartMatch( String [] arg )
          super("Part Match");
          setDefaultCloseOperation(EXIT_ON_CLOSE);
          Container cpane = getContentPane();
          FormLayout form = new FormLayout(cpane);
          JLabel lab1 = new JLabel("Fetch details") ;
          lab1.setFont( bold );
          form.setTopAnchor( lab1, 4 );
          form.setLeftAnchor( lab1, 4 );
          JLabel lab2 = new JLabel("Surname: ") ;
          form.setTopRelative( lab2, lab1, 4 );
          form.setLeftAlign( lab2, lab1 );
          namefld = new JTextField( 30 );
          form.setBottomAlign( namefld, lab2 );
          form.setLeftRelative( namefld, lab2, 4 );
          namefld.addCaretListener( new CaretListener()
             public void caretUpdate(CaretEvent e)
                 showMatches();
          quitbtn = new JButton( "Quit" );
          quitbtn.addActionListener( new ActionListener()
             public void actionPerformed(ActionEvent e)
                quitProcessing();
          form.setBottomAlign( quitbtn, namefld );
          form.setLeftRelative( quitbtn, namefld, 15 );
          results = new JTextArea( 10,50 );
          results.setEditable(false);
          JScrollPane jsp = new JScrollPane( results,
                                     JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
                                     JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED );
          form.setTopRelative( jsp, lab2, 6 );
          form.setLeftAlign( jsp, lab2 );
          form.setBottomAnchor( jsp, 5 );
          form.setRightAnchor( jsp, 5 );
          form.setRightAnchor( quitbtn, 5 );
          matches = new Chooser( this );
          //matches.setUndecorated(true);
          pack();
          setVisible(true);
          namefld.requestFocus();
          if (arg.length > 0) init(arg[0]);
          else init("triathlon.txt"); //<<<<<<<<<<<<<<<< Place the default filename here
          /** Called once only, at the end of the constructor, to read the data
            * from the membership file.
       public void init( String fname )
          members = new TreeSet();
           try {
               FileReader fr = new FileReader(new File (fname));
               Scanner scan = new Scanner(fr);
               trimember cmem;
               String cLine, eTag, memberNo, first, last, gender, yob, tel ,addr,
                       club;
               while(scan.hasNextLine())
                   cLine = scan.nextLine();
                   Scanner scan2 = new Scanner(cLine);
                   scan2.useDelimiter(";");
                   eTag = scan2.next().trim();
                   memberNo = scan2.next().trim();
                   first = scan2.next().trim();
                   last = scan2.next().trim();
                   gender = scan2.next().trim();
                   yob = scan2.next().trim();
                   tel = scan2.next().trim();
                   addr = scan2.next().trim();
                   club = scan2.next().trim();
                   cmem = new trimember(eTag, memberNo, first, last, gender, yob,
                           tel, addr, club);
                   members.add(cmem);
           catch (FileNotFoundException ex)
               results.append("Sorry can't find the input file\n");
               results.append("Please check file name and location and try again");
               ex.printStackTrace();
          /** Called every time there is a change in the contents of the text field
            * namefld.  It will first clear the text area.  It then needs to search
            * through the container of data to find all records where the surname
            * starts with the characters that have been typed.  The names and
            * addresses need to be set up as strings and placed in
            * an array of Strings.  This can be placed in the "matches" window and
            * displayed for the user, inviting one to be selected.
            * <p>
            * The performance of this is very important.  If necessary, it may be
            * necessary to run as a separate thread so that the user interface is
            * not delayed.  It is essential that the user be able to type letters at a
            * reasonable speed and not have the keystroke processing held up by
            * previous text.
       public void showMatches( )
           run();
                // First clear the text area
          //results.setText("");
                // Determine the leading characters of the surname that is wanted
                input = namefld.getText();
                // Locate the data for this name, and display each matching item
                //  in the JTextArea ...
                // Example of how to set the data in the popup dialog
          matches.list.setListData(found);
          matches.pack();   // resize the popup
                // set the location of the popup if it is not currently visible
          if ( ! matches.isVisible())
             Dimension sz = matches.getSize();
             Point mouse = getMousePosition();
             Point framepos = getLocation();
             int x=0, y=0;
             if (mouse == null)
                Point pt = results.getLocation();
                x = pt.x + 20 + framepos.x;
                y = pt.y + 20 + framepos.y;
             else
                x = mouse.x - 2 + framepos.x;
                y = mouse.y - 2 + framepos.y;
             matches.setLocation(x,y);
          matches.setVisible(true);
          namefld.requestFocus();
          /** Perform any final processing before closing down.
       public void quitProcessing( )
          // Any closing work.  Then
          System.exit(0);
        public void run()
            ArrayList<String> foundit = new ArrayList<String>();
            System.out.println(input);
            if(input != null)
            Iterator it = members.iterator();
            while(it.hasNext())
               trimember test = (trimember) it.next();
               if (test.last.startsWith(input))
                   foundit.add(test.last +", "+ test.first);
            found = new String[foundit.size()];
            for(int i=0; i<foundit.size();i++)
                found[i] = foundit.get(i);
         /** A window for displaying names and addresses from the data set which
          match the leading characters in namefld.
          <p>
          This will automatically pop down if the user moves the mouse out of the
          window.
          <p>
          It needs code added to it to respond to the user clicking on an item in
          the displayed list. */
       class Chooser extends JWindow
                /** To display a set of names and addresses that match the leading
                characters of the namefld text field. */
          public JList list = new JList();
          Chooser( JFrame parent )
             super( parent );
             Container cpane = getContentPane();
             cpane.addMouseListener( new MouseAdapter()
                public void mouseExited(MouseEvent e)
                   Chooser.this.setVisible(false);
             cpane.add("Center",list);
             list.addListSelectionListener( new ListSelectionListener()
                public void valueChanged(ListSelectionEvent e)
                   Chooser.this.setVisible(false);
                   System.out.println("ValueChanged");
                   // First clear the text area
                   results.setText("");
                   String in = (String) list.getSelectedValue();
                   System.out.println("Selected Value was : "+in);
                   String[] inlf = in.split(", ");
                   System.out.println("inlf[0]:"+inlf[0]+" inlf[1]:"+inlf[1]);
                   results.append("Surname \tFirst \teTag \tMemberNo \tSex \tYOB " +
                           "\tTel \tAddress \t\t\tClub\n");
                   Iterator it = members.iterator();
                   while(it.hasNext())
                       trimember test = (trimember) it.next();
                       if (test.last.equals(inlf[0])&&test.first.equals(inlf[1]))
                           results.append(test.toString()+"\n");
                   namefld.requestFocus();
          public class trimember implements Comparable
           String eTag;
           public String memberNo;
           public String first;
           public String last;
           String gender;
           String yob;
           String tel;
           String addr;
           String club;
           public trimember(String eT, String me, String fi, String la,
                   String ge, String yo, String te, String ad, String cl)
               eTag = eT;
               memberNo = me;
               first = fi;
               last = la;
               gender = ge;
               yob = yo;
               tel = te;
               addr = ad;
               club = cl;         
           //To String method to output string of details
           public String toString()
               return last + "\t" + first + "\t" + eTag + "\t" +
                       memberNo + "\t" + gender + "\t" + yob + "\t"+ tel + "\t" +
                       addr + "\t" + club;
           //Compare and sort on Last name
           public int compareTo(Object o)
               trimember com = (trimember) o;
               int lastCmp = last.compareTo(com.last);
               int firstCmp = first.compareTo(com.first);
               int memCmp = memberNo.compareTo(com.memberNo);
               if (lastCmp == 0 && firstCmp !=0)return firstCmp;
               else if (lastCmp==0&&firstCmp==0)return memCmp;
               else return lastCmp;
    }

    Please don't cross-post. It is considered very rude to do that here:
    http://forum.java.sun.com/thread.jspa?messageID=9953193

  • Help needed, Providing Dynamic User input

    Hello,
    I am attempting to create some dynamic user input by "predicting" what the user requires in a text box.
    For example if the user enters "Smi" I have a select list pop up which gives the user all options that begin with "Smi".
    I am able to achieve the popups but the interface is quite jerky and not terribly responsive I am trying to solve this by using a thread which starts and stops when new input is received but it is still not quite right.
    The program uses a Sorted TreeSet to hold the data (I thought this would give me a quick search time) and a simple interface at this stage.
    Any help would be fantastic
    Thanks in advance :P
    import java.io.*;
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import javax.swing.event.*;
    import java.text.*;
    import java.util.*;
       /** This program represents part of a larger user interface for allowing the
       user to select data from a file or database.
       <p>
       When the program starts up, it will read in data from a given file, and hold
       it in some type of container allowing rapid access.
       <p>
       The user may then type in the first few letters of the surname of a person,
       and this program should immediately present in a popup dialog the names which
       match.  The user will be able to click on one of the names in the popup and
       that will cause all data about that person to be displayed in the JTextArea
       at the bottom of the window.
       <p>
       This program requires the FormLayout.class, FormLayout$Placement.class, and
       FormLayout$Constraint.class files in the same directory
       (folder) or in its classpath.  These is provided separately.
    class PartMatch extends JFrame implements Runnable
                        /** Close down the program. */
       JButton quitbtn;
                        /** Field for the surname. */
       JTextField namefld;
                        /** Full details of the person(s). */
       JTextArea  results;
                        /** Popup dialog to display the names and addresses which
                        match the leading characters given in namefld. */
       Chooser matches;
                      /** Default background color for a window. */
       final static  Color            defBackground = new Color(0xD0C0C0);
                      /** Default foreground color for a window. */
       final static  Color            defForeground = new Color(0x000000);
                      /** Default background color for a field */
       final static  Color            fldBackground = new Color(0xFFFFFF);
                      /** Default background color for a button */
       final static  Color            btnBackground = new Color(0xF0E0E0);
       final static  Color            dkBackground = new Color(0xB0A0A0);
                      /** Larger font */
       final static  Font bold = new Font("Helvetica", Font.BOLD, 30);
       TreeSet members;
       String input;
       String[] found;
       public static void main(String arg[])
          UIManager.put("TextField.background",fldBackground);
          UIManager.put("TextField.foreground",defForeground);
          UIManager.put("TextField.selectionBackground",btnBackground);
          UIManager.put("TextArea.background",fldBackground);
          UIManager.put("TextArea.foreground",defForeground);
          UIManager.put("TextArea.selectionBackground",btnBackground);
          UIManager.put("Panel.background",defBackground);
          UIManager.put("Label.background",defBackground);
          UIManager.put("Label.foreground",defForeground);
          UIManager.put("Button.background",btnBackground);
          UIManager.put("Button.foreground",defForeground);
          UIManager.put("CheckBox.background",defBackground);
          UIManager.put("ScrollBar.background",defBackground);
          UIManager.put("ScrollBar.thumb",btnBackground);
          UIManager.put("ComboBox.background",btnBackground);
          UIManager.put("ComboBox.selectionBackground",dkBackground);
          PartMatch trial = new PartMatch(arg);
       public PartMatch( String [] arg )
          super("Part Match");
          setDefaultCloseOperation(EXIT_ON_CLOSE);
          Container cpane = getContentPane();
          FormLayout form = new FormLayout(cpane);
          JLabel lab1 = new JLabel("Fetch details") ;
          lab1.setFont( bold );
          form.setTopAnchor( lab1, 4 );
          form.setLeftAnchor( lab1, 4 );
          JLabel lab2 = new JLabel("Surname: ") ;
          form.setTopRelative( lab2, lab1, 4 );
          form.setLeftAlign( lab2, lab1 );
          namefld = new JTextField( 30 );
          form.setBottomAlign( namefld, lab2 );
          form.setLeftRelative( namefld, lab2, 4 );
          namefld.addCaretListener( new CaretListener()
             public void caretUpdate(CaretEvent e)
                 showMatches();
          quitbtn = new JButton( "Quit" );
          quitbtn.addActionListener( new ActionListener()
             public void actionPerformed(ActionEvent e)
                quitProcessing();
          form.setBottomAlign( quitbtn, namefld );
          form.setLeftRelative( quitbtn, namefld, 15 );
          results = new JTextArea( 10,50 );
          results.setEditable(false);
          JScrollPane jsp = new JScrollPane( results,
                                     JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
                                     JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED );
          form.setTopRelative( jsp, lab2, 6 );
          form.setLeftAlign( jsp, lab2 );
          form.setBottomAnchor( jsp, 5 );
          form.setRightAnchor( jsp, 5 );
          form.setRightAnchor( quitbtn, 5 );
          matches = new Chooser( this );
          //matches.setUndecorated(true);
          pack();
          setVisible(true);
          namefld.requestFocus();
          if (arg.length > 0) init(arg[0]);
          else init("triathlon.txt"); //<<<<<<<<<<<<<<<< Place the default filename here
          /** Called once only, at the end of the constructor, to read the data
            * from the membership file.
       public void init( String fname )
          members = new TreeSet();
           try {
               FileReader fr = new FileReader(new File (fname));
               Scanner scan = new Scanner(fr);
               trimember cmem;
               String cLine, eTag, memberNo, first, last, gender, yob, tel ,addr,
                       club;
               while(scan.hasNextLine())
                   cLine = scan.nextLine();
                   Scanner scan2 = new Scanner(cLine);
                   scan2.useDelimiter(";");
                   eTag = scan2.next().trim();
                   memberNo = scan2.next().trim();
                   first = scan2.next().trim();
                   last = scan2.next().trim();
                   gender = scan2.next().trim();
                   yob = scan2.next().trim();
                   tel = scan2.next().trim();
                   addr = scan2.next().trim();
                   club = scan2.next().trim();
                   cmem = new trimember(eTag, memberNo, first, last, gender, yob,
                           tel, addr, club);
                   members.add(cmem);
           catch (FileNotFoundException ex)
               results.append("Sorry can't find the input file\n");
               results.append("Please check file name and location and try again");
               ex.printStackTrace();
          /** Called every time there is a change in the contents of the text field
            * namefld.  It will first clear the text area.  It then needs to search
            * through the container of data to find all records where the surname
            * starts with the characters that have been typed.  The names and
            * addresses need to be set up as strings and placed in
            * an array of Strings.  This can be placed in the "matches" window and
            * displayed for the user, inviting one to be selected.
            * <p>
            * The performance of this is very important.  If necessary, it may be
            * necessary to run as a separate thread so that the user interface is
            * not delayed.  It is essential that the user be able to type letters at a
            * reasonable speed and not have the keystroke processing held up by
            * previous text.
       public void showMatches( )
           run();
                // First clear the text area
          //results.setText("");
                // Determine the leading characters of the surname that is wanted
                input = namefld.getText();
                // Locate the data for this name, and display each matching item
                //  in the JTextArea ...
                // Example of how to set the data in the popup dialog
          matches.list.setListData(found);
          matches.pack();   // resize the popup
                // set the location of the popup if it is not currently visible
          if ( ! matches.isVisible())
             Dimension sz = matches.getSize();
             Point mouse = getMousePosition();
             Point framepos = getLocation();
             int x=0, y=0;
             if (mouse == null)
                Point pt = results.getLocation();
                x = pt.x + 20 + framepos.x;
                y = pt.y + 20 + framepos.y;
             else
                x = mouse.x - 2 + framepos.x;
                y = mouse.y - 2 + framepos.y;
             matches.setLocation(x,y);
          matches.setVisible(true);
          namefld.requestFocus();
          /** Perform any final processing before closing down.
       public void quitProcessing( )
          // Any closing work.  Then
          System.exit(0);
        public void run()
            ArrayList<String> foundit = new ArrayList<String>();
            System.out.println(input);
            if(input != null)
            Iterator it = members.iterator();
            while(it.hasNext())
               trimember test = (trimember) it.next();
               if (test.last.startsWith(input))
                   foundit.add(test.last +", "+ test.first);
            found = new String[foundit.size()];
            for(int i=0; i<foundit.size();i++)
                found[i] = foundit.get(i);
         /** A window for displaying names and addresses from the data set which
          match the leading characters in namefld.
          <p>
          This will automatically pop down if the user moves the mouse out of the
          window.
          <p>
          It needs code added to it to respond to the user clicking on an item in
          the displayed list. */
       class Chooser extends JWindow
                /** To display a set of names and addresses that match the leading
                characters of the namefld text field. */
          public JList list = new JList();
          Chooser( JFrame parent )
             super( parent );
             Container cpane = getContentPane();
             cpane.addMouseListener( new MouseAdapter()
                public void mouseExited(MouseEvent e)
                   Chooser.this.setVisible(false);
             cpane.add("Center",list);
             list.addListSelectionListener( new ListSelectionListener()
                public void valueChanged(ListSelectionEvent e)
                   Chooser.this.setVisible(false);
                   System.out.println("ValueChanged");
                   // First clear the text area
                   results.setText("");
                   String in = (String) list.getSelectedValue();
                   System.out.println("Selected Value was : "+in);
                   String[] inlf = in.split(", ");
                   System.out.println("inlf[0]:"+inlf[0]+" inlf[1]:"+inlf[1]);
                   results.append("Surname \tFirst \teTag \tMemberNo \tSex \tYOB " +
                           "\tTel \tAddress \t\t\tClub\n");
                   Iterator it = members.iterator();
                   while(it.hasNext())
                       trimember test = (trimember) it.next();
                       if (test.last.equals(inlf[0])&&test.first.equals(inlf[1]))
                           results.append(test.toString()+"\n");
                   namefld.requestFocus();
          public class trimember implements Comparable
           String eTag;
           public String memberNo;
           public String first;
           public String last;
           String gender;
           String yob;
           String tel;
           String addr;
           String club;
           public trimember(String eT, String me, String fi, String la,
                   String ge, String yo, String te, String ad, String cl)
               eTag = eT;
               memberNo = me;
               first = fi;
               last = la;
               gender = ge;
               yob = yo;
               tel = te;
               addr = ad;
               club = cl;         
           //To String method to output string of details
           public String toString()
               return last + "\t" + first + "\t" + eTag + "\t" +
                       memberNo + "\t" + gender + "\t" + yob + "\t"+ tel + "\t" +
                       addr + "\t" + club;
           //Compare and sort on Last name
           public int compareTo(Object o)
               trimember com = (trimember) o;
               int lastCmp = last.compareTo(com.last);
               int firstCmp = first.compareTo(com.first);
               int memCmp = memberNo.compareTo(com.memberNo);
               if (lastCmp == 0 && firstCmp !=0)return firstCmp;
               else if (lastCmp==0&&firstCmp==0)return memCmp;
               else return lastCmp;
    }Edited by: Roger on Nov 3, 2007 11:50 AM

    Please don't cross-post. It is considered very rude to do that here:
    http://forum.java.sun.com/thread.jspa?threadID=5233033&messageID=9953169#9953169

Maybe you are looking for