Import statement problem

I am getting this error message:
Generated servlet error:
C:\Program Files\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\_\org\apache\jsp\OBJAVA\WEB\a100_jsp.java:8: package MakePosting does not exist
import MakePosting.*;
Where do I need to place my classes?
How does the folder structure should look like in tomcat?
Thanks.

Your web-application should have a WEB-INF directory and a classes directory inside that. All classes should be placed in the classes directory.
Here is the link -http://jakarta.apache.org/tomcat/tomcat-5.5-doc/appdev/deployment.html - on the organization of your directories in a j2ee web application.
cheers,
ram.

Similar Messages

  • JSP import statement problem

    Hey, I got confused with all import statement with jsp.
    Here is my problem.
    Folder structure:
    C:\Program Files\netbeans-4.1\enterprise1\jakarta-tomcat-5.5.7\webapps\ROOT\WEB\S\A
    This folder contains a.jsp.
    JSP code:
    <%@ page
         language="java"
         import="java.sql.*, MyPackage.DataBase"
         errorPage=". . ."
         contentType="text/html; charset=windows-1251"
    %>
    <%
           Connection connection = null;
         Statement statement = null;
           DataBase dataBase = new DataBase( connection, statement );
    %>
    ...Error message that I get:
    org.apache.jasper.JasperException: Unable to compile class for JSP
    Generated servlet error:
    C:\Program Files\netbeans-4.1\enterprise1\jakarta-tomcat-5.5.7\work\Catalina\localhost\_\org\apache\jsp\WEB\S\A\a_jsp.java:7: package MyPackage does not exist
    import MyPackage.DataBase;
                       ^
    An error occurred at line: 104 in the jsp file: /WEB/S/A/a.jsp
    Generated servlet error:
    C:\Program Files\netbeans-4.1\enterprise1\jakarta-tomcat-5.5.7\work\Catalina\localhost\_\org\apache\jsp\WEB\S\A\a100_jsp.java:147: cannot resolve symbol
    symbol  : class DataBase
    location: class org.apache.jsp.WEB.S.A.a_jsp
           DataBase dataBase = new DataBase( connection, statement );
            ^
    ...How do I import that class so I can use it?
    Do I need to use useBean?
    What do I need to do?
    Thanks

    DataBase class does not extend java.sql.
    I put this into my jsp page
         import="java.sql.*;"
         import="MyPackage.DataBase;" Here is the error message
    Generated servlet error:
    C:\Program Files\netbeans-4.1\enterprise1\jakarta-tomcat-5.5.7\work\Catalina\localhost\_\org\apache\jsp\WEB\S\A\a_jsp.java:7: 'class' or 'interface' expected
    import MyPackage.DataBase;;
    ^
    1 error
    ...

  • Java import statement problems

    Hello...
    I have the book "Java in a Nutshell, 2nd ed" and have a query about a nested top-level interface example they have in the book.
    Basically there's two files/classes. The first, LinkedList.java, is as follows:
    public class LinkedList {
        public static interface Linkable {
            // Linkable interface details here
        // rest of LinkedList class here
    Next is LinkedList.java as follows:
    import LinkedList.*;
    class LinkableInteger2 implements Linkable {
        // rest of LinkableInteger2 class here
    Now I thought the import statement had two forms - and both used a package name as part of the statement:
    import package.class;
    import package.*;
    Obviously, neither class has a package statement.
    As written, these classes do not compile. Am I right in assuming the lack of a package name is causing this problem, or is there something else going on here?
    Thanks...
    Mark.

    Since you don't have package statements in the files, the classes are being placed in the default package. You cannot explicitly import classes from the default package. Al classes in the default package, the java.lang package and the current package are always imported automatically. Your import statement is incorrect - remove it.

  • Weird import statement problem

    Hi
    I have a strange problem with an application I just developed. Once compiled, if I try to run it on another machine other than the one I developed on, I get a NoClassDefFoundError relating to a class that I did not use. I look at the class file (in a decompiled state) and there is an import statement in there that is not in the source file!! Can anyone tell me why this might have happened?
    the import is a symantec class/package I have never used to my knowledge at all and yet it shows up in the binary class file after compilation.
    Thanks for any suggestions.

    I did use Visual Cafe during parts of the development but I have never imported anything like what is in the class file. I assumed it was VC that was doing it but wasn't sure.
    Thanks.

  • Package-Import statement problem

    Greetings JDC Community...
    This problem has been driving me insane for over an hour. It's a simple package-import problem. I have a file called DataAddingTest.java which is in my C:\Java\risk\tests\ directory and it has a package statement "package risk.tests;". Then I try to import all of the files I have in the risk directory by using "import risk.*;" and it whines in error that "package risk does not exist". I'm about ready to throw my computer... can someone help me? Thanks for your time.
    -Billy Mahabir

    Hello again everyone...
    It seems all of you have mistaken my problem to some degree. The beginning part of my DataAddingTest.java file reads like this:
    // This class tests adding data to the data structures in my Risk(c) game.
    package risk.tests;
    import risk.*;
    DataAddingTest.java is in my C:\Java\risk\tests\ directory. I am trying to import a whole bunch of files from my main risk directory, i.e., C:\Java\risk\. And it is just not working. I have no idea why. I'm pretty sure I have the correct syntax for what I'm doing; it should work. The exact error message I get at compile-time is this:
    DataAddingTest.java:5: package risk does not exist
    import risk.*;
    ^
    There is indeed a C:\Java\risk\ directory (of course), and it contains many java files, all of which have "package risk;" declared at the top. And yes, I have also compiled those before I try to compile this file. Someone please help! Thanks for everyone's time.
    -Billy Mahabir

  • Package-import statement problem: Part II

    Hello again everyone...
    It seems all of you have mistaken my original problem to some degree. The beginning part of my DataAddingTest.java file reads like this:
    // This class tests adding data to the data structures in my Risk(c) game.
    package risk.tests;
    import risk.*;
    DataAddingTest.java is in my C:\Java\risk\tests\ directory. I am trying to import a whole bunch of files from my main risk directory, i.e., C:\Java\risk\. And it is just not working. I have no idea why. I'm pretty sure I have the correct syntax for what I'm doing; it should work. The exact error message I get at compile-time is this:
    DataAddingTest.java:5: package risk does not exist
    import risk.*;
    ^
    There is indeed a C:\Java\risk\ directory (of course), and it contains many java files, all of which have "package risk;" declared at the top. And yes, I have also compiled those before I try to compile this file. Someone please help! Thanks for everyone's time.
    -Billy Mahabir
    PS. Reply to http://forum.java.sun.com/thread.jsp?forum=31&thread=392985
    to earn some Duke Dollars for your trouble; if you can help me.

    Thank you for your help; you are the first one to
    successfully help me. I'll give you some DD's if you
    reply to my original post:
    http://forum.java.sun.com/thread.jsp?forum=31&thread=39
    985
    Thanks again!
    -Billy MahabirHuh??
    Maybe you should go back to your original post and check the last two replies.
    Both tell you to do exactly that: Set your classpath!

  • A problem from "import" statement

    When I was doing some test on "package" and "import" statement, I had a problem.
    1 I compiled one class:
    package com.sheng.population;
    public class A {
         public static int sum (int k, int l) {
              return (k+l);
    2 I tried to call the method 'sum' in A:
    import com.sheng.population.*;
    public class B {
         public static void main(String[] args){
              int i=9;
              int j=100;
              int k = A.sum(i, j);
              System.out.println(k);
    Then I got the error message:
    "B.java:7: cannot access A
    bad class file: E:\newjava\analysis\LDmeasure\A.java
    file does not contain class A"
    Only after I changed the import statement to "import com.sheng.population.A;" , then it worked.
    I just do not know why the '.*' does not work?
    Thanks

    Let's say your directory structure is "e:\newjava\com\sheng\population\A.class" and "e:\newjava\analysis\LDmeasure\A.java"
    If your Classpath is .;e:\newjava and when you compile, your current directory is e:\newjava\analysis\LDmeasure then you have A.java and A.class in your Classpath. When you use "import com.sheng.population.*;" the compiler does not know you mean com.sheng.population.A. The compiler finds A.java and thinks it is the A class that the B class needs. When it tries to compile A.java it finds the class name is com.sheng.population.A which causes the error. When you use "import com.sheng.population.A;" the compiler does not try to use A.java.
    If you are keeping the source code in a different directory from the compiled classes, then you should not have the source code in the Classpath. So, if you make sure the current directory is not e:\newjava\analysis\LDmeasure then it should compile.

  • Program Problems...Import Statement needed?

    I am currently a student at DeVry University, and today I had my java class where my professor played a video on java programming for us made by a group called "CBTNuggets". The video went over Inner classes and the professor had us copy the code as the person in the video was typing it up. While attempting to compile the code I encountered several compiler errors on the second of the two files I had typed, I am going to first post the source code for both files, and then follow that with the compiler errors that were generated when I attempted to compile the code. If anyone is able to assist me with this I would greatly appreciate it, I think I may need to add an import statement ;however, I do not know how to implement one for user defined Inner Classes:
    Invoice.java was the file that contained the Inner classes
    * Invoice.java
    * Created on February 1, 2007, 1:39 PM
    * To change this template, choose Tools | Template Manager
    * and open the template in the editor.
    * @author vontux
    import java.util.*;
    public class Invoice {
        private String strCustName;
        private String strCustAddr;
        private int intInvoiceNum;
        private Date dtInvoiceDate;
        /** Creates a new instance of Invoice */
       Invoice(String sCN, String sCA, int iN, Date dt)
           strCustName = sCN;
           strCustAddr = sCA;
           intInvoiceNum = iN;
           dtInvoiceDate = dt;
      class InvoiceItem //enclosed class
          private int intLineItem;
          private int intItemID;
          private int intUnits;
          private String strItemDesc;
          InvoiceItem(int li, int id,String desc, int iu)
              intLineItem = li;
              intItemID = id;
              intUnits = iu;
              strItemDesc = desc;
          public void showInvoice()
              System.out.println("Customer Name: " + Invoice.this.strCustName);
              System.out.println("Item Description: " + strItemDesc);
    }UseInvoice.java is the class that is supposed to create objects of the Inner classes from Invoice.java and then run the code:
    * UseInvoice.java
    * Created on February 1, 2007, 1:51 PM
    * To change this template, choose Tools | Template Manager
    * and open the template in the editor.
    * @author vontux
    import java.util.*;
    public class UseInvoice {
        public static void main(String[] args)
            Date today = new Date();
            Invoice myInvoice = new Invoice("Robert Barrr", "12345 N. CBTNuggets Dr.", 321,today );
            Invoice.InvoiceItem myInvItem = myInvoice.new InvoiceItem(1, 345,"Toy Train", 2);
            myInvItem.showInvoice();
        /** Creates a new instance of UseInvoice */
        public UseInvoice() {
    }And here are the compiler errors that I recieved:
    C:\Documents and Settings\Matt\Desktop\temptemp\temp\UseInvoice.java:19: cannot
    find symbol
    symbol  : class Invoice
    location: class UseInvoice
            Invoice myInvoice = new Invoice("Robert Barrr", "12345 N. CBTNuggets Dr.
    ", 321,today );
            ^
    C:\Documents and Settings\Matt\Desktop\temptemp\temp\UseInvoice.java:19: cannot
    find symbol
    symbol  : class Invoice
    location: class UseInvoice
            Invoice myInvoice = new Invoice("Robert Barrr", "12345 N. CBTNuggets Dr.
    ", 321,today );
                                    ^
    C:\Documents and Settings\Matt\Desktop\temptemp\temp\UseInvoice.java:20: package
    Invoice does not exist
            Invoice.InvoiceItem myInvItem = myInvoice.new InvoiceItem(1, 345,"Toy Tr
    ain", 2);
                   ^
    3 errors

    There are no errors occurs when I compile this two java files .
    Here are the result I'm using jdk1.6 and dos command
    [output]
    [search path for source files: [D:\J2SDK1.6.0\lib, .\out]]
    [search path for class files: [D:\J2SDK1.6.0\jre\lib\resources.jar, D:\J2SDK1.6.0\jre\lib\rt.jar, D:\J2SDK1.6.0\jre\lib\sunrsasign.jar, D:\J2SDK1.6.0\jre\lib\jsse.jar, D:\J2SDK1.6.0\jre\lib\jce.jar, D:\J2SDK1.6.0\jre\lib\charsets.jar, D:\J2SDK1.6.0\jre\classes, D:\J2SDK1.6.0\jre\lib\ext\dnsns.jar, D:\J2SDK1.6.0\jre\lib\ext\localedata.jar, D:\J2SDK1.6.0\jre\lib\ext\sunjce_provider.jar, D:\J2SDK1.6.0\jre\lib\ext\sunmscapi.jar, D:\J2SDK1.6.0\jre\lib\ext\sunpkcs11.jar, D:\J2SDK1.6.0\lib, .\out]]
    [parsing started .\Invoice.java]
    [parsing completed 31ms]
    [parsing started .\UseInvoice.java]
    [parsing completed 15ms]
    [loading D:\J2SDK1.6.0\lib\ct.sym(META-INF/sym/rt.jar/java/lang/Object.class)]
    [loading D:\J2SDK1.6.0\lib\ct.sym(META-INF/sym/rt.jar/java/lang/String.class)]
    [loading D:\J2SDK1.6.0\lib\ct.sym(META-INF/sym/rt.jar/java/util/Date.class)]
    [checking Invoice]
    [loading D:\J2SDK1.6.0\lib\ct.sym(META-INF/sym/rt.jar/java/lang/System.class)]
    [loading D:\J2SDK1.6.0\lib\ct.sym(META-INF/sym/rt.jar/java/io/PrintStream.class)]
    [loading D:\J2SDK1.6.0\lib\ct.sym(META-INF/sym/rt.jar/java/io/FilterOutputStream.class)]
    [loading D:\J2SDK1.6.0\lib\ct.sym(META-INF/sym/rt.jar/java/io/OutputStream.class)]
    [loading D:\J2SDK1.6.0\lib\ct.sym(META-INF/sym/rt.jar/java/io/Serializable.class)]
    [loading D:\J2SDK1.6.0\lib\ct.sym(META-INF/sym/rt.jar/java/lang/StringBuilder.class)]
    [loading D:\J2SDK1.6.0\lib\ct.sym(META-INF/sym/rt.jar/java/lang/AbstractStringBuilder.class)]
    [loading D:\J2SDK1.6.0\lib\ct.sym(META-INF/sym/rt.jar/java/lang/CharSequence.class)]
    [loading D:\J2SDK1.6.0\lib\ct.sym(META-INF/sym/rt.jar/java/lang/Comparable.class)]
    [loading D:\J2SDK1.6.0\lib\ct.sym(META-INF/sym/rt.jar/java/lang/StringBuffer.class)]
    [wrote .\out\Invoice$InvoiceItem.class]
    [wrote .\out\Invoice.class]
    [checking UseInvoice]
    [loading D:\J2SDK1.6.0\lib\ct.sym(META-INF/sym/rt.jar/java/lang/Class.class)]
    [wrote .\out\UseInvoice.class]
    [total 734ms]
    [output]
    check your syntax to compile these two files, may be you can show your syntax to compile these two files
    javac [options] [classpath] source

  • Problems with IMPORT STATEMENT

    Please, can someone assist me? I am using Java Studio Enterprise 8.1 & Netbeans to design a java application and input form. But the wizard keeps on generating repeated class and subclasses even after I have used the import statement. Its making my program looks clumsy.
    I just want to use import statement once and start using the variable in the program without repeating the declaration.
    For instance, after importing javax.swing.*, I just want to be able to specify in my program (e.g JPanel Coylogo) without the wizard generating another private javax.swing.JPanel Coylogo.
    How can I do it. Please help. I will appreciate
    You look at the following section of the program to unstand what I mean. Thank you.
    import java.awt.HeadlessException;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.sql.*;
    import java.text.ParseException;
    import java.text.SimpleDateFormat;
    import javax.swing.*;
    import java.sql.Date;
    * @author */
    public class inputForm extends JFrame
    private Connection con;
    private Statement stmt;
    private int k;
    ResultSet rs=null;
    // Variables declaration - do not modify
    private javax.swing.JLabel ClassLabel;
    private javax.swing.JPanel Connectivitypanel;
    private javax.swing.JPanel Coylogo;
    private javax.swing.JCheckBox DataCapable;
    private javax.swing.JLabel DateLabel;
    // End of variables declaration
    * Creates new form inputForm
    public inputForm()
    //con = new dbConnect();
    initComponents();
    con = dbconnection();
    /** This method is called from within the constructor to
    * initialize the form.
    * WARNING: Do NOT modify this code. The content of this method is
    * always regenerated by the Form Editor.
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">
    private void initComponents()
    Coylogo = new javax.swing.JPanel();
    PhoneType = new javax.swing.JPanel();
    PhoneIdLabel = new javax.swing.JLabel();
    ClassLabel = new javax.swing.JLabel();
    phoneid = new javax.swing.JTextField();
    DateLabel = new javax.swing.JLabel();
    Connectivitypanel.setBorder(javax.swing.BorderFactory.createTitledBorder("CONNECTIVITY"));
    pbluetooth.setText("Bluetooth");
    pbluetooth.setActionCommand("bluetooth");
    pbluetooth.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
    pbluetooth.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
    pbluetooth.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT);
    pbluetooth.setMargin(new java.awt.Insets(0, 0, 0, 0));
    }// </editor-fold>
    private void allPhonesTypeActionPerformed(java.awt.event.ActionEvent evt)
    }

    disable add imports or organize imports in your IDE

  • Java import statement memory problem

    Hi,
    will java.io.* loads all the classes in io package to the memory? will it afftect the program performance?

    RajBabu wrote:
    I hope that import statement might present in a java class fileNo, import statements are in no way represented in the java class files. All references to external classes are made via their fully quallified class names in a class file (com.foo.Bar and not just Bar*).
    Imports only serve as a shortcut so that you don't have to write the full class name everywhere in your Source code. You could just as well write a program without using any import statements, just by using the fully qualified class names of each class you use and it would produce the same class files (although the source code would be rather unreadable).
    * actually the format is different, but the idea is the same

  • IMPORT Statement Issue (Internal Table)

    Hi All,
    I am using an IMPORT statement to get all the data from other report's internal table. Now whenever this (the other report's internal table) is changed (for field addition, etc), my report throws a dump. Hence, everytime I have to add these fields in my program as well.
    Is there any way by which I can include the whole internal table of that report in my program just like
    'INCLUDE STRUCTURE VBRK'.
    Thanks in advance

    Hi, CHeck this code related to your problem..This will helpful to you...
    I have done this program earlier..I hope it will helpful to u..
    This programa calling the other program to import the data..
    Check it out...
    *" Tables declarations.................................................
    TABLES:
      spfli.
    *" Type declarations...................................................
    Type declaration of the structure to hold data from table SPFLI     *
    TYPES:
      BEGIN OF type_s_spfli,
        carrid LIKE spfli-carrid,          " Carrier Id
        connid LIKE spfli-connid,          " Connection Number
        cityfrom LIKE spfli-cityfrom,      " City from
        cityto LIKE spfli-cityto,          " City to
        airpfrom LIKE spfli-airpfrom,      " Airport from
        airpto LIKE spfli-airpto,          " Airport to
        countryfr LIKE spfli-countryfr,    " Country from
        countryto LIKE spfli-countryto,    " Country to
      END OF type_s_spfli.
    Data Declaration...................................................*
         Field String To Hold Flight Details Record from SPFLI          *
    DATA
      fs_spfli TYPE type_s_spfli.
    Data Declaration...................................................*
         Internal Table To Hold Flight Details Records from SPFLI       *
    DATA
      t_spfli LIKE STANDARD TABLE OF fs_spfli.
    TYPES:
      BEGIN OF types_s_itab,
        carrid LIKE sflight-carrid,        " Carrier id
        connid LIKE sflight-connid,        " Connection number
        fldate LIKE sflight-fldate,        " Flight date
      END OF types_s_itab.
    Data Declaration...................................................*
         Field String To Hold Flight Details Record from SFLIGHT        *
    DATA
      fs_itab TYPE types_s_itab.
    Data Declaration...................................................*
         Internal Table To Hold Flight Details Records from SFLIGHT     *
    DATA
      t_itab LIKE STANDARD TABLE OF fs_itab.
    *" Type declarations...................................................
    Type declaration of the structure to hold data from table SBOOK     *
    TYPES:
    BEGIN OF type_s_sbook,
       carrid LIKE sbook-carrid,           " Carrier Id
       connid LIKE sbook-connid,           " Connection Number
       fldate LIKE sbook-fldate,           " Flight date
       bookid LIKE sbook-bookid,           " Booking number
       loccuram LIKE sbook-loccuram,       " Local currency
       loccurkey LIKE sbook-loccurkey,
       order_date LIKE sbook-order_date,   " Booking date
    END OF type_s_sbook.
    Data Declaration...................................................*
         Field String To Hold Flight Details Record from BOOK           *
    DATA
      fs_sbook TYPE type_s_sbook.
    Data Declaration...................................................*
         Internal Table To Hold Flight Details Records from SBOOK       *
    DATA
      t_sbook LIKE STANDARD TABLE OF fs_sbook.
    DATA
      w_checkbox.                          " Checkbox
    SELECT-OPTIONS:
      s_carr FOR spfli-carrid.             " Carrier id range
                          START-OF-SELECTION EVENT                      *
    START-OF-SELECTION.
      PERFORM selectq.
                          END-OF-SELECTION EVENT                        *
    END-OF-SELECTION.
      SET PF-STATUS 'YH1314_030502'.
      PERFORM display_basic.
    AT USER-COMMAND.
      PERFORM ucomm.
    *&    Form  selectq
        This subroutine retreive data from SPFLI table
      There are no interface parameters to be passed to this subroutine.
    FORM selectq .
      SELECT carrid                        " Carrier id
             connid                        " Connection number
             cityfrom                      " City from
             cityto                        " City to
             airpfrom                      " Airport from
             airpto                        " Airport to
             countryfr                     " Country from
             countryto                     " Country to
             INTO CORRESPONDING FIELDS OF TABLE t_spfli
             FROM spfli
             WHERE carrid IN s_carr.
    ENDFORM.                               " Selectq
    *&      Form  display_basic
        This subroutine displays data from internal table
      There are no interface parameters to be passed to this subroutine.
    FORM display_basic .
      LOOP AT t_spfli INTO fs_spfli.
        WRITE:
          / w_checkbox AS CHECKBOX,
            fs_spfli-carrid,
            fs_spfli-connid,
            fs_spfli-cityfrom,
            fs_spfli-cityto,
            fs_spfli-airpfrom,
            fs_spfli-airpto,
            fs_spfli-countryfr,
            fs_spfli-countryto.
      ENDLOOP.                             " LOOP AT T-SPFLI INTO...
    ENDFORM.                               " Display_basic
    *&      Form  UCOMM
      This subroutine for at user-command event
      There are no interface parameters to be passed to this subroutine.
    FORM ucomm .
      RANGES :
        r_carr FOR spfli-carrid,
        r_conn FOR spfli-connid,
        r_carrid FOR sflight-carrid,
        r_connid FOR sflight-connid,
        r_fldate FOR sflight-fldate.
      CASE sy-ucomm.
        WHEN 'DISPLAY'.
          DATA:
            lw_lines TYPE i,
            lw_lineno TYPE i VALUE 3.
          DESCRIBE TABLE t_spfli LINES lw_lines.
          DO lw_lines TIMES.
            READ LINE lw_lineno FIELD
                 VALUE w_checkbox   INTO w_checkbox
                       fs_spfli-carrid INTO  fs_spfli-carrid
                       fs_spfli-connid INTO  fs_spfli-connid.
            IF sy-subrc = 0.
              IF w_checkbox = 'X'.
                r_carr-sign = 'I'.
                r_carr-option = 'EQ'.
                r_carr-low = fs_spfli-carrid.
                APPEND r_carr.
                r_conn-sign = 'I'.
                r_conn-option = 'EQ'.
                r_conn-low = fs_spfli-connid.
                APPEND r_conn.
              ENDIF.                       " IF W_CHECKBOX = 'X'
            ENDIF.                         " IF SY-SUBRC = 0
            ADD 1 TO lw_lineno.
          ENDDO.                           " DO LW_LINES TIMES
          SUBMIT yh1314_030502_call
            WITH s_carr IN r_carr
            WITH s_conn IN r_conn
             AND RETURN.
          IMPORT t_itab FROM MEMORY ID 'YH1314'.
          LOOP AT t_itab INTO fs_itab.
            r_carrid-sign = 'I'.
            r_carrid-option = 'EQ'.
            r_carrid-low = fs_itab-carrid.
            APPEND r_carrid.
            r_connid-sign = 'I'.
            r_connid-option = 'EQ'.
            r_connid-low = fs_itab-connid.
            APPEND r_connid.
            r_fldate-sign = 'I'.
            r_fldate-option = 'EQ'.
            r_fldate-low = fs_itab-fldate.
            APPEND r_fldate.
          ENDLOOP.                         " LOOP AT T_ITAB INTO.....
          SELECT carrid                    " Carriee Id
                 connid                    " Connection number
                 fldate                    " Flight date
                 bookid                    " Booking number
                 loccuram                  " Local Currency
                 order_date                " Booking date
             INTO CORRESPONDING FIELDS OF TABLE t_sbook
             FROM sbook
             WHERE carrid IN r_carrid AND
                   connid IN r_connid AND
                   fldate IN r_fldate.
          IF SY-SUBRC NE 0.
            MESSAGE 'NO RECORDS FOUND'(006) TYPE 'S'.
          ENDIF.                           " IF SY-SUBRC NE 0
          LOOP AT t_sbook INTO fs_sbook.
            AT FIRST.
              WRITE: /5 'Carrier Id'(001),
                     20 'Conn Id'(002),
                     35 'Flight date'(003),
                     50 'Book Id'(004),
                     65 'Local Currency'(005).
            ENDAT.                         " AT FIRST
            WRITE: /5 fs_sbook-carrid,
                   20 fs_sbook-connid,
                   35 fs_sbook-fldate,
                   50 fs_sbook-bookid,
                   65 fs_sbook-loccuram CURRENCY fs_sbook-loccurkey.
          ENDLOOP.                         " LOOP AT T_SBOOK INTO.....
      ENDCASE.                             " CASE SY-UCOMM
    ENDFORM.                               " UCOMM
    Regards
    Kiran

  • Import Statement - Which is Better ???

    Which import statement is better? Are there any performance advantages of calling the ones you need explicitly instead of using the shorthand (.*)?
    import java.util.*
    or
    import java.util.Vector;
    import java.util.TreeMap;

    there is no runtime performance difference. There could be a difference in compliation time if you use wildcards, but even that difference would probably be insignificant (plus, is compile time usually a concern in java?). The main advantage to importing only the classes you need, as the previous poster pointed out, is to reduce compilation ambiguities (e.g. does 'Date' refer to java.sql.Date or java.util.Date). For example, a recent poster just reported a problem where he imported java.beans.* and java.sql.* and, after upgrading to 1.4, none of his code compiles because both packages now have a Statement class, which causes ambiguities. As a general rule, it is best to import only the classes you need.

  • Javac(1.4.2) gives error in import statement

    Hi All,
    I am facing a surprising problem. I have 2 java class files. I write the import statement for second one in the first one. There is no package & these are in the same directory. I have compiled the second one. But when I try to compile the First one. Javac throws error at import statement like below :
    D:\Clubs\oct\6>javac -d . ManojTest.java
    ManojTest.java:1: '.' expected
    import SessionBean;
    ^
    1 error
    My Java Files are as below :
    import SessionBean;
    public class ManojTest
         public static void main(String args[])
    //ManojTest.java
    public class SessionBean
         public static void main(String args[])
    //SessionBean.java
    I have compiled SessionBean.java successfully but when I try to compile ManojTest.java I get error mentioned above.
    However this probelm comes when I use j2se 1.4.2.. but works in j2se 1.3.1..
    Another way could be I use package structure.
    But I can't do any of these, as I have to port my big project to j2se1.4.2.. from j2se1.3.1.. (Live project is running on Tomcat).
    Problems is similar in Unix & Windows both.
    Is this javac compiler issue or there is some setting which I can make.
    I have already included . (dot) in PATH & CLASSPATH environment varibales.
    Please help me out if there is any way around this, as i am stuck up in between
    thank you
    Manoj :confused:

    Use a package and then add that package in your classpathOr don't use a package, leave the file in the default (noname) package, and don't use the import statement. Java will find it in the default package without the import.
    Explicit import statements from the default package are no longer allowed

  • Use of wildcard(*) in import statement

    I am a bit new in Actionscript 3.0 and I love to learn it.
    I saw the following two import statements in an actionscript 3.0 code.
    import flash.display.MovieClip;
    import flash.display.SimpleButton;
    In this case, can I use just juse * sign as in import.flash.display.*; ???
    Is this change would cause any problem?
    Sami

    There are cases when it works and cases when it doesn't, and I don't know if there is a reason.  You can try and see if it makes a difference, and if you get error regarding lack of definition you can hopefully determine that you need to explicitly name the class.
    Also, it partly depends on where you are implementing the code.  Usually when coding in the Actions panel you do not need to import most classes at all.  But when you are working with class files you normally have to import any that are not top-level, such as the two you identified.

  • Dynamic parameter with an IMPORT statement

    Hello experts. I hope you can help me with this issue:
    I have a report performing an EXPORT statement into a Buffer:
      EXPORT I_USER    FROM P_USER
                    I_NAME    FROM P_NAME
                    I_SURNAME FROM P_SURNAM
               TO DATA BUFFER V_XPARVALUES.
    Then it calls the first FM where a type I program is created by using INSERT REPORT... This dynamic-generate INCLUDE has the explicits declaration for variables: I_USER, I_NAME, I_SURNAME.
    Afeter the dynamic Include generation, it calls a second FM, wich has the reference to the dynamic Include created before with the data declaration. The only thing remain is to IMPORT all the data from the buffer V_XPARVALUES:
    The following code lines are within a LOOP. wa_param-paramname has the name of the variable (I_USER, I_NAME I_SURNAME).
        ASSIGN (wa_param-paramname) TO
          FROM DATA BUFFER v_xparvalues.
    but what I need to achieve is dynamic parameters in the IMPORT statement.
    Had anybody came across this problem?
    I hope I have been clear with the explanation.
    Regards,
    Andrés Sarcevic.

    IMPORT/EXPORT scope didn't work out. Instead, I used CALL TRANSFORMATION and XML approach, besides some ABAP creativity.

Maybe you are looking for