How to create dynamic variable in Java?

Hi,
I want to create dynamic varible , using ArrayList or Vector. The number of array i dont knwo, so how to create dynamic ArrayList or Vector.
for example:
ArrayList1,ArrayList2,ArrayList3.....n
or
Vector1,Vector2,Vector3 .....n, the n value i will get at run time, so how to create the dynamic ArrayList or Vector or i can use any other Object in java,
Pls provide your input.
Sridhar

1. I have a HashMap with dataok ... fair enough.
2. depending on its size, i need to create variable
to store them.uhm ... why? If you have a variable number of elements in the map then you'd need to generate a variable number of variables (a number, that is not know at compile time, as it seems). Now if you could somehow create those variables, how would you access them? You'd have to generate the code handling them as well ...
Tell us what kind of data you've got and what you want to do with it. There's certainly a better solution to your problem.
how to generate variables as per content size of the
HashMapYou don't.

Similar Messages

  • How to create dynamic variable in HANA

    Hello experts,
    Please help me on how to create dynamic variable in calculation view.
    Ex:  variable automatically should take YTD, or MTD values so that I can directly consume column in BW on hana or BO reporting.

    Hi ,
    Not sure on what are looking for. Have a look on the below blog once, if this is what you are looking out for:
    Applying YTD in SAP HANA with SAP BO Analysis Office
    Regards,
    Krishna Tangudu

  • How to create dynamic images in java servlets?

    I want to create dynamic images in java servlet. Can servlet create dynamic images that based on the input data files? The results can be displayed in GIF, JPG..format? how can this be done? any example in internet?
    What OS do I need to install and what other requirements needed if i want to build up a servlet server?
    Thanks a lot!

    Also worth having a look at SVG http://www.w3.org/TR/2001/REC-SVG-20010904/, you can get a viewer at http://www.adobe.com/svg/ or you can use Batik http://xml.apache.org/batik/index.html to convert SVG to other formats such as JPEG.
    HH

  • How to create dynamic properties in java

    Hi All
    Let me give a breif intro of what i am tryng to do.......
    I want to write a jsp page where the data would be coming from JDBC.
    I have abt 18 columns in my oracle table.
    Out of which i am only configured 7 fields on my jsp page.
    I want to create a mapping file which would be like this
    field1 = name
    field10= designation
    field2 = company
    field3 = address
    field4 = pincode
    field7 = mobile
    field8 = salaryNow each field has its own validation. Suppose today i want pincodeto be a string and tomarrow i want it to be number
    the validation shd automatically change
    how can i put these values i meant in what data structure shd i store them
    Please give me some ideas
    thanks
    Diana

    how can i put these values i meant in what data structure shd i store themMeta data.
    You create a "structure" of some sort that has data in it like the following. Figure out how to store it (text file, xml, database, whatever) write code to parse the structure and then build an interpreter that constructs the page.
    I am rather certain that frameworks like this already exist, but if you are new to programming then creating your own is instructive.
    --- Definition
    name: <Display name>
    Oracle: <jdbc position> <oracle type> <size>
    Java: <display position> <java type>
    --- Example
    name: name
    Oracle: 1, varchar 10
    Java: 3, String
    name: Salary
    Oracle: 5, numeric 18,2
    Java: 1, double

  • How to create dynamic variables with SSRS report ?

    Hi everyone,
    I want to create one dynamic SSRS report which  can show details when user input data into textbox . Example : Users will input app_id then report will show details of each this id ( name, phone,salary...) .
    Pls help me solve it .
    Many thanks,
    Hong

    Follow below step.
    1. First create a dataset. The select statement or result set must contain (App_id, name, phone,salary...).
    2. Add a report parameter "App ID" with default setting.
    3. Drag dataset fields to a table or tablix. Select the tablix properties. Go to Filter section.
    4. Select the expression as Field App ID, Operator as "=" and Value as Parameter App ID.
    Regards, RSingh

  • How to create dynamic connection string with variables using ssis.

    Hello,
    Can anyone let me know on how to create dynamic connection string with variables using ssis?
    Any help would be appreciated.

    Hi vinay9738,
    According to your description, you want to connect multiple database from multiple servers using dynamic connection.
    If in this case, we can create a Table in our local database (whatever DB we want) and load all the connection strings.  We can use Execute SQL Task to query all the connection strings and store the result-set in a variable of object type in SSIS package.
    Then use ForEach Loop container to shred the content of the object variable and iterate through each of the connection strings. And then Place an Execute SQL task inside ForEach Loop container with the SQL statements we have to run in all the DB instances. 
    For more details, please refer to the following blog:
    http://sql-developers.blogspot.kr/2010/07/dynamic-database-connection-using-ssis.html
    If there are any other questions, please feel free to let me know.
    Regards,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • How to create Dynamic Webi 3.1 filename in Publication

    I have a webi 3.1 report that is being called from a publication used for bursting using the eFashion universe.  I want the file name to be dynamic, based on the profile.  Within the webi report I created a free standing cell that I set to "Western States" or "Eastern States" based on the states in the report at the time of the run (set by the profile).  This works correctly.  But there does not seem to be a way to get the report to use the free standing cell value as part of the report name.  From the publication, properties, destinations, use specific name I can only pick title and document name.  Neither of these is the free standing cell in the report.  I saw that version 4.0 has this ability but I can't upgrade for another year and deski is not an option.  Any suggestions?  Thank you.

    I figured out how to create dynamic report names with 2 fields within the Publication tool.  I padded fullname and  email in dynamic recipients to be the two fields I wanted from the report.  Then in Destinations, File Name:, Use specific name I picked userfullname and email address to create the report name.   But that would not work if I actually needed to use the email address to send the report to.  We don't have Java programmers and may have to find other options.  Thanks.

  • How to create Dynamic Window in Smartforms

    Hi all,
    Could you please help me out on how to create Dynamic Window in smartforms excluding Main Window.
    Thanks in Advance.
    Vinay.

    hi,
    Hi,
    1.If you are creating the Different windows for the Countries,then In conditions tab of window specify the Condition i.e.
    company -code = '2201'.
    2.Then that window can trigger ofr that condition.
    3.Other wise, if you are using the different layouts ,then write the condition in Print program and call that form .
    reward me if helpful.

  • HOW TO CREATE A VARIABLE IN SAP SCRIPT

    HI ALL,
    CAN ANYONE TELL ME HOW TO CREATE A VARIABLE IN SAP SCRIPT.
    THANK YOU,
    BYE
    TAKE CARE.

    Hi Ravi,
    You can use like this
    A text in the editor contains the following DEFINE commands:
    /: DEFINE &mysymbol& = 'xxx xxx xxxxx xxxx'
    &mysymbol&
    /: DEFINE &mysymbol& = 'yyyyy yyy yyyy'
    / &mysymbol&
    The printed text appears

  • How to create a variable in BEx 7.0

    Hi,
    Can anyone please tell me how to create a variable in BEx 7.0
    In 3.5, when we right click on a characteristic, we used to get an option for restrict.
    I cant find any such option in 7.0

    Hi,
    Right click on the characteristic 0CALMONTH in the default values or drag it to char. restriction section and say restrict.Pull the drop down menu in that to select variables. There u will get a create icon.Click on that...then in details tab u can specify whether mandatory,interval and all..
    Regards,
    Rathy

  • How to create dynamic context based on a structure defined in the program?

    Hi Experts,
             I need to create a dynamic context based on a structure wa_struc which i have define programatically.
    When I pass wa_struc to structure_name parameter of create_nodeinfo_from_struc, i get a runtime error:
    "Parameter STRUCTURE_NAME contains an invalid value wa_struc."
    How to create dynamic context based on a structure defined in the program?
    I have written the code like this:
    TYPES: BEGIN OF t_type,
                v_carrid TYPE sflight-carrid,
                v_connid TYPE sflight-connid,
             END OF t_type.
      Data:  i_struc type table of t_type,
             wa_struc type t_type.
      data: dyn_node   type ref to if_wd_context_node.
      data: rootnode_info   type ref to if_wd_context_node_info.
      rootnode_info = wd_context->get_node_info( ).
      clear i_struc. refresh i_struc.
      select carrid connid into corresponding fields of table i_struc from sflight where carrid = 'AA'.
    cl_wd_dynamic_tool=>create_nodeinfo_from_struct(
      parent_info = rootnode_info
      node_name = 'dynflight'
      structure_name = 'wa_struc'
      is_multiple = abap_true ).
    dyn_node = wd_context->get_child_node( name = 'dynflight' ).
    dyn_node->bind_table( i_struc ).
    Thanks
    Gopal
    Message was edited by: gopalkrishna baliga

    Hi Michelle,
              First of all Special thanks for your informative answers to my other forum questions. I really appreciate your help.
    Coming back to this question I am still waiting for an answer. Please help. Note that my structure is not in a dictionary.
    I am trying to create a new node. That is
    CONTEXT
    - DYNFLIGHT
    CARRID
    CONNID
    As you see above I am trying to create 'DYNFLIGHT' along with the 2 attributes which are inside this node. The structure of the node that is, no.of attributes may vary based on some condition. Thats why I am trying to create a node dynamically.
    Also I cannot define the structure in the ABAP dictionary because it changes based on condition
    I have updated my code like the following and I am getting error:
    TYPES: BEGIN OF t_type,
    CARRID TYPE sflight-carrid,
    CONNID TYPE sflight-connid,
    END OF t_type.
    Data: i_struc type table of t_type,
    dyn_node type ref to if_wd_context_node,
    rootnode_info type ref to if_wd_context_node_info,
    i_node_att type wdr_context_attr_info_map,
    wa_node_att type line of wdr_context_attr_info_map.
    wa_node_att-name = 'CARRID'.
    wa_node_att-TYPE_NAME = 'SFLIGHT-CARRID'.
    insert wa_node_att into table i_node_att.
    wa_node_att-name = 'CONNID'.
    wa_node_att-TYPE_NAME = 'SFLIGHT-CONNID'.
    insert wa_node_att into table i_node_att.
    clear i_struc. refresh i_struc.
    select carrid connid into corresponding fields of table i_struc from sflight where carrid = 'AA'.
    rootnode_info = wd_context->get_node_info( ).
    rootnode_info->add_new_child_node( name = 'DYNFLIGHT'
    attributes = i_node_att
    is_multiple = abap_true ).
    dyn_node = wd_context->get_child_node( 'DYNFLIGHT' ).
    dyn_node->bind_table( i_struc ).
    l_ref_interfacecontroller->set_data( dyn_node ).
    But now I am getting the following error :
    The following error text was processed in the system PET : Line types of an internal table and a work area not compatible.
    The error occurred on the application server FMSAP995_PET_02 and in the work process 0 .
    The termination type was: RABAX_STATE
    The ABAP call stack was:
    Method: IF_WD_CONTEXT_NODE~GET_STATIC_ATTRIBUTES_TABLE of program CL_WDR_CONTEXT_NODE_VAL=======CP
    Method: GET_REF_TO_TABLE of program CL_SALV_WD_DATA_TABLE=========CP
    Method: EXECUTE of program CL_SALV_WD_SERVICE_MANAGER====CP
    Method: APPLY_SERVICES of program CL_SALV_BS_RESULT_DATA_TABLE==CP
    Method: REFRESH of program CL_SALV_BS_RESULT_DATA_TABLE==CP
    Method: IF_SALV_WD_COMP_TABLE_DATA~MAP_FROM_SOURCE_DATA of program CL_SALV_WD_C_TABLE_V_TABLE====CP
    Method: IF_SALV_WD_COMP_TABLE_DATA~MAP_FROM_SOURCE of program CL_SALV_WD_C_TABLE_V_TABLE====CP
    Method: IF_SALV_WD_COMP_TABLE_DATA~UPDATE of program CL_SALV_WD_C_TABLE_V_TABLE====CP
    Method: IF_SALV_WD_VIEW~MODIFY of program CL_SALV_WD_C_TABLE_V_TABLE====CP
    Method: IF_SALV_WD_COMPONENT~VIEW_MODIFY of program CL_SALV_WD_A_COMPONENT========CP
    -Gopal
    Message was edited by: gopalkrishna baliga

  • How to create dynamic connection in business view manager.

    Hi Sir,
    Can u explain how to create dynamic connection in business view manager.
    Thanks
    Vishali Raghava Raju

    HI Vaishali,
       Can you please elaborate your requirement ?
    -Regards
    B

  • How to create web services in java?

    Hi,
    I am a newbie to java webservices. Can anybody tell me how to create web services in java?
    Any tutorial link or step by step doc would be useful.
    Appreciate your help in this regard.
    Thanks in advance.
    naymo01.

    Creating web services in Java appears to depend highly upon the server you intend to use.
    Here's a tutorial: http://java.sun.com/webservices/docs/1.6/tutorial/doc/index.html

  • How to create Presentation variable for columns and to use it in Narrative?

    Hi All,
    Anybody know how to create presentation variable for a column (i.e., i need to create it in edit formula section itself). And then, I should use it in Narrative section to display that column value. Is it possible? Or do i need to use any other variable for this requirement? If so please let me know, how to create it? This is very urgent requirement.
    Thanks in Advance
    Thenmozhi

    Hi Satya,
    I just want to create a table that should horizontally display the values like below:
         SUID Tag # :123456               Year Mfg: 2007                                                                                     
         Description: computer corporation FA ID#: 4576
         Model Number: 4569 hESC: #ert
         Serial Number: 78945 Flags: c
    Department: Hematology
    User: thenmozhi
    Database: OLAP
    I think we can create this type of report using either Narrative or Static Text. But I am not sure whether it is possible or not? And also another thing is that sectioning is applied for SUID Tag # column. So, depending on the dashboard prompt if the SUID Tag # retrieves two or more values.
    Then the first value for example 123456     and the values for the other columns related to this SUID Tag # value should display in the first page (i.e., page 1). And if the next value of the SUID Tag # for example say 678901 then the values should move to second page that is like this:
         SUID Tag # :678901               Year Mfg: 2008                                                                                     
         Description: Computer Manufacturing FA ID#: 4577
         Model Number: 4570 hESC: #eth
         Serial Number: 78946 Flags: G
    Department: Hematology
    User: Rehman
    Database: OLAP
    Thanks
    Thenmozhi

  • How to create selection variables on the KF

    Hi,
        i need to create a variable on the CKF and the user is going to give the selections like >90% or <100%  in the variable screen before runing the report.on the report should show the values based on the selection.
    1.how to create the variables on the CKF.
    2. how to restrict the values and give the selections(like >90%,<100%) values in the selections.

    Hi Venkat,
    You can achieve this by the following way:
    1. Create a CKF or a local formula(based on which queries it needs to be used)
    2. Then go to BEX Query Designer -> View -> Conditions
    3. Create New Condition -> select 'New' -> Select your CKF/Local Formula -> Define your Operator ( BT, GT, LT, Top % etc.) -> Create a Formula variable (Ready for input with Processing type as ;manual Input')
    4. DO the char. assignement for the condition with your condition definition
    4. Execute the report with your values.
    This will solve your prob.
    Cheers,
    VA

Maybe you are looking for