Data in as locals

What is the reason (not just Java, but C/C++/C#)
why we make a local copy of a piece of data when being passed into the local method?
Foo fooBar(Object a)
Foo b = (Foo) a;
doSomeWork();
return b;
is it just a matter of taste?
Thanks
Jack

In the examples it is a matter of showing how to equate one variable to another, but more fully, it is a good practice if you program in multiple languages to set local variables to be sure you don't have a pass by reference/value side effects that slip in at some point.
When you have a pass by value scheme, there is no need to make local copies since all changes only exist in the scope of the method it is used.

Similar Messages

  • How to get Date Format from Local Object.

    Hi All,
    I am new to Web Channel.
    I need to know Date format From date of locale.
    suppose there is a date "01/25/2010" date in date field I want to get string "mm/dd/yyyy". Actually I have to pass date format to backend when I call RFC. 
    Is there any way to get Date format from "Locale" object. I should get date format for local object
    I get local object from "UserSessionData" object but how to get Date format from it.
    I am not looking for Date value. I am looking for current local date format ("mm/dd/yyyy or dd/mm/yyyy or mon/dd/yyyy) whatever local date format.  I could not find example which show how to get date format from "Locale" object.
    Any help will be appreciated with rewards.
    Regards.
    Web Channel

    Hi,
    You can get it from "User" or "Shop" business object.
    Try to get User or Shop Business Object as shown below.
    BusinessObjectManager bom = (BusinessObjectManager) userSessionData.getBOM(BusinessObjectManager.ISACORE_BOM);
    User user = bom.getUser();
    char decimalNotation = user.getDecimalPointFormat().getGroupingSeparator();
    If you are seeing "1,234.00" then above code will return "."
    I hope this information help you to resolve your issue.
    eCommerce Developer.

  • What is it about data types of local variables?

    Hey there!
    I'm trying hard to access the booleans, whose refnums got stored into an array. As the example show, everything's fine unless I start using local variables: I can access the data in the topmost FOR loop. As soon as variables come into play, it seems as if I have to explicitly typecast the data. Is it just me? There has to be a less complicated way... can anybody give me a hint?
    Kind regards,
    Severin
    Attachments:
    data types of local variables.jpg ‏96 KB
    data types of local variables_7.11.vi ‏39 KB

    Hi Severin,
    The output from that property node is of variant data type. You can convert it to boolean by using the Variant to Data VI. See attached example
    Sarah
    Applications Engineer | National Instruments | UK & Ireland
    Attachments:
    data types of local variables_7.11.vi ‏41 KB

  • Can I use RunState.ProcessModelClient.Data.Seq[0].Locals.MyVariable in batch model to set variables in a client sequence?

    I have used RunState.ProcessModelClient.Data.Seq["MainSequence"].Locals.MyVariable to set Locals variables in client sequences running in a sequential model but it doesn't seem to work with the batch model. Using a breakpoint I found that RunState.ProcessModelClient.Data.Seq is a container listing all of the sequences in the client sequence with the Main Sequence being index 0.
    I tried using RunState.ProcessModelClient.Data.Seq[0].Locals.MyVariable to set the variables in my client sequence and it worked fine.
    My question: is this method reliable or am I doing something that might cause problems down the road?
    Thanks,
    Steve

    A few issues from doing it this way-
    1- You should try an make your process model such that it can handle almost any sequence file thrown at it.  MainSequence may not a) contain that local variable and b) be at array element 0.  Unless you do some serious error checking then using your process model elsewhere will be a problem because it will throw errors.
    2- It all depends on where you are changing that variable at.  Remember with the Batch Model that you are dealing with multiple copies of your client sequence.  If you change a Locals in the process model which threads does it actually affect?
    3- Locals is to be used for the sole purpose of the sequence it resides in.  Just like in text based programming where you have a function call:
    MyFunc(int x, int y){
    string foo;
    foo is local and really shouldn't be changed outside of MyFunc.  x and y are parameters and should be how data is shared among different sequences in TestStand.  There are variables for bigger scopes as well (i.e. StationGlobals, FileGlobals). 
    I recommend using either a StationGlobal or passing the data as a parameter. 
    In the end you are the engineer and the flexibility that TestStand gives you makes it so you can do things however you want. 
    My 2 Cents,
    jigg
    CTA, CLA
    teststandhelp.com
    ~Will work for kudos and/or BBQ~

  • Adobe offline form with capablity to read data from a local data base.

    Hi ,
            We have customer requirement for a offline Adobe form which will be used by Sales rep, this form when saved to the local hard disk is required to read data from another local data base available in the laptop  and prefill a few fields in the form . 
    Is this requirement technically feasible using Adobe forms?
    Thanks
    Srikanth S

    Well may be it's possible because if you go to the Data View in ALD and create a new Data Connection --> OLEDB database --> Build --> It gives you various options for connecting to different DBs but frankly speaking I have never tried it.
    Check the ALD help for more information on the topic.
    Using LiveCycle Designer > Working with Data Sources > Connecting to a data source > To create a data connection to an OLE database
    Chintan

  • LKKBLF99   runtime error while export data to the local file

    Hi experts,
    i got this error while i export data to the local file.
    Runtime Errors         OBJECTS_NOT_CHARLIKE
    Date and Time          10.09.2011 13:32:43
    Short text
         The current statement requires a character-type data object.
    Error analysis
        At the statment
             "STRLEN( obj )..."
        , only character-type data objects are supported at the argument
        position "obj".
        In this particular case, the operand "obj" has the non-charcter-type type
        "P".
    "OBJECTS_NOT_CHARLIKE"
    "SAPLKKBL" or "LKKBLF9
    "GEN_FIELD_OUT2"
    Include               LKKBLF99
      Überführung int. in ext. Format via Konvertierungsexit
        if not gs_fc-convexit is initial or                     "INS TECH11
           not gs_fc-inttype ca 'CN'.
      elseif not gs_fc-convexit is initial.            "DEL TECH11
          write  to gs_out-hlpchar left-justified.
          gs_out-hlplen = strlen( gs_out-hlpchar ).
      ansonsten entspricht sich min. Ausgabelänge und Ausprägungslänge
        else.
          if gs_fc-tech_form ne 99.
            gs_out-hlplen = strlen(  ).
          endif.
        endif.
      endif.
    the error says the operand "obj" has the non-charcter-type type " P" .
    i do debug on this and find the LS_FIELDCAT-INTTYPE = " P". so i changed it the QUAN type with length 13 decimal places 2. i can't change it in "C" char type or "NUMC" type  because i need the output in decimals. the output is for amount and quantity so need this in decimal places up to 2 or 3.
    but still find the same, i do debug on it after change it into QUAN type. find the same value for LS_FIELDCAT-INTTYPE = " P".
    let me know how can i define this in char type with decimal places or what.
    Please give some suggestion, if you need code, i will post the code.
    Thanks in advance
    Sachin

    Hi Sachin,
    Check this links.
    [Run time error|OBJECTS_NOT_CHARLIKE : ALV export to local file;
    [Error|Runtime error : OBJECTS_NOT_CHARLIKE;
    Regards,
    Madhu.

  • Not able to download the complete data to the local PC file

    Hi,
    I have a BDC program where I am creating an Unix file and later downloading the same to the local PC file(Text file).
    As far as creating the Unix file is concerned, there are no issues. It is working fine.
    When I try to download the data to the local file(in my case.. it is Text file), it is not downloading the complete data. I mean, it is saying that 3,94,654 records are processed. But, it is downloading around 94,000 records only to the Text file. Approximately, 3,00,000 records are missing when downloading.
    Can anyone tell me what the reason might be..?
    My doubt is.... will there be any limit to the number of records to be downloaded to the local PC file(say text file).
    Thanks in advance...
    Best Regards,
    Paddu.

    Hi,
    I have a similar program running for over 5 Lac records.
    There could be issues with memory. Also check in debug if the internal table holds the complete records. If everythings fine then as suggested in upper reply
    Create internal tables with 90,000 records and use FM GUI_DOWNLOAD with importing parameter APPEND = 'X' and with the same filename and same path.
    Hope it helps.
    Lokesh

  • Without providing access of mass storage,allow access of data card or local printer ,

    Hello,
    Pls assist in exploring the possibility to allow access of data card or local printer  without providing access of mass storage.
    Balwan Singh

    Hello Balwan Singh,
    You can use two methods on is using Administrative Template and the other is using Preferences, both are available within the GPO in Domain Controllers with 2008 and later.
    Option 1: Administrative Template.
    This setting can be configured either at Computer or User level.
    You need to go to:
    Computer or User Configuration\Policies\Administrative Templates\System\Removable Storage Access
    In here you can Enable the setting "Removable Disks: Deny read access" or "Removable Disks: Deny write access" 
    Just be aware that this settings does not apply to a servers at a "User Configuration" level.
    Option 2: Preferences.
    This setting can be configured either at Computer or User level.
    You need to go to:
    Computer or User Configuration\Preferences\Control Panel\Devices
    In here you need to create a new item as follows:
    - Right click and select new --> Device
    - On General Tab you can select two "Action" options "Use this device (enable)" or "Do not use this device (disable)" in this case you should use the second option "Do
    not use this device (disable)"
    - On "Device class:" you can browse the devices attached to the computer from where you are configuring this GPO.
    In this list yo need to choose the "Universal Serial Bus controllers" node and among the options listed in here you should choose the "USB Mass Storage Device" which is the class used for USB drives.
    Remember that if you are configuring the GPO from a domain controller probably you do not see the "USB Mass Storage Device" in the "Universal
    Serial Bus controllers" node since there does not exists a USB drive directly attached to your domain controller.
    You can workaround this by either connect a USB drive to your Domain Controller or connect with the Group Policy Management Console (GPMC.msc) from a workstation on which you can safely plug a USB drive just to be able to visualize it and configure your GPO.
    Related Info:
    Configure a Device Item
    https://technet.microsoft.com/en-us/library/cc771861.aspx?f=255&MSPPError=-2147217396
    I hope this info help you to reach yor goal. :D
    5ALU2 !

  • Changing date format in locale

    Hi Experts,
    Date, currency format and so on depends on locale. If locale changes formats change as well.
    But is possible to change these formats in locale itself (change, for example, short date format in locale en_US to dd/mm/yyyy instead of mm/dd/yyyy)?
    Best Regards
    Price Young

    Hi Price
    The date format is user dependent. It may vary from user to user depending upon the settings applied at the time of user creation. This can however be changed from transaction SU01 ( defaults tab).
    Also please check the following link:
    http://help.sap.com/javadocs/nwce/current/wdr/com/sap/tc/webdynpro/services/sal/localization/api/IWDResourceHandler.html
    and
    http://help.sap.com/javadocs/MDM/SP06P2/com/sap/mdm/valuetypes/format/MdmDateTimeFormatInfo.html
    I hope this helps
    Regards
    Chen

  • Data Acquisition - using local variables to write data to a file

    Hello,
    I am running a Data Acquisition vi (currently in LabVIEW 7.1 but soon to be updated to 8.2) that collects ~100 parameters of data from several sources contained in a while loop. The current configuration (which I did not write) uses very few subVIs and writes to ~100 local variables to store each parameter. It then reads all the local variables and builds an array of all the strings, converts then to a spreadsheet string, then uses the write characters to file function to append to a datafile. I am trying to clean things up and have came up with subVIs to collect the data from the following sources:
    8 serial port sources collecting btwn 8 and 20 parameters each
    ~15 thermocouple readings
    ~10 analog inputs
    ~20 parameters read off an ARINC 429 bus.
    I have come up with a subVI to read each of the sources and have placed the subVIs in the while loop. Each subVI outputs the data that it collects in array or cluster form. I was wondering how best to write each parameter to a CSV file at between 1 and 10 Hz. Should I write each subVI output to a LV and then read them off as was done before (the difference being that I have reduced the # of LVs to ~10 vs >100?
    I should add that precise timing is not that important, so if all the subVIs are not collecting simultaneously (which I understand that they won't be), it does not really matter.
    Thanks.

    Hi jilla,
    jilla wrote:
    What I think that you are saying is to turn the outputs of the 4 subVIs into inputs of a 5th subVI that writes to the data file. Correct?
    Yes.  It may sound like a fine-point, but I beileve it's better to create a VI specifically for formatting data - in your example, 4 arrays IN, a single string OUT.  Then write the string to file as a seperate operation.  GUI-displayed data can go through a similar transformation, the four arrays wired to a subVI which builds output-structures specifically for display.  It's a beginner's mistake to put lots of individual controls and indicators on the screen when groups of them are naturally related (in an object-oriented sense.)  Use clusters to group related controls - this will keep the diagram much cleaner.
    One more question: at what point (either # of data points or frequency of data collection) does it become necessary to use queues? Thanks.
    Well, there's not really a clearly definable "point".  I'd say if your update-rate climbs above 100Hz, or you witness poor program or system performance, then it's time.  The scenario you've described is a fairly simple acquire/display&log loop - and simple is good.   Then-again people can't see/react-to updates faster than about 10Hz - so it doesn't make sense to sacrifice performance - if performance becomes an issue.
    Re: queues:  Queues are sometimes used to buffer data that's "produced" in one place and "consumed" in another.
    Here, if/when logging data, you're logging with every DAQ.  I wouldn't recommend using a queue to transport data from a "DAQ loop" to a "Logging-loop" - those functions can be in the same loop.  Should/could a queue be used to get data from a "DAQ loop" to update the GUI at a lower frequency?  Sure, but a Notifier might be a better choice.   Further, in the (simple?) program you've described, you might use a case structure (True/False) to only update FP indicators every "X" iterations - a simple solution that doesn't require Queues or Notifiers.
    Cheers!
    "Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)

  • Cl_gui_alv_grid:exporting protected table data MT_OUTTAB to local int.table

    Hi guys,
    this is my problem.
    I've an instance of cl_gui_alv_grid in the reference variable gos_alv. This instance
    is populated by "sap GOS service". 
    Now, i'd like to save locally the internal data table of the gos_alv (populated
    automatically by the service call).
    The data tables is called "mt_outtab" and is a standard protected component of the cl_gui_alv_grid class
    (you can see it in the se24 transaction).
    I think to create a subclass of the cl_gui_lav_grid and make a public method to
    save data like this :
    field-symbols: <outtab> type standard table.
    *       CLASS lcl_gui_alv_grid DEFINITION
    class lcl_gui_alv_grid definition inheriting from cl_gui_alv_grid.
      public section.
        methods : get_tab_line.
    endclass.                    "lcl_gui_alv_grid DEFINITION
    *       CLASS lcl_gui_alv_grid IMPLEMENTATION
    class lcl_gui_alv_grid implementation.
      method get_tab_line.
    * mt_outtab is the data table held as a protected attribute
    * in class cl_gui_alv_grid.
        assign me->mt_outtab->* to <outtab>. "Original data
      endmethod.                    "get_tab_line
    endclass.                    "lcl_gui_alv_grid IMPLEMENTATION
    data : l_alv type ref to lcl_gui_alv_grid.
    But when i do a downcast like this :
    l_alv ?= gos_alv.
    I have an exception of casting error. SO, how i can extract protected data into
    local internal table?
    I've already try to debug the service that build the alv list to understand how the data table
    is populated but it's too complex.
    Thank you
    Andrea

    Hi,
    not yet any suggestion?
    Generally speaking, i cannot understand why i cannot use down-cast with an instance declared as a subclass of a super-class.
    Many examples, shows that i can create a sub-class inheriting from a super-class, add methods and attributes, make something like this : subclass ?= superclass and the call method of the subclass.
    But when i try to do the same with a class derived from cl_gui_alv_grid, i have always a casting type exception in the down-cast instruction.
    Could you explain me why?
    Thank you very much
    Andrea

  • Conversion from Date to say Locale time

    Hello All,
    I receive a date in xml file as a string. eg 01/27/2004 . I have to convert it to Locale format(2005-01-10T12:30-04:10) using XSL. Is it possible ?. If yes how to do that ?.
    Thanks and regards,
    Sachin

    Hello All,
    I am very sorry for framing the question wrongly. Actually I have recieved the date and time from xml which I will concat and store it in <xsl:variable>. Now I want to do processing on the variable using Java. Is it possble to do so ?. Means can I call some java function and pass the variable to the function do the processing on the variable and return the output and save that output in some variable which can be displayed.
    Thanks in advance.
    Waiting for reply.

  • Download data into a local file from PCUI

    Hi,
    i need to export items from 'quotation' into a local file (on presentation server) with CRM4.0 and using the fileupload field type. I used the MF 'GUI_DOWNLOAD' but i had an exception error 'CONTROL_FLUSH_ERROR'. Effectively it was expected since PCUI is based on BSP technology and this one requires to use methods from the 'HTTP_REQUEST' object. This last one is not accessible
    from pcui methods assigned to fieldgroups... So i try to use methods from the class 'cl_abap_conv_out_ce' as i did for import items with the class 'cl_abap_conv_in_ce' but
    there is no input enabling to define the file getting data.
    Somebody would have an idea ?
    Thank you.

    Hello KB Ram,
    You have a program RSECHK05 using which you can check the data of the idoc segements.
    Please make a point of clicking the "Output in Internal Formal" pushbutton.
    The output will come in a classical report format with which you can play around.
    BR,
    Suhas

  • Calendar data for new locales

    We're developing an aplication on JDK 6. This application needs to support Spanish and Basque. Spanish is not a problem as "es" is a supported locale for the JDK but Basque "eu" is not supported. We've used the new SPI API for defining the Date and Currency Symbols for the eu locale, this works fine.
    Our problem arises when we use the GregorianCalendar class for the "eu" locale. When we retrieve the first day of the week the method returns 1 (sunday) but in our locale it should be 2 (monday). It seems that when the locale is not known for the JDK it returns the default value (English, I supose).
    Does anyone know how to define the CalendarData for the "eu" locale? or at least, change the default value for getFirstDayOfWeek method?
    Thanks in advance,
    Juanjo

    You may have a look at the java.text.spi and java.util.spi packages.
    With these packages you can define your own provider classes, based, for instance, on the ICU4J classes. These classes will be used throughout your JVM, so by third party software as well.
    I remember having done this once as an experiment. I don't quite remember how to activate it, but I found my source code. Just as an example here how to make use of the com.ibm.icu.text.DateFormatSymbols
    The provider class:
    package org.pbjar.icu4j;
    import java.text.spi.DateFormatSymbolsProvider;
    import java.util.Locale;
    import org.pbjar.icu4j.wrap.DateFormatSymbolsWrapper;
    import com.ibm.icu.text.DateFormatSymbols;
    * Wraps com.ibm.icu.text.DateFormatSymbols.
    * @author Piet Blok
    public class ICU4JDateFormatSymbolsProvider extends DateFormatSymbolsProvider {
        public ICU4JDateFormatSymbolsProvider() {
        @Override
        public Locale[] getAvailableLocales() {
            return ICU4JLocales.getAvailableLocales();
        @Override
        public java.text.DateFormatSymbols getInstance(Locale locale) {
            return new DateFormatSymbolsWrapper(new DateFormatSymbols(locale));
    }And here the wrapper class:
    package org.pbjar.icu4j.wrap;
    import com.ibm.icu.text.DateFormatSymbols;
    * Wrapper for com.ibm.icu.text.DateFormatSymbols.
    * @author Piet Blok
    public class DateFormatSymbolsWrapper extends java.text.DateFormatSymbols {
        private static final long serialVersionUID = 1L;
        DateFormatSymbols symbols;
        public DateFormatSymbolsWrapper(DateFormatSymbols symbols) {
            this.symbols = symbols;
        @SuppressWarnings("unused")
        private DateFormatSymbolsWrapper() {
        @Override
        public Object clone() {
            return new DateFormatSymbolsWrapper((DateFormatSymbols) symbols.clone());
        @Override
        public boolean equals(Object obj) {
            return (obj instanceof DateFormatSymbolsWrapper ? symbols
                    .equals((DateFormatSymbolsWrapper) obj) : false);
        @Override
        public String[] getAmPmStrings() {
            return symbols.getAmPmStrings();
        @Override
        public String[] getEras() {
            return symbols.getEras();
        @Override
        public String getLocalPatternChars() {
            return symbols.getLocalPatternChars();
        @Override
        public String[] getMonths() {
            return symbols.getMonths();
        @Override
        public String[] getShortMonths() {
            return symbols.getShortMonths();
        @Override
        public String[] getShortWeekdays() {
            return symbols.getShortWeekdays();
        @Override
        public String[] getWeekdays() {
            return symbols.getWeekdays();
        @Override
        public String[][] getZoneStrings() {
            return symbols.getZoneStrings();
        @Override
        public int hashCode() {
            return symbols.hashCode();
        @Override
        public void setAmPmStrings(String[] newAmpms) {
            symbols.setAmPmStrings(newAmpms);
        @Override
        public void setEras(String[] newEras) {
            symbols.setEras(newEras);
        @Override
        public void setLocalPatternChars(String newLocalPatternChars) {
            symbols.setLocalPatternChars(newLocalPatternChars);
        @Override
        public void setMonths(String[] newMonths) {
            symbols.setMonths(newMonths);
        @Override
        public void setShortMonths(String[] newShortMonths) {
            symbols.setShortMonths(newShortMonths);
        @Override
        public void setShortWeekdays(String[] newShortWeekdays) {
            symbols.setShortWeekdays(newShortWeekdays);
        @Override
        public void setWeekdays(String[] newWeekdays) {
            symbols.setWeekdays(newWeekdays);
        @Override
        public void setZoneStrings(String[][] newZoneStrings) {
            symbols.setZoneStrings(newZoneStrings);
    }Piet

  • How to change timezone in B2B to reflect date fields per local time in DB

    Hi,
    I am in EST zone and I could see the data in database with date columns having time in PST. One of my transaction just errorred , I could see from B2B user interface tool error report message date time as 2:14 EST, while when I check the database values from TOAD the value is 11:14, which indicates there is some setup which might have caused to update Pacific Time in the database, I am not sure what could be the setup. Can anyone please indicate or provide inputs on what could be the cause and how to set up the application so that the date type data is updated with local time in database.
    Thanks
    Sachin Sutar

    Hi Sachin,
    We store the message using the database time. It seems like the database time zone is set to PST. To change it to a different time zone, please follow the instructions on this link:
    http://www.oracle.com/technology/products/oracle9i/daily/may02.html
    Hope this helps,
    Eng

  • Vendor data to XML local file

    Hello all,
    I am looking for a way to create a background job able to generate or update regularly a xml (or csv or xls) local file containing all my vendors data. I think transaction MDM_CLNT_EXTR on object CREDITOR_EXTRACT can be a good start for this, but I can not generate a local file with this.... Do you have any idea to get to this result?
    Thanks a lot for your kind help,
    R.L.

    Hi,
    Using MDM_CLNT_EXTR you can not generate a local file. This extracts data from source system and sends to PI.  If you want local file then you can choose the following  options:
    1. Execute MDM_CLNT_EXTR. this will create an XML message and will try to send to PI using Proxy framework. Go to transaction SXMB_MONI in you system and download the XML message.
    2. Else, you can go to the transparent table for vendor data and can export it in an Excel file from the table.
    Note: If you have PI system in your landscape then You can also automate the process by configuring PI interface.
    Best Regards,
    Shiv

Maybe you are looking for

  • Folder is missing files...help!

    I have CS GoLive and my portfolio folder on the local side of the window has a plus sign next to it, but won't expand and show the portfolio files. I've tried to copy and paste the pages and I've tried to import the pages to the folder, but nothing s

  • Aggregate Invoicing - Manual billing documents

    Hi All, I am working on Aggregate invoicing functionality for the distributor. So far, I have posted the aggr bills (FICA and Billing) tables DFKKTHI / ECROSSREFNO. However this i have managed to do only for Consumption Bills (periodic/interim). I ha

  • No sound  in organizer photoshop elements 13

    I recently upgraded from Photoshop Elements 10 to 13 and when I play videos there is no sound.  Video sound is fine in Priemer Elements 13. When will this be fixed?

  • Controlling Area and Responsible cost center

    Hi, is it possible to find out "Controlling Area" and "Responsible cost center"to SAP USER Friendly regards Alexander

  • Hiding screen fields containing tables

    HI guyz, i have created a custom  infotype which has 2 subtypes . certain fields should not be displayed when we select the subtypes. i have used the  code below. the screen contains a table. MODULE hide_FIELDS OUTPUT. IF p9555-subty = '1'. LOOP AT S