Dynamic Variable name (for int/long) from a String variable

Hi,
I want to give a int/long variable name from a String.
for ex.
String str = lookup + "Id";
lookup is a String variable coming from XML. Now, for instance lookup="name". So str = "nameId".
Now I want to create a int/long variable by nameId.
Could anybody tell me the way how to do. Please don't tell to use MAP.
Edited by: Shah on Dec 5, 2007 3:26 PM

Well you can't. Use a Map.
The compiler translates variable names into slot numbers, either within an object or withing the local "stack frame" and these slot numbers are assigned names at compile time. No new slots can be created at run time. Java is not Basic.
Reflection allows you to find existing field names and methods (not local variables), so it's possible to map, for example, XML attribute names to field names or setters in an object but the names have to be known at compile time.

Similar Messages

  • How to find table name for the fields from Standard Extractor in CRM system

    How to find table name of fields from the standard extractor in CRM system ?
    e.g. We use LBWE TCode in R/3 system to find table name for the field from Extractor VCSCL(e.g.).
    Likewise is there any way to find table name for the fields from Standard extractor like 0CRM_LEAD_I.

    Hi ,
    Please find the link below for understanding BW CRM analysis.
    http://help.sap.com/bp_biv135/html/bw.htm
    activate the CRM DSs by scenario:
    1) Activate the application component hierarchy (tcode RSA9). Changes made to the application component hierarchy in the CRM system can be transferred to the BW using the "Edit Application Component Hierarchy" (SBIW - Postprocessing of DataSources).
    SAP Note 434886 must be implemented in CRM 3.0 before the application component hierarchy is activated.
    2) Activate the Business Content DataSources (tcode RSA5).
    Select/enter the application component and choose Execute (F8).
    To compare the shipped and active versions, choose the 'Select Delta' pushbutton. If there is no active version of the DataSource, it is selected automatically.
    To activate the shipped version, choose the 'Transfer DataSources' pushbutton.
    3) Management of the versions of the BW-Adapter metadata (tcode BWA5). All DataSources are displayed that are managed by the BW Adapter.
    As in transaction RSA5 (Service API Metadata Activation), the 'Select Delta' function can be used to select the inactive DataSources or compare shipped and active versions.
    You can also go directly to the screen for maintaining DataSources that are managed by the BW Adapter.
    The 'Compare Version' function makes a detailed comparison of the shipped and active versions.
    All BW-Adapter metadata is considered when versions are compared:
    Header information (Table SMOXHEAD)
    Mapping information (Table SMOXRELP)
    Global selection conditions (Table SMOXGSEL)
    Attribute key fields (Table SMOXAFLD)
    Hope this helps.
    Regards,
    csm reddy

  • Dynamic Internal Table for reading data from external file

    Hello All,
    The task was to create a internal table with dynamic columns,
    Actually this is my first task in the WebAS 6.20, my program is based on input file provided by user with certain effort. this file can have different effort for a one yr to five year frame..
    I needed to read the raw data from file, based on months create a internal table to hold the data, after this i need to validate the data...
    I have browsed thru dynamic internal table topic, but couldn't find any dynamic appending structure, the dynamic structure would contains 12 month fileds.
    can any one help me in getting my task completed..
    Thanks
    Kumar

    Hi,
    I see that you posted the same question a couple of days ago at Dynamic Internal Table for reading data from external file Didn't Charles's response address your problem?
    Regards

  • Escape single quote from a String variable

    Hi,
    I have a String variable called "name" which i am using in my form tag.
    <form name=test action="test.jsp?fname=<%=name%>" method="post">
    But i am getting Javascript error if the "name" variable contains a string with some special characters like single quote( ' ).
    Plz help me to escape this special char from my String variable.
    Thanks..

    You need to url-encode the value using the URLEncoder class.
    http://java.sun.com/javase/6/docs/api/java/net/URLEncoder.html
    For example:
    <form name=test action="test.jsp?fname=<%=URLEncoder.encode(name, "ISO-8859-1")%>" method="post">

  • How to populate an internal table from a string variable

    Hi Experts,
    My internal table contains a field of length 255 characters.
    I have a string variable. I need to populate the internal table from the string variable.
    How should I code for this.
    Thanks,
    Sangeeta.

    Hi Sangeetha,
    <li>Try this way.
    REPORT ztest_notepad.
    DATA: BEGIN OF it_file OCCURS 0,
           data TYPE c LENGTH 255,
          END OF it_file.
    DATA str     TYPE string.
    DATA g_len   TYPE i.
    DATA g_off   TYPE i.
    DATA g_loops TYPE i.
    CONCATENATE
    '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890x'
    '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890y'
    '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890z'
    '12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789m'
    INTO str SEPARATED BY space.
    g_len   = STRLEN( str ).
    g_loops = g_len / 255.
    g_off = 1.
    DO g_loops TIMES.
      IF g_loops NE sy-index.
        IF sy-index EQ 1.
          it_file-data = str+0(255).
        ELSE.
          it_file-data = str+g_off(255).
        ENDIF.
        APPEND it_file.
        CLEAR  it_file.
        g_off = sy-index * 255.
      ELSE.
        g_len = g_len - g_off.
        it_file-data = str+g_off(g_len).
        APPEND it_file.
        CLEAR  it_file.
      ENDIF.
    ENDDO.
    LOOP AT it_file.
      WRITE:/ it_file-data.
    ENDLOOP.
    Thanks
    Venkat.O

  • Building a data flow task, within a foreach loop for dynamic table name, but ole db source not allowing variable

    In my control flow, I set up a variable for the table name, enumerated by SMO, following the instructions from the link here:
    http://www.bidn.com/blogs/mikedavis/ssis/156/using-a-for-each-loop-on-tables-ssis
    Now, I put a data flow task inside the foreach. I selected the OLE DB connection manger for my database, set the Data access mode to "Table name or view name variable", and selected my variable name from the drop down. So far so good. When I click on OK,
    it gives me an error 0x80040E37, basically saying it can't open the rowset for "my variable", Check that the object exists in the database.
    So, I assume I won't be able to do this "that' easily, and I will need to build a "SQL command from variable" or some such thing. Any advice on how to build this Source editor to dynamically name my columns from the variable?
    Thanks in advance!
    mpleaf

    Hi mpleaf,
    Please try to set "ValidateExternalData" to False in your OLE DB Source Properties and "DelayValidation" property to TRUE, please refer to similar threads:
    http://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/620557d9-41bc-4a40-86d5-0a8d2f910d8c/
    http://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/456f2201-447c-41b3-bf27-b3ba47e6b737
    Thanks,
    Eileen
    Eileen Zhao
    TechNet Community Support

  • Dynamic  File Name for Receiver File Adapter

    Hi All,
    How can we use dynamic name for Receiver file adapter?
    Can anyone help.
    Thanks in Advance
    Chemmanz

    Hi Chemmanz,
    The dynamic filename generation concept is as follows.
    In your filename field. just give a variable with % symbols. (eg: %file% ).
    Now, under the option Variable Name Substitution, you can give how the value has to be created.
    It can be your interface name, sender service name, etc or it can be some value dynamically from your payload.
    For the former, your give
    message:interface_name ,etc
    and for the payload part you give,
    Payload: "your element root which u wanna acecss"
    Just check this link out,
    http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
    And read the contents under variable substitution and it will help you understand the concepts better.
    If you have any clarifications, do get back,
    Regards,
    Bhavesh

  • How to give a dynamic File Name for Receiver File/FTP Adapter.

    Hi Experts,
        I have one scenario in which we are creating a flat file of IDOC which is coming from R/3 & sending it to FTP location. For this we have configured Receiver FTP adapter with File Name Scheme as "NT.out"  & in File Consturction mode i have given as "Add Time Stamp".
        therfore while creating a file it is creating as NTyyyyMMdd-HHmmss-SSS.out
    where as my requirement is only to to add Time & not the Date. (NThhmmss.out)
        How to do this ?
        for your info we are using ABAP Mapping.
        Pl help me
    Regards,
    Umesh

    Hi Umesh,
          Add one more field to your target structure for your file name and populate that field as per your requirement like NTyyyyMMdd.out. In receiver communication channel use Variable subtiution option and give the refrence of Payload and file construction mode set as create.
    And refer the below weblogs for Variable Subtiutuion File Name Scheme
    /people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i - Dynamic File Name Part 1
    /people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii - Dynamic File Name Part 2
    Hope this way would be solve u r problem.
    Cheers
    Veera
    >>>Reward points, if it is needful

  • Using variable names for object names

    Is there any way you can use a String variable to name an object? I.e., something like:
    String name = "objectName";
    \\ create an Image object named objectName
    Image (name.valueOf()) = new Image();
    This code obviously does not work, but I'm working on a map applet which uses a map composed of thousands of tiles, and then shows only a portion of the map by drawing the appropriate tiles into the window using the x/y coordinates and a nested for loop to determine which tiles to draw. However, unless I want to manually declare and then call each of these Image objects, I need to have a way to have the actual name of each image object be a reference to a variable, which I will then initalize according to the name of the tile I'm using. Does that make sense at all? Anyway, I was just wondering if anyone knows of any way to do this. Thanks.
    -Ari

    Typically this is done using a Collection, for example:
    Image[] img = new Image[100];
    for (int i=0; i<img.length;i++)
      img[i] = new Image();... Sort of thing.

  • Need Selection variable name for "System Year - 1"

    Hi All,
    I have Fiscal Year field in the selection screen of a custom program. The value of this field comes from system variable.
    I need to create a variant where this fiscal year should have the value "Current year - 1".
    This has to be done using Selection Variable. Currently there is no such variable in the F4 help (TVARV table).
    Please tell me if there is a way to get such a selection variable...

    Hi Tolga,
    The selection screen parameter is defined as:
    parameters: p_gjahr        type gjahr obligatory memory id gjr,
    I cannot use the FM in the AT SELECTION SCREEN ON VALUE-REQUEST.
    When you create a variant for the program.. click button "Variant Attributes" - Here the checkbox for Selection variable is ticked for this field. Now click "Selection Variables". here we can provide the variable name which comes from TVARV table.
    I need this Selection variable. I am not allowed to do any program changes.

  • Using variable name for Netstream Publish() (actionscript)

    Relatively new to Actionscript.  In the netstream publish() or play() methods, can I pass variable names to the methods instead of hard-coding the stream name?
    Example:
    private function publishLiveStream():void
                ns = new NetStream(nc);
                ns.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
                ns.client = this;
              // blah blah other stuff...
               ns.publish("thefilename", "record");
    I want to replace "thefilename" with a value passed from an input box or use dynamic naming (i.e. current date & time).

    you can use in procedure using sunopisis technology
    OdiExportMaster "-TODIR=/temp/" "-ZIPFILE_NAME=export.zip" "-XML_CHARSET=ISO-8859-1" "-JAVA_CHARSET=ISO8859_1" "-EXPORT_VERSIONS=YES"
    or you can use (unix System)
    OdiExportMaster "-TODIR=/#v_FileName" "-ZIPFILE_NAME=export.zip" "-XML_CHARSET=ISO-8859-1" "-JAVA_CHARSET=ISO8859_1" "-EXPORT_VERSIONS=YES"
    Hope it will work
    Thanks

  • Using variable name for target dir in OdiExportMaster tool

    Hi
    I am using OdiExportMaster tool to export master repo on daily basis as backup. But for the target directory option in the tool, I am not able to use a variable (variable fetches the directory path from a pl/sql table).
    Please provide a solution for this.
    Thanks,
    Divya

    you can use in procedure using sunopisis technology
    OdiExportMaster "-TODIR=/temp/" "-ZIPFILE_NAME=export.zip" "-XML_CHARSET=ISO-8859-1" "-JAVA_CHARSET=ISO8859_1" "-EXPORT_VERSIONS=YES"
    or you can use (unix System)
    OdiExportMaster "-TODIR=/#v_FileName" "-ZIPFILE_NAME=export.zip" "-XML_CHARSET=ISO-8859-1" "-JAVA_CHARSET=ISO8859_1" "-EXPORT_VERSIONS=YES"
    Hope it will work
    Thanks

  • Variable name for an ArrayList

    is there any way of giving an Arraylist a variable name if it was to be in some kind of loop eg:
    int index = 0;
    while(index < 10) {
    String name = "Array" + index;
    Arraylist value of name = new ArrayList();
    index++;
    which would produce 10 arrays with name, Array0, Array1, ..., Array9.
    is that possible?
    Thanks

    sorry, i managed to post this twice so please ignore this one.
    thanks

  • System variable name for email field.

    Hi
    Can anyone give me the system name for the email field,
    eg username is &APP_USER.
    Thanks
    Fiona

    Fiona - John's suggestion is to use a PL/SQL API call to get the email_address attribute from the wwv_flow_users record for a user account. There is no corresponding substitution string but you could create an item in your application and set it using this API. Keep in mind that this applies only to APEX user accounts, i.e., if you're using other authentication methods such as LDAP, SSO, Database Account, or custom tables, then the email_address will not be accessible using the API.
    Scott

  • EnterProjectStage - reading GUID from a string variable within Workflow created in Visual Studio 2012.

    Hi,
    I am creating a Project Server Workflow (site workflow) using Visual Studio 2012.
    If i set the "EnterProjectStage" activity with a GUID within quotes the workflow works
    (as suggested in the MSDN blog (http://blogs.msdn.com/b/project_programmability/archive/2012/11/07/creating-project-workflows-using-visual-studio-2012.aspx).
    However, the GUID of stages will change from environment to environmet (QA, Stage, PROD). So, I tried setting the GUID in a string variable (which i am populating dynamically) and assigned the string variable to the "EnterProjectStage"
    activity. However, this dynamic assignment of stage id to "EnterProjectStage" does not work and after deployment the workflow dumps with the following error:
    ===============================================
    Exception Starting Workflow: Sequence contains no elements. Trace: at System.Linq.Enumerable.First[TSource](IEnumerable`1 source) at Microsoft.Office.Project.Server.BusinessLayer.Workflow.<FillWorkflowStatusTableFromXaml>b__47(XElement
    e) at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext() at System.Linq.Enumerable.<DistinctIterator>d__81`1.MoveNext() at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable`1
    source) at Microsoft.Office.Project.Server.BusinessLayer.Workflow.FillWorkflowStatusTableFromXaml(String xaml, WorkflowDataSet& ds, Guid projUid) at Microsoft.Office.Project.Server.BusinessLayer.Workflow.StartWorkflow(Guid projectGuid, Guid enterpriseProjectTypeUid,
    Boolean isNewProject, Guid previousEntepriseProjectTypeUid, Boolean skipStage, Guid stageToSkipTo):
    WorkflowExceptionStartingWorkflow (35115). Details: id='35115' name='WorkflowExceptionStartingWorkflow'
    uid='b31d825e-1d00-e411-9466-005056b11412'. 
    ===============================================
    Is there a way the "EnterProjectStage" can be made dynamic so that it reads from a variable.
    Thanks,
    Amitava.

    Arthur,
    Thank you for your reply.  But at this point, one of my points of confusion is what software I have available to me.  I wish I had a useful central help desk to call up and just say, "Hey, load me up with all of the professional version(s) of Visual
    Studio.  But I do not know what we have license to.  And I kind of need to know what the options are, so that I can ask a specific question of our vast buracracy.
    For now, I have downloaded only free versions of Visual Studio client software.  Since my company does have servers running Microsoft SQL Server, I am going to assume that we have proper licensing for those servers.  But does that server license
    allow me to get any professional versions of the PC client software for the various Visual Studio(s) 2012?
    And if I get a professional version of Visual Studio 2012, does that do away with the three different flavors that I have right now?  I have 2012 versions of SQL Server Management Studio, Visual Studio Express, and Visual Studio Shell (Integrated).
    Your feedback is much appreciated.
    Thanks!

Maybe you are looking for

  • Problem with JDBC and Tomcat

    I don't know where the problem originate, the only thing in my memory is that the program worked very well on my PC yesterday, but today, without even slightest change, it doesn't work anymore. As to debug it, I simplified the codes to the least, but

  • Turn Sound OFF in Javascript or HTML

    My client would like the Flash banner I'm using to play audio only on the home page. Can I shut the sound off in javascrpt or html (in the object tag properties)? Client does not want a sound toggle button - simply no sound. I know I can create a sec

  • Methods in bapi used to convert data into XML

    Methods in bapi used to convert data into XML, how to implement those also, points will be rewarded Thank you, Regards, Jagrut BharatKumar Shukla

  • Activate Window not working in teststand

    Hello, I have two small test-Vis. What they do is: First VI: a.) Starting notepad.exe b.) get refnum of the notepad-window c.) Make it topmost with the lvutil.llb d.) Write a text in it with "keybd_event" Second VI: The Same like in 1.) but without s

  • Dynamically loading client proxy no longer works

    I've got several instances where we need to dynamically load/initialize a WebService client proxy using a URL classloader all within an Applet. The need for the classloader and dynamic loading is due to the seperate jars holding different system modu