Array of superclass with multiple subclasses

I have a project in which I need to use an array of objects using the superclass Person, where each element can be of the subclass either Student or Instructor. However, it produces some errors that don't make sense to me.
here is the initialization block (it is at the beginning of the class I am using it in.)
Person[] people= new Person[6];
people[0]= new Student("Jake Duck",3,25,1997,"Flying");
people[1]= new Student("Loosy Goose",3,29,1998,"Swimming");
people[2]= new Instructor("Blizzard Tiger",12,12,1996,40000);
people[3]= new Student("Tuffy Terrier",10,12,1996,"Barking");
people[4]= new Instructor("Zip Cat",3,28,1994,50000);
people[5]= new Instructor("Sparky Dalmatian",2,27,1996,30000);
This produces errors like these, modified for every entry.
C:\Java\JCreator le\MyProjects\Lab 5\L5Main.java:4: ']' expected
     people[0]= new Student("Jake Duck",3,25,1997,"Flying");
^
C:\Java\JCreator le\MyProjects\Lab 5\L5Main.java:4: <identifier> expected
     people[0]= new Student("Jake Duck",3,25,1997,"Flying");
However, when I commented out the initialization block and tried this, the same thing without the array, it seemed to accept the syntax, so I think it must be something to do with the array.
Person me = new Student("Jake Duck",3,25,1997,"Flying");
I've been trying different things and trying to find what is wrong in a couple of textbooks for about an hour now, with no luck, so if anyone has any ideas, they would be greatly appreciated.

Given that the error is on line 4 of your code, I'm going to take a guess that its not inside a method, constructor or instance initialiser.
If your code looks something like this:
public class MyClass {
Person[] people= new Person[6];
people[0]= new Student("Jake Duck",3,25,1997,"Flying");
//etc...
}then the error is because you are trying to execute code where only variable declaration are required. You can fix it by either:
1. Use an array initialisation block:
Person[] people= new Person[] {
new Student("Jake Duck",3,25,1997,"Flying"),
new Student("Loosy Goose",3,29,1998,"Swimming"),
new Instructor("Blizzard Tiger",12,12,1996,40000),
new Student("Tuffy Terrier",10,12,1996,"Barking"),
new Instructor("Zip Cat",3,28,1994,50000),
new Instructor("Sparky Dalmatian",2,27,1996,30000),
2. Use an instance initialiser:
Person[] people= new Person[6];
people[0]= new Student("Jake Duck",3,25,1997,"Flying");
people[1]= new Student("Loosy Goose",3,29,1998,"Swimming");
people[2]= new Instructor("Blizzard Tiger",12,12,1996,40000);
people[3]= new Student("Tuffy Terrier",10,12,1996,"Barking");
people[4]= new Instructor("Zip Cat",3,28,1994,50000);
people[5]= new Instructor("Sparky Dalmatian",2,27,1996,30000);
(the difference is just the braces).
3. Put the code inside the braces above, in your class's consructor.
From the brief section of code you've shown us, I'd recommend using approach (1) above, and making the array static. (but obviously I don't know that muich about what you're trying to achieve).
If none of the above suggestions solve your problem, can you post code for an entire class, that can be compiled and executed without change (just the minimum necessary to show the error - remove all unrelated code).
Hope this helps,
Matt

Similar Messages

  • String Array declaration with multiple lines

    I have an array declaration with several indexes where it covers multiple lines.
    Please advise if this is the best way to declare an array declaration with multiple lines:
    String cityString = "San Diego, Oakland, London, New York, Dublin," +
    "Dallas, Milan";
    String city[] = cityString.split(",");

    String[] city = {"San Diego", "Oakland", "London",
    "New York", "Dublin", "Dallas", "Toronto"};You can use indentation and line breaks as you like, as usual in Java.

  • X79-GD45(8D) with multiple raid0 arrays

    Hello everyone,
    I would like to upgrade my computer soon and I was checking different motherboards for an i7-3930K processor.
    The X79-GD45(8D) seems pretty good for such a low price motherboard for this socket.
    However I intend to have 2 different raid0 arrays on my system and I would like to know if this motherboard will support them or if anyone has already done that on it and succeeded.
    Here are the specs for the arrays :
    - a raid0 with 2x OCZ Vector 256GB on the SATA6Gbs ports
    - a raid0 with 2x Western Digital Caviar Black 500GB or 750GB on the SATA3Gbs ports
    Added to these arrays, I will also plug a single 1 TB HDD and a Bluray reader (meaning all SATA ports will be used on the motherboard).
    As I was checking the forums, it seems that the X79-GD65 is capable of doing that but it costs a little more than the GD45 (and the 2 other Marvel SATA6Gbs ports will not be of any use for me since they cannot be raided).
    Since my configuration is already pretty costly, I try to keep everything I can to a minimum.
    Thanks in advance for your help 

    Quote from: Froggy Gremlin on 15-January-13, 17:16:54
    The X79A-GD65 standard or (8D) have ASMedia SATA III controllers, not Marvell. If they had Marvell, RAID would have been supported on those ports as well as Intel's.
    Ah yes sorry my mistake . But well at least I was right when saying that they cannot be raided.
    Oh btw (I'm quite a noob when it comes to overclocking), which RAM would be the best to use for the combo i7-3930K and X79-GD45 :
    - G.Skill RipJaws Z Series 16 GB (4x 4GB) DDR3 1600 MHz CL7 (overclocked to 2400MHz)
    or
    - G.Skill RipJaws Z Series 16 GB (4x 4GB) DDR3 2400 MHz CL10 ?
    Oh and do you know why higher latency sticks are sometimes more expensive than the lower ones (for instance G.Skill RipJaws Z Series 16 GB (4x 4GB) DDR3 2400 MHz CL11 is more expensive than the CL10 bundle...) ?

  • How to control one server with multiple clients via TCP/IP

    I am wanting to control a single server with multiple clients.  Only one client would be active at a time, so there would be no conflict.  I want to use TCP/IP.  So far, I have programmed a cluster that passes data back to the server with no problems.  The challenge come in when a second client is added to the mix.  I have't been able to figure out how to turn each client on and send the appropriate data and then turn it off so it doesn't keep sending the same data to the server. 
    Here are the things that I have considered and did some preliminary testing, but don't really know how to impliment:
    1.  Send a numeric on the front of the cluster packet that tells the server that data is on the way.
    2.  Send a boolean on the front of the cluster packet to somehow turn the server TCP/IP on.
    The problem I have found is that LabVIEW TCP/IP doesn't like to be turned on and off.  If it doesn't get the data it expects, it goes into a reset mode and that kills the response time.
    Any help?

    You should consider implementing a set of simple one-byte commands that can be sent back and forth between the Server and the Clients. You can base all of these ideas off the example in the Example Finder under Networking >> TCP and UDP called Multiple Connections - Server.
    You will have two loops in the server VI: one to wait for new connections, and one to send and receive data from the existing connections. For instance, after one of the clients connects, it can request control of the server to send data to it by sending the character "R" for request. Every time the send/receive loop of the Server executes, the first thing it can do is to check all the existing connections to see if any of the clients have sent a control request ("R"). If so, it will create a buffer (array) of control requests. This could be in the form of Connection IDs or indexes in the array for a particular Connection ID. Your choice.
    After the Server receives a request for contol, if it is not already under control by another client, then it can send a response to the first client on the control request list. For instance, the server could send the first client a "S" command for send. Note that after the clients send their control request, they should execute a TCP Read and wait indefinitely for the server to respond with the one-byte "S" command. Then, once the client in control is finished sending data to the server, it could send the character "X" telling the Server to release it from control.
    The example I mentioned above already does a similar thing. Note how when a client wants to disconnect, they send the letter "Q". You can see this in the Multiple Connections - Client VI. The Server then checks each individual connection to see if it's received this one-byte command, and if it has, it closes the connection to the client. This is what you would want to implement, but instead of having just one command, you'll have to distinguish between a few and build up a buffer of control requests.
    Finally, if a client does decide to disconnect in your application, they could send the command "Q" just like the example above. At this point, close the connection and remove that Connection ID from the array of connections. You will also have to handle the case that this client was in the request control waiting line when it disconnected, in which case you need to delete it from that array as well.
    This will definitely work for you, but it will take some work. Best of luck!
    Jarrod S.
    National Instruments

  • How can I convert string to the record store with multiple records in it?

    Hi Everyone,
    How can I convert the string to the record store, with multiple records? I mean I have a string like as below:
    "SecA: [Y,Y,Y,N][good,good,bad,bad] SecB: [Y,Y,N][good,good,cant say] SecC: [Y,N][true,false]"
    now I want to create a record store with three records in it for each i.e. SecA, SecB, SecC. So that I can retrieve them easily using enumerateRecord.
    Please guide me and give me some links or suggestions to achieve the above thing.
    Best Regards

    Hi,
    I'd not use multiple records for this case. Managing more records needs more and redundant effort.
    Just use single record. Create ByteArrayOutputStream->DataOutputStream and put multiple strings via writeUTF() (plus any other data like number of records at the beginning...), then save the byte array to the record...
    It's easier, it's faster (runtime), it's better manageable...
    Rada

  • [svn] 949: Bug: BLZ-96 - When sending a HttpService request from ActionScript with multiple headers with the same name , it causes a ClassCastException in the server

    Revision: 949
    Author: [email protected]
    Date: 2008-03-27 07:12:59 -0700 (Thu, 27 Mar 2008)
    Log Message:
    Bug: BLZ-96 - When sending a HttpService request from ActionScript with multiple headers with the same name, it causes a ClassCastException in the server
    QA: Yes - try again with legacy-collection true and false.
    Doc: No
    Checkintests: Pass
    Details: Another try in fixing this bug. When legacy-collection is false, Actionscript Array on the client becomes Java Array on the server and my fix yesterday assumed this case. However, when legacy-collection is true, Actionscript Array becomes Java ArrayList on the server. So added code to handle this case.
    Ticket Links:
    http://bugs.adobe.com/jira/browse/BLZ-96
    Modified Paths:
    blazeds/branches/3.0.x/modules/proxy/src/java/flex/messaging/services/http/proxy/RequestF ilter.java

    Hi all!
    Just to post the solution to this if anyone ever runs accross this thread...
    For some reason i had it bad the first time, don't have time right now to see why but here is what worked for me:
    HashMap primaryFile = new HashMap();
    primaryFile.put("fileContent", bFile);
    primaryFile.put("fileName", uploadedFile.getFilename());
    operationBinding.getParamsMap().put("primaryFile", primaryFile);
    HashMap customDocMetadata = new HashMap();
    HashMap [] properties = new HashMap[1];
    HashMap customMetadataPropertyRoom = new HashMap();
    customMetadataPropertyRoom.put("name", "xRoom");
    customMetadataPropertyRoom.put("value", "SOME ROOM");
    properties[0] = customMetadataPropertyRoom;
    customDocMetadata.put("property", properties);
    operationBinding.getParamsMap().put("CustomDocMetaData", customDocMetadata);
    Basically an unbounded wsdl type is an array of objects (HashMaps), makes sense, i thought i had it like this before, must have messed up somewhere...
    Good luck all!

  • [svn] 931: Bug: BLZ-96 - When sending a HttpService request from ActionScript with multiple headers with the same name , it causes a ClassCastException in the server

    Revision: 931
    Author: [email protected]
    Date: 2008-03-26 11:31:01 -0700 (Wed, 26 Mar 2008)
    Log Message:
    Bug: BLZ-96 - When sending a HttpService request from ActionScript with multiple headers with the same name, it causes a ClassCastException in the server
    QA: Yes - we need automated tests for this basic case.
    Doc: No
    Checkintests: Pass
    Details: RequestFilter was not handling multiple headers with the same name properly.
    Ticket Links:
    http://bugs.adobe.com/jira/browse/BLZ-96
    Modified Paths:
    blazeds/branches/3.0.x/modules/proxy/src/java/flex/messaging/services/http/proxy/RequestF ilter.java

    Hi all!
    Just to post the solution to this if anyone ever runs accross this thread...
    For some reason i had it bad the first time, don't have time right now to see why but here is what worked for me:
    HashMap primaryFile = new HashMap();
    primaryFile.put("fileContent", bFile);
    primaryFile.put("fileName", uploadedFile.getFilename());
    operationBinding.getParamsMap().put("primaryFile", primaryFile);
    HashMap customDocMetadata = new HashMap();
    HashMap [] properties = new HashMap[1];
    HashMap customMetadataPropertyRoom = new HashMap();
    customMetadataPropertyRoom.put("name", "xRoom");
    customMetadataPropertyRoom.put("value", "SOME ROOM");
    properties[0] = customMetadataPropertyRoom;
    customDocMetadata.put("property", properties);
    operationBinding.getParamsMap().put("CustomDocMetaData", customDocMetadata);
    Basically an unbounded wsdl type is an array of objects (HashMaps), makes sense, i thought i had it like this before, must have messed up somewhere...
    Good luck all!

  • Howto deal with multiple source files having the same filename...?

    Ahoi again.
    I'm currently trying to make a package for the recent version of subversive for Eclipse Ganymede and I'm almost finished.
    Some time ago the svn.connector components have been split from the official subversive distribution and have to be packed/packaged extra. And here is where my problem arises.
    The svn.connector consists (among other things) of two files which are named the same:
    http://www.polarion.org/projects/subversive/download/eclipse/2.0/update-site/features/org.polarion.eclipse.team.svn.connector_2.0.3.I20080814-1500.jar
    http://www.polarion.org/projects/subversive/download/eclipse/2.0/update-site/plugins/org.polarion.eclipse.team.svn.connector_2.0.3.I20080814-1500.jar
    At the moment makepkg downloads the first one, looks at its cache, and thinks that it already has the second file, too, because it has the same name. As a result, I can neither fetch both files nor use both of them in the build()-function...
    Are there currently any mechanisms in makepkg to deal with multiple source files having the same name?
    The only solution I see at the moment would be to only include the first file in the source array, install it in the build()-function and then manually download the second one via wget and install it after that (AKA Quick & Dirty).
    But of course I would prefer a nicer solution to this problem if possible. ^^
    TIA!
    G_Syme

    Allan wrote:I think you should file a bug report asking for a way to deal with this (but I'm not sure how to fix this at the moment...)
    OK, I've filed a bug report and have also included a suggestion how to solve this problem.

  • Building array and writing to multiple files

    Greetings,
    I have a VI wherein, I am collecting data from 3 channels (using Global Virtual Channels with scaling). I am collecting 100 samples at a time with sampling frequency of 1000 Hz. I am then taking average and st. dev of 100 data points/channel and write it to a file (‘*.dat’). I would like to limit the file size to 1000 entries, and so after that limit is reached I would like to create a new file and write the subsequent set of data to the next file and so on. I am doing this in a case structure, wherein I build an array of the values until the condition of file limit is reached and then I write that array to a ‘*.dat’ file. (I’m hoping that this logic is correct, if not please suggest the correct method)
    I am also taking average and st. dev of data/channel over period of 1 sec and write it to another ‘*.sum’ file. The VI has other features like writing time stamp to file, stopping the VI after preset time limit is reached or certain safety limit is reached.
    When I run the VI, I get an error message:
    Error 7 occurred at Open/Create/Replace File in Global Channel with Multiple file Write.vi
    Possible reason(s):
    LabVIEW:  File not found. The file might have been moved or deleted, or the file path might be incorrectly formatted for the operating system. For example, use \ as path separators on Windows, : on Mac OS X, and / on Linux. Verify that the path is correct using the command prompt or file explorer.
    =========================
    NI-488:  Nonexistent GPIB interface.
    I have indicated the location of the error in the attached picture, as well as I’m attaching the VI.
    I would really appreciate if someone would tell me what is causing the error and how to fix it.
    Thanks,
    Dinesh
    Solved!
    Go to Solution.
    Attachments:
    Block Diag.png ‏121 KB
    Global Channel with Multiple file Write.vi ‏515 KB

    I did try that but it does not solve the problem. I think I'm missing something while building the array in the Case Structure. I would like to write the average & st. dev values/channel in an array while the loop coount < file limit, and once the file limit is reached write that array to a *.dat file. And keep repeating this procedure till the target time is reached.
    Another issue that I discovered is that TestFile_1.dat is not generted, after TestFile_0.dat TestFile_2.dat gets generated. I'm not sure why this is happening.
    I would really appreciate if you would take another look and suggest some debugging tips.
    Thanks.
    P.S. I am attaching the updated VI
    Attachments:
    Global Channel with Multiple file Write.vi ‏515 KB

  • Oracle 8i array DML operations with LOB objects

    Hi all,
    I have a question about Oracle 8i array DML operations with LOB objects, both CLOB and BLOB. With the following statement in mind:
    INSERT INTO TABLEX (COL1, COL2) VALUES (:1, :2)
    where COL1 is a NUMBER and COL2 is a BLOB, I want to use OCIs array DML functionality to insert multiple records with a single statement execution. I have allocated an array of LOB locators, initialized them with OCIDescriptorAlloc(), and bound them to COL2 where mode is set to OCI_DATA_AT_EXEC and dty (IN) is set to SQLT_BLOB. It is after this where I am getting confused.
    To send the LOB data, I have tried using the user-defined callback method, registering the callback function via OCIBindDynamic(). I initialize icbfps arguments as I would if I were dealing with RAW/LONG RAW data. When execution passes from the callback function, I encounter a memory exception within an Oracle dll. Where dvoid **indpp equals 0 and the object is of type RAW/LONG RAW, the function works fine. Is this not a valid methodology for CLOB/BLOB objects?
    Next, I tried performing piecewise INSERTs using OCIStmtGetPieceInfo() and OCIStmtSetPieceInfo(). When using this method, I use OCILobWrite() along with a user-defined callback designed for LOBs to send LOB data to the database. Here everything works fine until I exit the user-defined LOB write callback function where an OCI_INVALID_HANDLE error is encountered. I understand that both OCILobWrite() and OCIStmtExecute() return OCI_NEED_DATA. And it does seem to me that the two statements work separately rather than in conjunction with each other. So I rather doubt this is the proper methodology.
    As you can see, the correct method has evaded me. I have looked through the OCI LOB samples, but have not found any code that helps answer my question. Oracles OCI documentation has not been of much help either. So if anyone could offer some insight I would greatly appreciate it.
    Chris Simms
    [email protected]
    null

    Before 9i, you will have to first insert empty locators using EMPTY_CLOB() inlined in the SQL and using RETURNING clause to return the locator. Then use OCILobWrite to write to the locators in a streamed fashion.
    From 9i, you can actually bind a long buffer to each lob position without first inserting an empty locator, retrieving it and then writing to it.
    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by CSimms:
    Hi all,
    I have a question about Oracle 8i array DML operations with LOB objects, both CLOB and BLOB. With the following statement in mind:
    INSERT INTO TABLEX (COL1, COL2) VALUES (:1, :2)
    where COL1 is a NUMBER and COL2 is a BLOB, I want to use OCIs array DML functionality to insert multiple records with a single statement execution. I have allocated an array of LOB locators, initialized them with OCIDescriptorAlloc(), and bound them to COL2 where mode is set to OCI_DATA_AT_EXEC and dty (IN) is set to SQLT_BLOB. It is after this where I am getting confused.
    To send the LOB data, I have tried using the user-defined callback method, registering the callback function via OCIBindDynamic(). I initialize icbfps arguments as I would if I were dealing with RAW/LONG RAW data. When execution passes from the callback function, I encounter a memory exception within an Oracle dll. Where dvoid **indpp equals 0 and the object is of type RAW/LONG RAW, the function works fine. Is this not a valid methodology for CLOB/BLOB objects?
    Next, I tried performing piecewise INSERTs using OCIStmtGetPieceInfo() and OCIStmtSetPieceInfo(). When using this method, I use OCILobWrite() along with a user-defined callback designed for LOBs to send LOB data to the database. Here everything works fine until I exit the user-defined LOB write callback function where an OCI_INVALID_HANDLE error is encountered. I understand that both OCILobWrite() and OCIStmtExecute() return OCI_NEED_DATA. And it does seem to me that the two statements work separately rather than in conjunction with each other. So I rather doubt this is the proper methodology.
    As you can see, the correct method has evaded me. I have looked through the OCI LOB samples, but have not found any code that helps answer my question. Oracles OCI documentation has not been of much help either. So if anyone could offer some insight I would greatly appreciate it.
    Chris Simms
    [email protected]
    <HR></BLOCKQUOTE>
    null

  • Counting rows with multiple criteria

    I know this is a silly beginner question, but is there an easy way to count the number of rows in a table which match criteria based on different columns (sort of a countif with multiple criteria). For example, if Column A in a table has "All, Some, None" responses and Column B has "Main, Off" responses, is there an easy way to count the number of rows in which Column A has All and Column B has Off?

    Neondiet wrote:
    From an intellectual and philosophical view I agree with you. But from a practical view what I really want to do is just use one application for my spreadsheet tasks, not jump back and forth because one sheet I share with MS Windows users, and another with Numbers users, and another with OS X users who don't have Numbers or Excel but do have NeoOffice. Maybe I have to settle for that though.
    Yeah... this kind of situation stinks. Its like needing to writing software that will run on both Macs and PCs.
    Anyway, I've followed the advise in this forum and resorted to using a hidden column with concatenated values to solve my own problem, though it does seem like a bit of a hack compared to managing a single formula in a single cell. Horses for courses I suppose.
    jaxjason has posted a very elegant pivot table like solution that utilizes this technique. See http://www.numberstemplates.com/forums/showthread.php?t=36
    Btw, from what I've read on the net to date, SUM (in Excel) with an array formula answers the original authors problem of counting occurrences of values, not SUMPRODUCT; which I believe sums up the contents of cells in a range, if cells in other ranges match specific criteria.
    Yes, if you use the '*' (as indicated above) then SUM() is sufficient though SUMPRODUCT() will work as it degenerates to SUM when there is only one argument. If you use two arrays as arguments (like: = SUMPRODUCT((A1:A4="All"), (B1:B4="Off")), then SUMPRODUCT() is necessary. Here's my understanding of how it works (I hope your able to follow my abuse of algebraic techniques):
    =SUM((A1:A4="All") * (B1:B4="Off"))
    expanding the array expressions...
    =SUM((A1="All", A2="All", A3="All", A4="All") * (B1="Off", B2="Off", B3="Off", B4="Off"))
    at this point Excel computes the equality expressions, for example...
    =SUM((TRUE, FALSE, TRUE, FALSE) * (TRUE, TRUE, FALSE, FALSE))
    expanding the array multiplication...
    =SUM((TRUE * TRUE, FALSE * TRUE, TRUE * FALSE, FALSE * FALSE))
    Excel, apparently, then, when forced to multiply Boolean values, maps TRUE -> 1 and FALSE -> 0...
    =SUM((1 * 1, 0 * 1, 1 * 0, 0 * 0))
    performing the multiplications...
    =SUM((1, 0, 0, 0))
    summing...
    =1 + 0 + 0 + 0
    resulting...
    =1
    I'm afraid, now, if I continue any further, Yvan will chastise me.

  • OBIEE Date Comparison report with multiple measures

    Hello everyone...
    I have a requirement where I need to create a date comparison report (Current Month vs. Prior Month vs Prior Month Year Ago vs YTD vs Prior YTD vs Rolling 3 months, etc) with multiple Measures (Quote count, Quote offered count, New Business count, etc). I am to generate this report in this fashion:
    Quotes Current Month vs PM vs YoY Prior
    Month Current Month Prior Year Current
    YTD vs PM Prior
    YTD Rolling 3 Months vs PM Prior Rolling 3 Months
    Issued 120 120 123 1400 1020 1700 1580
    Unique Risks
    Offered 556 449 571 5881 6220 6101 5892
    Unique Risk Close Ratio
    Offered Close Ratio 21.6% 26.7% 21.5% 23.8% 16.4% 27.9% 26.8%
    Bitmap
    Avg Issued Premium 240 238 222 2801 2630 3104 2892
    Avg Offered Premium
    New Business
    Count
    Avg Full Term Premium
    I understand that time series is an option, and have created the time series (which show up as measures).
    My problem is:
    when creating the report (even as a pivot table) , OBIEE is not allowing me to drag the measure to rows, nor is it allowing me to drag the time series to columns. Also, I need to do conditional formating on some of the columns showing an up arrow for increased vs. prior month and down arrow for decreased vs. prior month.
    Does anyone have a solution for this issue? Any assistance would be greatly appreciated...
    Please advise and thanks!!!

    Jason,
        You've been very helpful, but I guess I'm just not explaining myself that well. The Credit Memo's throw things off because they do not contain a "Paid Date" value. That field in the record is blank. Since it is blank the report query ignores them. Therefore when the report query returns all records that have a "Paid date" range of "x to y" they are never returned. This is a problem whenever a credit memo exists for an invoice because the "invoice total" never changes. So when a customer pays on their account for a particular invoice, they only pay what is due which is the "invoice total" minus any "credit" from the "Credit Memo". So when my A/R person receives payment they are showing the invoice paid in full because MAS automatically includes all invoices and credit memo's. My report does not because there is no data in the "Paid Date" field of the record for Credit Memos.
    I've been doing alot research in trying to resolve this "exception" to my report. I think I may be on to something, but my knowledge of arrays is extremely limited. My resolution involves populating an array with the "invoice numbers" that are returned from the initial query from the supplied date range. Then using the "invoice numbers" from the array have it then populate my details section of the report with all of "invoice records" both the actual invoice record and any "credit memo" records. I can then group the records returned  based upon the "invoice number". then within that grouping I can performing my calculations to show whether or not the invoice has been paid in full. What do you think?  I've been able to populate an array with the invoice numbers based upon my date search range, but I have yet to figure out how to take that information and perform another lookup to pull in the rest of the data I need. Do you have any ideas?
    Thanks.  Bill

  • Unzip.vi only works with 1-internal file, error2 with multiple even in raw form.

    I've attempted to use the LabView unzip tool with several different meathods & I can only get it to work when there's only one file in the zip file. Multiple files continually cause an error in the VI, even when using raw LabView example code/tools. The first file does get unzipped in the specified folder before the error. Error 2 occurred at System Exec.vi. Command was "touch 08131333062007 "Chamber 1.ted"",LabVIEW:  Memory is full.

    Thanks for you response Juan & while this gives me some insight as to where the error is occurring it doesn't solve my problem. You can use the NI provided "Zip Tool.vi" to zip some files & then start a new blank VI & drop in the unzip tool & do nothing with it & run the Untiltled VI like that & it'll prompt for the file & as soon as you select the file...."Error 2", you can even double-click the unzip from the block diagram & use it that way.  I did this as a test to verify that what I'm doing wasn't causing the problem. My actual code uses the "File Dialog Express VI" in a flat sequence to first determine the zip file then the unzip-to location then runs the unzip function. I even get folders if zipped but only one file, no error if there's only one file, the error only occurs with multiple files.
    It appears to be an access issue as if it gets the first file & then trys to re-access for the next. I could handle this if it had functions to close the reference but it doesn't. I did try to take the preview, turn it into an array, run it through a for-loop but there's no way to specify a specific file w/in a zip file.
    Any thoughts?

  • Data binding with Multiple Filter

    Hi Experts,
    I am trying to do the data binding using filters with multiple values.
    ex: I am selecting the multiple values from list dialog and those i want to pass to odata service as a filters.
    name : abc
                   pqr
    I am looping on above and pushing it to array of filters.
         jQuery.sap.require("sap.ui.model.FilterOperator");
         var FilterOperator = sap.ui.model.FilterOperator;
         var filtersTerr =  new Array();
       for(i=0;i<name.length;i++){
      filterName = new sap.ui.model.Filter("FirstName", sap.ui.model.FilterOperator.EQ, name[i]);
      filter.push(filterName );
    this..getBinding("items").filter([filter],false);
    Final filter should be something $filter=FirstName='abc' or FirstName='pqr'.
    I have already looked into below discussions but somehow came to conclusion that array cannot be use with OR/AND.
    Odata Filter with OR
    http://scn.sap.com/thread/3462246
    http://scn.sap.com/thread/3560814
    Please let me know how this needs to be written.
    Thanks,
    Rahul

    Hi Rahul
    There are many ways.
    Filter for table
    var sRlUrl = "http://<host Name>/sap/opu/odata/sap/ZTWMP" ;
    var list = new sap.ui.model.odata.ODataModel( sRlUrl, false, "username", "pswd"); 
    list.setDefaultBindingMode(sap.ui.model.BindingMode.TwoWay);
    var iv_proID  = sap.ui.getCore().getElementById('input1').getValue();
    var iv_listNo = sap.ui.getCore().getElementById('input2').getValue();
    var iv_Matnr  = sap.ui.getCore().getElementById('input3').getValue();
    var iv_Po     = sap.ui.getCore().getElementById('input4').getValue(); 
    //... Set any Filters .. if reqd'
    var oFilter = new Array();
    var iCount = 0;
    if (iv_proID) {
    oFilter[iCount] = new sap.ui.model.Filter("abc", sap.ui.model.FilterOperator.EQ, sap.ui.getCore().getElementById('input1').getValue());
    iCount++;
    if (iv_listNo){
    oFilter[iCount] = new sap.ui.model.Filter("def", sap.ui.model.FilterOperator.EQ, sap.ui.getCore().getElementById('input2').getValue());
    iCount++;
    oFilter[iCount] = new sap.ui.model.Filter("PcTotal", sap.ui.model.FilterOperator.EQ,"HEADER" );
    iCount++;
    sap.ui.getCore().getElementById('T-POhdr-DR').setModel(list);
    //... Bind Rows with oData, with filters if any
    sap.ui.getCore().getElementById('T-POhdr-DR').bindRows({
    path: '/t_entity set/',
    filters: oFilter
    2 General filter
      OData.read({ requestUri: "http://<URL>:8001/sap/opu/odata/sap/ZTMP_ABC/Item?$filter=ID eq '"+ID+"' and DESC eq '"+Desc+"'", headers: { Accept: "application/json" } }, function (data, response) {
    if (data.results[0]) {
                     sap.ui.getCore().byId("oInput2").setText(data.results[0].<odata field to assign>;

  • List with multiple selection

    Hello;
    I seek a code to implement a list with multiple selection for a browser Web (HTML is imited).
    I have a list containing of the years, the user can select one or several years and I created dynamically a array : for each year a column.
    Thank you;

    Look at JList.
    http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/JList.html
    � {�                                                                                                                                                                           

Maybe you are looking for

  • I can't burn a DVD even after following all the tips

    I have a nine minute movie created from still phtos in iMovie that I need to burn to a DVD using iDVD 4. I followed all the steps provided online and still cannot get the disk to burn. (I have saved all the images and audio to the hard drive, there i

  • MacPro: How to prevent scanning for monitor after sleep?

    Hi everybody, So here's the deal: When I power up my MacPro or wake it up from sleep, it seems to do a quick search for connected displays and activates only the DVI output(s) which have a monitor connected to them. While I understand that behavior a

  • Messages don't reach XI from ABAP client proxy

    All messages in SAP System have "Recorded" status and don't  reach XI. Could you help me what is wrong? SXMB_ADM Role of Business System: Application System Corresponding Integ. Server: dest://MY_XI When I test MY_XI destination it returns 500 status

  • Prevent form/timer hanging while holding the minimize button

    I got troubles when the customers holding the minimize button (without release) on my form, it make all forms and all timers/controls entirely hanging. And thus make some exception bugs for my application.  Steps to Reproduce Behavior: In Form1,  cre

  • MacBook pro 15" Retina - connecting to Thunderbolt display issue

    Hi Is everyone else have trouble connecting the thunderbolt to the MacBook Pro with Retina? With my air it was plug and play (nomatter if the MBA were asleep or awake - it would just wake up when I uesed the wirless mouse or keyboard), but now I have