An enterprise question on local field definition in a loop

Hi all,
I have two situation as follows, one is to define A a in a loop, the other is to define A a outside loop. From enterprise view, which is better, ot both are same. Thank you so much in advance.
List<A> aList = new ArrayList<A>();
for (int i = 0; i < 10; i++) {
A a = new A();
aList.add(a);
List<A> aList = new ArrayList<A>();
A a = null;
for (int i = 0; i < 10; i++) {
a = new A();
aList.add(a);
}

Thank you very much for your reply. What I think
about "enterprise view" is that in an enterprise
project,It's just Java... it doesn't behave differently in different project scales.
both the two situations have the same memory
consumption and garbage collection? Yes. How would the memory consumption differ anyway? 4 kB of reference created and released vs. 4 kB of reference created, released, created, released... (Though I said before, the latter does not happen anyway.)
GC might not be able to clean up the last object in the second way if it happens to run just after the loop exited because you still have a valid reference to it, but that's purely academic.

Similar Messages

  • How to use dates/times in the definition of local fields?

    Hello!
    I have few tough questions for which I haven't found an answer. I hope someone is capable to help me.
    1. Is there a transaction to search tables if we know the field?
    2. I'd like to define a local field and need to use dates in the calculation function. So basically I need to calculate the lean-time from the date of the purchase order (field BSTDK) to the date of the final delivery (field PLIFTS) and the result should be displayed in weeks. How can I do this? Or can I?
    3. Can I use the local fields further in my calculations?
    Thank you in advance!
    Maria Kangasniemi

    Hi,
    1. Is there a transaction to search tables if we know the field?
    Tcode:    SE84
    2. I'd like to define a local field and need to use dates in the calculation function. So basically I need to calculate the lean-time from the date of the purchase order (field BSTDK) to the date of the final delivery (field PLIFTS) and the result should be displayed in weeks. How can I do this? Or can I?
    Doing some calculation you can define it.
    3. Can I use the local fields further in my calculations?
    What is local Fields?

  • Include command in SapScript to fill in a local field

    Dear all,
    Normally when we are using the INCLUDE SAPscript command, the system is printing the information retrieved.
    My question is, if someone of you know, whether is possible to put the information retrieved into a local field, defined as DEFINE &wa_localfield& := include &tdname& object vbbk ...
    Many thanks in advance !
    Rgds., Anton

    No, that is not possible using the INCLUDE statement.
    Welcome to SDN!
    Regards,
    Rich Heilman

  • CUIC Report Field Definitions

    Hi Guys,
    I am trying to find doco on report field definitions in CUIC….
    Example, what exactly "Internal In Time", "External Out Time" & "Internal Out Time" actually mean???
    Any help, much appreciated!!!
    Cheers!

    Hi James,
    - internal in time means the length of an internal call received by the agent (internal means the call came directly to the agent's phone, it has not been routed by a routing script);
    - external out time means the length of a call initiated by the agent off switch (the call goes beyond the horizon visible by the call routing system);
    - internal out time means the length of a call initiated by the agent within the same switch (for example agent calls another agent directly).
    So, if agent Alice calls agent Bob directly, the Internal Out Time is increased for Alice, and the Internal In Time is increased for Bob.
    If agent Alice calls her grandmother in Australia, the External Out Time is increased for her.
    You might want to take a look at these documents:
    Reporting Guide for Cisco Unified ICM/Contact Center Enterprise & Hosted 8.5(3)
    Database Schema Guide for Cisco Unified Contact Center Enterprise 8.5(1)
    G.

  • Display Image on report through Field Definitions Only File.

    Hi all,
    I have a report where I work with Field Definitions Only files (ttx).
    These files are mapped to classes in code behind (csharp).
    In code behind I make lists of these classes. Each list is set as the datasource of a subreport.
    This works great!
    My new goal:
    Now I tried adding a picture to my report.
    In the TTX file I added a BLOB field.
    In the code-behind class I added a System.Drawing.Image.
    My actual problem:
    The class gets filled with the image, but the image is NOT displayed on the report
    Does anyone know why this is happening?
    How can I fix this? (should I use another Type in my class for the picture?) (should I format the picture in the report? ....)
    Kind regards,
    Wim

    Hi AG,
    Thanks for your response.
    This is my TTX field:
    Signature     BLOB          
    I can't see the image in the report because I create the image in code-behind.
    I think the problem doesn't occur in CrystalReports but in the conversion from my StrokeCollection (I use an InkCanvas [WPF] to capture a signature) to a ByteArray.
    I am already one step closer to the solution. You can't just assign an object of type Image to the BLOB field of the report but it has to be a Byte-Array.
    The problem I am facing now is that the picture is black after a conversion. (I see this when I export to disk and open the file in MSPaint).
    The good thing is that CR shows me a black image so I guess CR is doing its job!
    Kind regards,
    Wim

  • I want to cut and paste iCal entries on iPad.  Have seen a number of questions raised but no definitive answer - is it possible or not?  (I use Bento but that doesn't sync with ICal now so can use that solution)

    I want to cut and paste iCal entries on iPad.  Have seen a number of questions raised but no definitive answer - is it possible or not? 
    (I use Bento but that doesn't sync with ICal now so can use that solution)
    Hope to hear helpful news soon....
    C

    No, the camera connection kit only supports the copying of photos and videos to the Photos app, it doesn't support copying content off the iPad. For your second camera instead of the SD reader part of the kit, does the iPad to camera cable not work with it for direct transfer to the iPad ?
    For Lightroom and Nikon software again no - you can only install apps that are available in the iTunes app store on your computer and the App Store app on the iPad, 'normal' PC and Mac (OS X) software are not compatible with the iPad (iOS). There are some apps that perform fairly basic editing functions that are available in the store, but nothing as sophisticated as, for example, Lightroom.

  • ABAP Query: creation of local field (Subtraction between 2 dates)

    Hi,
    I want to create a local field which will calculate the number of days between 2 dates (for example, document date - posting date).
    What I did:
    1) Created the user group in SQ03
    2) Created the infoset in SQ02
    3) I'm stucked at the creation of the Query in SQ01. I'm at the «Create Query: Select field screen». I clicked on Edit --> Local Field --> Create. I selected the «calculation field» attribute. I clicked on the «Complex calculation button», but I don't know how to write my formulate DOCUMENT DATE - POSTING DATE.
    Thanks a lot for your help.
    Julien

    Try these FM's to calculate difference between two dates..
    DAYS_BETWEEN_TWO_DATES
    LEAP_DAYS_BETWEEN_TWO_DATES
    HR_SEN_CALE_DAYS_DATE
    ISB_DAYS_BETWEEN_TWO_DATES
    FIMA_DAYS_BETWEEN_TWO_DATES
    FIMA_DAYS_BETWEEN_TWO_DATES_2
    FIMA_LEAP_DAYS_BETWEEN_2_DATES
    SD_DATETIME_DIFFERENCE

  • Creation of local field in ABAP Query

    Hi
    Please let me know how to create a local field in ABAP query. I am finding the option inactive in SQ01.
    Regards
    Priyadarshini

    hi priya,
         *__Adding u201CLocal Fieldu201D (user defined field) in SAP Query_ :
    There is also facility to add the user defined fields in SAP query output. Also we can provide calculation formula for calculating values for this user defined field.
    Calculation formula consists of standard fields from standard SAP tables. So the values fetched for particular standard SAP fields from standard SAP tables get calculated as per the calculation formula defined for the user defined field and displays the value accordingly.
    To do this first go to change mode for Query which automatically takes you to screen shown below and click on icon   , as below :
    Then further screen will appears. So select the Field group and again click on the same icon button   .
    Then switch on the Short names for the fields and give the short names to fields which we need to use in Calculation formula.
    Give the short names and then created u201CLocal Fieldu201D, as shown in below screen shot. Also Short names are given to fields, which can be used further for calculation.
    Defining Local Field u201CREM_QTYu201D along with its field type and Calculation formula.
      In this case we have 
      defined field type for new  
      field as similar to
      ORD_QTY and
      Calculation formula is  
      defined.
    Also its possible to have Conditional logic for Local field by putting Condition in u201CConditionu201D line.
    Now activate this newly added Local field for coming it in output screen. To do the same again go to u201CBasic Listu201D and activate the Local Field as shown below :
    i think this will help u
    regards,
    sindhu.

  • Syntax error in field definition

    Hello,
    Does java sun default driver support data type BLOB? I need create a table name PERSONS, and then store it to Access Database. But, every time when I run the program, it shows the following message:
    SQLException: [Microsoft] [ODBC Microsoft Access Driver]
    Syntax error in field definition.
    Below are the code, does any one have any idea about the problem?
    import java.sql.*;
    public class CreatePersons {
         public static void main(String args[]) {
              String url = "jdbc:odbc:DRIVER={Microsoft Access Driver (*.mdb)};DBQ=Database\\DB1.mdb";
              Connection con;
              String createString;
              Statement stmt = null;
              createString = "create table PERSONS " +
                                       "(PersonName VARCHAR (20) NOT NULL, " +
                                       "PersonPicture BLOB (64K) NOT NULL," +
                                       "PRIMARY KEY( PersonName )" +
              try {
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
              } catch(java.lang.ClassNotFoundException e) {
                   System.err.print("ClassNotFoundException: ");
                   System.err.println(e.getMessage());
              try {
         con = DriverManager.getConnection(url,
                   stmt = con.createStatement();                                   
                   stmt.executeUpdate(createString);
                   stmt.close();
                   con.close();
              } catch(SQLException ex) {
                   System.err.println("SQLException: " + ex.getMessage());
    Thanks,
    Daniel

    It doesn't have anything to do with the java driver.
    You are passing DDL. That goes directly to the MS Access interface (the ODBC driver and the supporting dlls.)
    There are two possibilities.
    - The ODBC driver (and support) does not allow you to create blobs.
    - The syntax you are using is wrong (this would be my guess.)
    For the second case you might try creating the table in Acces, then use tools->analyze->documentor to produce the SQL description for that table. Whatever it produces is probably the output that it expects.

  • "[Microsoft][ODBC Microsoft Access Driver] Syntax error in field definition

    I am creating a program in Java which has a Database reference application.The Database I am using is MS Access.But whenever I am trying to run the program from DOS Prompt(ie executing the program:java <program name>) I am unable to connenct to the database.The compiling of the program doesn't show any error(ie javac <program name>) The following error is displayed at the DOS Prompt:
    "[Microsoft][ODBC Microsoft Access Driver] Syntax error in field definition."
    Pls give me a detailed help report.If it is a Machine side problem do help me to solve it.Mine is a Compaq Presario Machine,OS:Windows 98,Database:MS Access(Office XP)
    I request you to help me in this matter.Pls email ur responses to:
    [email protected]
    [email protected]

    hi there
    did u configure ur ODBC setting if no then try these steps
    ================== ODBC Settings ========================
    step 1 : go to control panel
    step 2 : ODBC Data Sources
    step 3 : click UserDSN Tab
    step 4 : click ADD Button , Select Microsoft Access Driver , Finish
    step 5 : Give Datasource Name as "DATABASE_NAMEXXX" , no double quotes
    step 6 : use Select and select Database_NAME.mdb from <INSTALL DIRECTORY>\DATABASE_NAME.mdb
    click ok , ok finish
    <INSTALL DIRECTORY> is where yr database is
    =========================================================
    then in yr program
    URL for yr database
    "jdbc:odbc:DATABASE_NAMEXXX" // as name in step 5
    and Driver is
    "sun.jdbc.odbc.JdbcOdbcDriver"
    if u done all these steps then check yr spelling of table and tabel field in yr program
    hope this works for u
    regards
    Satinderjit

  • Not found Users Form in User Defined Field Definition!!

    I want to add new filed into Users form, As my subject, but when I query "Users" in User Defined Field Definition, no result return, just exist Orgnizations, Roles, Resource Objects,Structure Utility.
    FYI, OIM Version: oim 11g
    Thanks,
    Edited by: 793495 on 2010-10-11 上午2:53

    this you can find in Web console
    configuration>>user configuration>>action>>attributes
    I am able to add attribute but not able to make field as mandatory,while creating attribute we are not getting option like that you want this field mandatory or not but while modifying the attribute we are getting option like required field radio button if i select that i am getting error "you cant change an attribute to required unless all the user have value for this field"

  • "Users " Form Name from "User Definied Field Definition" does not showing

    Hi everyone!
    I start to implement the new SAP Connector on OIM 9.1.0 and one of steps is configure the lookup Lookup.SAP.HRMS.AttributeMapping.
    I need to add more fields beyond those already exists, and in accord to Documentation, I need to create the UDF of these fields, but when I search of "Users" form name form "User Definied Field Definition" option, I receive the follow response:
    "Query Failed: No Record For this Query"
    Thinking about it, I think that necessary create one User Form, but...this form isn't a standard form?
    What I do in scenarios like this?

    Can you share your environment details. Are you trying it out in a newly installed OIM ?_
    Yes, it's a newer fresh installation of OIM 9.10. We use the old version (9.03) in production environment and would like to upgrade to 9.10. This issue occur in a fresh installation in Development Environment.
    The one possible reason for this may be due an improper upgrade to 910X. I actually faced this issue while I was installing/upgrading my OIM. I did the process all over again and it was just perfect. I am not sure that this might be an issue with you or not. But there is simply no othe reason for the Users from not showing uo in the "User Definied Field Definition"._
    If you have taken a fresh backup of the schema just after installation, then import that backup dump and see if you are able to view the Users form. If in case you are not able to view it then your installation / upgrade is corrupt._
    No, we don´t have a fresh dump of environment. We just follow the documentation and all the steps was done without problem. The SAP connector import the fields from the reconciliation using flat IDOC file, just only the standard fields. We need to add newer fields and attributes and after, we face this problem.

  • ABAP Query - Local field creation error

    Hi,
    In SQ01, I created a query. when i try to create local field EDIT>LOCAL FIELD>CREATE. Its throwing error 'Reference field does not exist' Message no. AQ273.Can anyone please tell me how to create local field then?
    useful answers will be rewarded.
    Thanks
    Shameem.

    Hi,
    When creating a local field in a query, you need to define the type of data it will hold. There is a radio button to select a "reference field" or you can specify the type of data directly. I believe you got this error message because you selected reference field but specified no other field in the query to use as reference.
    RaulV

  • SQ01 local field division problem.

    i have a report in sq 01 and i want to divide  two fields
    so i pick local field and try to do it..but result not correctly but addition and substraction working fine.
    any one tell me how perform division in sq01 local field

    I realize this post is very old, but the solution may help somebody else down the road.
    Within the infoset, the setting for "Fixed Point Arithmetic" must be turned on (checked).
    This is turned off by default when converting an SQVI into a Query within SQ00 or SQ01.
    To turn on "Fixed Point Arithmetic".  Go into infoset change mode in SQ02.  Click Goto in the menu path and then Global Properties.  Click on the setting for "Fixed Point Arithmetic" at the very bottom of the pop-up box.  Regenerate the infoset.

  • Local field in infoset

    hi,
    I want to check personnel 0008 infotype wagetype amount and scale amount.
    ex. personnel p0008-bet01 = 2000 but from t510 p0008 scale data derives amount 1800,
    To compare these 2 amount, within an ad-hoc query, I added an edditional field to 8 infotype in infoset.
    after that no error appears, when query run frım sq01, if added field selected ad hoc does not run, orherwise ad hoc runs.
    how should I write code for additionbal field.
    here is the code that I added to code part of local field.
    tables:t510.
    get pernr.
    select single betrg from t510 into sklucrt
    where molga = 47 and trfar = p0008-trfar and trfgb = p0008-trfgb
    and trfkz = 1 and trfgr = p0008-trfgr and trfst = p0008-trfst and lgart = p0008-lga01
    and begda le p0008-begda and endda ge p0008-endda.

    Hi Kara,
    first the field BET01 of IT0008 is a repeat field. That means all subsequent values from BET02 ... BET40 are processing in the query using the DO ... VARYING statement.
    Now to your coding.
    You must not use GET PERNR in your code! This is of course automatically added by the query generator and if you add it in your coding the statement will come up twice.
    Second your date comaprison is wrong.
    You always have to select with
    ITx-BEGDA <= ITy-ENDDA  AND
    ITx-ENDDA >= ITy-BEGDA
    to get the correct set. Make a drawing and you will realize why.
    So your coding would look like:
    * first clear the return value
    clear sklucrt.
    * select the value from T510
    select single betrg from t510 into sklucrt
    where molga = 47 and
    trfar = p0008-trfar and
    trfgb = p0008-trfgb and
    trfkz = 1 and
    trfgr = p0008-trfgr and
    trfst = p0008-trfst and
    lgart = p0008-lga01 and
    begda le p0008-ENDDA and
    endda ge p0008-BEGDA.
    You MUST clear the return value first otherwise you get the old value in case nothing is found.
    Tables declaration you also don't need as you make a direkt select into the field SKLUCRT that I assume is your defined additional field in the InfoSet.
    But I wonder why you want to do this as the additional fields available calculate the right amount also in case of indirect evaluation.
    Regards,
    Michael

Maybe you are looking for