When to use CLASSPATH for .jar files

I find I must put newly added .jar files in my classpath in order to avoid "does not exist" errors when I compile. Where should .jar files be placed in order to avoid hardcoding this in my classpath?

Actually. With this .jar file (ksoap-midp.jar) which I downloaded, I can't resolve the imports even when I put the .jar in my classpath. What are the steps to take to add new classes to your system?

Similar Messages

  • Classpath for jar files?

    Hi all,
    i am trying to run a standalone java program using JRC through command promt.
    my problem is i am importing few classes from jar files into my java class. but its not getting imported.
    how to resolve it?

    Hi Saravana
    You can use batch file to run your standalone java program.
    The contents of the batch file would be as follows:
    @echo off
    if "%OS%" == "Windows_NT" setlocal
    rem
    rem Sets the CLASSPATH environment variable to include all JAR files
    rem required for the JRC then compiles and jars Java file(s).
    rem
    rem Edit the environment variable BOBJ_JAVA_LIB to point to the
    rem location where you have the JRC jar files.
    rem
    rem Make sure to define any other required libraries in the environment
    rem variable CLASSPATH.
    rem
    rem Make sure you have defined the environment variable JAVA_HOME
    rem
    set BOBJ_JAVA_LIB=c:\Program Files\Business Objects\Common\3.5\java\lib
    set CURRENT_DIR=%cd%
    echo Using JAVA_HOME: %JAVA_HOME%
    echo Using CURRENT_DIR: %CURRENT_DIR%
    set RUNJAVA="%JAVAHOME%/bin/java"
    set RUNJAVAC="%JAVAHOME%/bin/javac"
    set RUNJAR="%JAVAHOME%/bin/jar"
    set CLASSPATH=%BOBJ_JAVA_LIB%\ReportViewer.jar;%BOBJ_JAVA_LIB%\ReportPrinter.jar;%BOBJ_JAVA_LIB%\CrystalCommon.jar;%BOBJ_JAVA_LIB%\CrystalDatabaseConnectors.jar;%BOBJ_JAVA_LIB%\CrystalReportingCommon.jar;%BOBJ_JAVA_LIB%\CrystalFormulas.jar;%BOBJ_JAVA_LIB%\CrystalQueryEngine.jar;%BOBJ_JAVA_LIB%\CrystalReportEngine.jar;%BOBJ_JAVA_LIB%\keycodeDecoder.jar;%BOBJ_JAVA_LIB%\MetafileRenderer.jar;%BOBJ_JAVA_LIB%\rpoifs.jar;%BOBJ_JAVA_LIB%\jrcerom.jar;%BOBJ_JAVA_LIB%\jrcadapter.jar;%BOBJ_JAVA_LIB%\rascore.jar;%BOBJ_JAVA_LIB%\rasapp.jar;%BOBJ_JAVA_LIB%\Serialization.jar;%BOBJ_JAVA_LIB%\external\log4j.jar;%BOBJ_JAVA_LIB%\external\icu4j.jar;%BOBJ_JAVA_LIB%\external\Concurrent.jar;%BOBJ_JAVA_LIB%\external\xercesImpl.jar;%BOBJ_JAVA_LIB%\external\xml-apis.jar;%BOBJ_JAVA_LIB%\CrystalCharting.jar;%BOBJ_JAVA_LIB%\CrystalContentModels.jar;%BOBJ_JAVA_LIB%\CrystalExporters.jar;%BOBJ_JAVA_LIB%\CrystalExportingBase.jar;%CURRENT_DIR%;%CLASSPATH%
    %_RUNJAVAC% -classpath "%CLASSPATH%" *.java
    %_RUNJAVA% -classpath "%CLASSPATH%" HelloWorldSwing
    // HelloWorldSwing is the name of your .java file
    Make sure you have all the jar files in the lib directory.
    Hope this helps you.
    Thanks
    Soni

  • Apache Tomcat 7.0.4 can't recognize the classpath for .jar files

    Hiii Everybody,
    I have a weird problem. I am trying to develop a simple application where I am trying to pass an excel file name as an argument to a method and the method creates a copy of the specified file. I have used jxl.jar for excel file manipulation. During this I have faced two problems.......
    1) I tried to compile the file CopyExcel.java in the command prompt(windows), sometimes the file is not compiled and the error shown indicates that it can't recognize the package jxl. But if I close the command prompt window and open it again.... I could compile the CopyExcel.java succesfully with no error.
    2) Even if I have compiled the CopyExcell.java file successfully, whenever I am tryiyng to call a method copyMain() inside it, browser shows....
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: Servlet execution threw an exception
    root cause
    java.lang.NoClassDefFoundError: jxl/Workbook
         CopyExcel.copy(CopyExcel.java:39)
         CopyExcel.copyMain(CopyExcel.java:81)
         ServicePage.processRequest(ServicePage.java:28)
         ServicePage.doPost(ServicePage.java:73)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    root cause
    java.lang.ClassNotFoundException: jxl.Workbook
         org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1672)
         org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1517)
         java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
         CopyExcel.copy(CopyExcel.java:39)
         CopyExcel.copyMain(CopyExcel.java:81)
         ServicePage.processRequest(ServicePage.java:28)
         ServicePage.doPost(ServicePage.java:73)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    note The full stack trace of the root cause is available in the Apache Tomcat/7.0.4 logs.
    --------------------------------------------------------------------------------The code for CopyExcel.java is as folows.............
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    * @author Administrator
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    import java.io.File;
    import java.io.IOException;
    import jxl.Cell;
    //import jxl.CellType;
    import jxl.Sheet;
    import jxl.Workbook;
    import jxl.read.biff.BiffException;
    import jxl.write.WritableWorkbook;
    public class CopyExcel {
         private String inputFile;
         public void setInputFile(String inputFile) {
              this.inputFile = inputFile;
         public void copy() throws IOException  {
              File inputWorkbook = new File(inputFile);
              Workbook w;
                    try{
                        System.out.println("Before w= Workbook.getWorkbook(inputWorkbook);  ");
              w= Workbook.getWorkbook(inputWorkbook);
                     System.out.println("After w= Workbook.getWorkbook(inputWorkbook);  ");
              WritableWorkbook copy=Workbook.createWorkbook(new File("CopyPan.xls"), w);
                    copy.write();
                    copy.close();
                    }catch(Exception e){}
    /*          try {
                   w = Workbook.getWorkbook(inputWorkbook);
                   // Get the first sheet
                   Sheet sheet = w.getSheet(0);
                   // Loop over first 10 column and lines
                        for (int i = 1; i < 6; i++) {
                             Cell cell = sheet.getCell(0, i);
                             //CellType type = cell.getType();
                             //if (cell.getType() == CellType.LABEL) {
                                  //System.out.println("I got a label "
                                       //     + cell.getContents());
                             //if (cell.getType() == CellType.NUMBER) {
                                  //System.out.println("I got a number "
                                            //+ cell.getContents());
                                                    System.out.println(cell.getContents());
              } catch (BiffException e) {
                   e.printStackTrace();
         public static  String copyMain(String args) throws IOException {
              String str=args;
              CopyExcel test = new CopyExcel();
              test.setInputFile(args);
              test.copy();
                    return "Success";
    }I have set the "CLASSPATH" environment variables in "user variables for administrator" as follows,
    .;%SYSTEM%;C:\Program Files\Apache Software Foundation\apache-tomcat-7.0.4\bin;C:\Program Files\Apache Software Foundation\apache-tomcat-7.0.4\lib\servlet-api.jar;C:\Program Files\Java\jdk1.6.0_11\lib\jxl-2.6.jar Also I have tried editing the startup MS-dos batch file as folows....
    set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_11
    set CLASSPATH=.;%SYSTEM%;C:\Program Files\Apache Software Foundation\apache-tomcat-7.0.4\bin;C:\Program Files\Apache Software Foundation\apache-tomcat-7.0.4\lib\servlet-api.jar;C:\Program Files\Java\jdk1.6.0_11\lib\jxl-2.6.jar
    @echo off
    rem Licensed to the Apache Software Foundation (ASF) under one or more
    rem contributor license agreements.  See the NOTICE file distributed with
    rem this work for additional information regarding copyright ownership.
    rem The ASF licenses thi..........But the problem remained...........
    Plz. help me.
    Thank u in advance for any help.

    Hiii Everybody,
    I have a weird problem. I am trying to develop a simple application where I am trying to pass an excel file name as an argument to a method and the method creates a copy of the specified file. I have used jxl.jar for excel file manipulation. During this I have faced two problems.......
    1) I tried to compile the file CopyExcel.java in the command prompt(windows), sometimes the file is not compiled and the error shown indicates that it can't recognize the package jxl. But if I close the command prompt window and open it again.... I could compile the CopyExcel.java succesfully with no error.
    2) Even if I have compiled the CopyExcell.java file successfully, whenever I am tryiyng to call a method copyMain() inside it, browser shows....
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: Servlet execution threw an exception
    root cause
    java.lang.NoClassDefFoundError: jxl/Workbook
         CopyExcel.copy(CopyExcel.java:39)
         CopyExcel.copyMain(CopyExcel.java:81)
         ServicePage.processRequest(ServicePage.java:28)
         ServicePage.doPost(ServicePage.java:73)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    root cause
    java.lang.ClassNotFoundException: jxl.Workbook
         org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1672)
         org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1517)
         java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
         CopyExcel.copy(CopyExcel.java:39)
         CopyExcel.copyMain(CopyExcel.java:81)
         ServicePage.processRequest(ServicePage.java:28)
         ServicePage.doPost(ServicePage.java:73)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    note The full stack trace of the root cause is available in the Apache Tomcat/7.0.4 logs.
    --------------------------------------------------------------------------------The code for CopyExcel.java is as folows.............
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    * @author Administrator
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    import java.io.File;
    import java.io.IOException;
    import jxl.Cell;
    //import jxl.CellType;
    import jxl.Sheet;
    import jxl.Workbook;
    import jxl.read.biff.BiffException;
    import jxl.write.WritableWorkbook;
    public class CopyExcel {
         private String inputFile;
         public void setInputFile(String inputFile) {
              this.inputFile = inputFile;
         public void copy() throws IOException  {
              File inputWorkbook = new File(inputFile);
              Workbook w;
                    try{
                        System.out.println("Before w= Workbook.getWorkbook(inputWorkbook);  ");
              w= Workbook.getWorkbook(inputWorkbook);
                     System.out.println("After w= Workbook.getWorkbook(inputWorkbook);  ");
              WritableWorkbook copy=Workbook.createWorkbook(new File("CopyPan.xls"), w);
                    copy.write();
                    copy.close();
                    }catch(Exception e){}
    /*          try {
                   w = Workbook.getWorkbook(inputWorkbook);
                   // Get the first sheet
                   Sheet sheet = w.getSheet(0);
                   // Loop over first 10 column and lines
                        for (int i = 1; i < 6; i++) {
                             Cell cell = sheet.getCell(0, i);
                             //CellType type = cell.getType();
                             //if (cell.getType() == CellType.LABEL) {
                                  //System.out.println("I got a label "
                                       //     + cell.getContents());
                             //if (cell.getType() == CellType.NUMBER) {
                                  //System.out.println("I got a number "
                                            //+ cell.getContents());
                                                    System.out.println(cell.getContents());
              } catch (BiffException e) {
                   e.printStackTrace();
         public static  String copyMain(String args) throws IOException {
              String str=args;
              CopyExcel test = new CopyExcel();
              test.setInputFile(args);
              test.copy();
                    return "Success";
    }I have set the "CLASSPATH" environment variables in "user variables for administrator" as follows,
    .;%SYSTEM%;C:\Program Files\Apache Software Foundation\apache-tomcat-7.0.4\bin;C:\Program Files\Apache Software Foundation\apache-tomcat-7.0.4\lib\servlet-api.jar;C:\Program Files\Java\jdk1.6.0_11\lib\jxl-2.6.jar Also I have tried editing the startup MS-dos batch file as folows....
    set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_11
    set CLASSPATH=.;%SYSTEM%;C:\Program Files\Apache Software Foundation\apache-tomcat-7.0.4\bin;C:\Program Files\Apache Software Foundation\apache-tomcat-7.0.4\lib\servlet-api.jar;C:\Program Files\Java\jdk1.6.0_11\lib\jxl-2.6.jar
    @echo off
    rem Licensed to the Apache Software Foundation (ASF) under one or more
    rem contributor license agreements.  See the NOTICE file distributed with
    rem this work for additional information regarding copyright ownership.
    rem The ASF licenses thi..........But the problem remained...........
    Plz. help me.
    Thank u in advance for any help.

  • Ora 29534 while using loadjava for jar files

    I am trying to load activation/pop3/mail.jar in oracle 9.2.0.1 database.
    command : loadjava -user maxsb/maxsb@q71d -resolve -verbose -genmissing activation.jar
    but its giving me following error :
    resolving: class com/sun/mail/pop3/DefaultFolder
    errors : class com/sun/mail/pop3/DefaultFolder
    ORA-29534: referenced object MAXSB.com/sun/mail/pop3/POP3Store could not be
    resolved
    errors : class com/sun/mail/pop3/POP3Folder
    ORA-29534: referenced object MAXSB.com/sun/mail/pop3/DefaultFolder could not
    be resolved
    errors : class com/sun/mail/pop3/POP3Message
    ORA-29534: referenced object MAXSB.com/sun/mail/pop3/POP3Folder could not be
    resolved.....
    have already gave grant permissions to user..still giving me similar errors at the time of loading jar file nito oracle database.
    pl provide the solution..
    Kets

    Oracle is saying
    Cause: Name resolution determined that the indicated object is referenced but could not be resolved.
    Action: Correct name resolver or address resolution problems in the referenced class, or correct compilation problems in its source.
    -aijaz

  • Deployment problems when using several ejb-jar files

    Hello All,
    I am having problems with deployment of my J2EE application. My EAR file has several EJB-JARs, one for each entity bean. However I refer to the other EJBs in one EJB. Hence I included the <ejb-ref> element in the deployment descriptor of the entity bean. But I am getting the deployment error that "the bundle does not contain the bean name". I tried to change the <ejb-name> value (within the <ejb-ref> element) to the JNDI name of the EJB I am referring to, and also added the <ejb-link> tag specifying the location of the JAR file that has the EJB. None of the attempts worked.
    Can someone help me out on how I am supposed to go about when I have several ejb-jar files as opposed to a single one? I am deploying my app on Sun ONE AS 7.0.
    Thank you,
    PS: I am posting this message on several forum topics. Please disregard this message if you have seen/answered this message. Thanks.

    Hi ,
    It would help if you could post the relevant snippets of your
    ejb-jar.xml. In general, you definitely shouldn't use jndi-name
    for any of the linking information. jndi-name is not part of the
    standard deployment descriptor. The syntax for the ejb-link is
    [ejb-jar uri]#ejb-name
    K

  • How to use 3rd party jar files for xml transform

    Hi all,
    Am using OAS9.0.4 and I deployed my .ear successfully.
    In my application am using 4 jar files for xml transformation. (xerces.jar, xalan.jar, xml-apis.jar,xercesImpl.jar)
    OAS has its own xmlparserv2.jar file. Its using this jar file for transforming xml data and not even looking for above mentioned 4 jar files.
    In opmn.xml, I provided these 4 jar files in to class path. Then also it didn't effect my output.
    I also tried as put these 4 jar files into j2ee\home\applib directory, but o result.
    Can anybody tell me where should I keep these 4 jar files in OAS and OAS should use these 4 jar files instead of its own xmlparserv2.jar for transforming data.
    Thanks in Anticipation,
    Regards,
    RK

    Add the Xbootclasspath variable in the java-options field. It will somewhat look like the following in your opmn.xml file
    <process-type id="<OC4J Instance Name>" module-id="OC4J">
    <module-data>
    <category id="start-parameters">
    <data id="java-options value="........... -Xbootclasspath^/a:<location of your jar files>" />
    Ensure to use th ^/a (append) signature
    Regards,
    Chirag

  • Deployment error when using several ejb-jar files

    Hello All,
    I am having problems with deployment of my J2EE application. My EAR file has several EJB-JARs, one for each entity bean. However I refer to the other EJBs in one EJB. Hence I included the <ejb-ref> element in the deployment descriptor of the entity bean. But I am getting the deployment error that "the bundle does not contain the bean name". I tried to change the <ejb-name> value (within the <ejb-ref> element) to the JNDI name of the EJB I am referring to, and also added the <ejb-link> tag specifying the location of the JAR file that has the EJB. None of the attempts worked.
    Can someone help me out on how I am supposed to go about when I have several ejb-jar files as opposed to a single one? I am deploying my app on Sun ONE AS 7.0.
    Thank you,
    PS: I am posting this message on several forum topics. Please disregard this message if you have seen/answered this message. Thanks.

    Hello,
    Thanks for the response. I have got both Local and Remote EJB References, but for the JAR (where the ejbc compiler stopped) that I have an error, it is the local reference.

  • When we use XML,XSD,WSDL files to create SOA webservices in jdeveloper ,what will happen means internally,how will useful xml ,xsd,wsdl for composite ?

    When we use XML,XSD,WSDL files to create SOA webservices in jdeveloper ,what will happen means internally,how will useful xml ,xsd,wsdl for composite ?
    How xml will send message to XSD then how wsdl interaction then to composite ?

    XSD (XML Schema Definition), is an abstract representation of a XML characteristics.
    The WSDL (Web Services Description Language), describes the functionality offered by your web service.
    You can say what operations your services offers, and describe the messages used for this operations in your XSD.

  • It can't find URL when i use HLS for vod and the vod file name contain Chinese.

    It can't find URL when i use HLS for vod and the vod file name contain Chinese。eg: http://127.0.0.1:8134/hls-vod/你好.mp4.m3u8.
    How does it support Chinese path?

    To answer the post title FireFox save all downloads automatically in the download folder, which you can find in the Documents folder. If you want to choose where to save your downloads go to tools>options>check always ask me where to save files.
    Secondly, I am assuming you have IE 8 installed as this is the only version that supports this fix that is currently not in beta. Go to control panel>internet options>advanced tab and reset the settings at the bottom. This may or may not fix the problem but it is a good first step.

  • How to use javap with jar files ?

    how to use javap with jar files ?
    thanks

    As long as the jar is on the class path, your gold. So,
    javap -classpath myjar.jar mypackage.MyClass
    Chuck

  • When i use language for non-unicode [Russian] and i insert another language

    when i use language for non-Unicode [Russian] and i insert another language. it transform to Russian.
    i insert Thai language into MS access it transform to Russian type.i try to change anything,CharSet, sun.jnu.encoding.
    but it doesn't have any effect.How can i insert Thai data into database and in database shown Thai data not another type.
    Thank you for help.My English is not good,Sorry

    that is a little-known known issue
    Check this post:
    http://myitforum.com/cs2/blogs/smslist/archive/2009/01/12/mssms-userlocale-in-mdt-sccm-also-changes-system-locale-9a532hdf.aspx
    He details how to modify the ZTIConifgure.xml file.

  • Custom certificates for JAR file signing

    Hi,
    Can anyone please let me know how to check that we have custom certificates for JAR file signing set up in our instance
    Thanks,
    Praveen

    It depends on the version of your $ADJVAPRG. See the referenced note.
    How to use,create and /or update Digital Certificates for Jinitiator in 11i Applications
    http://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=365735.1

  • Looking for JAR files for AQ JMS

    Hello all,
    I installed Oracle 9i 9.2.0.1 and trying to run a
    JMS Sample that uses JMS oracle.jms.AQjmsQueueConnectionFactory
    and oracle.jms.AQjmsSession. My questions which jar
    files should be included in the CLASSPATH.
    thanks

    The jar file you need is called aqapi.jar.

  • Getting errors when iam using  BAPI_PO_CREATE1 for Purchase Order creation

    Hi sap Gurus,
      I am getting Errors when iam using  BAPI_PO_CREATE1 for Purchase Order creation that Material (144) does not exist but it is alreardy maintained in MM01.
    I dont get how it is coming.and what are the mandatory fields in bapi BAPI_PO_CREATE1 in item level .that is too material only.
    pls let me know .
    thanks in advance.

    Hi,
    Check the sample code..
    report  zpo_test             .
    *DATA DECLARATION
    constants : c_x value 'X'.
    *Structures to hold PO header data
    data : header like bapimepoheader ,
    headerx like bapimepoheaderx .
    *Structures to hold PO account data
    data : account like bapimepoaccount occurs 0 with header line ,
    accountx like bapimepoaccountx occurs 0 with header line .
    *Internal Tables to hold PO ITEM DATA
    data : item like bapimepoitem occurs 0 with header line,
    itemx like bapimepoitemx occurs 0 with header line,
    *Internal table to hold messages from BAPI call
    return like bapiret2 occurs 0 with header line,
    *Internal table to hold messages from BAPI call
    pocontractlimits like bapiesucc occurs 0 with header line.
    data : w_header(40) value 'PO Header',
    purchaseorder like bapimepoheader-po_number,
    delivery_date like bapimeposchedule-delivery_date.
    data : ws_langu like sy-langu.
    *text-001 = 'PO Header' - define as text element
    selection-screen begin of block b1 with frame title text-001.
    parameters : company like header-comp_code default '122' ,
    doctyp like header-doc_type default 'NB' ,
    cdate like header-creat_date default sy-datum ,
    vendor like header-vendor default '2000000012' ,
    pur_org like header-purch_org default 'PU01' ,
    pur_grp like header-pur_group default '005' .
    *sociedad like HEADER-COMP_CODE default '122' ,
    *vendedor like HEADER-SALES_PERS default 'sale person'.
    selection-screen end of block b1.
    selection-screen begin of block b2 with frame title text-002.
    parameters : item_num like item-po_item default '00010',
    material like item-material default '12000000' ,
    tipo_imp like item-acctasscat default 'K' ,
    *pos_doc like ITEM-ITEM_CAT default 'F' ,
    shorttxt like item-short_text default 'PRUEBA BAPI' ,
    grup_art like item-matl_group default '817230000' ,
    plant like item-plant default '3001' ,
    mpe like item-trackingno default '9999' ,
    *contrato like ITEM-AGREEMENT default '4904000003' ,
    *quantity like ITEM-QUANTITY default 1 .
    po_unit like item-po_unit default 'EA'.
    selection-screen end of block b2.
    Par?mnetros de imputaci?n
    selection-screen begin of block b3 with frame title text-004.
    parameters : centro like account-costcenter default '1220813150',
    cuenta like account-gl_account default '6631400' ,
    num_pos like account-po_item default '10' ,
    serial like account-serial_no default '01' ,
    ind_imp like account-tax_code default 'I2' .
    selection-screen end of block b3.
    start-of-selection.
    *DATA POPULATION
      ws_langu = sy-langu. "Language variable
    *POPULATE HEADER DATA FOR PO
    *HEADER-COMP_CODE = sociedad .
      header-doc_type = doctyp .
      header-vendor = vendor .
      header-creat_date = cdate .
      header-created_by = 'TD17191' .
      header-purch_org = pur_org .
      header-pur_group = pur_grp .
      header-comp_code = company .
      header-langu = ws_langu .
    *HEADER-SALES_PERS = vendedor .
    *HEADER-CURRENCY = 'DOP' .
    *HEADER-ITEM_INTVL = 10 .
    *HEADER-PMNTTRMS = 'N30' .
    *HEADER-EXCH_RATE = 1 .
    *POPULATE HEADER FLAG.
      headerx-comp_code = c_x.
      headerx-doc_type = c_x.
      headerx-vendor = c_x.
      headerx-creat_date = c_x.
      headerx-created_by = c_x.
      headerx-purch_org = c_x.
      headerx-pur_group = c_x.
      headerx-langu = c_x.
    *HEADERX-sales_pers = c_x.
    *HEADERX-CURRENCY = c_x.
    *HEADER-ITEM_INTVL = c_x.
    *HEADER-PMNTTRMS = c_x.
    *HEADER-EXCH_RATE = c_x.
    *HEADER-EXCH_RATE = c_x.
    *POPULATE ITEM DATA.
      item-po_item = item_num.
      item-quantity = '1'.
    *ITEM-MATERIAL = material .
      item-short_text = 'prueba bapi_po_create1'.
    *ITEM-TAX_CODE = ''.
      item-acctasscat = 'K' .
    *ITEM-ITEM_CAT = 'D' .
      item-matl_group = '817230000' .
      item-plant = '3001' .
      item-trackingno = '99999'.
      item-preq_name = 'test'.
    *ITEM-AGREEMENT = '' .
    *ITEM-AGMT_ITEM = ''.
      item-quantity = '1' .
      item-po_unit = 'EA'.
    *ITEM-ORDERPR_UN = 'EA'.
      item-conv_num1 = '1'.
      item-conv_den1 = '1'.
      item-net_price = '1000000' .
      item-price_unit = '1'.
      item-gr_pr_time = '0'.
      item-prnt_price = 'X'.
      item-unlimited_dlv = 'X'.
      item-gr_ind = 'X' .
      item-ir_ind = 'X' .
      item-gr_basediv = 'X'.
    *ITEM-PCKG_NO = '' .
      append item. clear item.
    *POPULATE ITEM FLAG TABLE
      itemx-po_item = item_num.
      itemx-po_itemx = c_x.
    *ITEMX-MATERIAL = C_X.
      itemx-short_text = c_x.
      itemx-quantity = c_x.
    *ITEMX-TAX_CODE = C_X.
      itemx-acctasscat = c_x.
    *ITEMX-ITEM_CAT = c_x.
      itemx-matl_group = c_x.
      itemx-plant = c_x.
      itemx-trackingno = c_x.
      itemx-preq_name = c_x.
    *ITEMX-AGREEMENT = C_X.
    *ITEMX-AGMT_ITEM = c_x.
      itemx-stge_loc = c_x.
      itemx-quantity = c_x.
      itemx-po_unit = c_x.
    *ITEMX-ORDERPR_UN = C_X.
      itemx-conv_num1 = c_x.
      itemx-conv_den1 = c_x.
      itemx-net_price = c_x.
      itemx-price_unit = c_x.
      itemx-gr_pr_time = c_x.
      itemx-prnt_price = c_x.
      itemx-unlimited_dlv = c_x.
      itemx-gr_ind = c_x .
      itemx-ir_ind = c_x .
      itemx-gr_basediv = c_x .
      append itemx. clear itemx.
    *POPULATE ACCOUNT DATA.
      account-po_item = item_num.
      account-serial_no = serial .
      account-creat_date = sy-datum .
      account-costcenter = centro .
      account-gl_account = cuenta .
      account-gr_rcpt = 'tester'.
      append account. clear account.
    *POPULATE ACCOUNT FLAG TABLE.
      accountx-po_item = item_num .
      accountx-po_itemx = c_x .
      accountx-serial_no = serial .
      accountx-serial_nox = c_x .
      accountx-creat_date = c_x .
      accountx-costcenter = c_x .
      accountx-gl_account = c_x .
      account-gr_rcpt = c_x.
      append accountx. clear accountx.
    *BAPI CALL
      call function 'DIALOG_SET_NO_DIALOG'.
      call function 'BAPI_PO_CREATE1'
        exporting
          poheader         = header
          poheaderx        = headerx
        importing
          exppurchaseorder = purchaseorder
        tables
          return           = return
          poitem           = item
          poitemx          = itemx
          poaccount        = account
          poaccountx       = accountx.
    *Confirm the document creation by calling database COMMIT
      call function 'BAPI_TRANSACTION_COMMIT'
      exporting
      wait = 'X'
    IMPORTING
    RETURN =
    end-of-selection.
    *Output the messages returned from BAPI call
      loop at return.
        write / return-message.
      endloop.
    Regards
    Sudheer

  • Framemaker uses $filename for short file name, can we edit this to change appearance? We do not want the short file name of long filename to include the .fm extension can this be removed or modified to make this happen?

    Framemaker uses <$filename> for short file name, can we edit this to change appearance? We do not want the short file name of long filename to include the .fm extension can this be removed or modified to make this happen? In compiling our books it would be helpful to not have this extension appear as it then requires us to create extra files without them.

    See: System Variables

Maybe you are looking for