Errors with small program

Ok, I'm trying to get a small program to compile on my windows box. I'm a student and in the lab (on a linux box) the program compiled fine. I keep getting this error:
Easypieces.java:52: cannot resolve symbol
symbol : variable volume
location: class EasyPieces
System.out.println("Volume:" + volume);
^
2 errors
Here's the code:
* Student should complete the five methods, document the class
* and the methods, and test this well. You may remove the instructor
* comments.
public class EasyPieces {
* Student should complete and document this method
public void waterBalloons(int radius) {
     double cubedRadius = Math.pow(radius, 3);
     double volume;
     double volume = 4/3 * Math.PI * cubedRadius ;
* Student should complete and document this method
public void upsLoad(double computer, double monitor, double other) {
* Student should complete and document this method
public void carpool(int people) {
* Student should complete and document this method
public void checksum(int number, int base) {
* Student should complete and document this method
public void combinationLock() {
* Instructor provided test cases. Student should add additional
* test cases as necessary to make sure the program functions as
* intended.
public static void main(String[] args) {
//Create an object of type EasyPieces to use for the testing
EasyPieces testPiece = new EasyPieces();
//Instructor provided test for waterBalloons
testPiece.waterBalloons(6);
System.out.println("Volume:" + volume);
//Instructor provided test for upsLoad
//testPiece.upsLoad(1.2,0.8,1.4);
//System.out.println("----------------------------------------------------------------------");
//Instructor provided test for carpool
//testPiece.carpool(15);
//System.out.println("----------------------------------------------------------------------");
//Instructor provided test for checksum
//testPiece.checksum(156,7);
//System.out.println("----------------------------------------------------------------------");
//Instructor provided test for combinationLock
//testPiece.combinationLock();
//System.out.println("----------------------------------------------------------------------");
For some reason it doesn't want to print the variable out...
Any help?
Thanks, Greg

<< That code didn't compile on your linux box, guaranteed. :o) >>
This program didn't but one similiar to it did, and I get the same error message when I try to compile it on my windows box:
public class zeller {
     public static void main(String args[]) {
          int month = 2;
          int day = 29;
          int year = 2000;
          if (month == 2) {
               year = year -1;
               day = day +3;
          if (month == 1) {
               year = year -1;
               day = day;
          if (month == 3) {
               year = year;
               day = day + 2;
          if (month == 4) {
               day = day + 5;
          if (month == 5) {
               day = day;
          if (month == 6) {
               day = day + 3;
          if (month == 7) {
               day = day + 5;
          if (month == 8) {
               day = day +1;
          if (month == 9) {
               day = day +4;
          if (month == 10) {
               day = day +6;
          if (month == 11) {
               day = day +2;
          if (month == 12) {
               day = day +4;
          int sum = year + year/4 - year/100 + year/400 + day;
          int dayOfWeek = sum % 7;
          System.out.println(dayofweek);
I get this error in windows (the same error I get with the other program):
D:\JAVA\jdk142\bin>javac zeller.java
zeller.java:67: cannot resolve symbol
symbol : variable dayofweek
location: class zeller
System.out.println(dayofweek);
^
1 error
Greg

Similar Messages

  • When I open Firefox I have to try several times because a Runtime Error with the program C:\Windows\System32\regsvr32.exe

    when I open Firefox I have to try several times because a Runtime Error with the program C:\Windows\System32\regsvr32.exe

    '''Try the Firefox Safe Mode''' to see how it works there. The Safe Mode is a troubleshooting mode, which disables most add-ons.''
    ''(If you're not using it, switch to the Default theme.)''
    * You can open the Firefox 4.0+ Safe Mode by holding the '''Shift''' key when you use the Firefox desktop or Start menu shortcut.
    * Or use the Help menu item and click on the '''Restart with Add-ons Disabled...''' menu item while Firefox is running.
    ''Don't select anything right now, just use "Continue in Safe Mode."''
    ''To exit the Firefox Safe Mode, just close Firefox and wait a few seconds before using the Firefox shortcut (without the Shift key) to open it again.''
    '''''If it is good in the Firefox Safe Mode''''', your problem is probably caused by an extension, and you need to figure out which one.
    Please follow the [[Troubleshooting extensions and themes]] article for that.
    ''When you figure out what's causing your issues, please let us know. It might help other users who have the same problem.''

  • Help with small program

    hey every time i compile i get errors with the JOptionPane.showMessageDialog(s) in the switch statement any help would be great
    ""incompatible types
    found : void""
    here is the code
    import java.util.Random;
    import javax.swing.*;
    public class Fish{
    String size;
    String type;
    String location;
    public String Fish(String type, String location, String size){
    String input = JOptionPane.showInputDialog("Press:" + "\n" + "1 for Bass" + "\n" + "2 for White perch" + "\n" + "3 for Yellow cat fish"
    + "\n" + "4 for Spec Trout" + "\n" + "5 for Red fish" + "\n" + "6 for Grouper");
    int choice = Integer.parseInt(input);
    switch (choice){
    case 1: String input1 = JOptionPane.showInputDialog("what is the size(length) of your bass?");
    String input2 = JOptionPane.showInputDialog("where did you catch your bass?");
    double siz = Double.parseDouble(input1);
    double loc = Double.parseDouble(input2);
    String output = JOptionPane.showMessageDialog(null, "Sorry but you bass is not big enough to keep so through it back or i will tell on you");
    String output1 = JOptionPane.showMessageDialog(null, "You caught a fresh water bass that is " + siz + "inches long and you caught it in " + loc);
    if (siz <= 13)
    return output;
    else
    return output1;
    break;
    case 2: String input3 = JOptionPane.showInputDialog("what is the size(length) of your White perch?");
    String input4 = JOptionPane.showInputDialog("where did you catch your White perch?");
    double siz1 = Double.parseDouble(input3);
    double loc1 = Double.parseDouble(input4);
    String output2 = JOptionPane.showMessageDialog(null, "Sorry but you White perch is not big enough to keep so through it back or i will tell on you");
    String output3 = JOptionPane.showMessageDialog(null, "You caught a fresh water White perch that is " + siz1 + "inches long and you caught it in " + loc1);
    if (siz1 <= 0)
    return output2;
    else
    return output3;
    break;
    case 3:String input5 = JOptionPane.showInputDialog("what is the size(length) of your Yellow cat fish?");
    String input6 = JOptionPane.showInputDialog("where did you catch your Yellow cat fish?");
    double siz2 = Double.parseDouble(input5);
    double loc2 = Double.parseDouble(input6);
    String output4 = JOptionPane.showMessageDialog(null, "Sorry but you Yellow cat fish is not big enough to keep so through it back or i will tell on you");
    String output5 = JOptionPane.showMessageDialog(null, "You caught a fresh water Yellow cat fish that is " + siz2 + "inches long and you caught it in " + loc2);
    if (siz1 <= 10)
    return output4;
    else
    return output5;
    break;
    case 4:String input7 = JOptionPane.showInputDialog("what is the size(length) of your Spec Trout?");
    String input8 = JOptionPane.showInputDialog("where did you catch your Spec Trout?");
    double siz3 = Double.parseDouble(input7);
    double loc3 = Double.parseDouble(input8);
    String output6 = JOptionPane.showMessageDialog(null, "Sorry but you Spec Trout is not big enough to keep so through it back or i will tell on you");
    String output7 = JOptionPane.showMessageDialog(null, "You caught a salt water Spec Trout that is " + siz3 + "inches long and you caught it in " + loc3);
    if (siz1 <= 0)
    return output6;
    else
    return output7;
    break;
    case 5:String input9 = JOptionPane.showInputDialog("what is the size(length) of your Red fish?");
    String input10 = JOptionPane.showInputDialog("where did you catch your Red fish?");
    double siz4 = Double.parseDouble(input9);
    double loc4 = Double.parseDouble(input10);
    String output8 = JOptionPane.showMessageDialog(null, "Sorry but you Red fish is not big enough to keep so through it back or i will tell on you");
    String output9 = JOptionPane.showMessageDialog(null, "You caught a salt water Red fish that is " + siz4 + "inches long and you caught it in " + loc4);
    if (siz1 <= 0)
    return output8;
    else
    return output9;
    break;
    case 6:String input11 = JOptionPane.showInputDialog("what is the size(length) of your Grouper?");
    String input12 = JOptionPane.showInputDialog("where did you catch your Grouper?");
    double siz5 = Double.parseDouble(input11);
    double loc5 = Double.parseDouble(input12);
    String output10 = JOptionPane.showMessageDialog(null, "Sorry but you Grouper is not big enough to keep so through it back or i will tell on you");
    String output11 = JOptionPane.showMessageDialog(null, "You caught a salt water Grouper that is " + siz4 + "inches long and you caught it in " + loc4);
    if (siz1 <= 0)
    return output10;
    else
    return output11;
    break;
    public boolean caught(){
    if (Math.random()*(2)+(1)==1){
    return true;
    else
    return false;
    public int hooked(String lure, String time){
    String input = JOptionPane.showInputDialog("What lure did you use?");
    String input1 = JOptionPane.showInputDialog("What time did you catch your fish at? include P.M or A.M");
    double lur = Double.parseDouble(input);
    double tim = Double.parseDouble(input1);
    JOptionPane.showMessageDialog(null, "You hooked you fish with a " + lur + "at " + tim);
    Message was edited by:
    skullker232

    i get errors on all the String outputs in the switch it says
    "incompatible types
    found : void"
    <code>
    import java.util.Random;
    import javax.swing.*;
    public class Fish{
    String size;
    String type;
    String location;
    public String Fish(String type, String location, String size){
    String input = JOptionPane.showInputDialog("Press:" + "\n" + "1 for Bass" + "\n" + "2 for White perch" + "\n" + "3 for Yellow cat fish"
    + "\n" + "4 for Spec Trout" + "\n" + "5 for Red fish" + "\n" + "6 for Grouper");
    int choice = Integer.parseInt(input);
    switch (choice){
    case 1: String input1 = JOptionPane.showInputDialog("what is the size(length) of your bass?");
    String input2 = JOptionPane.showInputDialog("where did you catch your bass?");
    double siz = Double.parseDouble(input1);
    double loc = Double.parseDouble(input2);
    String output = JOptionPane.showMessageDialog(null, "Sorry but you bass is not big enough to keep so through it back or i will tell on you");
    String output1 = JOptionPane.showMessageDialog(null, "You caught a fresh water bass that is " + siz + "inches long and you caught it in " + loc);
    if (siz <= 13)
    return output;
    else
    return output1;
    break;
    case 2: String input3 = JOptionPane.showInputDialog("what is the size(length) of your White perch?");
    String input4 = JOptionPane.showInputDialog("where did you catch your White perch?");
    double siz1 = Double.parseDouble(input3);
    double loc1 = Double.parseDouble(input4);
    String output2 = JOptionPane.showMessageDialog(null, "Sorry but you White perch is not big enough to keep so through it back or i will tell on you");
    String output3 = JOptionPane.showMessageDialog(null, "You caught a fresh water White perch that is " + siz1 + "inches long and you caught it in " + loc1);
    if (siz1 <= 0)
    return output2;
    else
    return output3;
    break;
    case 3:String input5 = JOptionPane.showInputDialog("what is the size(length) of your Yellow cat fish?");
    String input6 = JOptionPane.showInputDialog("where did you catch your Yellow cat fish?");
    double siz2 = Double.parseDouble(input5);
    double loc2 = Double.parseDouble(input6);
    String output4 = JOptionPane.showMessageDialog(null, "Sorry but you Yellow cat fish is not big enough to keep so through it back or i will tell on you");
    String output5 = JOptionPane.showMessageDialog(null, "You caught a fresh water Yellow cat fish that is " + siz2 + "inches long and you caught it in " + loc2);
    if (siz1 <= 10)
    return output4;
    else
    return output5;
    break;
    case 4:String input7 = JOptionPane.showInputDialog("what is the size(length) of your Spec Trout?");
    String input8 = JOptionPane.showInputDialog("where did you catch your Spec Trout?");
    double siz3 = Double.parseDouble(input7);
    double loc3 = Double.parseDouble(input8);
    String output6 = JOptionPane.showMessageDialog(null, "Sorry but you Spec Trout is not big enough to keep so through it back or i will tell on you");
    String output7 = JOptionPane.showMessageDialog(null, "You caught a salt water Spec Trout that is " + siz3 + "inches long and you caught it in " + loc3);
    if (siz1 <= 0)
    return output6;
    else
    return output7;
    break;
    case 5:String input9 = JOptionPane.showInputDialog("what is the size(length) of your Red fish?");
    String input10 = JOptionPane.showInputDialog("where did you catch your Red fish?");
    double siz4 = Double.parseDouble(input9);
    double loc4 = Double.parseDouble(input10);
    String output8 = JOptionPane.showMessageDialog(null, "Sorry but you Red fish is not big enough to keep so through it back or i will tell on you");
    String output9 = JOptionPane.showMessageDialog(null, "You caught a salt water Red fish that is " + siz4 + "inches long and you caught it in " + loc4);
    if (siz1 <= 0)
    return output8;
    else
    return output9;
    break;
    case 6:String input11 = JOptionPane.showInputDialog("what is the size(length) of your Grouper?");
    String input12 = JOptionPane.showInputDialog("where did you catch your Grouper?");
    double siz5 = Double.parseDouble(input11);
    double loc5 = Double.parseDouble(input12);
    String output10 = JOptionPane.showMessageDialog(null, "Sorry but you Grouper is not big enough to keep so through it back or i will tell on you");
    String output11 = JOptionPane.showMessageDialog(null, "You caught a salt water Grouper that is " + siz4 + "inches long and you caught it in " + loc4);
    if (siz1 <= 0)
    return output10;
    else
    return output11;
    break;
    public boolean caught(){
    if (Math.random()*(2)+(1)==1){
    return true;
    else
    return false;
    public int hooked(String lure, String time){
    String input = JOptionPane.showInputDialog("What lure did you use?");
    String input1 = JOptionPane.showInputDialog("What time did you catch your fish at? include P.M or A.M");
    double lur = Double.parseDouble(input);
    double tim = Double.parseDouble(input1);
    JOptionPane.showMessageDialog(null, "You hooked you fish with a " + lur + "at " + tim);
    </code>

  • Parsing a date error.help with small program

    I would like to read from a file which the user can choose on start of program. I want to read line for line, checking if the format of each is ok. if it is , I add it to ArrayList of good books, if not I add it to ArrayList of error books. The date isnt parsing correctly.
    import java.io.*;
    import java.text.DateFormat;
    import java.text.ParseException;
    import java.text.SimpleDateFormat;
    import java.util.*;
    public class Book {
        String isbn;
        int copyNumber;
        String title;
        String author;
        int statistics;
        Date borrowDate = new Date();
        Date returnDate = new Date();
        int libraryCardNumber;
        DateFormat formatter = new SimpleDateFormat("yy/mm/dd");
    public Book(String newIsbn, int newCopyNumber, String newTitle, String newAuthor,
            int newStatistics, Date newBorrowDate, Date newReturnDate, int newLibraryCardNumber)
        isbn = newIsbn;
        copyNumber = newCopyNumber;
        title = newTitle;
        author = newAuthor;
        statistics = newStatistics;
        borrowDate = newBorrowDate;
        returnDate = newReturnDate;
        libraryCardNumber = newLibraryCardNumber;
    public Book(){
    public Book(String newRow) throws ParseException
        String[] token = newRow.split("#");
                    isbn = token[0];
                    copyNumber = Integer.parseInt(token[1]);
                    title = token[2];
                    author = token[3];
                    statistics = Integer.parseInt(token[4]);
                    borrowDate = (Date)formatter.parse(token[5]);
                    returnDate = (Date)formatter.parse(token[6]);
                    libraryCardNumber = Integer.parseInt(token[7]);
    public String getIsbn()
         return isbn;
    public void setIsbn(String isbn)
        this.isbn = isbn;
    public int getCopyNumber()
        return copyNumber;
    public void setCopyNumber(int copyNumber)
        this.copyNumber = copyNumber;
    public String getTitle()
        return title;
    private void setTitle(String title)
        this.title = title;
    public String getAuthor()
        return author;
    private void setAuthor(String author)
        this.author = author;
    public int getStatistics()
        return statistics;
    public void setStatistics(int statistics)
        this.statistics = statistics;
    public Date setBorrowDate()
        return borrowDate;
    public void getBorrowDate(Date borrowDate)
        this.borrowDate = borrowDate;
    public Date getReturnDate()
        return returnDate;
    public void setReturnDate (Date returnDate)
        this.returnDate = returnDate;
    public int getLibraryCardNumber()
        return libraryCardNumber;
    public void setLibraryNumber(int libraryCardNumber)
        this.libraryCardNumber = libraryCardNumber;
    import java.io.*;
    import java.text.ParseException;
    import java.util.*;
    import java.util.regex.Matcher;
    import java.util.regex.Pattern;
    import javax.swing.JFileChooser;
    public class WriteFromBookFile {
        private static Pattern pattern;
        public static void main(String[] args) throws FileNotFoundException, ParseException, IOException {
            JFileChooser fileChooser = new JFileChooser();
            if(fileChooser.showOpenDialog(null)
                    == JFileChooser.APPROVE_OPTION){
            ArrayList<Book> newBooks = new ArrayList<Book>();
            ArrayList<Book> errorBooks = new ArrayList<Book>();
            java.io.File file = fileChooser.getSelectedFile();
        //  try{  BufferedReader reader = new BufferedReader(new FileReader("books.txt"));
           Scanner input = new Scanner(file);
           String line = input.nextLine();
            while (line != null) {
                Book newBook = new Book(line);
                String[] newToken = line.split("#");
                pattern = Pattern.compile("ISBN\\x20(?=.{13}$)\\d{1,5}([- ])\\d{1,7}\\1\\d{1,6}\\1(\\d|X)$");
                Matcher matchIsbn = pattern.matcher(newToken[0]);
                pattern = Pattern.compile("[\\d]+");
                Matcher matchCopyNumber = pattern.matcher(newToken[1]);
                pattern = Pattern.compile("[\\D&&\\w]+");
                Matcher matchTitle = pattern.matcher(newToken[2]);
                pattern = Pattern.compile("[\\D&&\\w]+");
                Matcher matchAuthor = pattern.matcher(newToken[3]);
                pattern = Pattern.compile("[\\d]+");
                Matcher matchStatistics = pattern.matcher(newToken[4]);
                pattern = Pattern.compile("YY/MM/DD");
                Matcher matchBorrowDate = pattern.matcher(newToken[5]);
                pattern = Pattern.compile("YY/MM/DD");
                Matcher matchReturnDate = pattern.matcher(newToken[6]);
                pattern = Pattern.compile("[\\d]+");
                Matcher matchLibraryCardNumber = pattern.matcher(newToken[7]);
                /*  if(matchIsbn.matches(newBook.getIsbn()) && matchCopyNumber.matches(newBook.getCopyNumber())
                && matchTitle.matches(newBook.getTitle()) && matchAuthor.matches(newBook.getAuthor())
                && matchStatistics.matches(newBook.getStatistics()) && matchBorrowDate.matches(newBook.getBorrowDate())
                && matchReturnDate.matches(newBook.getReturnDate()) && matchLibraryCardNumber.matches(newBook.getLibraryCardNumber()));*/
                if (matchIsbn.matches() && matchCopyNumber.matches() && matchTitle.matches() && matchAuthor.matches()
                        && matchStatistics.matches() && matchBorrowDate.matches() && matchReturnDate.matches() && matchLibraryCardNumber.matches())
                    newBooks.add(newBook);
                       else
                    errorBooks.add(newBook);
    line = input.nextLine();
    input.close();
           java.io.File newBookFile = new java.io.File("newBook.txt");
        if(newBookFile.exists()){
            System.out.println("File exists.");
            System.exit(0);
        java.io.PrintWriter output = new java.io.PrintWriter(newBookFile);
        for(int i = 0; i < newBooks.size(); i++)
            output.print(newBooks.get(i));
            output.close();
    }

    My program seems to work, the thing I cant work out is that because I try to match 8 fields using split
    String[] newToken = line.split("#");
                pattern = Pattern.compile("ISBN\\x20(?=.{13}$)\\d{1,5}([- ])\\d{1,7}\\1\\d{1,6}\\1(\\d|X)$");
                Matcher matchIsbn = pattern.matcher(newToken[0]);
                pattern = Pattern.compile("[\\d]+");
                Matcher matchCopyNumber = pattern.matcher(newToken[1]);
                pattern = Pattern.compile("[\\D&&\\w]+");
                Matcher matchTitle = pattern.matcher(newToken[2]);
                pattern = Pattern.compile("[\\D&&\\w]+");
                Matcher matchAuthor = pattern.matcher(newToken[3]);
                pattern = Pattern.compile("[\\d]+");
                Matcher matchStatistics = pattern.matcher(newToken[4]);
                pattern = Pattern.compile("YYMMDD");
                Matcher matchBorrowDate = pattern.matcher(newToken[5]);
                pattern = Pattern.compile("YYMMDD");
                Matcher matchReturnDate = pattern.matcher(newToken[6]);
                pattern = Pattern.compile("[\\d]+");
                Matcher matchLibraryCardNumber = pattern.matcher(newToken[7]);because some lines dont have 8 tokens, there is an array out of bounds error.
    How can it just move to the next token if there isnt a token to match or to the next line if there aren't enough tokens?

  • Error with small sap script program

    REPORT  ZFORM1                                  .
    TABLES : ZGTABLE.
    types:begin of warea,
          trackid type zgtable-trackid,
          artist type zgtable-artist,
          end of warea.
    data:itable like zgtable occurs 0 with header line.
    CALL FUNCTION 'OPEN_FORM'
    EXPORTING
    *   APPLICATION                       = 'TX'
    *   ARCHIVE_INDEX                     =
    *   ARCHIVE_PARAMS                    =
    *   DEVICE                            = 'PRINTER'
       DIALOG                            = 'X'
       FORM                              = 'ZFORM1'
       LANGUAGE                          = SY-LANGU
    *   OPTIONS                           =
    *   MAIL_SENDER                       =
    *   MAIL_RECIPIENT                    =
    *   MAIL_APPL_OBJECT                  =
    *   RAW_DATA_INTERFACE                = '*'
    * IMPORTING
    *   LANGUAGE                          =
    *   NEW_ARCHIVE_PARAMS                =
    *   RESULT                            =
    * EXCEPTIONS
    *   CANCELED                          = 1
    *   DEVICE                            = 2
    *   FORM                              = 3
    *   OPTIONS                           = 4
    *   UNCLOSED                          = 5
    *   MAIL_OPTIONS                      = 6
    *   ARCHIVE_ERROR                     = 7
    *   INVALID_FAX_NUMBER                = 8
    *   MORE_PARAMS_NEEDED_IN_BATCH       = 9
    *   SPOOL_ERROR                       = 10
    *   CODEPAGE                          = 11
    *   OTHERS                            = 12
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
       ELEMENT                        = 'MAIN'
    *   FUNCTION                       = 'SET'
    *   TYPE                           = 'BODY'
       WINDOW                         = 'MAIN'
    * IMPORTING
    *   PENDING_LINES                  =
    * EXCEPTIONS
    *   ELEMENT                        = 1
    *   FUNCTION                       = 2
    *   TYPE                           = 3
    *   UNOPENED                       = 4
    *   UNSTARTED                      = 5
    *   WINDOW                         = 6
    *   BAD_PAGEFORMAT_FOR_PRINT       = 7
    *   SPOOL_ERROR                    = 8
    *   CODEPAGE                       = 9
    *   OTHERS                         = 10
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL FUNCTION 'CLOSE_FORM'
    * IMPORTING
    *   RESULT                         =
    *   RDI_RESULT                     =
    * TABLES
    *   OTFDATA                        =
    * EXCEPTIONS
    *   UNOPENED                       = 1
    *   BAD_PAGEFORMAT_FOR_PRINT       = 2
    *   SEND_ERROR                     = 3
    *   SPOOL_ERROR                    = 4
    *   CODEPAGE                       = 5
    *   OTHERS                         = 6
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Inside sapscript:
    /E MAIN
    P1 <B> Track id : </> &ITABLE-TRACKID&
    P1 <B> Artist   : </> &ITABLE-ARTIST&
    output:
    Trackid : 00000000000
    Artist  :
    Why the output is like that? I expect the output to be first record of the table.Please help me.

    Where is loop ( Internal table ),Just see the bold code
    REPORT  ZFORM1                                  .
    TABLES : ZGTABLE.
    <b>data : begin of itable occurs 0,
              trackid type zgtable-trackid,
              artist type zgtable-artist,
             end of itable .</b>
    CALL FUNCTION 'OPEN_FORM'
    EXPORTING
      APPLICATION                       = 'TX'
      ARCHIVE_INDEX                     =
      ARCHIVE_PARAMS                    =
      DEVICE                            = 'PRINTER'
       DIALOG                            = 'X'
       FORM                              = 'ZFORM1'
       LANGUAGE                          = SY-LANGU
      OPTIONS                           =
      MAIL_SENDER                       =
      MAIL_RECIPIENT                    =
      MAIL_APPL_OBJECT                  =
      RAW_DATA_INTERFACE                = '*'
    IMPORTING
      LANGUAGE                          =
      NEW_ARCHIVE_PARAMS                =
      RESULT                            =
    EXCEPTIONS
      CANCELED                          = 1
      DEVICE                            = 2
      FORM                              = 3
      OPTIONS                           = 4
      UNCLOSED                          = 5
      MAIL_OPTIONS                      = 6
      ARCHIVE_ERROR                     = 7
      INVALID_FAX_NUMBER                = 8
      MORE_PARAMS_NEEDED_IN_BATCH       = 9
      SPOOL_ERROR                       = 10
      CODEPAGE                          = 11
      OTHERS                            = 12
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    <b>select  track id artist from zgtable into table itable.
    if sy-subrc ne 0.
    *message
    endif.
    loop at itable .
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
       ELEMENT                        = 'MAIN'
      FUNCTION                       = 'SET'
      TYPE                           = 'BODY'
       WINDOW                         = 'MAIN'
    IMPORTING
      PENDING_LINES                  =
    EXCEPTIONS
      ELEMENT                        = 1
      FUNCTION                       = 2
      TYPE                           = 3
      UNOPENED                       = 4
      UNSTARTED                      = 5
      WINDOW                         = 6
      BAD_PAGEFORMAT_FOR_PRINT       = 7
      SPOOL_ERROR                    = 8
      CODEPAGE                       = 9
      OTHERS                         = 10
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    clear itable.
    endif.</b>
    CALL FUNCTION 'CLOSE_FORM'
    IMPORTING
      RESULT                         =
      RDI_RESULT                     =
    TABLES
      OTFDATA                        =
    EXCEPTIONS
      UNOPENED                       = 1
      BAD_PAGEFORMAT_FOR_PRINT       = 2
      SEND_ERROR                     = 3
      SPOOL_ERROR                    = 4
      CODEPAGE                       = 5
      OTHERS                         = 6
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Thanks
    Seshu

  • Error with my program

    REPORT ZFORM1 .
    TABLES : ZGTABLE.
    data : begin of itable occurs 0,
    trackid type zgtable-trackid,
    artist type zgtable-artist,
    end of itable .
    CALL FUNCTION 'OPEN_FORM'
    EXPORTING
    * APPLICATION = 'TX'
    * ARCHIVE_INDEX =
    * ARCHIVE_PARAMS =
    * DEVICE = 'PRINTER'
    DIALOG = 'X'
    FORM = 'ZFORM1'
    LANGUAGE = SY-LANGU
    * OPTIONS =
    * MAIL_SENDER =
    * MAIL_RECIPIENT =
    * MAIL_APPL_OBJECT =
    * RAW_DATA_INTERFACE = '*'
    * IMPORTING
    * LANGUAGE =
    * NEW_ARCHIVE_PARAMS =
    * RESULT =
    * EXCEPTIONS
    * CANCELED = 1
    * DEVICE = 2
    * FORM = 3
    * OPTIONS = 4
    * UNCLOSED = 5
    * MAIL_OPTIONS = 6
    * ARCHIVE_ERROR = 7
    * INVALID_FAX_NUMBER = 8
    * MORE_PARAMS_NEEDED_IN_BATCH = 9
    * SPOOL_ERROR = 10
    * CODEPAGE = 11
    * OTHERS = 12
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    select track id artist from zgtable into table itable.
    if sy-subrc ne 0.
    *message
    endif.
    loop at itable .
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
    ELEMENT = 'MAIN'
    * FUNCTION = 'SET'
    * TYPE = 'BODY'
    WINDOW = 'MAIN'
    * IMPORTING
    * PENDING_LINES =
    * EXCEPTIONS
    * ELEMENT = 1
    * FUNCTION = 2
    * TYPE = 3
    * UNOPENED = 4
    * UNSTARTED = 5
    * WINDOW = 6
    * BAD_PAGEFORMAT_FOR_PRINT = 7
    * SPOOL_ERROR = 8
    * CODEPAGE = 9
    * OTHERS = 10
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    clear itable.
    endloop.
    CALL FUNCTION 'CLOSE_FORM'
    * IMPORTING
    * RESULT =
    * RDI_RESULT =
    * TABLES
    * OTFDATA =
    * EXCEPTIONS
    * UNOPENED = 1
    * BAD_PAGEFORMAT_FOR_PRINT = 2
    * SEND_ERROR = 3
    * SPOOL_ERROR = 4
    * CODEPAGE = 5
    * OTHERS = 6
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    This code is bringing trackid,but not artist and one error is coming 'write_form' is invalid,start_form is missing'.So how to go about this.Help me.

    Hey I goy the solution.I tried that uncomment to printer,but the result was same.Then I came to know that there might be to ways to that error
    1.the given form is not existing
    2.the window size is small and there is data still that need to be printed,since there is no other page,the error will come.
    I debugged to find out only after the last record the error is coming,then I increased the main window size,surprisingly it worked.So the problem was with window size,The other problem was very silly problem,the spelling was incorrect in internal table declration.Now all the records are fetched for trackid and artist.Thanks your support.Now Iam thinking of how to use perform statement in my program..whats the difference in giving perform statement in sapscript program and giving it in se38 prgrogram.Can anyone tell how to use perform in my above program?
    Thanks in advance.

  • Error with Autoloader program - someone please help - so frustrated

    HI there.... I am a wedding photography and use Mike d's autoloader program to zip through my wedding edits...it was working great until yesterday... I use it through bridge and when I try to ope the files, the autoloader comes up fine ..I pick my action....hit save and then I get a ps error 21 object is null line 1026 and then it I close that and hit the preassigned key to open up the files I get another error ps 8000 cannot open files beciase open options are incorrect.....I have tried reinstalling, updating, asking adobe forhelp ( they won't help becuase it is a third party program even though it is giving me ps errors), I have contacted Mike D the creator of the program and he is not sure what is going on either....any ideas at all ?  I am at a loss and rely on this program to make the workflow much quicker!  Any help would be appreciated
    Jill

    Have you received a resolution for this yet?   I'm having exactly the same problem -- I purchased this software yesterday, got it set up, and ran through my first folder of images with no problem.   When I tried to run the tool through my second batch of images, I got the error 21.   I contacted Mike D, but he hasn't responded.   Meanwhile I tried several combinations of uninstalling and reinstalling, rebooting, and switching to a different image file to try and resolve, all with no luck whatsoever.  If you have a solution that you could share with me, I would really appreciate it!
    Thanks!

  • Error with Run Program Service in invoke runbook.

    I made main runbook (it do some things) and on the end i pute invoke runbook. In this child runbook i have
    Run Program activities with Java srcipt. 
    When started this rb finaly i get error Could
    not start Orchestrator Run Program Service service on 10.56.7.17 - Access is denied. (code 5), 
    but when manually i run this child runbook with any chaneges and this same date it works well. 
    In this Run Program i set that it ryn from admin acount but that don't nothing changes. 
    Where is problem?

    When you run it manually (with Runbook tester I assume) the Runbook will use
    your admin credentials to perform all of the actions. When it runs scheduled or with an invoke from somewhere else it will use the credentials of the user account you've assigned to the Runbook service.
    As a test, check which user is assigned to the service (via services.msc) and make that one a temporary local admin on the target machine. If it works, then you know it's permissions related to that specific account.
    I give up ;), Yes, I testing by Runbook tester. But not shure that we understand :)
    I  have two scenarios (i can't put images, i need to verify my account).
    1) One runbook. Exp. name" child. Inside is Run Program, that program is on different server.
    Its work only when in options this activity i set local admin account from that server.
    2). I created new runbook - parent. In this I put invoke runbook linked to that child. I do not change anything else. Now i will try run it (from tester, web console or scheduled) i get error
    Could not start Orchestrator Run Program Service service on 10.56.7.17 - Access is denied. (code 5). 
    What I do wrong, what I think wrong?

  • Help, i am just wondering why am i having an error with this program....

    package hall;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.util.*;
    /** Simple servlet that reads three parameters from the form data.
    * Part of tutorial on servlets and JSP that appears at
    * http://www.apl.jhu.edu/~hall/java/Servlet-Tutorial/
    * 1999 Marty Hall; may be freely used or adapted.
    public class ThreeParams extends HttpServlet {
    public void doGet(HttpServletRequest request,
    HttpServletResponse response)
    throws ServletException, IOException {
    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    String title = "Reading Three Request Parameters";
    out.println(ServletUtilities.headWithTitle(title) +
    "<BODY>\n" +
    "<H1 ALIGN=CENTER>" + title + "</H1>\n" +
    "<UL>\n" +
    " <LI>param1: "
    + request.getParameter("param1") + "\n" +
    " <LI>param2: "
    + request.getParameter("param2") + "\n" +
    " <LI>param3: "
    + request.getParameter("param3") + "\n" +
    "</UL>\n" +
    "</BODY></HTML>");
    public void doPost(HttpServletRequest request,
    HttpServletResponse response)
    throws ServletException, IOException {
    doGet(request, response);
    the error is something like,
    ThreeParams.java:20:cannot find symbol
    symbol: variable ServletUtilities
    location:class hall.ThreeParams
    out.println(ServletUtilities.headWithTitile(title) +
    ^
    something like that, i do know that the package hall could be the problem, but where can i find that package and where do i put it. thank you. and about this program(that i saw in http://www.apl.jhu.edu/~hall/java/Servlet-Tutorial/), well, i really need it as a reference, that is why i need to work on this one. once again, thank you...

    hi :-)
    put your ThreeParams in the folder hall :-)
    to resolve the issue in package,
    but for ServletUtilities, im not sure where they got that,
    i dont see in any part of the code that import or create an instance
    for ServletUtilities :-( better to check the code for typo error
    or contact the author regarding ServletUtilities.
    regards,

  • Error with "Mapping Program not Found"

    We exported all of our XI development from DEV and imported it to Prod. We have not changed anything at all. Now, even though I have authority I can't go into EDIT mode in Prod.
    The main problem is that even though everything imported into Prod without error, when we run our program we are getting the following error:
    <b>="MAPPING">NO_MAPPINGPROGRAM_FOUND </b>
    What could have changed and were do I start to look?
    Thanks in advance, will reward points.
    Mike Curtis

    Micheal,
    You dont need to externally import XSD's and WSDL's. If you import the whole software component or the whole namespace then they will come automatically.
    Check in message mappings whether you can see the mappings or not? I think you might have exported object by object not the whole SWCV. If it is yes then you also import the message mapping. Also check in your change list whether there are any objects. If yes please activate them.
    By the way you dont see only the one message mapping you are tyring to check or all of them? Dont edit anything in production. Its not good. So dont enable the edit button as other threads reply.
    ---Satish

  • Compilation error with cookies program

    Hi,
    I have got following code:
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class ShowCookies extends HttpServlet{
    public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException{
    res.setContentType("text/html");
    PrintWriter out= res.getWriter();
    out.println("<!DOCTYPE HTML PUBLIC \"~//W3C//DTD HTML 4.0 " +
    "Transitional//EN\">\n" +
    "<HTML>\n" +
    "<HEAD><TITLE>My Cookie </TITLE></HEAD>\n" +
    "<BODY>\n" +
    "<H1> My Cookie </H1>\n" +
    "<P>" +
    Cookie[ ] cookies = req.getCookies();
    When I compile it I get following error:
    '.class' expected
    Cookie[ ] ^cookies = req.getCookies();
    ')' expected
    Cookie[ ] cookies = req.getCookies();
    unexpected type
    Cookie [ ] cookies = req.getCookies();
    ^
    Can somebody help me with that?
    Zulfi.

    Now I have extended my code:
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class ShowCookies extends HttpServlet{
    public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException{
    res.setContentType("text/html");
    PrintWriter out= res.getWriter();
    out.println("<!DOCTYPE HTML PUBLIC \"~//W3C//DTD HTML 4.0 " +
    "Transitional//EN\">\n" +
    "<HTML>\n" +
    "<HEAD><TITLE>My Cookie </TITLE></HEAD>\n" +
    "<BODY>\n" +
    "<H1> My Cookie </H1>\n" +
    "<P>" +
    Cookie[ ] cookies = req.getCookies();
    if(cookies == null){
    out.println("No cookies");
    else {
    Cookie MyCookie;
    for (int i=0; i<cookies.length();i++){
    MyCookie = cookies;
    out.println(Mycookie.getName() + "=" + MyCookie.getValue());
    In the for loop:
    for (int i=0; i<cookies.length();i++)
    ^
    error at method length
    Zulfi.

  • Error in small program

    The following program shows error when I give input to Num1 and Num2 ,then press Add or Exit.It says "Invalid Format (Screen Error)" Any Help Please
    REPORT  ZTODAY                                  .
    data : num1 type i,
           num2 type i,
           NUM3 TYPE I,
           OK_CODE TYPE SY-UCOMM.
    call screen 100.
    *&      Module  USER_COMMAND_0100  INPUT
          text
    MODULE USER_COMMAND_0100 INPUT.
    case OK_CODE.
    WHEN 'ADD'.
    NUM3 = NUM1 + NUM2.
    when 'EXIT'.
    LEAVE PROGRAM.
    ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Module  CNUM1  INPUT
          text
    MODULE CNUM1 INPUT.
    ENDMODULE.                 " CNUM1  INPUT

    Hi,
      ON Screen the data type of screen fields are diffrent than the data type declared in Report.
    Check it once.
    Don't forget to reward if useful....

  • Download error with CC programs/apps updates. Solutions?

    I am getting a download error when I try to update my CC programs/apps. Solutions?

    WHAT error?
    A chat session where an agent may remotely look inside your computer may help
    Creative Cloud chat support (all Creative Cloud customer service issues)
    http://helpx.adobe.com/x-productkb/global/service-ccm.html

  • Re: Dynadock error with specific program

    Hi, I have a dynadock for connect my notebook (external monitor, network, ...). All it's ok but when I run a specific program, for exemple evernote, i don't see the program correctly in the external monitor. The window program is transparent but if I see the notebook I can see the program correctly.
    The dislpayLink version is 5.4.26772 and i'm using windows 7 64bit. My dynadock is PA3541E-2prp.
    How I can fix it?
    Thanks.
    Message was edited by: litris
    add Dynadock model

    Does it work when you connect external display directly to your notebook?
    I mean it is not easy to discuss about some third part application. Who knows how it is programmed?
    Have you tried to speak with their support? I mean they should test functionality of their own product under different conditions.

  • Assistance needed with small program for non-profit

    Energy Cycle is a small non-profit based in Virginia. We are using labview for a project that monitors 20 dc generators. Looking for someone who might be able to donate a modest amount of time and help us out.

    I have 20 years of LabVIEW Experience and I have developed a LabVIEW based HTML5 WebSockets Server that works with simple JavaScript HTML5 WebSockets Clients on Mobile Devices like iPhone/iPod/iPad and Android Phone/Tablet devices.  I would be willing to help you out.
    I keep a LabVIEW Demo WebSockets Server I have developed running on my desktop online and here is a link to a JavaScript iPhone Simulator I wrote that runs a WebSocket Client Demo I wrote that can be checked out: http://invbapp.com/iPhoneSimulator
    Note: Run this in the Chrome Browser because it fully supports HTML5 WebSockets! Also, this demo is a single client version and if a new client connects while you are on, it will knock you off, I am working on a multi-client version.
    I bring this up because this sort of technology could be integrated into products or systems to allow control and monitoring from devices like their iPhone.
    Best Regards,
    George Miles
    INVENTEERING, Inc.
    317 South 4th Street, Unit 329
    La Crosse, WI 54601
    Tel: 608-498-4982 or 858-926-5927
    Skype:skype.gmiles (Free Internet Video Phone requires Skype™ Software)
    Email: [email protected]
    Website: http://www.inventeering.com

Maybe you are looking for