Need Help in Context Methods

Hi Everyone,
Iam Working on Wbdynpro from a week,I was able to see many methods like
get_static_attributes_table,get_element...etc etc
can anyone post a document containing detail descriptions of the methods like how can they be used
and in what context they shld be used...
Thanks,
Harika

Hi Harika,
Welcome to Web Dynpro for ABAP Forum.
Check the below article and sap document for your reference.
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/60730016-dbba-2a10-8f96-9754a865b814
http://help.sap.com/saphelp_erp2005/helpdata/en/de/408e41392fb85fe10000000a1550b0/frameset.htm
If you want any clarification search in sap help documents.

Similar Messages

  • Need help with Sound Methods

    Hi, I am new to java and need help with sound methods.
    q: create a new method that will halve the volume of the positive values and double the volume of the negative values.
    Message was edited by:
    Apaula30

    duplicate message #2

  • Need Help on CallServer Method

    I am implementing a PM for my custom control. I have two requirements for Call Server which I am not sure how to give input parameters. I am not able to find help in other controls implementations.
    1.I need to call a method (GetCustomCtrlInfo) in applet using Call server. But this method takes two parameters out of which one is a reference which contains the output value required to render my control. I tried using the ouput property set from the Callserver. But it donot contain the reference property set. How can I achieve this.
    ErrCode CSSSWEFrameOfferFile::GetCustomCtrlInfo (CSSSWEFieldItem* pFieldItem, CCFPropertySet& psCustCtrlProp)
    2.I need to call Applet method in which it is access Web Engine HTTP TXN ‘s GetAllRequestParameters. How can I set it while calling the CallServer method form my PModel.
    DOCHILD (m_pFrameMgr->GetModel (), GetService(SStext("Web Engine HTTP TXN"), pHttpService));
    DOCHILD (pHttpService, InvokeMethod (SStext("GetAllRequestParameters"), inputs, outputs));
    Is there any argument in input property set that can be used to achieve the both of above?

    Hi
    I was able to write the function using recursion (thanks a lot !!!), and its tested to be correct. Now , i am able to get the correct element given the index and also the stack remains the as it is upon return to the function call.
    But, if the index is out of bound , that is if its not in the stack , then i am supposed to throw an exception (any exception will do) without altering the original stack. I was thinking of using stack.size() check at the begining f the program to throw the exception, but then , i i cant use the size() method here , so in this case, is there any way i can accomodate the exceptional condition with the oroginal stack intact ? because , i tried a few ways but then everytime the stack is beign destroyed if i throw the exception...
    any pointer will be appreciated!
    here is my function
    int getStackElement( Stack<Integer> stack, int index ) throws Exception
              int res = 0;
              int value = 0;
              int count = index;
              if(count == 0){                    
                        return stack.peek().intValue();
                   }else {
                        value = stack.pop();
                        res = getStackElement(stack, --count);
                        stack.push(value);
                        return res;
         

  • Need help with calling method

    I'm new to Java, trying to pass a required class so I can graduate this semester, and I need help figuring out what is wrong with the code below. My assignment is to create a program to convert celsius to fahrenheit and vice versa using Scanner for input. The program must contain 3 methods - main, convert F to C, method, and convert C to F method. Requirements of the conversion methods are one parameter which is an int representing temp, return an int representing calculated temp after doing appropriate calculation, should not display info to user, and should not take in info from user.
    The main method is required to ask the user to input a 1 for converting F to C, 2 for C to F, and 3 to end the program. It must include a while loop that loops until the user enters a 3, ask the user to enter a temp, call the appropriate method to do the conversion, and display the results. I'm having trouble calling the conversion methods and keep getting the following 2 compiler errors:
    cannot find symbol
    symbol : method farenheitToCelsius(int)
    location: class WondaPavoneTempConverter
    int celsius = farenheitToCelsius(intTemp);
    ^
    cannot find symbol
    symbol : method celsiusToFarenheit(int)
    location: class WondaPavoneTempConverter
    int farenheit = celsiusToFarenheit(intTemp);
    The code is as follows:
    public static void main(String[] args) {
    // Create a scanner
    Scanner scanner = new Scanner(System.in);
    // Prompt the user to enter a temperature
    System.out.println("Enter the temperature you wish to convert as a whole number: ");
    int intTemp = scanner.nextInt();
    System.out.println("You entered " + intTemp + " degrees.");
    // Prompt the user to enter "1" to convert to Celsius, "2" to convert to
    // Farenheit, or "3" to exit the program
    System.out.println("Enter 1 to convert to Celsius, 2 to convert to Farenheit, or 3 to exit.");
    int intConvert = scanner.nextInt();
    // Convert temperature to Celsius or Farenheit
    int celsius = farenheitToCelsius(intTemp);
    int farenheit = celsiusToFarenheit(intTemp);
    while (intConvert >= 0) {
    // Convert to Celsius
    if (intConvert == 1) {
    System.out.println("Celsius is " + celsius + " degrees.");
    // Convert to Farenheit
    else if (intConvert == 2) {
    System.out.println("Farenheit is " + farenheit + " degrees.");
    // Exit program
    else if (intConvert == 3) {
    break;
    else {
    System.out.println("The number you entered is invalid. Please enter 1, 2, or 3.");
    //Method to convert Celsius to Farenheit
    public static int celsiusToFahrenheit(int cTemp) {
    return (9 / 5) * (cTemp + 32);
    //Method to convert Farenheit to Celsius
    public static int fahrenheitToCelsius(int fTemp) {
    return (5 / 9) * (fTemp - 32);
    I readily admit I'm a complete dunce when it comes to programming - digital media is my area of expertise. Can anyone point me in the right direction? This assignment is due very soon. Thanks.

    1) consider using a boolean variable in the while statement and converting it to true if the input is good.
    while (inputNotValid)
    }2) put the code to get the input within the while loop. Try your code right now and enter the number 30 when your menu requests for input and you'll see the infinite loop.... and why you need to request input within the loop.
    3) Fix your equations. You are gonig to have to do some double calcs, even if you convert it back to int for the method return. Otherwise the results are just plain wrong. As a good test, put in the numbers -40, 0, 32, 100, and 212. Are the results as expected? (-40 is the only temp that is the same for both cent and fahr). I recommend doing double calcs and then casting the result to int in the return. for example:
    int a = (int) (20 + 42.0 / 3);  // the 42.0 forces the compiler to do double calc.4) One of your equations may still be plain wrong even with this fix. Again, run the test numbers and see.
    5) Also, when posting your code, please use code tags so that your code will be well-formatted and readable. To do this, either use the "code" button at the top of the forum Message editor or place the tag &#91;code&#93; at the top of your block of code and the tag &#91;/code&#93; at the bottom, like so:
    &#91;code&#93;
      // your code block goes here.
    &#91;/code&#93;

  • Need help writing a method..

    Hi, I am new to Java and I have a little problem with this statement:
    a soldTickets(int num) method that records the fact that the specified number of tickets have been sold at this booth.
    Basically I only wrote this part:
    public int soldTickets(int num)
    return num;
    I wonder if it is correct, if not what value should I return?

    i don't think tht shud correctly work. u just define a static variable num in the class. and just perform >num++ in the function and when the program executes u will get to know how many tickets r sold after >printing num. if u do this there is no need of any parameter to be passed in the function because u have >already defined it in the class.
    Bye ! i hope it works What happen when he want to enter 50 ticket at a time..then using ur code he needs to call that method 50 times.
    Sounds like you need a Booth object which has a variable - int totalTicketsSold;
    and a method - public void soldTickets(int num)
    in the body of the method num is added to totalTicketsSold; public int soldTickets(int num)
    totalTicketsSold = totalTicketsSold + num;
    return totalTicketsSold;
    I think this match ur requirment best...

  • Need Help in Context Mapping

    Hi,
    I am having two components.
    Comp A  is main componenet  and Comp B is Used component and using in Comp A.
    Intially I am getting the data from the Comp A ( main Comp) to Comp B(used Comp) by context mapping.
    it is working fine.
    The same way I need in Reverse. From Comp B (Used Comp) to Comp A (Main Comp) i have to get the data .
    how to do context mapping for this.
    pl help.
    Thanks in Advance.
    Kar

    Hi,
    To achieve reverse (external) context mapping, the attribute 'Input Element' in interface node of component B has to be marked. When you declare a component usage of component B in your component A, you will see the interface node under Component Usages->Interface Controllers (in your navigation tree). You can define the mapping here, between the 'Input element' node of component B and the component controller Node in comp A by right click->Define external context mapping.
    Have a look at the [documentation |http://help.sap.com/saphelp_nw04s/helpdata/en/67/cc744176cb127de10000000a155106/frameset.htm] in detail.
    You can have a look at the ALV component SALV_WD_TABLE, which uses external context mapping to render the ALV in any component using this component. This will give you a good idea.
    Regards,
    Nithya

  • Need help in compare method of Comparator class

    I am writing a program that will display elements of a TreeMap in an order in which I want. By default the order is ascending. To change the order I need to override the compare method of the Comparator class.
    I've done this in my code below.
    I want to display keys with lower-case 1st and then those with upper-case.
    Please help.
    import java.util.*;
    public class MyComparator implements Comparator {
      public int compare(Object o1, Object o2) {
        String s1 = o1.toString();
        String s2 = o2.toString();
        return s1.compareTo(s2);
      public static void main(String[] args) {
        Map names = new TreeMap(new MyComparator());
        names.put("a", new Integer(1435)); 
        names.put("b", new Integer(1110));
        names.put("A", new Integer(1425));
        names.put("B", new Integer(987));
        names.put("C", new Integer(1323));   
        Set namesSet = names.keySet();
        Iterator iter = namesSet.iterator();
        while(iter.hasNext()) {
          String who = (String)iter.next();
          System.out.println(who + " => " +     names.get(who));
    }

    public int compare(Object o1, Object o2) {
        String s1 = o1.toString();
        String s2 = o2.toString();
        String ss1 = beginsWithLowerLetter(s1)? s1.toUpperCase() : s1.toLowerCase();
        String ss2 = beginsWithLowerLetter(s2)? s2.toUpperCase() : s2.toLowerCase();
        return ss1.compareTo(ss2);
    }

  • Need help getting these methods to work

    this program consists three seperate classes. i have two of the three working, i just can't figure out this one. here is my code, and the pseudo code for the methods. any help would be greatly appreciated. i am getting the following 18 errors
    CheckingAccountsTest.java:35: getAccountType(java.lang.String) in CheckingAccount cannot be applied to ()
    if(myFields[indexForAccountType].equals(CheckingAccount.getAccountType())){ //A-1-2-10
    ^
    CheckingAccountsTest.java:45: cannot find symbol
    symbol : constructor CheckingAccountPlus(java.lang.String,java.lang.String,java.lang.String,double)
    location: class CheckingAccountPlus
    CheckingAccountPlus currentAccount = new CheckingAccountPlus(myFields[indexForAccountId], //A-1-2-17 THROUGH A-1-2-20
    ^
    CheckingAccountsTest.java:72: getAccountId(java.lang.String) in CheckingAccount cannot be applied to ()
    currentAccount.getAccountId().equals(myFields[indexForAccountId]); //A-1-3-06
    ^
    CheckingAccountsTest.java:124: cannot find symbol
    symbol : method makeDeposit(double)
    location: class CheckingAccountPlus
    currentAccount.makeDeposit(amount); //A-1-6-02
    ^
    CheckingAccountsTest.java:161: getAccountId(java.lang.String) in CheckingAccount cannot be applied to ()
    currentAccount, currentAccount.getAccountId(), CheckingAccount.getAccountType(), currentAccount.getBalance());
    ^
    CheckingAccountsTest.java:161: getAccountType(java.lang.String) in CheckingAccount cannot be applied to ()
    currentAccount, currentAccount.getAccountId(), CheckingAccount.getAccountType(), currentAccount.getBalance());
    ^
    CheckingAccountsTest.java:167: non-static method getAccountType() cannot be referenced from a static context
    currentAccount, currentAccount.getAccountId(), CheckingAccountPlus.getAccountType(), currentAccount.getBalance());
    ^
    CheckingAccountsTest.java:171: getAccountId(java.lang.String) in CheckingAccount cannot be applied to ()
    System.out.printf("Account Totals", currentAccount.getAccountId(), CheckingAccount.getAccountType(), //A-1-11-01
    ^
    CheckingAccountsTest.java:171: getAccountType(java.lang.String) in CheckingAccount cannot be applied to ()
    System.out.printf("Account Totals", currentAccount.getAccountId(), CheckingAccount.getAccountType(), //A-1-11-01
    ^
    CheckingAccountsTest.java:172: getBeginningBalance(double) in CheckingAccount cannot be applied to ()
    currentAccount.getBeginningBalance(), currentAccount.getDeposits(), currentAccount.getWithdrawals(), //A-1-11-02
    ^
    CheckingAccountsTest.java:172: getDeposits(double) in CheckingAccount cannot be applied to ()
    currentAccount.getBeginningBalance(), currentAccount.getDeposits(), currentAccount.getWithdrawals(), //A-1-11-02
    ^
    CheckingAccountsTest.java:172: getWithdrawals(double) in CheckingAccount cannot be applied to ()
    currentAccount.getBeginningBalance(), currentAccount.getDeposits(), currentAccount.getWithdrawals(), //A-1-11-02
    ^
    CheckingAccountsTest.java:173: getFees(double) in CheckingAccount cannot be applied to ()
    currentAccount.getFees(), currentAccount.getBalance(), currentAccount.getOverdrafts(), " *"); //A-1-11-03 THROUGH A-1-11-04
    ^
    CheckingAccountsTest.java:173: getOverdrafts(double) in CheckingAccount cannot be applied to ()
    currentAccount.getFees(), currentAccount.getBalance(), currentAccount.getOverdrafts(), " *"); //A-1-11-03 THROUGH A-1-11-04
    ^
    CheckingAccountsTest.java:178: getAccountType(java.lang.String) in CheckingAccount cannot be applied to ()
    System.out.printf("Account Totals", currentAccount.getAccountId(), CheckingAccount.getAccountType(), //A-1-12-01
    ^
    CheckingAccountsTest.java:179: cannot find symbol
    symbol : method getBeginningBalance()
    location: class CheckingAccountPlus
    currentAccount.getBeginningBalance(), currentAccount.getDeposits(), currentAccount.getWithdrawals(), //A-1-12-02
    ^
    CheckingAccountsTest.java:179: cannot find symbol
    symbol : method getDeposits()
    location: class CheckingAccountPlus
    currentAccount.getBeginningBalance(), currentAccount.getDeposits(), currentAccount.getWithdrawals(), //A-1-12-02
    ^
    CheckingAccountsTest.java:180: cannot find symbol
    symbol : method getSumOfCreditCardAdvances()
    location: class CheckingAccountPlus
    currentAccount.getBalance(), currentAccount.getSumOfCreditCardAdvances(), " *"); //A-1-12-03 THROUGH A-1-12-04
    ^
    18 errors
    Process completed.
    public class CheckingAccountsTest
         private static final int indexForAccountId = 0;
         private static final int indexForAccountType = 2;
         private static final int indexForBalance = 5;
         private static final int indexForDepositAmount = 2;
         private static final int indexForFirstName = 3;
         private static final int indexForLastName = 4;
         private static final int indexForRecordType = 1;
         private static final int indexForWithdrawalAmount = 2;
         private static final String recordTypeForDeposit = "CKD";
         private static double sumOfBeginningBalances = 0.0;
         private static double sumOfCreditCardAdvances = 0.0;
         private static double sumOfDeposits = 0.0;
         private static double sumOfEndingBalances = 0.0;
         private static double sumOfFees = 0.0;
         private static double sumOfOverdrafts = 0.0;
         private static double sumOfWithdrawals = 0.0;
    public static void main(String args[])
         MyCsvFile myFile = new MyCsvFile("monthlyBankTransactions,v05.txt"); //A-1-2-01 THRU A-1-2-02
         System.out.println("\nBig Bank: Monthly Checking Account Activity\n"); //A-1-2-04
         System.out.println("----------- Account ----------- Beginning\t\t    With-\t\t   Ending\tOver-\tCredit Cd"); //A-1-2-05
         System.out.println("     Name\t   Id    Type\t Balance   +   Deposit   -  drawal   -    Fee   =  Balance\tdraft\t Advance\n"); //A-1-2-06
         myFile.readARecord(); //A-1-2-07
         while(myFile.getEofFound() == false) //A-1-2-08
              String []myFields = myFile.getCsvRecordFieldArray();//A-1-2-09
              if(myFields[indexForAccountType].equals(CheckingAccount.getAccountType())){ //A-1-2-10
             CheckingAccount currentAccount = new CheckingAccount(myFields[indexForAccountId], //A-1-2-11 THROUGH A-1-2-12
             myFields[indexForFirstName], myFields[indexForLastName],
             Double.parseDouble(myFields[indexForBalance])); //A-1-2-13
             handleAccount(currentAccount, myFile, myFields); //A-1-2-14
             currentAccount = null;// A-1-2-15
        else//A-1-2-16
             CheckingAccountPlus currentAccount = new CheckingAccountPlus(myFields[indexForAccountId], //A-1-2-17 THROUGH A-1-2-20
             myFields[indexForFirstName], myFields[indexForLastName], Double.parseDouble(myFields[indexForBalance]));
             handleAccount(currentAccount, myFile, myFields);
             currentAccount = null; //A-1-2-21
        }//end if A-1-2-22
    }//end while A-1-2-23
         System.out.printf("Report Totals", sumOfBeginningBalances,sumOfDeposits, //A-1-2-24
         sumOfWithdrawals, sumOfFees, sumOfEndingBalances, sumOfOverdrafts, sumOfCreditCardAdvances, "**"); //A-1-2-25
         System.out.printf("The information in the above report is from the 17 records in the following file:",
         myFile.getCountOfRecords());                                                                           //A-1-2-26
         System.out.printf("Path to file:", myFile.getFilePath()); //A-1-2-27
         System.out.printf("Name of file:", myFile.getFileName()); //A-1-2-28
         System.out.println("\nEnd of program"); //A-1-2-29
    }// end main method
    public static void handleAccount(CheckingAccount currentAccount, MyCsvFile myFile, String []myFields)
         sumOfBeginningBalances += currentAccount.getBalance(); //A-1-3-01
         printBeginningBalance(currentAccount); // A-1-3-02
         myFile.readARecord(); //A-1-3-03
         myFields = myFile.getCsvRecordFieldArray(); //A-1-3-04
    while (myFile.getEofFound() == false) //A-1-3-05
       currentAccount.getAccountId().equals(myFields[indexForAccountId]); //A-1-3-06
    if(myFields[indexForRecordType].equals(recordTypeForDeposit)){ //A-1-3-07
         handleDeposit(currentAccount, Double.parseDouble(myFields[indexForDepositAmount])); //A-1-3-08 THROUGH A-1-3-09
          else //A-1-3-10
          handleWithdrawal(currentAccount,Double.parseDouble(myFields[indexForWithdrawalAmount])); //A-1-3-11 THROUGH A-1-3-12
       }//end if //A-1-3-13
    myFile.readARecord();//A-1-3-14
    myFields = myFile.getCsvRecordFieldArray(); //A-1-3-15 THROUGH A-1-3-16
    }//end while //A-1-3-17
    sumOfEndingBalances += currentAccount.getBalance();//A-1-3-18
    printEndingBalance(currentAccount); //A-1-3-19
    public static void handleAccount(CheckingAccountPlus currentAccount, MyCsvFile myFile, String [] myFields)
    sumOfBeginningBalances += currentAccount.getBalance(); //A-1-4-01
    printBeginningBalance(currentAccount); //A-1-4-02
    myFile.readARecord(); //A-1-4-03
    myFields = myFile.getCsvRecordFieldArray(); //A-1-4-04
      while (myFile.getEofFound()==false) //A-1-4-05
    currentAccount.getAccountId().equals (myFields[indexForAccountId]); //A-1-4-06
    if(myFields[indexForRecordType].equals(recordTypeForDeposit)){ //A-1-4-07
         handleDeposit(currentAccount, Double.parseDouble(myFields[indexForDepositAmount])); //A-1-4-08 THROUGH //A-1-4-09
          else //A-1-4-10
          handleWithdrawal(currentAccount,Double.parseDouble(myFields[indexForWithdrawalAmount])); //A-1-4-11 THROUGH A-1-4-12
       }//end if A-1-4-13
    myFile.readARecord(); //A-1-4-14
    myFields = myFile.getCsvRecordFieldArray(); //A-1-4-15 THROUGH A-1-4-16
    }//end while A-1-4-17
    sumOfEndingBalances += currentAccount.getBalance(); //A-1-4-18
    printEndingBalance(currentAccount); //A-1-4-19
    private static void handleDeposit(CheckingAccount currentAccount, double amount)
    sumOfDeposits += amount; //A-1-5-01
    currentAccount.makeDeposit(amount); //A-1-5-02
    System.out.printf("$,%.2f", amount); //A-1-5-03
      private static void handleDeposit(CheckingAccountPlus currentAccount, double amount)
      sumOfDeposits += amount;//A-1-6-01
      currentAccount.makeDeposit(amount); //A-1-6-02
      System.out.printf("$,%.2f", amount); //A-1-6-03
      private static void handleWithdrawal(CheckingAccount currentAccount, double amount)
      if (currentAccount.makeWithdrawal(amount) == true){ //A-1-7-01
       sumOfWithdrawals += amount; //A-1-7-02
       System.out.printf("$,%.2f", amount); //A-1-7-03
      }else{ //A-1-7-04
       double overdraftFee = currentAccount.getOverdraftFee(); //A-1-7-05
       sumOfFees += overdraftFee; //A-1-7-06
       sumOfOverdrafts += amount; //A-1-7-07
       System.out.printf("$,%.2f",overdraftFee, amount); //A-1-7-08
      }//end if A-1-7-09
      private static void handleWithdrawal(CheckingAccountPlus currentAccount, double amount)
           if (currentAccount.makeWithdrawal(amount) == true){ //A-1-8-01
            sumOfWithdrawals += amount; //A-1-8-02
            System.out.printf("$,%.2f",amount); //A-1-8-03
      }else{ //A-1-8-04
       double creditCardAdvance = currentAccount.getCreditCardAdvance(); //A-1-8-05 THROUGH A-1-8-06
       sumOfCreditCardAdvances += creditCardAdvance; //A-1-8-07
       sumOfWithdrawals += currentAccount.getActualWithdrawal(); //A-1-8-08
       System.out.printf("$,%.2f",currentAccount.getActualWithdrawal(),creditCardAdvance); //A-1-8-09
      }//end if //A-1-8-10
    private static void printBeginningBalance(CheckingAccount currentAccount)
    System.out.printf("",   //A-1-9-01 THROUGH A-1-9-02
       currentAccount, currentAccount.getAccountId(), CheckingAccount.getAccountType(), currentAccount.getBalance());
    private static void printBeginningBalance(CheckingAccountPlus currentAccount)
    System.out.printf("",   //A-1-10-01 TROUGH A-1-10-02
       currentAccount, currentAccount.getAccountId(), CheckingAccountPlus.getAccountType(), currentAccount.getBalance());
    private static void printEndingBalance(CheckingAccount currentAccount)
      System.out.printf("Account Totals", currentAccount.getAccountId(), CheckingAccount.getAccountType(), //A-1-11-01
        currentAccount.getBeginningBalance(), currentAccount.getDeposits(), currentAccount.getWithdrawals(), //A-1-11-02
        currentAccount.getFees(), currentAccount.getBalance(), currentAccount.getOverdrafts(), " *"); //A-1-11-03 THROUGH A-1-11-04
    private static void printEndingBalance(CheckingAccountPlus currentAccount)
      System.out.printf("Account Totals", currentAccount.getAccountId(), CheckingAccount.getAccountType(), //A-1-12-01
        currentAccount.getBeginningBalance(), currentAccount.getDeposits(), currentAccount.getWithdrawals(), //A-1-12-02
        currentAccount.getBalance(), currentAccount.getSumOfCreditCardAdvances(), " *"); //A-1-12-03 THROUGH A-1-12-04
    }PSEUDO CODE FOR ALL METHODS
    This public static method has no return value and has one parameter of type String named args[ ], an array
    A-1-2-01)     INSTANTIATE a local variable named myFile of class MyCsvFile, passing a single String argument for the CSV filename:
    A-1-2-02)          ?monthlyBankTransactions,v05.txt?
    A-1-2-03)     DISPLAY the task / programmer identification line
    A-1-2-04)     DISPLAY the ?Big Bank: Monthly Checking Account Activity? title line
    A-1-2-05)     DISPLAY the first column heading line: ?---------- Account ----------??
    A-1-2-06)     DISPLAY the second column heading line: ? Name Id??
    A-1-2-07)     Get 1st record from CSV file using method readARecord: MyCsvFile class: myFile.readARecord()
    A-1-2-08)     WHILE (myFile.getEofFound() IS FALSE)
    A-1-2-09)          DEFINE a String Array named myFields, and ASSIGN it the value myFile.getCsvRecordFieldArray()
    A-1-2-10)          IF (myFields[indexForAccountType].equals(CheckingAccount.getAccountType()))
    A-1-2-11)               INSTANTIATE a local variable named currentAccount of class CheckingAccount, passing the following arguments:
    A-1-2-12)                    myFields[indexForAccountId], myFields[indexForFirstName], myFields[indexForLastName],
    A-1-2-13)                    Double.parseDouble(myFields[indexForBalance])
    A-1-2-14)               CALL method handleAccount of this class, passing the following arguments: currentAccount, myFile, myFields
    A-1-2-15)               ASSIGN null TO currentAccount
    A-1-2-16)          ELSE
    A-1-2-17)     INSTANTIATE a local variable named currentAccount of class CheckingAccountPlus, passing the following arguments:
    A-1-2-18)          myFields[indexForAccountId], myFields[indexForFirstName], myFields[indexForLastName],
    A-1-2-19)          Double.parseDouble(myFields[indexForBalance])
    A-1-2-20)     CALL method handleAccount of this class, passing the following arguments: currentAccount, myFile, myFields
    A-1-2-21)               ASSIGN null TO currentAccount
    A-1-2-22)          END IF
    A-1-2-23)     END WHILE
    A-1-2-24)     DISPLAY the report-total line using the following arguments: ?Report Totals?, sumOfBeginningBalances, sumOfDeposits,
    A-1-2-25)          sumOfWithdrawals, sumOfFees, sumOfEndingBalances, sumOfOverdrafts, sumOfCreditCardAdvances and ?**?
    A-1-2-26)     DISPLAY the ?The information in the above report? line with the following arguments: myFile.getCountOfRecords()
    A-1-2-27)     DISPLAY the ?Path to file? line with the following arguments: myFile.getFilePath()
    A-1-2-28)     DISPLAY the ?Name of file? line with the following arguments: myFile.getFileName()
    A-1-2-29)     DISPLAY the ?End of program? line
    This private static method has no return value, and has three parameters: currentAccount of type CheckingAccount, myFile of type MyCsvFile and myFields of type String array.
    A-1-3-01)     CALL method currentAcccount.getBalance and ADD its return value to sumOfBeginningBalances
    A-1-3-02)     CALL method printBeginningBalance with the following argument list: currentAccount
    A-1-3-03)     CALL method myFile.readARecord, which reads the 1st record after the Balance record (a deposit or withdrawal) for the current customer
    A-1-3-04)     CALL method myFile.getCsvRecordFieldArray and ASSIGN its return value to myFields, a String array. This makes the values from the
    A-1-3-05)          fields in the record just read available for access as elements in the myFields string array
    A-1-3-06)     WHILE (myFile.getEofFound() IS FALSE AND currentAccount.getAccountId().equals(myFields[indexForAccountId]))
    A-1-3-07)          IF (myFields[indexForRecordType].equals(recordTypeForDeposit))
    A-1-3-08)               CALL method handleDeposit with the following argument list: currentAccount,
    A-1-3-09)                    Double.parseDouble(myFields[indexForDepositAmount]
    A-1-3-10)          ELSE
    A-1-3-11)               CALL method handleWithdrawal with the following argument list: currentAccount,
    A-1-3-12)                    Double.parseDouble(myFields[indexForWithdrawalAmount]
    A-1-3-13)          END IF
    A-1-3-14)          CALL method myFile.readARecord, which reads the next deposit or withdrawal record, if any, for this customer
    A-1-3-15)     CALL method myFile.getCsvRecordFieldArray and ASSIGN its return value to myFields, a String array. This makes the value from the
    A-1-3-16)          fields in the record just read available for access as elements in the myFields string array
    A-1-3-17)     END WHILE
    A-1-3-18)     CALL method currentAcccount.getBalance and ADD its return value to sumOfEndingBalances
    A-1-3-19)     CALL method printEndingBalance with the following argument list: currentAccount
    This private static method has no return value, and has three parameters: currentAccount of type CheckingAccountPlus, myFile of type MyCsvFile and myFields of type String array.
    A-1-4-01)     CALL method currentAcccount.getBalance and ADD its return value to sumOfBeginningBalances
    A-1-4-02)     CALL method printBeginningBalance with the following argument list: currentAccount
    A-1-4-03)     CALL method myFile.readARecord, which reads the 1st record after the Balance record (a deposit or withdrawal) for the current customer
    A-1-4-04)     CALL method myFile.getCsvRecordFieldArray and ASSIGN its return value to myFields, a String array. This makes the values from the
    A-1-4-05)          fields in the record just read available for access as elements in the myFields string array
    A-1-4-06)     WHILE (myFile.getEofFound() IS FALSE AND currentAccount.getAccountId().equals(myFields[indexForAccountId]))
    A-1-4-07)          IF (myFields[indexForRecordType].equals(recordTypeForDeposit))
    A-1-4-08)               CALL method handleDeposit with the following argument list: currentAccount,
    A-1-4-09)                    Double.parseDouble(myFields[indexForDepositAmount]
    A-1-4-10)          ELSE
    A-1-4-11)               CALL method handleWithdrawal with the following argument list: currentAccount,
    A-1-4-12)                    Double.parseDouble(myFields[indexForWithdrawalAmount]
    A-1-4-13)          END IF
    A-1-4-14)          CALL method myFile.readARecord, which reads the next deposit or withdrawal record, if any, for this customer
    A-1-4-15)     CALL method myFile.getCsvRecordFieldArray and ASSIGN its return value to myFields, a String array. This makes the value from the
    A-1-4-16)          fields in the record just read available for access as elements in the myFields string array
    A-1-4-17)     END WHILE
    A-1-4-18)     CALL method currentAcccount.getBalance and ADD its return value to sumOfEndingBalances
    A-1-4-19)     CALL method printEndingBalance with the following argument list: currentAccount
    This private static method has no return value, and has two parameters: currentAccount of type CheckingAccount and amount of type double.
    A-1-5-01)     ADD amount TO sumOfDeposits
    A-1-5-02)     CALL method currentAccount.makeDeposit, passing it the following arguments: amount
    A-1-5-03)     DISPLAY the deposit line using the following arguments: amount
    This private static method has no return value, and has two parameters: currentAccount of type CheckingAccountPlus and amount of type double.
    A-1-6-01)     ADD amount TO sumOfDeposits
    A-1-6-02)     CALL method currentAccount.makeDeposit, passing it the following arguments: amount
    A-1-6-03)     DISPLAY the deposit line using the following arguments: amount
    This private static method has no return value, and has two parameters: currentAccount of type CheckingAccount and amount of type double.
    A-1-7-01)     IF (currentAccount.makeWithdrawal(amount) IS TRUE)
    A-1-7-02)          ADD amount TO sumOfWithdrawals
    A-1-7-03)          DISPLAY the withdrawal line using the following arguments: amount
    A-1-7-04)     ELSE
    A-1-7-05)          DEFINE variable overdraftFee of type double and ASSIGN it the value returned from a call of method currentAccount.getOvedraftFee
    A-1-7-06)          ADD overdraftFee TO sumOfFees
    A-1-7-07)          ADD amount TO sumOfOverdrafts
    A-1-7-08)          DISPLAY the overdraft line using the following arguments: overdraftFee, amount
    A-1-7-09)     END IF
    This private static method has no return value, and has two parameters: currentAccount of type CheckingAccountPlus and amount of type double.
    A-1-8-01)     IF (currentAccount.makeWithdrawal(amount) IS TRUE)
    A-1-8-02)          ADD amount TO sumOfWithdrawals
    A-1-8-03)          DISPLAY the withdrawal line using the following arguments: amount
    A-1-8-04)     ELSE
    A-1-8-05)          DEFINE variable creditCardAdvance of type double and ASSIGN it the value returned from a call of method
    A-1-8-06)               currentAccount.getCreditCardAdvance
    A-1-8-07)          ADD creditCardAdvance TO sumOfCreditCardAdvances
    A-1-8-08)          ADD currentAccount.getActualWithdrawal() TO sumOfWithdrawals
    A-1-8-09)          DISPLAY the credit-card-advance line using the following arguments: currentAccount.getActualWithdrawal(),creditCardAdvance
    A-1-8-10)     END IF
    This private static method has no return value, and has one parameter: currentAccount of type CheckingAccount.
    A-1-9-01)     DISPLAY the beginning balance line using the following arguments: currentAccount , currentAccount.getAccountId(),
    A-1-9-02)          currentAccount.getAccountType() and currentAccount.getBalance()
    This private static method has no return value, and has one parameter: currentAccount of type CheckingAccountPlus.
    A-1-10-01)     DISPLAY the beginning balance line using the following arguments: currentAccount , currentAccount.getAccountId(),
    A-1-10-02)          currentAccount.getAccountType() and currentAccount.getBalance()
    This private static method has no return value, and has one parameter: currentAccount of type CheckingAccount.
    A-1-11-01)     DISPLAY the ending balance line using the following arguments: ?Account Totals,? currentAccount.getAccountId(),
    A-1-11-02)          currentAccount.getAccountType(), currentAccount.getBeginningBalance(), currentAccount.getDeposits(),
    A-1-11-03)          currentAccount.getWithdrawals(), currentAccount.getFees(), currentAccount.getBalance() and
    A-1-11-04)          currentAccount.getOverdrafts(), ?? *?

    You're calling a bunch of methods and constructors with the wrong arguments, or missing arguments. Take the errors one by one, and look at the method you're being told you're calling, and check that the arguments you're using are right

  • Need help getting Main method to work...

    Hello everyone, I have a problem, I have a GUI that I need to run (it compiles fine, but will not run.) I am very new to Java and programing in general so go easy on me. I think I am just missing something simple here. I am going to post the basic code and see if you all can help...the issue is in written in red to help you identify my problem...
    public class LagersGUI extends JFrame implements ActionListener,Serializable
    {color:#0000ff}private {color}JTextArea {color:#339966}textArea{color};
    {color:#0000ff}private {color}JButton {color:#339966}start,
    next,
    previous,
    last;{color}
    JLabel {color:#339966}imageLabel{color};
    {color:#0000ff}private static{color} LagersAddInfo {color:#339966}inv{color} = {color:#0000ff}new {color}LagersAddInfo();
    {color:#808080} /**
    * @param arg0
    * @throws HeadlessException
    */{color}
    {color:#0000ff}public {color}LagersGUI( String arg0 ) {color:#0000ff}throws {color}HeadlessException
    {color:#0000ff}super{color}( {color:#ff9900}"Inventory GUI" {color});
    {color:#339966}textArea{color} = {color:#0000ff}new {color}JTextArea( 800,800 );
    JScrollPane scrollPane = new JScrollPane( {color:#339966}textArea{color} );
    textArea.setEditable( {color:#0000ff}false {color});
    scrollPane.setVerticalScrollBarPolicy( JScrollPane.VERTICAL_SCROLLBAR_ALWAYS );
    scrollPane.setPreferredSize( new Dimension( 600, 100 ) );
    JPanel cp = new JPanel();
    cp.setSize( 400, 100 );
    cp.setLayout( new BorderLayout() );
    cp.add( scrollPane,BorderLayout.{color:#339966}CENTER{color} );
    JPanel buttonPanel = new JPanel();
    JPanel buttonPanel1 = new JPanel();
    {color:#339966}start{color} = new JButton( {color:#ff9900}"Start"{color} );
    {color:#339966}start{color}.addActionListener( {color:#0000ff}this {color});
    {color:#339966} next{color} = new JButton( {color:#ff9900}"Next" {color});
    {color:#339966} next{color}.addActionListener( {color:#0000ff}this {color});
    {color:#339966}previous{color} = new JButton( {color:#ff9900}"Previous"{color} );
    {color:#339966} previous{color}.addActionListener( {color:#0000ff}this {color});
    {color:#339966} last{color} = new JButton({color:#ff9900} "Last"{color} );
    {color:#339966} last{color}.addActionListener( {color:#0000ff}this {color});
    buttonPanel.add( {color:#339966}start {color});
    buttonPanel.add( {color:#339966}next {color});
    buttonPanel.add( {color:#339966}previous {color});
    buttonPanel.add( {color:#339966}last {color});
    cp.add( buttonPanel,BorderLayout.{color:#339966}SOUTH {color});
    cp.add( buttonPanel1,BorderLayout.{color:#339966}NORTH {color});{color:#999999}///NewInventory_Test/logo.gif{color}
    java.net.URL u = {color:#0000ff}this{color}.getClass().getClassLoader().getResource({color:#ff9900}"\\NewInventory_Test\\logo.gif"{color});
    ImageIcon icon = {color:#0000ff}new {color}ImageIcon(u);
    {color:#339966}imageLabel{color} = new JLabel( {color:#ff9900}"Inventory View"{color}, icon, JLabel.{color:#339966}CENTER {color});
    cp.add({color:#339966} imageLabel{color},BorderLayout.{color:#339966}WEST{color} );
    {color:#0000ff}this{color}.setContentPane( cp );
    {color:#0000ff}this{color}.setContentPane( cp );
    {color:#0000ff}this{color}.setTitle( "Inventory Program IT 215" );
    {color:#0000ff}this{color}.setDefaultCloseOperation( JFrame.{color:#339966}EXIT_ON_CLOSE{color} );
    {color:#0000ff} this{color}.{color:#339966}textArea{color}.setText({color:#339966}inv{color}.getStart());
    {color:#0000ff} this{color}.setSize(200, 200);
    {color:#0000ff}this{color}.pack();
    {color:#0000ff}this{color}.setVisible( {color:#0000ff}true {color});
    @Override
    {color:#0000ff}public void{color} actionPerformed( ActionEvent e )
    // TODO Auto-generated method stub
    {color:#0000ff} if {color}( e.getActionCommand().equals({color:#ff9900} "Start"{color} ) )
    textArea.setText( {color:#339966}inv{color}.getStart() );
    {color:#0000ff}if {color}( e.getActionCommand().equals( {color:#ff9900}"Next" {color}) )
    textArea.setText({color:#339966}inv{color}.getNext());
    {color:#0000ff}if{color} ( e.getActionCommand().equals( {color:#ff9900}"Previous" {color}) )
    textArea.setText( {color:#339966}inv{color}.getPrevious() );
    {color:#0000ff} if{color} ( e.getActionCommand().equals( {color:#ff9900}"Last"{color} ) )
    textArea.setText({color:#339966}inv{color}.getLast());
    {color:#0000ff}public static {color}LagersAddInfo getInv()
    {color:#0000ff}return{color:#339966} {color}{color}{color:#339966}inv{color};
    {color:#0000ff}public static void{color} setInv( LagersAddInfo inv )
    LagersGUI.{color:#339966}inv {color}= inv;
    {color:#808080} /**
    * @param args
    */{color}
    {color:#0000ff}public static void {color}main( String[] args )
    LagersGUI {color:#ff0000}_inventory_ {color}= {color:#0000ff}new {color}LagersGUI( {color:#ff9900}"Inventory"{color} );{color:#ff0000}//** here's the part I'm having trouble with...inventory is an * unused variable. What other way could I get {color:#000000}main{color} */ method to work?{color}
    }

    This forum can format your code for you and make it easier to read. Simply click the CODE button and two tags will appear. Then paste your code in between the tags. Important, copy code form your source not first post.                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Need help with drawLine method

    Hello,
    I've been having trouble with a recent programming assignment and the prof isn't being very helpful. I need to call the drawLine method to plot a line between (0,0) and two coordinates entered by the user; is there a way to do this without a JPanel? Here are the specs:
    I've already done Part 1., just posting it to give a complete representation of the assignment.
    Part 1. Implement a ComplexNumber class to represent complex numbers (z = a + bi).
    1) Instance variables:
    private int real; /* real part */
    private int imag; /* imaginary part */
    2) Constructor:
    public ComplexNumber ( int realVal, int imagVal )
    { /* initialize real to realVal and imag to imagVal */ }
    3) Get/Set functions:
    public int getReal ( )
    { /* returns the real part */ }
    public int getImag ( )
    { /* returns the imaginary part */ }
    public void setReal ( int realVal )
    { /* sets real to realVal */ }
    public void setImag ( int imagVal )
    { /* sets imag to imagVal */ }
    Part 2. Implement a ComplexNumberPlot class (with a main method) that gets complex
    numbers from the user and plots them. The user will be prompted a complex number until
    he/she enters 0. The numbers will be input from the keyboard (System.in) and displayed
    in the plot as they are entered. Assume that the user will enter the numbers in blank
    separated format. For example, if the user wants to enter three complex numbers: 3 + 4i,
    5 + 12i, and 15 + 17i, the input sequence will be:
    3 4
    5 12
    15 17
    0 0
    To plot a complex number, you need to draw a line between (0,0) and (real, imag) using
    the drawLine method.
    Name your classes as ComplexNumber and ComplexNumberPlot.
    For simplicity, you can assume that the complex numbers input by the user fall
    into the first quadrant of the complex plane, i.e. both real and imaginary values
    are positive.
    Thanks for any help!

    Ok I've made some progress, here is what I've got.
    public class ComplexNumber
    private int real;
    private int imag;
    public ComplexNumber (int realVal, int imagVal)
    real = realVal;
    imag = imagVal;
    public int getReal()
    return real;
    public int getImag()
    return imag;
    public void setReal(int realVal)
    real = realVal;
    public void setImag(int imagVal)
    imag = imagVal;
    import java.util.Scanner;
    import java.awt.*;
    import javax.swing.*;
    public class ComplexNumberPlot
    public static void main (String [] args)
    ComplexNumber num = new ComplexNumber (1,0);
    Scanner scan = new Scanner (System.in);
    System.out.println("Enter a complex number(s):");
    num.setReal(scan.nextInt());
    num.setImag(scan.nextInt());
    while (num.getReal() + num.getImag() != 0)
    num.setReal(scan.nextInt());
    num.setImag(scan.nextInt());
    System.out.println();
    JFrame frame = new JFrame ("ComplexNumberPlot");
    frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
    ComplexPanel panel = new ComplexPanel();
    frame.getContentPane().add(panel);
    frame.pack();
    frame.setVisible(true);
    class ComplexPanel extends JPanel
    public ComplexPanel()
    setPreferredSize (new Dimension(150,150));
    public void PaintComponent (Graphics page)
    super.paintComponent(page);
    page.drawLine(0,0,100,100);
    However
    1) The JPanel pops up but no line is drawn.
    2) I am not sure how to get the variables I'm scanning for to work in the drawLine method
    Thanks for all your help so far.

  • Need help with a method

    I am re-writing this method because it does not return the expected data. I
    am still somewhat new to coding in Forte. Please help if you can. The
    error exception message I receive when I run is.....
    This error is a TOOL CODE ERROR
    Detected In:
    Class: RPTClientNumberList
    Method: DBCursor::Open
    Location: 0
    Forte Error Message is:
    No input values supplied for the SQL statement.
    Additional Information:
    **** End of Error ****
    No matter what changes I make to the SQL I still receive this error.
    //: Parameters: pReportCriteria : ClientNumberListReportCriteria
    //: Returns: Array of ClientNumberListReportData
    //: Purpose: To get the data required for the ClientNumberListReportData.
    //: Logic
    //: History: mm/dd/yy xxx comment
    lClientTransfersArray : Array of ClientNumberListReportData = new();
    lResultArray : Array of ClientNumberListReportData =
    new();
    lReportData : ClientNumberListReportData;
    lReportInfo :
    ClientNumberListReportTransactions;
    lThis : TextData =
    'ReportSQLAgent.SelectClientNumberListReportData()';
    lSQL : TextData = new();
    lSQL.SetValue(
    'SELECT C.ClientName aClientName, \
    CN.ClientNumber aClientNumber, \
    CN.ClientNumberID aClientNumberID, \
    T.TeamNumber aIsTeamID, \
    AM.FirstName aFirstName, \
    AM.MiddleName aMiddleName, \
    AM.LastName aLastName \
    FROM SUPER_DBA.Client C, \
    SUPER_DBA.ClientN CN, \
    SUPER_DBA.Team T, \
    SUPER_DBA.OASUSER AM \
    WHERE CN.ClientID = C.ClientID and \
    CN.ISTeamID = T.TeamID
    and \
    CN.IsActive = \'Y\' AND
    CN.AccountMgrID = AM.UserID ');
    // If the criteria contains an ISTeamID, search by it.
    if pReportCriteria.aISTeamID <> cEmptyDropListValue then
    lSQL.concat( ' and CN.ISTeamID = ');
    lSQL.concat( pReportCriteria.aISTeamID );
    end if;
    begin transaction
    lDynStatement : DBStatementHandle;
    lInputDesc : DBDataset;
    lOutputDesc : DBDataset;
    lOutputData : DBDataset;
    lRowType : Integer;
    lStatementType : Integer;
    // The prepare method parses the SQL statement, verifying the
    // syntax and returns a statement identifier (the handle
    lDynStatement)
    // to use as a reference
    lDynStatement = DefaultDBSession.prepare( lSQL, lInputDesc,
    lStatementType );
    // The opencursor method positions the cursor before the first row
    // in the result set
    lRowType = DefaultDBSession.OpenCursor( lDynStatement, lInputDesc,
    lOutputDesc );
    lNumRows : Integer;
    while true do
    lNumRows = DefaultDBSession.FetchCursor( lDynStatement,
    lOutputData );
    if lNumRows <= 0 then
    exit;
    end if;
    lReportData = new();
    lReportData.aFirstName = TextData(
    lOutputData.GetValue(ColumnName='aFirstName')).value;
    lReportData.aMiddleName = TextData(
    lOutputData.GetValue(ColumnName='aMiddleName')).value;
    lReportData.aLastName = TextData(
    lOutputData.GetValue(ColumnName='aLastName')).value;
    lReportData.aClientName = TextData(
    lOutputData.GetValue(ColumnName='aClientName')).value;
    lReportData.aClientNumber = DoubleNullable(
    lOutputData.GetValue(ColumnName='aClientNumber')).TextValue.value;
    lReportData.aClientNumberID = DoubleNullable(
    lOutputData.GetValue(ColumnName='aClientNumberID')).integervalue;
    lReportData.aIsTeamID = IntegerNullable(
    lOutputData.GetValue(ColumnName='aIsTeamID')).TextValue.value;
    lResultArray.AppendRow( lReportData );
    end while;
    // Close the cursor
    DefaultDBSession.CloseCursor( lDynStatement );
    // Remove the cursor to free resources
    DefaultDBSession.RemoveStatement( lDynStatement );
    end transaction;
    for lEach in lResultArray do
    lHistorySQL : TextData = new();
    lHistorySQL.SetValue(
    'SELECT CNH.isActive aIsActive, \
    T.TeamNumber aTeamID, \
    CNH.ModifyDateTime
    aTransactionDate \
    FROM SUPER_DBA.ClientNH CNH, \
    SUPER_DBA.Team T \
    WHERE CNH.ISTeamID = T.TeamID and \
    CNH.ClientNumberID =
    :lResultArray.aClientNumberID ');
    // If a date range was specified, include it in the SQL
    if NOT pReportCriteria.aStartDate.IsNull then
    lHistorySQL.concat( ' and CNH.ModifyDateTime between
    :pReportCriteria.aStartDate ');
    lHistorySQL.concat( ' and :pReportCriteria.aEndDate ');
    end if;
    begin transaction
    lDynStatement : DBStatementHandle;
    lInputDesc : DBDataset;
    lOutputDesc : DBDataset;
    lOutputData : DBDataset;
    lRowType : Integer;
    lStatementType : Integer;
    // The prepare method parses the SQL statement, verifying
    the
    // syntax and returns a statement identifier (the handle
    lDynStatement)
    // to use as a reference
    lDynStatement = DefaultDBSession.prepare( lHistorySQL,
    lInputDesc, lStatementType );
    // The opencursor method positions the cursor before the
    first row
    // in the result set
    lRowType = DefaultDBSession.OpenCursor( lDynStatement,
    lInputDesc, lOutputDesc );
    lNumRows : Integer;
    while true do
    lNumRows = DefaultDBSession.FetchCursor(
    lDynStatement, lOutputData );
    if lNumRows <= 0 then
    exit;
    end if;
    lReportInfo = new();
    lReportInfo.aIsActive = TextData(
    lOutputData.GetValue(ColumnName='aIsActive')).value;
    lReportInfo.aISTeamID =
    IntegerNullable(
    lOutputData.GetValue(ColumnName='aTeamID')).TextValue.value;
    lReportInfo.aTransactionDate = DateTimeData(
    lOutputData.GetValue(ColumnName='aTransactionDate'));
    lResultArray.AppendRow( lReportData );
    end while;
    // Close the cursor
    DefaultDBSession.CloseCursor( lDynStatement );
    // Remove the cursor to free resources
    putline( '%1: Removing the cursor.', lThis );
    DefaultDBSession.RemoveStatement( lDynStatement );
    end transaction;
    lLastTeamNumber : string = cEmptyText;
    lKeepRecord : boolean = False;
    if lReportInfo.aISTeamID <> lLastTeamNumber then
    lLastTeamNumber = lReportInfo.aISTeamID;
    lReportInfo.aTransactionDescription = 'New Team Assignment';
    lResultArray.appendRow( lReportInfo );
    end if;
    if lReportInfo.aIsActive = 'N' then
    lReportInfo.aTransactionDescription = 'Team Number Deleted';
    lResultArray.appendRow( lReportInfo );
    end if;
    end for;
    // Success! Excellent!! Return the ClientNumberListReportData!
    return lResultArray;
    exception
    when e : GenericException do
    LogException( e, lThis );
    raise e;
    Lisa M. Tucci - Applications Programmer
    Business Applications Support and Development - West Corporation
    tel.: (402) 964-6360 ex: 208-4360 stop: W8-IS e-mail: lmtucciwest.com

    I am re-writing this method because it does not return the expected data. I
    am still somewhat new to coding in Forte. Please help if you can. The
    error exception message I receive when I run is.....
    This error is a TOOL CODE ERROR
    Detected In:
    Class: RPTClientNumberList
    Method: DBCursor::Open
    Location: 0
    Forte Error Message is:
    No input values supplied for the SQL statement.
    Additional Information:
    **** End of Error ****
    No matter what changes I make to the SQL I still receive this error.
    //: Parameters: pReportCriteria : ClientNumberListReportCriteria
    //: Returns: Array of ClientNumberListReportData
    //: Purpose: To get the data required for the ClientNumberListReportData.
    //: Logic
    //: History: mm/dd/yy xxx comment
    lClientTransfersArray : Array of ClientNumberListReportData = new();
    lResultArray : Array of ClientNumberListReportData =
    new();
    lReportData : ClientNumberListReportData;
    lReportInfo :
    ClientNumberListReportTransactions;
    lThis : TextData =
    'ReportSQLAgent.SelectClientNumberListReportData()';
    lSQL : TextData = new();
    lSQL.SetValue(
    'SELECT C.ClientName aClientName, \
    CN.ClientNumber aClientNumber, \
    CN.ClientNumberID aClientNumberID, \
    T.TeamNumber aIsTeamID, \
    AM.FirstName aFirstName, \
    AM.MiddleName aMiddleName, \
    AM.LastName aLastName \
    FROM SUPER_DBA.Client C, \
    SUPER_DBA.ClientN CN, \
    SUPER_DBA.Team T, \
    SUPER_DBA.OASUSER AM \
    WHERE CN.ClientID = C.ClientID and \
    CN.ISTeamID = T.TeamID
    and \
    CN.IsActive = \'Y\' AND
    CN.AccountMgrID = AM.UserID ');
    // If the criteria contains an ISTeamID, search by it.
    if pReportCriteria.aISTeamID <> cEmptyDropListValue then
    lSQL.concat( ' and CN.ISTeamID = ');
    lSQL.concat( pReportCriteria.aISTeamID );
    end if;
    begin transaction
    lDynStatement : DBStatementHandle;
    lInputDesc : DBDataset;
    lOutputDesc : DBDataset;
    lOutputData : DBDataset;
    lRowType : Integer;
    lStatementType : Integer;
    // The prepare method parses the SQL statement, verifying the
    // syntax and returns a statement identifier (the handle
    lDynStatement)
    // to use as a reference
    lDynStatement = DefaultDBSession.prepare( lSQL, lInputDesc,
    lStatementType );
    // The opencursor method positions the cursor before the first row
    // in the result set
    lRowType = DefaultDBSession.OpenCursor( lDynStatement, lInputDesc,
    lOutputDesc );
    lNumRows : Integer;
    while true do
    lNumRows = DefaultDBSession.FetchCursor( lDynStatement,
    lOutputData );
    if lNumRows <= 0 then
    exit;
    end if;
    lReportData = new();
    lReportData.aFirstName = TextData(
    lOutputData.GetValue(ColumnName='aFirstName')).value;
    lReportData.aMiddleName = TextData(
    lOutputData.GetValue(ColumnName='aMiddleName')).value;
    lReportData.aLastName = TextData(
    lOutputData.GetValue(ColumnName='aLastName')).value;
    lReportData.aClientName = TextData(
    lOutputData.GetValue(ColumnName='aClientName')).value;
    lReportData.aClientNumber = DoubleNullable(
    lOutputData.GetValue(ColumnName='aClientNumber')).TextValue.value;
    lReportData.aClientNumberID = DoubleNullable(
    lOutputData.GetValue(ColumnName='aClientNumberID')).integervalue;
    lReportData.aIsTeamID = IntegerNullable(
    lOutputData.GetValue(ColumnName='aIsTeamID')).TextValue.value;
    lResultArray.AppendRow( lReportData );
    end while;
    // Close the cursor
    DefaultDBSession.CloseCursor( lDynStatement );
    // Remove the cursor to free resources
    DefaultDBSession.RemoveStatement( lDynStatement );
    end transaction;
    for lEach in lResultArray do
    lHistorySQL : TextData = new();
    lHistorySQL.SetValue(
    'SELECT CNH.isActive aIsActive, \
    T.TeamNumber aTeamID, \
    CNH.ModifyDateTime
    aTransactionDate \
    FROM SUPER_DBA.ClientNH CNH, \
    SUPER_DBA.Team T \
    WHERE CNH.ISTeamID = T.TeamID and \
    CNH.ClientNumberID =
    :lResultArray.aClientNumberID ');
    // If a date range was specified, include it in the SQL
    if NOT pReportCriteria.aStartDate.IsNull then
    lHistorySQL.concat( ' and CNH.ModifyDateTime between
    :pReportCriteria.aStartDate ');
    lHistorySQL.concat( ' and :pReportCriteria.aEndDate ');
    end if;
    begin transaction
    lDynStatement : DBStatementHandle;
    lInputDesc : DBDataset;
    lOutputDesc : DBDataset;
    lOutputData : DBDataset;
    lRowType : Integer;
    lStatementType : Integer;
    // The prepare method parses the SQL statement, verifying
    the
    // syntax and returns a statement identifier (the handle
    lDynStatement)
    // to use as a reference
    lDynStatement = DefaultDBSession.prepare( lHistorySQL,
    lInputDesc, lStatementType );
    // The opencursor method positions the cursor before the
    first row
    // in the result set
    lRowType = DefaultDBSession.OpenCursor( lDynStatement,
    lInputDesc, lOutputDesc );
    lNumRows : Integer;
    while true do
    lNumRows = DefaultDBSession.FetchCursor(
    lDynStatement, lOutputData );
    if lNumRows <= 0 then
    exit;
    end if;
    lReportInfo = new();
    lReportInfo.aIsActive = TextData(
    lOutputData.GetValue(ColumnName='aIsActive')).value;
    lReportInfo.aISTeamID =
    IntegerNullable(
    lOutputData.GetValue(ColumnName='aTeamID')).TextValue.value;
    lReportInfo.aTransactionDate = DateTimeData(
    lOutputData.GetValue(ColumnName='aTransactionDate'));
    lResultArray.AppendRow( lReportData );
    end while;
    // Close the cursor
    DefaultDBSession.CloseCursor( lDynStatement );
    // Remove the cursor to free resources
    putline( '%1: Removing the cursor.', lThis );
    DefaultDBSession.RemoveStatement( lDynStatement );
    end transaction;
    lLastTeamNumber : string = cEmptyText;
    lKeepRecord : boolean = False;
    if lReportInfo.aISTeamID <> lLastTeamNumber then
    lLastTeamNumber = lReportInfo.aISTeamID;
    lReportInfo.aTransactionDescription = 'New Team Assignment';
    lResultArray.appendRow( lReportInfo );
    end if;
    if lReportInfo.aIsActive = 'N' then
    lReportInfo.aTransactionDescription = 'Team Number Deleted';
    lResultArray.appendRow( lReportInfo );
    end if;
    end for;
    // Success! Excellent!! Return the ClientNumberListReportData!
    return lResultArray;
    exception
    when e : GenericException do
    LogException( e, lThis );
    raise e;
    Lisa M. Tucci - Applications Programmer
    Business Applications Support and Development - West Corporation
    tel.: (402) 964-6360 ex: 208-4360 stop: W8-IS e-mail: lmtucciwest.com

  • Need help on last method in this class

    import java.util.*;
    import java.util.Random;
    class Homework2
    static Scanner keyboard = new Scanner(System.in);
    public static void main(String args[])
    final int beer = 1;
    final int ale = 2;
    final int wine = 3;
    final int bourbon = 4;
    final int scotch = 5;
    final int rum = 6;
    final int water = 7;
    int x = getRandom(beer, ale, wine, bourbon, scotch, rum, water);
    switch(x)
    case 1:
    System.out.println("first drink is beer");
         break;
         case 2:
    System.out.println("first drink is ale");
         break;
         case 3:
    System.out.println("first drink is wine");
         break;
    case 4:
    System.out.println("first drink is bourbon");
         break;
         case 5:
    System.out.println("first drink is scotch");
         break;
    case 6:
    System.out.println("first drink is rum");
         break;
    case 7:
    System.out.println("first drink is water");
         break;
    int y = getRandom2(beer, ale, wine, bourbon, scotch, rum, water);
    switch(y)
    case 1:
    System.out.println("first drink is beer");
         break;
         case 2:
    System.out.println("first drink is ale");
         break;
         case 3:
    System.out.println("first drink is wine");
         break;
    case 4:
    System.out.println("first drink is bourbon");
         break;
         case 5:
    System.out.println("first drink is scotch");
         break;
    case 6:
    System.out.println("first drink is rum");
         break;
    case 7:
    System.out.println("first drink is water");
         break;
    System.out.print(x + " " + y);
    double z = alcoholicCon(x,y); (* Here is where i started with problems*)
    System.out.println(z);
    public static int getRandom(int a, int b, int c, int d, int e, int f, int g)
    Random generator = new Random();
    return (int)(1 + Math.random()* 7);
    public static int getRandom2(int h, int i, int j, int k, int l, int m, int n)
    Random generator = new Random();
    return (int)(1 + Math.random()* 7);
    public static double alcoholicCon(int o, int p,) (*Error here*)
    double content1;
    double content2;
    double content;
    if(o==1)
    content1=.04;
    if(o==2)
    content1=.07;
    if(o==3)
    content1=.12;
    if(o==4)
    content1=.40;     
    if(o==5)
    content1=.60;
    if(o==6)
    content1=.77;          
    if(o==7)
    content1=.00;
    if(p==1)
    content2=.04;
    if(p==2)
    content2=.07;
    if(p==3)
    content2=.12;
    if(p==4)
    content2=.40;     
    if(p==5)
    content2=.60;
    if(p==6)
    content2=.77;          
    if(p==7)
    content2=.00;
         content = content1 + content2;
         return content;      
    Here is the program everything worked great till i added the last method, i keep getting a illegal start of type error message now. Do i have to switch my data type in the main? or do i have to switch it down in the method?

    WOW, Im not sure what you are trying to do.
    What was the compiler error?
    Just an observation,
    Both of your getRandom() and getRandom2(), you pass in 7 parameters and do nothing with them. you really do not need to do this. Also both of those methods do exactly the same thing, the same way. Thats just redundant.
    You could say something like:
         public static int newRandom(){
            return (int) (1 + Math.random() * 7);
        }Also check your method signature for the
    public static double alcoholicCon(int o, int p,){I see your error, do you? Hint: too much punctuation...
    Also, you should initialize your method variables to a value.
    Darn too slow...
    Message was edited by:
    Java_Jay

  • I need help creating a method!

    Hi,
    I'm following a Java course, we have a homework to do and I have some problems with it... We have to create a table (int [] a) with a 100 elements ( 0,2,4,6 ... to 198 - all even) we have to go through a "for" to fill the table (I have no problem with that) but the thing is that we have to create a JOptionPane asking a value and our method has to find that value in the table and give the position of that value. And if the value is not even a JOptionPane has to respond "that value is not in the table". I'll give yall an example:
    let's say that table [4] contains the value 8. If "8" is enter in the JOptionPane the program will return "the position of 8 in the table is 4"
    here is what I have done so far (some of the text is in french):
    import javax.swing.*;
    import java.awt.*;
    public class TP3a extends JApplet{
         JTextArea zone = new JTextArea ();
         String sortie= " ";
         String cle1;
         int indice=0;
         int cle;
         int [] tableau = new int [100];
              public void init (){
                        for (int x=0; x<=200; x++){
                             tableau[x]= x*2+2;
                             indice=x;
                   cle1=JOptionPane.showInputDialog ("Entrer la valeur de l'element que vous desirez voir: ");
                   cle=Integer.parseInt (cle1);
                   rechercheIndice (int tableau [], cle);
                        sortie+=tableau [cle];
                        zone.append (sortie);
                        JOptionPane.showMessageDialog (null, zone, "Tableau", JOptionPane.PLAIN_MESSAGE);
                        System.exit (0);
              public int rechercheIndice (int tableau [], int cle){
                   for (int x; x<=tableau.length; x++){
                        if (cle == tableau [x])
                             return tableau [cle];
                             else
                             continue;
    Please help me!!!
    Thanks,
    Neriade

    import javax.swing.*;
    import java.awt.*;
    public class TP3a extends JApplet{
          JTextArea zone = new JTextArea ();
          String sortie= " ";
          String cle1;
          int indice=0;
          int cle;
          int [] tableau = new int [100];
          public void init (){
          for (int x=0, y = 0; x<100; x++, y += 2 ){
             tableau[x]= y;
             indice=x;
          cle1=JOptionPane.showInputDialog ("Entrer la valeur de l'element que vous desirez voir: ");
          cle=Integer.parseInt (cle1);
          int i = rechercheIndice (tableau, cle);
          System.out.println( "i: " + i );
          sortie+=tableau [cle];
          zone.append (sortie);
          JOptionPane.showMessageDialog (null, zone, "Tableau", JOptionPane.PLAIN_MESSAGE);
          System.exit (0);
          public int rechercheIndice (int[] tableau, int cle){
          for (int x = 0; x<tableau.length; x++){
             if (cle == tableau [x])
                return x;//tableau [cle];
          return -1;
    }

  • Java Newbie needs help with multi method dialog calculator

    Our example for the unit was the example below... we now must create a 5 method program for a calculator... 1 main method and 4 for the standard operations(+ - * /). It is supposed to utilize Swing for graphics/dialog boxes that ask you for the operation you would like to use(if statements based on which operation they enter), and a prompt that asks you separately for the 2 numbers used.... anyone feel like drawing this skeleton out? I am in class right now and none of my neighbors can figure it out either....
    import javax.swing.JOptionPane;
    public class Payroll
         public static void main(String[] args)
         String name;         //the user's name
         String inputString;  //holds input
         int hours;           //hours worked
         double payRate;      //hourly pay wage
         double grossPay;     //total pay
         //getUser
         name = JOptionPane.showInputDialog("What is your name?");
         //getHours
         inputString = JOptionPane.showInputDialog("How many hours did you work?");
         hours = Integer.parseInt(inputString);
         //getRate
         inputString = JOptionPane.showInputDialog("What is your hourly pay rate?");
         payRate = Double.parseDouble(inputString);
         //setGross
         grossPay = payRate * hours;
         //showGross
         JOptionPane.showMessageDialog(null, "Hello " + name + ". Your gross pay is: " + grossPay); 
         //End
         System.exit(0);
    }

    import javax.swing.JOptionPane;
    public class CalcDiag
         public static void main(String[] args)
         String operation;
         String inputString;
         double num1, num2, total=0;
         inputString = JOptionPane.showInputDialog("What is your first number?");
         num1 = Double.parseDouble(inputString);
         inputString = JOptionPane.showInputDialog("What is your second number?");
         num2 = Double.parseDouble(inputString);
         inputString = JOptionPane.showInputDialog("Please indicate which operation you would like to use: A,S,M,D ?");
         operation = inputString;
         if (operation.equals("A"))
              total = getAdd(num1, num2);
         if (operation.equals("S"))
              total = getSub(num1, num2);
         if (operation.equals("M"))
              total = getMult(num1, num2);
         if (operation.equals("D"))
              total = getDiv(num1, num2);
         JOptionPane.showMessageDialog(null,"Total = "+total);
         System.exit(0);
    public static double getAdd(double x, double y)
              return x+y;
    public static double getSub(double x,double y)
              return x-y;
    public static double getMult(double x, double y)
              return x*y;
    public static double getDiv(double x, double y)
              return x/y;
    }your welcome

  • Need help calling a method from an immutable class

    I'm having difficulties in calling a method from my class called Cabin to my main. Here's the code in my main              if(this is where i want my method hasKitchen() from my Cabin class)
                        System.out.println("There is a kitchen.");
                   else
                        System.out.println("There is not a kitchen.");
                   }and here's my method from my Cabin class:public boolean hasKitchen()
         return kitchen;
    }

    You should first have an instance of Cabin created by using
       Cabin c = ....
       if (c.hasKitchen()) {
         System.out.println("There is a kitchen.");
       } else {
            System.out.println("There is not a kitchen.");
       }

Maybe you are looking for

  • Billing document creation problem

    Hi All,       i am not able create a billing document (vf01)with reference to a delivery order.It is giving error as billing document can not be saved due to error in account determination.can u please tell me how can i solve this problem.

  • Setting the resolution of a Pages document

    I'd be very grateful if some kind soul could tell me how to set the resolution of a new document in Pages. I want to use Pages to create an advert for inclusion in a magazine. They need artwork at 300dpi resolution and preferably in jpeg format. I've

  • Transfer kodak emailed photos to iphoto

    my newest question is how do you get photos emailed to you in kodak's email photo gallery to transfer to iphoto ? there is no attachment to click on or save button

  • How can I download languages for my N81 8G

    any help plz I need it asap

  • Concatenate with tab delimiter

    Hi, I need to put 3 fields in a Unix text file separating them with a tab delimiter.I know How to send it to unix but anyone tell me how I write the concatenate . I have another issue ...when I bring it back from unix to r/3...then how should I check