Question on functions etc.

Say for instance I declared in a function called Function1 an array e.g. int [] sumarr = new int [4];
Then I filled the array with values.
How can I use this array(with contents) in another function, say function2. How do I call it in main if it hasn't been declared in main?
Thanks.

You can return it.
public class Test {
public int[] Function1() {
    int[] sumarr = new int[4];
    for (int i = 0; i < 4; ++i) sumarr[i] = i;
    return sumarr;
public void Function2() {
    int[] s = Function1();
    int sum = 0;
    for (int i = 0; i < s.length; ++i)
       sum += s;
public static void main(String[] args) {
Test t = new Test();
int[] q = t.Function1();
t.Function2();

Similar Messages

  • UI Components Properties, Methods, Functions, etc..

    Hello everyone,
    I have been trying to find the table on SAP that stores the UI components properties, methods, functions, etc..
    As far as i know the Metadata Repository (RSA1) is in charge of managing these information, but is there any table that has this data?
    Doing some research i found that table TADIR contains the Directory of Repository Objects, and querying to the table i found lot of information, unfortunately i dont understand it.
    So, i dont know if somebody has a document, that explains how SAP manages the UI components (buttons, radio buttons, grids, etc..) and where is this information recorded?
    If somebody knows something else that could help me, please let me know or contact me at [email protected]
    Thanx in advance,

    Sorry i made the wrong question.
    I'll try to explain it.
    Im using SECATT for functional testing, and recording some actions in the transaction MB01, i realized that SECATT, gives different names to the fields. For example:
    For the tcode MB01, program 'SAPMM07M' and screen 200.
    The field "Movement Type" field is named 'RM07M-BWARTWE'
    As far as i know the RM07M is the name of the structure which is stored in memory during the execution of the program. Now, my first question is, the field BWARTWE, where is it? , because i couldnt find it in the sap table.
    and my second question is, is there any place where sap records the relation between the fields that the structure uses and the field of the table that will saved the data?
    Any suggestion or help is welcomed. If somebody has any documentation realted with this issue, please let me know, i will really appreciated.
    Thanx in advance.

  • Elements 11 Organizer window is truncated at top, on iMac running 10.9.2, so I can't use Share function, etc.

    Elements 11 Organizer window is truncated at top, on iMac running 10.9.2, so I can't use Share function, etc.

    Thank you very much.  I changed the resolution from 2048 x 1152 to 1600 x 900, and it showed the bar with the Import, Media ... Create, Share buttons, but did not show the bar at the very top with the red, yellow and green buttons for closing, hiding and maximizing the window. 
    Then I noticed that Apple had an update to Mavericks available.  Since I installed that, I can set the resolution back to 2048 x 1152 and still see the Import, etc. bar.  I can live without the Close and Maximize buttons, but it does seem like there is a bug lurking here that either Adobe or Apple needs to fix. 

  • Question about function with in parameters

    Hello,
    I have a question about functions with in-parameters. In the HR schema, I need to get the minimum salary of the job_id that is mentioned as an in-parameter.
    this is what I am thinking but I dont know if it's correct or not or what should I do next!
    create or replace function get_minimum_salary (i_job_id in varchar2)
    return number
    as
    begin
    SELECT min_salary INTO min_sal
    FROM jobs
    where job_id = get_minimum_salary(xy);
    RETURN i_job_id;
    end get_minimum_salary;
    thanks in advance
    EDIT
    Thanks for your help all.
    Is it possible to add that if the i_job_id which is the in type parameter does not have a minimum salary then use the following function to register an error:
    create or replace procedure insert_error (i_error_code in number,
                                                      i_error_message in varchar2)
    as
    begin
    insert into error_table (error_user, error_date, error_code, error_message)
    values (user,sysdate,i_error_code,i_error_message);
    end insert_error;
    This function is basically to say that an error has occured and to register that error, at the same time I need to print out the error using the dbms_out.put_line.
    Any ideas of how to do that?
    Thanks again
    Edited by: Latvian83 on Jun 1, 2011 5:14 AM

    HI
    I have made little bit changes in ur code. try this
    create or replace function get_minimum_salary (i_job_id in varchar2)
    return number
    as
    v_Min_sal jobs.salary%type=0;---- Variable declaration
    begin
    SELECT min_salary INTO v_ min_sal
    FROM jobs
    where job_id = i_job_id;
    RETURN v_Min_sal;
    end get_minimum_salary;
    Regards
    Srikkanth.M

  • Statistical calc with MDX question (Mode function as an excel)

    Hi All,
      I need to create an MDX Calc to Returns the most frequently occurring, or repetitive, value in an array or range of data.
      For example, the mode of 2, 3, 3, 5, 7, 10 is 3.
      In Excel I use the MODE() function but I don't know how to do this in MDX and add it as a measure in Universe.
      I can't do the formula in WEBI because we have big data volume and I can't retrieve all the customers in WEBI.
      We have SAP BW 7.0 and SAP BusinessObjects XI 3.1 fix pack 1.3
    Thanks in advance.

    Hi,
    it looks like you created the entry twice so I would suggest you close on of them:
    Statistical calc with MDX question (Mode function as an excel)
    I don't think that those kind of statistical functions are available in MDX. you can always go to se37 and use the bapi_get_functions to see the list of supported functions.
    Ingo

  • Black lined 'ghost box' is suddenly around every text box, functions, etc.

    I have OS 10.4.11. I had Safari/Firefox open. I was on Ebay, I copied a link to forward.  I opened Entourage to send the link via Email, suddenly I had a black lined box around all functions, etc. and under the Apple Menu, shutdown, restart and logout are double listed.  HELP!  Something is weird, it even seemed to change the font look.
    Somehow my system seems to think there's a second system open simultaneously?
    Computer is also working slower and is acting very oddly.  Have never had issues before like this and I have had Macs for nearly 20 years.
    Thanks!

    That did it.  Thank you very, very much - I appreciate your expertise in helping me!  Would you happen to have any idea how that may have been turned on?  I did not access that program at all - I was just going between Safari, Firefox and my E-mail client and voila - the box was on. . .
    Just curious so I don't make the same mistake again. . .
    Don

  • Transportable Tablespace and Packages/Functions etc

    We are currently experimenting with transportable tablespaces. Is it possible to take functions/packages etc or are you limited to tables/data/triggers.
    Thanks
    Chris

    Transport tablespace is available in version 9.2. In that version you need to put the tablespace in read only mode, export the tablespace metadata, copy the tabalespace files, and then import the metadata. Now, I don't believe this will transport the other objects. Someone else chime in if I am incorrect.
    What you can do is transport the tabelspace and then run an export rows=n
    and then import this empty dump (that will include the procedures/functions.etc) with ignore=y

  • What is going on? My password works here but when I used it to check about find my phone, it got complicated, put in answer to question, get email, etc.

    What is going on? My password works here but when I used it to check about find my iphone, it got complicated, put in answer to question, get email, etc.

    No, dude, if this guy can use it, so can most of his other neighbors. Let's point out a few things:
    1. This is very poor security, not to mention irresponsible of the neighbor to open his wireless to every person and pervert in his neighborhood!
    2. This guy still has NO control over who's using is, so of course bandwidth will be affected
    3. Until the neighbor locks it down to just 2 people, of course it will be slow
    Let's start using our brains before we have the poor guy start deleting plists, getting the apple broadband utility, rebuilding his O/S, reinstalling the combo updates and/or repairing permissions (good one!) .... he simply has NO control over the speed of that which he's using/stealing.
    Power Mac G5 Dual 2Ghz/iBook G4 1.42Ghz   Mac OS X (10.4.7)   2.5 Gig, Rad 9800 Pro 256M

  • SD ABAP Questions for functional

    Hi People,
                       Can some body please help out about how much of the ABAP is expected to be known by a SAP SD functional consultant?Please list some usual  questions asked to SD functional regarding ABAP?

    Hi,
    Depend upon your experience you ABAP knowledge will be expected and generally we have to know the tables, fields, user exits etc., to prepare functional specifications for any enhancements, reports or forms etc.,
    regards

  • Had to change my Apple ID because the original email address is no longer valid.  How do I change the iCloud user name on iMac?  I found instructions about signing out of iCloud and signing back end.  It asks questions about contact, etc.

    Had to change Apple ID due to email address no longer valid.  Trying to change id for icloud...saw direction online about signing out of icloud and signing back in...when it ask questions about contacts, photos, etc. being deleted how do I answer those?  That just sort of freaks me out.

    For the ones that give you an option, select the option you want (keep on the Mac or Delete). For the ones that are simply warning you, click on Delete from Mac.
    They will all come back when you sign back on, since all you did was change your existing Apple ID to a new email address. It's the same iCloud account, just with a different name.
    It's the only way to get your updated ID signed onto iCloud.
    Cheers,
    GB

  • Question regarding Function F4IF_INT_TABLE_VALUE_REQUEST

    Hi Experts,
    I am using the function F4IF_INT_TABLE_VALUE_REQUEST in my code as follows :
    *& Report  ZTESTER
    REPORT  ZTESTER.
    DATA : begin of VALUE_TAB occurs 0,
            matnr like marc-matnr,
            werks like marc-werks,
            pstat like marc-pstat,
           end of value_tab.
    data: Lt_fields type table of dfies,
          lt_return LIKE ddshretval OCCURS 0 WITH HEADER LINE.
    PARAMETERS : P_WERKS LIKE MARC-WERKS.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_WERKS.
    SELECT matnr werks pstat INTO CORRESPONDING FIELDS OF TABLE
    VALUE_TAB
    FROM MARC WHERE MATNR LIKE 'SH%'.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
      EXPORTING
      DDIC_STRUCTURE         = 'MARC'
        retfield               = 'WERKS'
      PVALKEY                = ' '
       DYNPPROG               = SY-REPID
       DYNPNR                 = SY-DYNNR
      DYNPROFIELD            = 'P_WERKS'
      STEPL                  = 0
      WINDOW_TITLE           =
      VALUE                  = ' '
       VALUE_ORG              = 'S'
      MULTIPLE_CHOICE        = 'X'
       DISPLAY                = 'X'
      CALLBACK_PROGRAM       = ' '
      CALLBACK_FORM          = ' '
      MARK_TAB               =
    IMPORTING
      USER_RESET             =
      tables
        value_tab              = VALUE_TAB
       FIELD_TAB              = LT_FIELDS
       RETURN_TAB             = LT_RETURN
      DYNPFLD_MAPPING        =
    EXCEPTIONS
       PARAMETER_ERROR        = 1
       NO_VALUES_FOUND        = 2
       OTHERS                 = 3
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    LOOP AT LT_RETURN.
    P_WERKS = LT_RETURN-fieldval.
    ENDLOOP.
    The code is working fine and when we execute the report and press F4 on the Field, there is an option for User Input also in the search help. The F4 Help shows the values for Material, Plant and Maintenance Status. Also, the user-input options contain the same fields.
    My question is Can we give user an additional field say, MARC-MMSTA to enter the value in but dont display it in the value-list.
    Please help. Points will be rewarded to useful answers.
    Thanks.

    This is not possible.... when ever you give an additional field as user input, these values are definitely reflected when you call for F4 help... So its not possible to avoid the additional field to be displayed...
    Regards,
    Pavan P.

  • Microsoft Exam Questions On Functionality That Doesn't Work!

    What does a student do if they are tested, in a Microsoft exam, on functionality that's known not to work?!
    It seems absurd that Microsoft is doing this.

    Assume it does work when you take the exam.
    How can functionality that doesn't work outside of the exam suddenly and mysteriously work in the exam? that doesn't make sense!
    Turn a blind eye toward "real world" experiences in these types of cases.
    Turning a blind eye to functionality that doesn't work isn't the correct solution: fixing the software or removing the question
    from the exam is.
    Be sure to mark the exam questions that you disagree with.
     - and what happens if the student concerned did not think to do this at this time but only after she had time
    to think about it afterwards?
    Thank you for your contribution but I feel that it does not really address the problem I have highlighted.

  • Question regarding functional​ity of "Sear​ch 1D Array Function&q​uot; in TCP/IP context

    In the attached tcp_Registry.vi, the vi uses the "Search 1D Array Function".  I can't figure out why this function can't find the index of the input element, since the inputs to the function match...
    Solved!
    Go to Solution.
    Attachments:
    tcpInstrument.llb ‏238 KB
    tcp_registry_error_2Jun09.zip ‏435 KB

    I was a bit surprised this morning by the fact that the Initialize vi worked, so I decided, "What the heck?" I'll try the "LCLSA Wave Save To File.vi" again, as I haven't been able to get this one working without errors for the past few months.  And, magically, it worked!  I didn't believe it, so I ran it again - and it worked again!  I still didn't think this was true, so I ran a slightly modified vi I made, "LCLSA Wave Save To File_looped.vi", which just repeats the vi for multiple iterations to create multiple data files.  And this worked, too!  I have NO idea why today everything seems to be fine - I've seriously had issues with the stuff for at least 3 months.  However, I'm just going to go with the flow and see if I can now implement this stuff in my own application now and will let you know how that goes.
    A quick question - do you have any suggestions as to how to view the data files properly?  I believe they come out as binary, but look like mumbo-jumbo when viewed in a text editor like WordPad.  Thanks!
    Attachments:
    3Jun09 Files.zip ‏2 KB

  • Database Refresh with (data + metadata including views, functions etc)

    PROBLEM:
    I want to refresh data + metadata (tables, views, function, procedures, packages, triggers, package body etc) from one database to another database.
    Now if objects already exists in the TARGET database, then we have option as TABLE_EXISTS_ACTION=REPLACE for TABLE.
    But, do we have any other such option for OBJECTS OTHER THAN TABLE (LIKE VIEWS, PROCEDURES, FUNCTION, TRIGGER, PACKAGE, PACKAGE BODY).?
    Because I dont see any such option. Currently if the Object is already there in the TARGET Database, it errors out without importing as OBJECT ALREADY EXISTS statement.
    As we have lots of migration, number of objects changes & new objects coming up in Production very frequently.
    And due to this, we cannot put big list of INCLUDE and also even keeping that we have to prepare that list very often as number of objects changes very frequently.
    Please help me with some better solution.
    Thanks to all participants in advance.
    Nil

    I understand that you are Newbie , let give me simple steps.
    Follow the steps on testing envi.
    1. Drop only Application users that you want to refresh from Prod(Do NOT drop users system,sysaux.. or tablespaces)
    2. Create the users that you dropped.
    3. using import or import data pump import the data.
    In case you want to import user"A" data to "B" use REMAP_SCHEMA option.
    See the below link for data pump export/import with examples.
    http://oracleracexpert.blogspot.com/2009/08/oracle-data-pump-exportimport.html
    Hope this helps.
    Regards,
    Satishbabu Gunukula
    http://oracleracexpert.blogspot.com
    Click here for [How to add and remove OCR|http://oracleracexpert.blogspot.com/2009/09/how-to-add-and-remove-ocr-oracle.html]
    Click here in [ Making decisions and migrating your databases |http://oracleracexpert.blogspot.com/2009/08/download-sql-developer-migration.html]
    Click here to lean [ Static parameters change in SPFILE and PFILE|http://oracleracexpert.blogspot.com/2009/09/how-to-change-static-parameters-in.html]
    Edited by: Satishbabu Gunukula on Sep 14, 2009 5:09 PM
    Edited by: Satishbabu Gunukula on Sep 18, 2009 10:35 AM

  • Mapping Question p3: .. etc.. namespace prefixes

    Does anyone know why xi uses namespace prefixes like p3: p2: etc..?  I am trying to map based on an rfc as the target and a message from a wsdl as the source.  I can not test the map because it expects the test file ( from our partner ) to have all these P3:'s in it and it doesn't.  Here is a snippet of what is happening at translation ....
    <p3:Execute2 xmlns:p3="http://www.some/namespace/">
    <p3:transaction-limit type="Amount"><p3:value>99999999999</p3:value></p3:transaction-limit><p3:transaction-limit type="Number"><p3:value> 9999</p3:value></p3:transaction-limit></p3:daily-transaction-limits><p3:single-transaction-limits></p3:single-transaction-limits><p3:monthly-transaction-limits></p3:monthly-transaction-limits></p3:authorization-control><p3:request-type>Activate</p3:request-type>
    Message was edited by: Andrew Alpaugh

    Hi Andrew,
    the question is a little bit unclear to me. When I get you right, you have a WSDL that describes a message you get from a partner. You use this WSDL to define a Message Mapping. The Message Mapping does not work as expected. The fragment you have posted is probably what the Message Mapping seems to expect (according to the test panel). But the message you get from your partner looks different (it does not have all these prefixes).
    I suppose that the schema contained in the WSDL (more precisely in the types-section) states that all elements have to be namespace-qualified (this could e.g. be done by having an elementFormDefault="qualified" in the schema). Thus, if the elements are unqualified in the message you get from your partner it simply means that the partner does not stick to the WSDL.
    If this does not help you, I would have to see the WSDL and an example message that failed to work.
    Note, however that there are different ways to express namespaces. If the document sent by your partner looks as follows:
    <Execute2 xmlns="http://www.some/namespace/">
    <transaction-limit type="Amount">...
    it is logically equivalent to the one you posted, and the Message Mapping will treat them identical.
    Greetings
              Stephan

Maybe you are looking for

  • Lenovo W530 no longer boots since updating past 3.7.1

    Hi, I've been suffering from this for a while and I finally thought I should get around to asking the collective wisdom of the forums.  I use rEFInd to boot my laptop and everything has been working well until I updated to 3.7.3.  The next time I reb

  • R/3 to XI configuration

    Hi I am new to ALE-IDOC.I had a requirement to establish connectivity to XI system from the R/3 system.Can I got a blog or document which serves my purpose.If so please povide me the link.I also need to send master data from R/3 to XI and viceversa.

  • NSS2000 anonymousftp

    I setup anonymousftp share on my nss2000, I can upload files to it as anonymous, but I cannot delete anything.  I create a username, give it read/write access to this share.  I connect to the CIFS share using this user.  I see the incoming directory,

  • Using photoshop on more than one computer

    I purchased Photoshop CS6 for my home Mac several months ago. I am about to buy my daughter a Mac. Will I be able to install photoshop on her computer, too? Can I use it on more than one computer in the same household?

  • Adobe Photoshop Elements 12 Fehler beim Installieren

    Hello, i have a PC with windows 7 and an old version Elements 8 that i have deinstall. I bought yesterday the new photoshop elements 12 on a CD and i try to install- That was not a good Idea!. By every try a get a: COMMON TECHNOLOGIES CANT BE INSTALL