Add to favorites...........?very Urgent

Hi all
my client requirement is when he run reports on Internet Explorer(iviews),
he wants to save his reports on Favorites by using Favorites-->Add to favorites.
when he came back & click that saved link, he wants to display the report as usal.
is it possible? if yes, please let me know how we achieve this?
Regards
Venkat

Hi A.H.P
Yes its possible through Bookmark. but what user wants is he used Fav-->Add to Fav. menu item in Internet Explorer. how he says the report in IE is,
After Query initial view, means selection conditions.., user enter all desired input to the selections, and executed the query.., now report is displayed.
Now user is trying to add in his favorites menu by using Fav--> Add to Fav.
when he came back again, he used the link in Fav. and wants display the Report with all selection conditions. is it possible AHP.
Regards
Venkat

Similar Messages

  • Javascript code needed for "Add to Favorites" icon in Webhelp using RH8

    Hi,
      I have a huge problem in making the add to favorites icon click event associate with the appropriate code.
    This was the code i used in the Inline Javascript tab:
    <script type="text/javascript" language="JavaScript" src="showhide.js"></script>
    <input type="image" value="Add to Favorites" onclick="window.external.AddFavorite(location.href, document.title);return false"
    /="" name="AddTopicToFavorites_selected.gif"  src="AddTopicToFavorites_selected.gif"  
    <script type="text/javascript">var BookmarkURL="http://www.geekpedia.com"
    var BookmarkTitle="Geekpedia"
    // If the browser is Internet Explorer
    if (document.all)
      // Add to Favorites (Internet Explorer)
        window.external.AddFavorite(BookmarkURL,BookmarkTitle)
          else
                  // Add to Bookmarks (Mozilla Firefox)
                  window.sidebar.addPanel(BookmarkTitle, BookmarkURL, '');
          }</script>
    Also in the onclick in the Edit tab, i wrote: window.external.AddFavorite(BookmarkURL,BookmarkTitle)
    It loads the add to favorites window very well as in any IE..But since the static word Geekpedia is being used, it displays the same and also navigates to the static URL http://www.geekpedia.com".
    I want to make it work dynamically...Please help me with any code change if any one has tried this before.
    One other thing that got messed up with was this icon replaced all other icons in the output....but...if i viewed the whskin_tbars.htm, i could see that the default icons appeared below somwhere...and there was this Add to Favorites icon appearing at the top...I dont know why these icons have got misplaced,,,i want to align them all in the same line..
    Please help me with this.....
    -Nanditha

    Hi,
    A long story, but I will need some more time to sort this out:
    Simple solutions:
         - Change the var BookmarkURL="http://www.geekpedia.com" to your own URL, such as: var BookmarkURL="http://myhelp.com"
         - Change the var BookmarkTitle="Geekpedia" to your name, such as: var BookmarkTitle="My help system"
         - Do not insert an image trough the javascript tab, add it using the image options with the custom toolbar items popup. This will probably solve your image problem.
    If you want to the URL dynamic, you need document.location.href, such as: var BookmarkURL = document.location.href; This however will get the adress of the current frame, which is whskin_tbars.htm.
    If you want to get the Title dynamic, you will need document.getElementsByTagName('title')[0]; and then you need to retrieve the title, as: xxx.firstChild.data,: such as:
         - var BookmarkGet = document.getElementsByTagName('title')[0];
         - var BookmarkTitle = BookmarkGet.firstChild.data;
    This always gets the URL and the Title of the frame you inserted the script in, which for the button toolbar is whskin_tbar.htm. When you insert this in any give topic, your bookmark will work fine, but will only call the topic, and not your skin.
    If you only want the URL of your helpsystem, I suggest you just change the  variables BookmarkURL and BookmarkTitle.
    If you want to target the current topic from any other location, such as the title bar, you need to address the top frame and then the topic. I don't know which frame this is, but I will look into it. This may take me some time though, but perhaps someone else knows which frames to address.
    Example for getting the url of your helpsystem dynamically:
    var BookmarkURL= this.parent.document.location.href;
    //Your projects main file does not have a title, so don't get it dynamically.
    var BookmarkTitle="My help system"
    // If the browser is Internet Explorer
    if (document.all)
      // Add to Favorites (Internet Explorer)
        window.external.AddFavorite(BookmarkURL,BookmarkTitle)
          else
                  // Add to Bookmarks (Mozilla Firefox)
                  window.sidebar.addPanel(BookmarkTitle, BookmarkURL, '');
    Long story, if you have any further questions, just ask.
    Greets,
    Willam

  • Very urgent --pls help Report Painter Problem,

    Hi to all,
    I have created  5 operating expenses report by cost centres through report painter. some for full period , some for actual and sone for budget.
    Under one set of that cost centre reports I have many subsets under which there are cost centre groups and then the cost centres.
    I want to add one more set to existing set. I have added the set and set contains one cost centre group and their are also cost centres under it.
    The table  which i am using for cost centre grous is GLT1 and field is RCNTR and for cost centres it is CCSS and KOSTL respectively.
    In the above procedure I have two queries.
    1)even after adding the set and when i try to execute the report from T- code SERP it doesnot show my created set in variation.
    2)Also even if it was showing the set earlier but report was showing zero values. When i clicked on zero amount a pop up arises for plan and actual values and when i clicked on plan values it had value of Rs 255000(for cost centres). then outside why this amount doesnot appears.
    PLS THIS IS VERY VERY URGENT
    Regards
    TANUJA

    I've just read this thread three times and I have absolutely no idea what you are doing, in what version, and what you are asking for help with.
    Do you want to change the message type? If you do you MUST drop the queue and start over again from the beginning.
    Do you want to enqueue messages?
    Post your DDL and other relevant information or you are on your own. We can not guess at your issue.

  • Unable to start IDC Content Service(Very Urgent)

    Hi,
    My local system has Windows XP.I have installed Oracle 10g Express Edition,Apache,has jre1.6.0_03 and run the UCM installer.Both IDC Content Admin Service and IDC Content Service are set to start automatically during installation time."IDC Content Admin Service" is getting started automatically but "IDC Content Service" is not getting started.It is getting the following Error Message when we are starting IDC Content Service
    Error 1064 : An exception occured in the service when handling the Control Request.
    I have already installed Oracle Database 10g and D2k 10g also on my local system.
    i am getting following error in the log file
    Failed to initialize the server. Unable to initialize the system provider 'SystemDatabase'. Unable to create database connection for the database 'SystemDatabase' with connection string 'jdbc:oracle:thin:@localhost:1521:xe'. Please make sure that the connection string, user and password are correct. Listener refused the connection with the following error:
    ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
    The Connection descriptor used by the client was:
    localhost:1521:xe
    Unable to create database connection for the database 'SystemDatabase' with connection string 'jdbc:oracle:thin:@localhost:1521:xe'. Please make sure that the connection string, user and password are correct. Listener refused the connection with the following error:
    ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
    The Connection descriptor used by the client was:
    localhost:1521:xe
    java.sql.SQLException: Listener refused the connection with the following error:
    ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
    The Connection descriptor used by the client was:
    localhost:1521:xe [ Details ]
    A fatal error has occurred. The stack trace below shows more information.
    !csFailedToInitServer!csProviderUnableToInitialize,SystemDatabase!csJdbcUnableToCreateConnection,SystemDatabase,jdbc:oracle:thin:@localhost:1521:xe!$Listener refused the connection with the following error:<br>ORA-12505\, TNS:listener does not currently know of SID given in connect descriptor<br>The Connection descriptor used by the client was:<br>localhost:1521:xe<br>!csJdbcUnableToCreateConnection,SystemDatabase,jdbc:oracle:thin:@localhost:1521:xe!$Listener refused the connection with the following error:<br>ORA-12505\, TNS:listener does not currently know of SID given in connect descriptor<br>The Connection descriptor used by the client was:<br>localhost:1521:xe<br>!syExceptionType2,java.sql.SQLException,Listener refused the connection with the following error:<br>ORA-12505\, TNS:listener does not currently know of SID given in connect descriptor<br>The Connection descriptor used by the client was:<br>localhost:1521:xe<br>
    intradoc.common.ServiceException: !csProviderUnableToInitialize,SystemDatabase!csJdbcUnableToCreateConnection,SystemDatabase,jdbc:oracle:thin:@localhost:1521:xe!$Listener refused the connection with the following error:
    ORA-12505\, TNS:listener does not currently know of SID given in connect descriptor
    The Connection descriptor used by the client was:
    localhost:1521:xe
         at intradoc.server.IdcSystemLoader.loadProviders(IdcSystemLoader.java:1949)
         at intradoc.server.IdcSystemLoader.initProviders(IdcSystemLoader.java:1729)
         at intradoc.server.IdcSystemLoader.finishInit(IdcSystemLoader.java:221)
         at intradoc.server.IdcSystemLoader.init(IdcSystemLoader.java:185)
         at intradoc.server.IdcServerManager.init(IdcServerManager.java:73)
         at IdcServerNT.init(IdcServerNT.java:86)
         at IdcServerNT.main(IdcServerNT.java:54)
    Caused by: intradoc.data.DataException: !csJdbcUnableToCreateConnection,SystemDatabase,jdbc:oracle:thin:@localhost:1521:xe!$Listener refused the connection with the following error:
    ORA-12505\, TNS:listener does not currently know of SID given in connect descriptor
    The Connection descriptor used by the client was:
    localhost:1521:xe
         at intradoc.jdbc.JdbcConnectionUtils.getConnection(JdbcConnectionUtils.java:88)
         at intradoc.jdbc.JdbcWorkspace.init(JdbcWorkspace.java:97)
         at intradoc.provider.Provider.init(Provider.java:68)
         at intradoc.server.IdcSystemLoader.loadProviders(IdcSystemLoader.java:1937)
         ... 6 more
    Caused by: java.sql.SQLException: Listener refused the connection with the following error:
    ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
    The Connection descriptor used by the client was:
    localhost:1521:xe
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:261)
         at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:387)
         at oracle.jdbc.driver.PhysicalConnection.&#60;init&#62;(PhysicalConnection.java:441)
         at oracle.jdbc.driver.T4CConnection.&#60;init&#62;(T4CConnection.java:165)
         at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
         at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
         at java.sql.DriverManager.getConnection(DriverManager.java:525)
         at java.sql.DriverManager.getConnection(DriverManager.java:171)
         at intradoc.jdbc.JdbcConnectionUtils.getConnection(JdbcConnectionUtils.java:70)
         ... 9 more
    The Oracle Homes are different for both the Oracle.
    If somebody have idea about this problem,please help me. This is very urgent.
    Manoj Baghel
    [email protected]

    I think so..
    Your Oracle Database doesn't connect to content server..
    Maybe, you can edit the configuration of your UCM..
    Please open the file at C:\oracle\ucm\server\config\config.cfg..
    And then add the code :
    NumConnection = 5;
    CMIIW

  • Very Urgent, files, threads, and swing !!!!

    Dear friends, i have a swing application, in that application i have a class that extends a thread, that thread will do nothing but read the contents of my data file and puts them in an array, but i am getting a NullpointerException in my thread, could any friend help me please, it is very urgent, i will post my code below.
    import java.awt.*;
    import java.awt.event.*;
    import java.text.DateFormat;
    import java.util.*;
    import javax.swing.*;
    import java.sql.*;
    import java.net.URL;
    import java.io.*;
    public class FinalMachine extends JFrame
    private JPanel MainPanel, ThicknessPanel, MainManager,fieldsPanel, sub_panel;
    private Container c;
    private CardLayout CardManager;
    private String timezone;
    private static final int ONE_SECOND = 1000;
    private JLabel welcome_label, label1, label2, label3,field_label;
    private JTextField data_entry;
    private Connection connection;
    public JPanel thick_figure;
    public int num_of_hits, next_index, recCount;
    public int dataBuffer[];
    public FileReader data_file;
    public BufferedReader b_data_file;
    public File tem_file;
    final int num_of_rec = 20;
    public FinalMachine()
    super("PHOENIX MACHINERY s.a.l");
    /* Start all threads */
    /* Start filling data file in global array */
         loadData dataFile = new loadData();
         dataFile.start();          
    /* Adding control to window application */
    addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent windowevent)
    // setDefaultCloseOperation(0);
              System.exit(0);
    public void windowDeiconified(WindowEvent eve)
    setState(0);
    addComponentListener(new ComponentAdapter() {
    public void componentResized(ComponentEvent componentevent)
    setSize(500, 500);
    Dimension dimension1 = Toolkit.getDefaultToolkit().getScreenSize();
    if(dimension1.width == 800 && dimension1.height == 600)
    setLocation(150, 25);
    else
    if(dimension1.width == 1024 && dimension1.height == 768)
    setLocation(200, 100);
    /* Setting the location of the application on the screen */
    Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize();
    if(dimension.width == 800 && dimension.height == 600)
    setLocation(150, 25);
    else
    if(dimension.width == 1024 && dimension.height == 768)
    setLocation(200, 100);
    /* Constructing the main menu */
         JMenuBar bar = new JMenuBar();
         setJMenuBar( bar );
         JMenu fileMenu = new JMenu( "File");
         fileMenu.setMnemonic( 'F' );
         JMenuItem mainItem = new JMenuItem( "Main page" );
         mainItem.setMnemonic( 'M' );
         mainItem.addActionListener (
              new ActionListener() {
                   public void actionPerformed( ActionEvent e )
                   CardManager.show(MainManager, "main");
         fileMenu.add( mainItem );
         JMenuItem dataItem = new JMenuItem( "Database page" );
         dataItem.setMnemonic( 'D' );
         dataItem.addActionListener (
              new ActionListener() {
                   public void actionPerformed( ActionEvent e )
                   CardManager.show(MainManager, "data_base");
         fileMenu.add( dataItem );
         JMenuItem printItem = new JMenuItem( "Print" );
         printItem.setMnemonic( 'P' );
         printItem.addActionListener (
              new ActionListener() {
                   public void actionPerformed( ActionEvent e )
                   PrintUtilities.printComponent(MainManager);
         fileMenu.add( printItem );
         JMenuItem exitItem = new JMenuItem( "Exit" );
         exitItem.setMnemonic( 'P' );
         exitItem.addActionListener (
              new ActionListener() {
                   public void actionPerformed( ActionEvent e )
                        System.exit(0);
         fileMenu.add( exitItem );
         bar.add( fileMenu );
         JMenu figureMenu = new JMenu( "Figures");
         figureMenu.setMnemonic( 'G' );
         JMenuItem thicknessItem = new JMenuItem( "Thickness" );
         thicknessItem.setMnemonic( 'T' );
         thicknessItem.addActionListener (
              new ActionListener() {
                   public void actionPerformed( ActionEvent e )
                   CardManager.show(MainManager, "thickness");
         figureMenu.add( thicknessItem );
         bar.add( figureMenu );
         JMenu helpMenu = new JMenu( "Help");
         helpMenu.setMnemonic( 'H' );
         JMenuItem aboutItem = new JMenuItem( "About us" );
         aboutItem.setMnemonic( 'A' );
         aboutItem.addActionListener (
              new ActionListener() {
                   public void actionPerformed( ActionEvent e )
                   JOptionPane.showMessageDialog(null, "Engineer Bilal Haidar (Computer & "+                     "Communication Engineering)\n\n All Rights Reserevd. @ 2002",
                        "About me...", JOptionPane.PLAIN_MESSAGE);
         helpMenu.add( aboutItem );
         bar.add( helpMenu );
    /* Intializing global values */
    dataBuffer = new int[60];
    /* Initializing the panels */
    c = getContentPane();
    c.setLayout(new FlowLayout());
    CardManager = new CardLayout();
    MainManager = new JPanel(false);
    MainManager.setLayout(CardManager);
    c.add(MainManager);
    javax.swing.border.Border border = BorderFactory.createEmptyBorder(10, 10, 5, 10);
    MainPanel = new JPanel(false);
    MainPanel.setLayout(new BoxLayout(MainPanel, 1));
    MainPanel.setBorder(border);
    ThicknessPanel = new JPanel(false);
    ThicknessPanel.setLayout(new BoxLayout(ThicknessPanel, 1));
    ThicknessPanel.setBorder(border);
    fieldsPanel = new JPanel(false);
    fieldsPanel.setLayout( new BoxLayout( fieldsPanel,1));
    fieldsPanel.setBorder(border);
    sub_panel = new JPanel(false);
    sub_panel.setLayout( new BoxLayout(sub_panel,0) );
    sub_panel.setBorder(border);
    thick_figure = new JPanel(false);
    thick_figure.setBorder(border);
    /* Filling the main panel */
    JLabel jlmain = new JLabel("Main Page");
    MainPanel.add(jlmain);
    timezone = showTime(new Locale("en", "US"));
    JLabel jltime = new JLabel(" " + timezone);
    MainPanel.add(jltime);
    MainManager.add(MainPanel, "main");
    /* Filling the thickness panel */
    num_of_hits = 0;
    next_index = 0;
    /* fill in with ero values for everything*/
    /*display the figure*/
    ThicknessPanel.add(thick_figure);
    JLabel blanklabel = new JLabel(" ");
    ThicknessPanel.add(blanklabel);
    JButton build_fig = new JButton("Draw Figure");
    build_fig.addActionListener(
         new ActionListener() {  // anonymous inner class
         public void actionPerformed( ActionEvent e )
    if ( num_of_hits == 0 )
    /* draw figure based on first 20 points in the array */
    next_index = num_of_rec;
    else
    if ( num_of_hits > 3 )
    JOptionPane.showMessageDialog(null,"No more data to draw","Error Drawing",JOptionPane.ERROR_MESSAGE);
    else
    /* draw the figure starting the data from index 20*/
    next_index = next_index + num_of_rec;
    num_of_hits += 1;
    ThicknessPanel.add(build_fig);
    MainManager.add(ThicknessPanel, "thickness");
    /* filling the database panel */
    label1 = new JLabel(" ",SwingConstants.CENTER);
    welcome_label = new JLabel(" Database Page ",SwingConstants.CENTER);
    label2 = new JLabel(" ",SwingConstants.CENTER);
    fieldsPanel.add( label1 );
    fieldsPanel.add( welcome_label );
    fieldsPanel.add( label2 );
    field_label = new JLabel(" Enter your name: ");
    data_entry = new JTextField( 10 );
    sub_panel.add( field_label );
    sub_panel.add( data_entry );
    fieldsPanel.add( sub_panel );
    JButton add_data = new JButton( "Add me" );
    add_data.addActionListener(
         new ActionListener() {  // anonymous inner class
         public void actionPerformed( ActionEvent e )
    // try {
    //          url = "jdbc:odbc:DataEntry";
    //          Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver" );
    //          connection = DriverManager.getConnection( url );
    //               System.out.println( "Connection Suucessfull");
    // Statement statement = connection.createStatement();
    //                String get_field;
    //               get_field = data_entry.getText();
    //               String query = "INSERT INTO data (anyField) VALUES ('get_field')";
    //                int result1 = statement.executeUpdate( query );
    //           if ( result1 == 1 )
    // JOptionPane.showMessageDialog(null, "Thanks for the info..."," Data Entry Success",JOptionPane.INFORMATION_MESSAGE);
    //                else
    //                     JOptionPane.showMessageDialog(null, "Sorry, your name was not added...","Data entry error",JOptionPane.ERROR_MESSAGE);
    //     catch ( ClassNotFoundException cnfex ) {
    //          // process ClassNotFoundExceptions here
    //          cnfex.printStackTrace();
    //               System.out.println( "Connection UN Suucessfull");
    //          catch ( SQLException sqlex ) {
    //     // process SQLExceptions here
    //          sqlex.printStackTrace();
    //                System.out.println( "Connection UN Suucessfull");
    //          catch ( Exception ex ) {
    //          // process remaining Exceptions here
    //          ex.printStackTrace();
    //               System.out.println( "Connection UN Suucessfull");
    fieldsPanel.add(add_data);
    MainManager.add(fieldsPanel, "data_base");
    /* display time */
    Timer timer = new Timer(1000, new ActionListener() {
    public void actionPerformed(ActionEvent actionevent)
    timezone = showTime(new Locale("en", "US"));
    setTitle("PHOENIX MACHINERY s.a.l " + timezone);
    timer.start();
    public static void main(String args[])
    FinalMachine finalmachine = new FinalMachine();
    finalmachine.setSize(500, 500);
    ImageIcon imageicon = new ImageIcon("images/pc.gif");
    finalmachine.setIconImage(imageicon.getImage());
    finalmachine.show();
    public static String showTime(Locale locale)
    java.util.Date date = new java.util.Date();
    byte byte0 = 2;
    DateFormat dateformat = DateFormat.getTimeInstance(byte0, locale);
    String s = dateformat.format(date);
    return s;
    /* Thread loadData starts here */
    class loadData extends Thread
    public void run()
    try {
              readMyFile();
    catch( Exception x )
    System.out.println("The following error occured in LoadData thread : "+x.toString() ); }
    } // run() ends here
    /* method read file inside thread loadData */
    void readMyFile() {
    String record = " ";
    recCount = 0;
    try {
              tem_file = new File("mydata.dat");
              data_file = new FileReader(tem_file);
              b_data_file = new BufferedReader( data_file );
              record = new String();
              while ( (record = b_data_file.readLine()) != null ) {
              dataBuffer[recCount] = Integer.parseInt(record);
              recCount += 1; }
         b_data_file.close();     
              catch (IOException e) {
         System.out.println("Uh oh, got an IOException error!");
         e.printStackTrace();
         } // end of readMyFile()
    } // thread loadData ends
    mydata.dat
    2
    4
    3
    1
    2
    3
    5
    2
    4
    1
    6
    3
    2
    5
    4
    1
    2
    5
    8
    2
    6
    9
    7
    4
    2
    1
    0
    2
    5
    4
    8
    7
    5
    6
    3
    2
    1
    4
    3
    0
    2
    3
    6
    5
    2
    1
    4
    5
    6
    9
    8
    5
    2
    1
    6
    8
    3
    1
    7
    5

    Thank you Mr. jobuck, you helped me a lot, i wonder if you can provide me with a tutorial on how threads work and how runnables work too. i fixed the error ut old me about but still when i try to add another thread to my program i got an error saying that, i must decalre the new thread in a seperate file please can u have a look on what i have:
    import java.awt.*;
    import java.awt.event.*;
    import java.text.DateFormat;
    import java.util.*;
    import javax.swing.*;
    import java.sql.*;
    import java.net.URL;
    import java.io.*;
    public class FinalMachine extends JFrame
    private JPanel MainPanel, ThicknessPanel, MainManager,fieldsPanel, sub_panel;
    private Container c;
    private CardLayout CardManager;
    private String timezone;
    private static final int ONE_SECOND = 1000;
    private JLabel welcome_label, label1, label2, label3,field_label;
    private JTextField data_entry;
    private JPanel thick_figure;
    private int num_of_hits, next_index, recCount, read_flag;
    private int dataBuffer[];
    private FileReader data_file;
    private BufferedReader b_data_file;
    private File tem_file;
    private Connection connection;     
    final int num_of_rec = 20;
    public FinalMachine()
    super("PHOENIX MACHINERY s.a.l");
    /* load JDBC drivers */
    try {
    String url = "jdbc:odbc:DataEntry";
    Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver" );
         connection = DriverManager.getConnection( url );
         System.out.println( "Connection Suucessfull");
    catch ( ClassNotFoundException cnfex ) {
    // process ClassNotFoundExceptions here
    cnfex.printStackTrace();
         System.out.println( "Connection UN Suucessfull");
    catch ( SQLException sqlex ) {
    // process SQLExceptions here
    sqlex.printStackTrace();
         System.out.println( "Connection UN Suucessfull");
    catch ( Exception ex ) {
    // process remaining Exceptions here
    ex.printStackTrace();
         System.out.println( "Connection UN Suucessfull");
    /* Intializing global values */
    dataBuffer = new int[60];
    /* Start all threads */
    /* Start filling data file in global array */
         loadData dataFile = new loadData();
         dataFile.start();          
         setData setdata = new setData();
         setdata.start();          
    /* Adding control to window application */
    addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent windowevent)
    // setDefaultCloseOperation(0);
              System.exit(0);
    public void windowDeiconified(WindowEvent eve)
    setState(0);
    addComponentListener(new ComponentAdapter() {
    public void componentResized(ComponentEvent componentevent)
    setSize(500, 500);
    Dimension dimension1 = Toolkit.getDefaultToolkit().getScreenSize();
    if(dimension1.width == 800 && dimension1.height == 600)
    setLocation(150, 25);
    else
    if(dimension1.width == 1024 && dimension1.height == 768)
    setLocation(200, 100);
    /* Setting the location of the application on the screen */
    Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize();
    if(dimension.width == 800 && dimension.height == 600)
    setLocation(150, 25);
    else
    if(dimension.width == 1024 && dimension.height == 768)
    setLocation(200, 100);
    /* Constructing the main menu */
         JMenuBar bar = new JMenuBar();
         setJMenuBar( bar );
         JMenu fileMenu = new JMenu( "File");
         fileMenu.setMnemonic( 'F' );
         JMenuItem mainItem = new JMenuItem( "Main page" );
         mainItem.setMnemonic( 'M' );
         mainItem.addActionListener (
              new ActionListener() {
                   public void actionPerformed( ActionEvent e )
                   CardManager.show(MainManager, "main");
         fileMenu.add( mainItem );
         JMenuItem dataItem = new JMenuItem( "Database page" );
         dataItem.setMnemonic( 'D' );
         dataItem.addActionListener (
              new ActionListener() {
                   public void actionPerformed( ActionEvent e )
                   CardManager.show(MainManager, "data_base");
         fileMenu.add( dataItem );
         JMenuItem printItem = new JMenuItem( "Print" );
         printItem.setMnemonic( 'P' );
         printItem.addActionListener (
              new ActionListener() {
                   public void actionPerformed( ActionEvent e )
                   PrintUtilities.printComponent(MainManager);
         fileMenu.add( printItem );
         JMenuItem exitItem = new JMenuItem( "Exit" );
         exitItem.setMnemonic( 'P' );
         exitItem.addActionListener (
              new ActionListener() {
                   public void actionPerformed( ActionEvent e )
                        System.exit(0);
         fileMenu.add( exitItem );
         bar.add( fileMenu );
         JMenu figureMenu = new JMenu( "Figures");
         figureMenu.setMnemonic( 'G' );
         JMenuItem thicknessItem = new JMenuItem( "Thickness" );
         thicknessItem.setMnemonic( 'T' );
         thicknessItem.addActionListener (
              new ActionListener() {
                   public void actionPerformed( ActionEvent e )
                   CardManager.show(MainManager, "thickness");
         figureMenu.add( thicknessItem );
         bar.add( figureMenu );
         JMenu helpMenu = new JMenu( "Help");
         helpMenu.setMnemonic( 'H' );
         JMenuItem aboutItem = new JMenuItem( "About us" );
         aboutItem.setMnemonic( 'A' );
         aboutItem.addActionListener (
              new ActionListener() {
                   public void actionPerformed( ActionEvent e )
                   JOptionPane.showMessageDialog(null, "Engineer Bilal Haidar (Computer & "+                     "Communication Engineering)\n\n All Rights Reserevd. @ 2002",
                        "About me...", JOptionPane.PLAIN_MESSAGE);
         helpMenu.add( aboutItem );
         bar.add( helpMenu );
    /* Initializing the panels */
    c = getContentPane();
    c.setLayout(new FlowLayout());
    CardManager = new CardLayout();
    MainManager = new JPanel(false);
    MainManager.setLayout(CardManager);
    c.add(MainManager);
    javax.swing.border.Border border = BorderFactory.createEmptyBorder(10, 10, 5, 10);
    MainPanel = new JPanel(false);
    MainPanel.setLayout(new BoxLayout(MainPanel, 1));
    MainPanel.setBorder(border);
    ThicknessPanel = new JPanel(false);
    ThicknessPanel.setLayout(new BoxLayout(ThicknessPanel, 1));
    ThicknessPanel.setBorder(border);
    fieldsPanel = new JPanel(false);
    fieldsPanel.setLayout( new BoxLayout( fieldsPanel,1));
    fieldsPanel.setBorder(border);
    sub_panel = new JPanel(false);
    sub_panel.setLayout( new BoxLayout(sub_panel,0) );
    sub_panel.setBorder(border);
    thick_figure = new JPanel(false);
    thick_figure.setBorder(border);
    /* Filling the main panel */
    JLabel jlmain = new JLabel("Main Page");
    MainPanel.add(jlmain);
    timezone = showTime(new Locale("en", "US"));
    JLabel jltime = new JLabel(" " + timezone);
    MainPanel.add(jltime);
    MainManager.add(MainPanel, "main");
    /* Filling the thickness panel */
    num_of_hits = 0;
    next_index = 0;
    /* fill in with ero values for everything*/
    /*display the figure*/
    ThicknessPanel.add(thick_figure);
    JLabel blanklabel = new JLabel(" ");
    ThicknessPanel.add(blanklabel);
    JButton build_fig = new JButton("Draw Figure");
    build_fig.addActionListener(
         new ActionListener() {  // anonymous inner class
         public void actionPerformed( ActionEvent e )
    if ( num_of_hits == 0 )
    /* draw figure based on first 20 points in the array */
    next_index = num_of_rec;
    else
    if ( num_of_hits > 3 )
    JOptionPane.showMessageDialog(null,"No more data to draw","Error Drawing",JOptionPane.ERROR_MESSAGE);
    else
    /* draw the figure starting the data from index 20*/
    next_index = next_index + num_of_rec;
    num_of_hits += 1;
    ThicknessPanel.add(build_fig);
    MainManager.add(ThicknessPanel, "thickness");
    /* filling the database panel */
    label1 = new JLabel(" ",SwingConstants.CENTER);
    welcome_label = new JLabel(" Database Page ",SwingConstants.CENTER);
    label2 = new JLabel(" ",SwingConstants.CENTER);
    fieldsPanel.add( label1 );
    fieldsPanel.add( welcome_label );
    fieldsPanel.add( label2 );
    field_label = new JLabel(" Enter your name: ");
    data_entry = new JTextField( 10 );
    sub_panel.add( field_label );
    sub_panel.add( data_entry );
    fieldsPanel.add( sub_panel );
    JButton add_data = new JButton( "Add me" );
    add_data.addActionListener(
         new ActionListener() {  // anonymous inner class
         public void actionPerformed( ActionEvent e )
              try {
    Statement statement = connection.createStatement();
                   String get_field;
              get_field = data_entry.getText();
              String query = "INSERT INTO data (anyField) VALUES ('"+get_field+"')";
              int result1 = statement.executeUpdate( query );
              if ( result1 == 1 )
              JOptionPane.showMessageDialog(null, "Thanks for the info..."," Data Entry Success",JOptionPane.INFORMATION_MESSAGE);
                        data_entry.setText(" ");     
              else
                        JOptionPane.showMessageDialog(null, "Sorry, your name was not added...","Data entry error",JOptionPane.ERROR_MESSAGE);
         catch ( SQLException sqlex ) {
         // process SQLExceptions here
              sqlex.printStackTrace();
                   System.out.println( "Connection UN Suucessfull");
              catch ( Exception ex ) {
              // process remaining Exceptions here
              ex.printStackTrace();
                   System.out.println( "Connection UN Suucessfull");
    fieldsPanel.add(add_data);
    MainManager.add(fieldsPanel, "data_base");
    /* display time */
    Timer timer = new Timer(1000, new ActionListener() {
    public void actionPerformed(ActionEvent actionevent)
    timezone = showTime(new Locale("en", "US"));
    setTitle("PHOENIX MACHINERY s.a.l " + timezone);
    timer.start();
    public static void main(String args[])
    FinalMachine finalmachine = new FinalMachine();
    finalmachine.setSize(500, 500);
    ImageIcon imageicon = new ImageIcon("images/pc.gif");
    finalmachine.setIconImage(imageicon.getImage());
    finalmachine.show();
    public static String showTime(Locale locale)
    java.util.Date date = new java.util.Date();
    byte byte0 = 2;
    DateFormat dateformat = DateFormat.getTimeInstance(byte0, locale);
    String s = dateformat.format(date);
    return s;
    /* Thread loadData starts here */
    public class loadData extends Thread
    public void run()
    try {
              readMyFile();
              read_flag = 1;
              notify();
    catch( Exception x )
    System.out.println("The following error occured in LoadData thread : "+x.toString() );
    } // run() ends here
    /* method read file inside thread loadData */
    void readMyFile() {
    String record = " ";
    recCount = 0;
    try {
              tem_file = new File("mydata.dat");
              data_file = new FileReader(tem_file);
              b_data_file = new BufferedReader( data_file );
              record = new String();
              while ( (record = b_data_file.readLine()) != null ) {
              dataBuffer[recCount] = Integer.parseInt(record);
              recCount += 1; }
         b_data_file.close();     
              catch (IOException e) {
         System.out.println("Uh oh, got an IOException error!");
         e.printStackTrace();
         } // end of readMyFile()
    } // thread loadData ends
    public class setData extends Thread {
    public void run()
    try {
              while ( !read_flag ) {
                   try {     wait(); }
                   catch( InterruptedException e ) {
                        e.printStackTrace();
              } // end while
              for(int index = 0; index < 60; index++)
              System.out.println("Array["+index+"] = "+dataBuffer[index]);
    catch( Exception x )
    System.out.println("The following error occured in LoadData thread : "+x.toString() );
    } // run() ends here
    the only added thing is the setData thread, i want this thread to start printing out the array whenever, loadData thread has finished filling the data inside the array please i need ur help.

  • CATS Issue VERY Urgent..

    HI ALL,
    BiW  PROD is placing CATS data for 2007 in to week 52 2006.  Can advise why?
    Please advise what would be the error.
    Cheers,
    Sri

    Hi All,
    We have a problem for 0CALWEEK in CATS.
    FOR  0CALQUARTER
    20061 means 1st quarter
    20062 means 2ND quarter
    20063 means 3RD quarter
    20064 means 4TH quarter
    FOR 0calweeK:
    20061 means 1st WEEK
    20062 means 2ND WEEK
    20063 means 3RD WEEK
    20064 means 4TH WEEK
    0CALWEEK is giving problem  IN CUBE.
    It  shows wrongly.
    0CALQUARTER      0CAL WEEk
    2007 1             2006 52 ( 52 week)
    2007 1                          2006 52
    <b>0CAL WEEk          should show 2007 1     instead of 2006 52.</b>
    It should show :
    0CALQUARTER      0CAL WEEk
    2007 1             2007 1 (ist week in 2007)
    2007 1                         2007 1
    we have a routine on 0CAL_week
    =====
    PROGRAM UPDATE_ROUTINE.
    $$ begin of global - insert your declaration only below this line  -
    TABLES: ...
    DATA:   ...
    data:   employee_md like /bi0/memployee,
            employee_wa like /bi0/memployee,
            person_md   like /bi0/mperson,
            PERSON_WA   LIKE /BI0/MPERSON.
    DATA:   G_RECORD_NO LIKE SY-TABIX.
    INCLUDE RS_BCT_HR_UPDATE_RULES_GENERAL.
    INCLUDE RS_BCT_HR_PAPA_UPDATE_RULES.
    $$ end of global - insert your declaration only before this line   -
    FORM compute_characteristics
      TABLES   MONITOR STRUCTURE RSMONITOR "user defined monitoring
      USING    COMM_STRUCTURE LIKE /BIC/CS0CATS_IS_1
               RECORD_NO LIKE SY-TABIX
               RECORD_ALL LIKE SY-TABIX
               SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS
      CHANGING RESULT LIKE /BIC/VZCATST-CALWEEK
               RETURNCODE LIKE SY-SUBRC
               ABORT LIKE SY-SUBRC. "set ABORT <> 0 to cancel update
    $$ begin of routine - insert your code only below this line        -
    fill the internal table "MONITOR", to make monitor entries
    data: w_date type d.
    data: w_date_check type d.
    data: w_numberofdays type p decimals 2.
    data: w_numberofweeks type i.
    data: w_dayofweek type p.
    data: w_first_day_of_sap_calendar type d value '19790101'.
    data: check type i.
    data: w_year(4) type c.
    data: w_weekno(2) type c.
    w_date_check = COMM_STRUCTURE-CALDAY.
    w_date = w_date_check.
    w_date+04(04) = '0101'. " beginning of the year
    do.
    w_dayofweek = ( ( w_date - w_first_day_of_sap_calendar ) mod 7 ) + 1.
    if w_dayofweek = 7. " First sunday(7) of the Current year
    exit.
    endif.
    add 01 to w_date+07(01).
    enddo.
    w_numberofdays = ( w_date_check - w_date ) + 1.
    w_numberofweeks = ceil( w_numberofdays / 7 ).
    w_year = w_date_check+0(4).
      if w_numberofweeks = 53.
        w_numberofweeks = 1.
        w_year = w_date_check+0(4) + 1.
      endif.
      if w_numberofweeks = 0.
        w_numberofweeks = 52.
        w_year = w_date_check+0(4) - 1.
      endif.
    w_weekno = w_numberofweeks.
    call function 'CONVERSION_EXIT_ALPHA_INPUT'
         exporting
              input   = w_weekno
        importing
             output  = w_weekno.
    concatenate w_year w_weekno into RESULT.
    result value of the routine
    RESULT = .
    if the returncode is not equal zero, the result will not be updated
      RETURNCODE = 0.
    if abort is not equal zero, the update process will be canceled
      ABORT = 0.
    $$ end of routine - insert your code only before this line         -
    ENDFORM.
    ========
    This is giving problem from 2007 year only.
    We need to check with FI or HR teams , Is there any configuration settings in R/3 side for 0Calweek?
    This is production ISSUE. Help me on very Urgent BASIS!!
    Thanks & Regards,
    Sri.

  • Very urgent, no Transacctions Types possible to create Business Transaction

    Hello, this question is very urgent, please I will be very pleased if anybody can helps me.
    When I want to create a Business Transaction, at CRMD_ORDER, I dont have any Transaction Type to choose to create the Business Transaction, so I can't create anyone.
    I have got many Transaction types, I am usign CRM 5.0 and I have got many Transaction Types with all Channel communication allowed.
    Please check this image for further information:
    <a href="http://img380.imageshack.us/my.php?image=businesspq5.jpg">http://img380.imageshack.us/my.php?image=businesspq5.jpg</a>

    HI Fernando,
    Please check whether all your Transaction type are in Active mode or Not.
    Also check the Allowed Channels status, if it is not filled please add the same from the drop down.
    Regards
    Arun Kumar

  • Very urgent Decimal issue in ADF page

    Hello friends,
    i have an issue in ADF page which was weight field, issue has below.
    1) weight filed was validated that without entering 5 digit value in filed, example suppose i enter 12345 in weight it is showing that in small dialog box -weight value should be 0 to 9999.999 only. but it is let me to go next field and submit button. it is happening only in create page only.
    2)but when i go to detail page , same weight fild is populated there - i enter invalid weight something 12345, it is showing that in small dialog box -weight value should be 0 to 9999.999 only. but here let me not go to another filed until i ENTER valid value.
    create page weight filed need to work same as detail page.i am new to ADF development, how to check where this validation done and how to fix this.
    very very urgent.
    Thanks,
    vamshi.

    If you use ADF BC, open the entity and choose "Business Rules". You can then add validation rules such as range limits under the attributes. It is usually best practice to include validation rules in the entity (model layer), this way they apply automatically to all view objects based on the entity and you are guaranteed to have only valid values in the database. (View layer validation may have its place as a convenience supplement.)
    Read more about business rules in the developer's guide: http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/bcvalidation.htm

  • Adding Custom fields to VL02N...very urgent

    Hi Friends,
    I have come up with a requirement, where i need to add 2 custom fields namely "EOD INDICATOR and FREIGHT AMOUNT" in a customized additional tab at the header level in VL02N transaction.I need to update the freight amount in the deliveries that are picked up by a report program where, the shipment number and the freight cost are the inputs. The problem is that, how to update the data in the delivery through VL02N and database.
    I found a BAPI, named "BAPI_OUTB_DELIVERY_CHANGE", where in at the header data we dont have fields for the custom fields i stated above. I want to know, how to enhance a BAPI, so that we can update the data for the outbound delivery and the database.
    In the BAPI, in tables I found EXTENSION1 and EXTENSION2 tables. Can I use these tables to update my fields?
    Let me know the way, like how to go ahead to update the customized fields in tcode using BAPI or some other way as soon as possible..it's very urgent..
    Thanks in advance..
    --sudha
    Edited by: sudha koduri on Jul 3, 2008 2:58 PM

    Check this thread:
    https://forums.sdn.sap.com/click.jspa?searchID=6422849&messageID=392261

  • Making a webdynpro through Web Service| VERY URGENT

    Hi ,
       I am having a problem in the scenario when I am trying to make a webdynpro application using a WSDL file . When I deploy the application in my first view which is a search view the field appears disabled and I am not able to input the values for the same .I have done the following ...
    1) In my action search following is the code
    public void onActionSearch(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionSearch(ServerEvent)
        wdThis.wdFirePlugToOutputView();
        wdThis.wdGetContactTestAgainController().executeSearch();
        //@@end
    2) in the wdDoInit method of the component controller following is the code
    public void wdDoInit()
        //@@begin wdDoInit()
         Request_Default_siebelContactQueryByExample input =
              new Request_Default_siebelContactQueryByExample();
         wdContext.nodeRequest_ByExample().bind(input);
        //@@end
    3) In the execute search method following is the code
    public void executeSearch( )
        //@@begin executeSearch()
         try
              wdContext.currentRequest_ByExampleElement().modelObject().execute();
         catch(Exception ex)
              wdContext.nodeResponse().invalidate();
              wdContext.nodeResult().invalidate();
        //@@end
    The scenario is somewhat like this . There is a proxy class being generated while importing the model by the name "Request_Default_siebelContactQueryByExample" . This class has a list inside . The relevant code for this inside the above mentioned class is as follows
    private java.util.List _listOfContactInterface;
    public void setListOfContactInterface (java.util.List arg)
         this._listOfContactInterface = arg;          
    public java.util.List getListOfContactInterface ()
         return _listOfContactInterface;           
    public void setListOfContactInterface (com.test.last.proxies.types.Contact[] args)
         if(_listOfContactInterface == null) _listOfContactInterface = new java.util.ArrayList();
         if (args == null ) return ;
         for(int i=0;i<args.length;i++)
              com.test.last.ComplexType_Contact wrapper = new com.test.last.ComplexType_Contact ();
              wrapper.setOriginalBean(args<i>);
              _listOfContactInterface.add(wrapper);     
    public com.test.last.proxies.types.Contact[] getListOfContactInterfaceAsArray ()
         if(_listOfContactInterface == null) return new com.test.last.proxies.types.Contact[]{};
         com.test.last.proxies.types.Contact[] ListOfContactInterfaceAsArray = new com.test.last.proxies.types.Contact[_listOfContactInterface.size()];
         for(int i=0;i<_listOfContactInterface.size();i++)
              com.test.last.ComplexType_Contact item = (com.test.last.ComplexType_Contact)_listOfContactInterface.get(i);
              ListOfContactInterfaceAsArray<i> = item.getOriginalBean();
         return ListOfContactInterfaceAsArray ;
    I think I have to do something to set the values for the input the parameters . There  is a field "id" that I am taking as my input but I am not sure how to set this value from the list .May be this is the reason for the whole problem .
    Also if there is a cardinality issue then I have checked the context for views and the controller for the same . The cardinality appears to be 0..n for the input model node and 0..1 for the output model node that I have created and in both the cases it appears to be non editable .
    This is a very urgent issue and will highly appreciate a prompt reply .
    Regards
    Deepak Singh

    Hi Deepak,
    I was facing the same problem with my webservice, the problem is when u create a model for a webservice, u need to create a webservice through UDDI server. When u create model u will get three option :
    1) Local Server
    2) Local Server URL
    3) UDDI Server URL
    U need to select the 3rd option and importing of webservice should be
    Import webservice (deprecated) if u are using NWDS version 13.
    And also refer this document, and hope your question will answered ..
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/696f9c90-0201-0010-0abd-86c6c7454052
    All the best
    Regards,
    Sameer Ali Khan

  • Hi this is very urgent

    could u plz explain how to populate the data into  the final internal table in this program.
    i need how to add this all select statement into one final internal table
    plz provide me
    i am using ALVgrid repors
    could u plz explain clearly with comments 
    very urgent
    TABLES: eban,                 "Purchase Requisition
            ekko,                 "Purchasing Document Header
            mereq3328,            "Purchase Requisition: Contact
            cdpos,                "Change document items
            cdhdr,                "Change document header
            dd04t.                "R/3 DD: Data element texts
    TYPE-POOLS: slis.
    TYPES :
    *declaration of type for internal table to be passed in ALV report as
    *internal table.
          BEGIN OF typ_req1,
             statu               TYPE    eban-statu,                        "Processing status of purchase requisition
             banpr               TYPE    eban-banpr,                        "Requisition Processing State
             bsart               TYPE    eban-bsart,                        "Purchase requisition document type
             banfn               TYPE    eban-banfn,                        "Purchase requisition number
             bnfpo               TYPE    eban-bnfpo,                        "Item number of purchase requisition
             ebeln               TYPE    eban-ebeln,                        "Purchase order number
             ebelp               TYPE    eban-ebelp,                        "Purchase order item number
             matnr               TYPE    eban-matnr,                        "Material Number
             txz01               TYPE    eban-txz01,                        "Short text
             creator_name        TYPE    mereq3328-creator_name,            "Creator
             afnam               TYPE    eban-afnam,                        "Name of requisitioner/requester
             lifnr               TYPE    eban-lifnr,                        "Desired vendor
             flief               TYPE    eban-flief,                        "Fixed Vendor
             ekgrp               TYPE    ekko-ekgrp,                        "Purchasing Group
             tabkey              TYPE    cdpos-tabkey,                      "Item Number
             ddtext              TYPE    dd04t-ddtext,                      "Short Text
             chngind             TYPE    cdpos-chngind,                     "Action
             value_new           TYPE    cdpos-value_new,                   "New Value
             value_old           TYPE    cdpos-value_old,                   "Old Value
             username            TYPE    cdhdr-username,                    "Name
             udate               TYPE    cdhdr-udate,                       "Date
             utime               TYPE    cdhdr-utime,                       "Time
             changenr            TYPE    cdhdr-changenr,                    "Doc Number
             tcod                TYPE    cdhdr-tcode,                       "Transaction Code
          END OF typ_req1,
    Type declaration for EBAN table fields
          BEGIN OF typ_eban,
             statu               TYPE    eban-statu,                        "Processing status of purchase requisition
             banpr               TYPE    eban-banpr,                        "Requisition Processing State
             bsart               TYPE    eban-bsart,                        "Purchase requisition document type
             banfn               TYPE    eban-banfn,                        "Purchase requisition number
             bnfpo               TYPE    eban-bnfpo,                        "Item number of purchase requisition
             ebeln               TYPE    eban-ebeln,                        "Purchase order number
             ebelp               TYPE    eban-ebelp,                        "Purchase order item number
             matnr               TYPE    eban-matnr,                        "Material Number
             txz01               TYPE    eban-txz01,                        "Short text
             afnam               TYPE    eban-afnam,                        "Name of requisitioner/requester
             lifnr               TYPE    eban-lifnr,                        "Desired vendor
             flief               TYPE    eban-flief,                        "Fixed Vendor
          END OF typ_eban,
    Type declaration for ekko table fields
          BEGIN OF typ_ekko,
             ekgrp               TYPE    ekko-ekgrp,                        "Purchasing Group
          END OF typ_ekko,
    Type declaration for cdpos table fields
          BEGIN OF typ_cdpos,
             fname               TYPE    cdpos-fname,
             changenr            TYPE    cdpos-changenr,                    "Doc Number
             objectclas          TYPE    cdpos-objectclas,                  "Object class
             objectid            TYPE    cdpos-objectid,                    "Object value
             tabkey              TYPE    cdpos-tabkey,                      "Item Number
             chngind             TYPE    cdpos-chngind,                     "Action
             value_new           TYPE    cdpos-value_new,                   "New Value
             value_old           TYPE    cdpos-value_old,                   "Old Value
            CHNGIND    type    cdpos-CHNGIND
          END OF typ_cdpos,
    Type declaration for cdhdr table fields
          BEGIN OF typ_cdhdr,
             objectclas          TYPE    cdhdr-objectclas,                  "Object class
             objectid            TYPE    cdhdr-objectid,                    "Object value
             username            TYPE    cdhdr-username,                    "Name
             udate               TYPE    cdhdr-udate,                       "Date
             utime               TYPE    cdhdr-utime,                       "Time
             changenr            TYPE    cdhdr-changenr,                    "Doc Number
             tcod                TYPE    cdhdr-tcode,                       "Transaction Code
             change_ind          TYPE    cdhdr-change_ind,
             objectid1(10)       TYPE    c,
          END OF typ_cdhdr,
    Type declaration for dd04t table fields
          BEGIN OF typ_dd04t,
             ddtext              TYPE    dd04t-ddtext,                      "Short Text
            END OF typ_dd04t,
    Type declaration for dd04t table fields
          BEGIN OF typ_mereq3328,
             creator_name        TYPE    mereq3328-creator_name,            "Creator
          END OF typ_mereq3328.
    *&   delcaratilon of internal table                                   *
          DATA:
      Internal table for final internal table
             it_req1             TYPE    STANDARD TABLE OF typ_req1,
      Internal table for eban table
             it_eban             TYPE    STANDARD TABLE OF typ_eban,
      Internal table for ekko table
             it_ekko             TYPE    STANDARD TABLE OF typ_ekko,
      Internal table for cdpos table
             it_cdpos            TYPE    STANDARD TABLE OF typ_cdpos,
      Internal table for cdhdr table
             it_cdhdr            TYPE    STANDARD TABLE OF typ_cdhdr,
      Internal table for cdhdr1 table
             it_dd04t            TYPE    STANDARD TABLE OF typ_dd04t,
      Internal table for mereq3328 table
             it_mereq3328        TYPE    STANDARD TABLE OF typ_mereq3328,
    Internal table for ALV Field Catalog
           it_fieldcat_alv     TYPE   slis_t_fieldcat_alv,
    Internal table for ALV Event
           it_events           TYPE   slis_t_event.
    *& Declaration of Work Area
      work area for final internal table
         wa_req1 TYPE typ_req1,
      work area for eban table
             wa_eban             TYPE    typ_eban,
      work area for ekko table
             wa_ekko             TYPE    typ_ekko,
      work area for cdpos table
             wa_cdpos            TYPE    typ_cdpos,
      work area for cdhdr table
             wa_cdhdr            TYPE    typ_cdhdr,
      work area for dd04t table
             wa_dd04t            TYPE    typ_dd04t,
      work area for mereq3328 table
             wa_mereq3328        TYPE    typ_mereq3328.
    Declaration  of work area for Field Catalog
           wa_fieldcat         TYPE    slis_fieldcat_alv,
    SELECTION-SCREEN BEGIN OF BLOCK b WITH FRAME TITLE text-001.
    SELECT-OPTIONS: s_bsart    FOR     eban-bsart   OBLIGATORY
                               DEFAULT 'znb1' TO 'znb2',                 "Purchase requisition document type
                    s_banfn    FOR     eban-banfn,                       "Req Number
                    s_bnfpo    FOR     eban-bnfpo,                       "Req Item Number
                    s_ebeln    FOR     eban-ebeln,                       "Purchase Order Number
                    s_ebelp    FOR     eban-ebelp,                       "Purchase Order Item Number
                    s_matnr    FOR     eban-matnr.                       "Material Number
    PARAMETER:      p_txz01    TYPE    eban-txz01.                       "Short text
    SELECT-OPTIONS: s_creat    FOR     mereq3328-creator_name,           "Creator
                    s_afnam    FOR     eban-afnam,                       "Requester
                    s_lifnr    FOR     eban-lifnr,                       "Desired vendor
                    s_flief    FOR     eban-flief.                       "Fixed Vendor
    SELECTION-SCREEN END OF BLOCK b.
    SELECT objectclas
                 objectid
                 changenr
                 username
                 udate
                 utime
                 tcode
                 change_ind FROM cdhdr
                 INTO TABLE it_cdhdr
                 WHERE objectclas = 'BANF'
                 AND   udate      =  sy-datum .
    SELECT    objectclas
                    objectid
                    changenr
                    chngind
                    tabkey
                    value_new
                    value_old
                    FROM cdpos INTO TABLE it_cdpos
                    FOR ALL ENTRIES IN it_cdhdr
                    WHERE changenr EQ it_cdhdr-changenr AND
                          chngind EQ it_cdhdr-change_ind AND
                          objectclas EQ it_cdhdr-objectclas AND
                          objectid EQ it_cdhdr-objectid.
    IF NOT it_cdhdr[] IS INITIAL.
            SELECT banfn
                   bnfpo
                   bsart
                   statu
                   afnam
                   txz01
                   matnr
                   lifnr
                   ebeln
                   ebelp
                   banpr
                   FROM  eban INTO TABLE it_eban
                   WHERE "banfn = it_cdhdr-objectid
                      banfn IN s_banfn
                     AND bnfpo IN s_bnfpo
                     AND bsart IN s_bsart
                     AND matnr IN s_matnr
                     AND lifnr IN s_lifnr
                     AND flief IN s_flief.
          ENDIF.
    IF NOT it_cdpos[] IS INITIAL.
            SELECT rollname
                   ddtext
                   FROM dd04t INTO TABLE it_dd04t
                   FOR ALL ENTRIES IN it_cdpos
                   WHERE rollname = it_cdpos-fname.

    hi rajeshreddy,
    create one global internal table for the all output fields,
    then move all these fields into this global internal table  and pass into your gird FM.
    i.e. see the below code for reference ,
    loop at <itab> into <wa>.
    read table <itab1> into <wa1> with key <keyfield> = <wa-field>.
    if sy-subrc = 0.
    move-correspondig <wa1> to <globalwa>.
    move-correspondig <wa> to <globalwa>.
    endif.
    then read another <itab2> into <wa2> with key <keyfield> = <wa-field>.
    if sy-subrc = 0.
    move-correspondig <wa2> to <globalwa>.
    endif.
    endloop.
    like this u can move all output fields into one global internal table but u should have relation among all the internal tables.
    reward points if helpful,
    regards,
    seshu.

  • Very URGENT : BAPI_ROUTING_CREATE Component Allocation

    Hi All,
    I want to create a routing using BAPI. I tried using BAPI_ROUTING_CREATE, it is creating operations without any problem.
    But when I want to assign an Operation/Activity to a Component through New Assignment in Component Allocation through BAPI, it is not assigning.
    Please let me know what fields should be passed to the Component Allocation Table in the BAPI.
    Please help me as it is very URGENT.
    Reward Points for useful answers
    Thanks,
    Harish

    Hi,
    The componenet allocation will take automatically if you have the BOM created for the Material for which you are creating the Routing.
    It will not add the new components.
    i too tried but lot of problems with this BAPI.
    I prefered recording.
    Reward points if it is helpful.

  • Help with DAQmx tension measurement and saving to spreadsheet file with NI USB-6218 (very urgent !)

    Hello people,
    I've been given at the last minute a project at school where I need to do some data acquisitions (tensions) with a DAQ NI USB-6218 and it has
    been miserable ever since, I first tried the "easy" way with DAQ assistant to save a given number of samples per channel to a text file
    in order to use it in matlab, well...it isn't working : every time in my text file I have a different number of samples, I used the "Write to spreadsheet" function within a while loop where I wired the path outputs to a shift register in order not to have it asking me the path all the time,
    but I'm still not getting the X number of samples per channel as specified at the beginning.
    So I've been using another method with the DAQmx where I get each individual waveform into a vector of samples, when I look for the size
    of the vector it looks Ok, 100 in my case but the problems start when I try to have a text file where each column will represent a channel for
    subsequent matlab treatment, what I'm doing doesn't seem to be working, it's really unbearable, please help me sort this mess out.
    I'll add both VIs as attachment so it can help you help me, thank you.
    Basically what I need is to acquire 15 tensions with a given number of samples per channel (the same for each channel) and then plot it in matlab.
    Note the first VI has switches to "unblock" each channel but it doesn't seem to be working, please look at both VIs.
    It's very urgent, I could fail my school year if I fail this project.
    Thank you very much for your help.
    Attachments:
    Projet EM acquisition - Copie.zip ‏78 KB
    projet autre version envoyer sur forum.zip ‏20 KB

    Hi Thank you very much for your help, in the meantime, I've changed the project to (see attachment), now
    it is at least writing the waveforms to the txt file, but again there is an another problem, it seems to be ignoring the
    number of samples I specified per channel, it seems to be writing into the txt file for as long as I keep the VI running.
    What is missing ? Also I'd like to have a clock for my samples, that is when I plot in matlab I do not just plot random numbers, but the
    physical analogical inputs as a function of time, that is for instance the first line corresponds to time 0, line 2 to time 0,001
    ect...How could I do that ? For the meantime I got only 5 channels, when I know what my mistake is, I'll expand it to 15 channels.
    Please help me.
    Attachments:
    acquisition 5 voies.zip ‏61 KB

  • Badi's on vi01. Pls Its very urgent

    Hi Experts,
          I have given the requirement below I am not aware of badi's. Pls tell me the info about  Business event 1120P. And also post the coding for this functionality . Its very urgent
    Enhancement Summary
    Two user exits are needed to determine the correct G/L Account and Cost Center on Shipment Cost documents and post the Material Group on the Accounting document. BADI_SCD_ACCTG and Business Event 1120P can be used to accommodate the new functionality.
    Business Process
    Specific G/L Accounts and Cost Centers have to be determined to post on the Shipment Cost document. This is needed to provide accurate management reporting capabilities on shipments for Sales Order or Stock Transfer Order. A new custom table must be created which contains the following information: Distribution, Mode of Transport, Account, Cost Center Material group. Distribution is an identifier here if this shipment originated from an SO or STO.
    There are no screens involved in this enhancement.
    Components
    Table: ZTABLE1
    Field     Data Element     Type     Length     Description
    MANDT     MANDT     CLNT (key)     3     Client
    DISTRIBUTION     Z_DISTRIBUTION     CHAR (key)     1     Distribution
    MOT     ZZDEF_MOT     CHAR (key)     2     Mode of Transportation
    MATKL     MATKL     CHAR (key)     9     Material group
    SAKNR     SAKNR     CHAR     10     G/L Account Number
    KOSTL     KOSTL     CHAR     10     Cost Center
    This table gets updated manually by the FI team.
    Values for Distribution are:
    ‘1’  =  Primary Distribution to Refinery
    ‘2’ = Primary and Secondary– Excluding refinery
    All entries must be checked against SAP config and master tables
    User exit BADI BADI_SCD_ACCTG will be used to determine the correct G/L Account, Cost Center and Product Group based on Distribution and Mode of Transport. This BADI gets called only when a new Shipment Cost document get created.
    Once the BADI determined the new values it populates field c_vfkn-sakto with the G/L account, field c_vfkn-kostl with the Cost Center and exports the Product group to memory.
    There is no field on the Shipment Cost Document to store the Product group. Therefore another mechanism must be used to get the Product Group on the accounting document.
    Business Event 1120P can be used to import the Product group out of memory and put it on BSEG-MATNR. Structure BSEG_SUBST must be enhanced with field MATNR for this purpose.
    Function, Rules, Exits      Description of Functionality, Rules, Exits
    BADI_SCD_ACCTG     Business Add-In for Shipment Cost Account Assignment
    Business Framework     Business Event 1120P can be used to import the Product Group from memory and to populate field BSEG_SUBST-MATNR.
    This event gets called from different places. It needs to be ensured that it only populates the value when it was called from BADI_SCD_ACCTG.
    Custom Table     A look-up Table needs to be maintained for Distribution, Mode of Transport, G/L Account, Cost Center and Material Group
    Transaction code     To maintain the new table
    Append Structure     To enhance structure BSEG_SUBST with MATNR
          Business Add-In BADI_SCD_ACCTG can be used to determine the account assignments for a shipment cost item to set the G/L Account and Cost Center. All data needed to determine the new information gets provided in this BADI.
    Logic:
    •     Determine if STO or SO based on Document Category from internal table I_REFOBJ-VTRLP field VGTYP If is C then Distribution type is Sales Order (Primary and Secondary – Excluding Refinery – ‘2’ ) else we need to check the receiving plant. If the receiving plant (I_REFOBJ-VTRLK field WERKS) is a refinery the Distribution type is Primary (1) else it’s a (Primary and Secondary – Excluding Refinery – ‘2’ ). Refineries can be identified via Function Module Z_M_GET_PLANTCLASSIFICATION. The plant must be passed into Import Parameter IP_SAPPLANT and field INT_PLANTCHAR-ATNAM must be looked up with value SAPTYPE. If it exists and field ATWRT contains ‘RFY’, the plant is a refinery.
    •     Product Group can be determined from the Material master through Material group field MARA-MATKL.
    •     Mode of Transport will be passed in the BADI in VTRLK-OIC_MOT.
    •     Select single entry from table ZTABLE1based on Distribution, Mode of Transport and Material Group. If nothing gets selected, error message ‘No entry exists in table ZTABLE1for Distribution (distribution), MOT (MOT) & Mat. Group (material group)’ should be triggered.
    •     Move ZTABLE1-SAKNR  to c_vfkn-sakto and ZTABLE1-KOSTL to c_vfkn-kostl
    •     The Material group must be exported to memory in BADI_SCD_ACCTG
    •     The Material group must be imported from memory in Business Event BP1120P
    •     Free Memory in Business Event BP1120P
    This is VI01 – Creation of Freight Cost Item screen

    check the reply of ur Same Post .
    regards
    prabhu

  • Pls...help...printing the whole delivery order...very very urgent

    Can anybody help me in this code.
    I would like to print out delivery order,but when i printed,it just printed out the whole delivery order in the bottom of A4 paper.Can anybody modify the source code and give me proper one?
    I would it to fit on A4 paper.
    These are the soource code,Pls help,it's very urgent.Thanks for any help.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.table.*;
    import java.sql.*;
    import java.net.*;
    import java.io.*;
    import java.util.*;
    import java.awt.print.*;
    import java.awt.geom.*;
    public class ConfirmDeliveryOrderDialog extends JDialog implements ActionListener,Printable
    private ResultSetTableModel retrieveDOInfoModel;
    private JTable newDOTable;
    private JScrollPane newDOSp;
    private JLabel comT1,comT2,comT3,doT,doID,doIDNo,receivedDate,actualReceivedDate,deliveryTo,deliveryToCustomerInfo,
    companyAddress,companyAddressInfo,tel,telNo,dispatchDate,actualDispatchDate,total,totalQuantity,
    inputTotalQuantity,totalKg,inputTotalKg,remark,inputRemark;
    private Line2D line,line1;
    private Graphics2D g;
    private Container cp;
    private JButton printBtn,exitBtn;
    private Connection con;
    private Statement retrieveDOInfoStmt;
    private ResultSet retrieveDOInfoRs;
    int quan,Kg;
    boolean centered = true;
    public ConfirmDeliveryOrderDialog(JDialog parent)
    super(parent,"New Delivery Order",true);
    try
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    con = Laundry.getConnection();
    retrieveDOInfoStmt = con.createStatement();
    String retrieveDOInfo = "SELECT ItemName,ItemTypeName,WashingType,CleaningType,ItemCategory,QuantityOrKg AS [Quantity/Kg] " +
    "FROM DoDetail,DOInfo " +
    "WHERE DODetail.DOID = DOInfo.DOID " +
    "AND DOInfo.CompanyID = " + Laundry.companyDetails.get(0) +
    "AND DODetail.DOID = " + EnterDeliveryOrderNumberDialog.DOInfo.get(0);
    retrieveDOInfoRs = retrieveDOInfoStmt.executeQuery(retrieveDOInfo);
    if(Laundry.SCROLLABLE)
    retrieveDOInfoModel = new ScrollingResultSetTableModel(retrieveDOInfoRs);
    else
    retrieveDOInfoModel = new CachingResultSetTableModel(retrieveDOInfoRs);
    newDOTable = new JTable(retrieveDOInfoModel);
    newDOSp = new JScrollPane(newDOTable);
    newDOTable.getTableHeader().setReorderingAllowed(false);
    newDOTable.setPreferredScrollableViewportSize(new Dimension(550,350));
    retrieveDOInfoStmt.close();
    con.close();
    cp = getContentPane();
    cp.add(newDOSp, BorderLayout.CENTER);
    catch(SQLException ext)
    JOptionPane.showMessageDialog(null,"SQL Exception:","ERROR",JOptionPane.ERROR_MESSAGE);
    while (ext != null)
    JOptionPane.showMessageDialog(null,"SQL State:" + ext.getSQLState() + "\nMessage:" + ext.getMessage() + "\nVendor:" + ext.getErrorCode(),"ERROR",JOptionPane.ERROR_MESSAGE);
    ext = ext.getNextException();
    catch(ClassNotFoundException ex)
    JOptionPane.showMessageDialog(null,"Exception:" + ex,"ERROR",JOptionPane.ERROR_MESSAGE);
    ex.printStackTrace();
    catch(Exception e)
    JOptionPane.showMessageDialog(null,"Exception:" + e,"ERROR",JOptionPane.ERROR_MESSAGE);
    try
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    con = Laundry.getConnection();
    retrieveDOInfoStmt = con.createStatement();
    String retrieveDOInfo = "SELECT SUM(QuantityOrKg) AS [Total Quantity] " +
    "FROM DOInfo,DODetail " +
    "WHERE DOInfo.DOID = DODetail.DOID " +
    "AND DOInfo.CompanyID = " + Laundry.companyDetails.get(0) +
    "AND DODetail.DOID = " + EnterDeliveryOrderNumberDialog.DOInfo.get(0) +
    "AND ItemCategory = 'Piece' " +
    "GROUP BY DODetail.DOID ";
    retrieveDOInfoRs = retrieveDOInfoStmt.executeQuery(retrieveDOInfo);
    while(retrieveDOInfoRs.next())
    quan = retrieveDOInfoRs.getInt("Total Quantity");
    retrieveDOInfoStmt.close();
    con.close();
    catch(SQLException ext)
    JOptionPane.showMessageDialog(null,"SQL Exception:","ERROR",JOptionPane.ERROR_MESSAGE);
    while (ext != null)
    JOptionPane.showMessageDialog(null,"SQL State:" + ext.getSQLState() + "\nMessage:" + ext.getMessage() + "\nVendor:" + ext.getErrorCode(),"ERROR",JOptionPane.ERROR_MESSAGE);
    ext = ext.getNextException();
    catch(ClassNotFoundException ex)
    JOptionPane.showMessageDialog(null,"Exception:" + ex,"ERROR",JOptionPane.ERROR_MESSAGE);
    ex.printStackTrace();
    catch(Exception e)
    JOptionPane.showMessageDialog(null,"Exception:" + e,"ERROR",JOptionPane.ERROR_MESSAGE);
    try
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    con = Laundry.getConnection();
    retrieveDOInfoStmt = con.createStatement();
    String retrieveDOInfo = "SELECT SUM(QuantityOrKg) AS [Total Kg] " +
    "FROM DOInfo, DODetail " +
    "WHERE DOInfo.DOID = DODetail.DOID " +
    "AND DODetail.DOID = " + EnterDeliveryOrderNumberDialog.DOInfo.get(0) +
    "AND DOInfo.CompanyID = " + Laundry.companyDetails.get(0) +
    "AND ItemCategory = 'Kg' " +
    "GROUP BY DODetail.DOID ";
    retrieveDOInfoRs = retrieveDOInfoStmt.executeQuery(retrieveDOInfo);
    while(retrieveDOInfoRs.next())
    Kg = retrieveDOInfoRs.getInt("Total Kg");
    retrieveDOInfoStmt.close();
    con.close();
    catch(SQLException ext)
    JOptionPane.showMessageDialog(null,"SQL Exception:","ERROR",JOptionPane.ERROR_MESSAGE);
    while (ext != null)
    JOptionPane.showMessageDialog(null,"SQL State:" + ext.getSQLState() + "\nMessage:" + ext.getMessage() + "\nVendor:" + ext.getErrorCode(),"ERROR",JOptionPane.ERROR_MESSAGE);
    ext = ext.getNextException();
    catch(ClassNotFoundException ex)
    JOptionPane.showMessageDialog(null,"Exception:" + ex,"ERROR",JOptionPane.ERROR_MESSAGE);
    ex.printStackTrace();
    catch(Exception e)
    JOptionPane.showMessageDialog(null,"Exception:" + e,"ERROR",JOptionPane.ERROR_MESSAGE);
    comT1 = new JLabel("Deluxe Laundry Sdn Bhd");
    comT1.setFont(new Font("Sanserif",Font.BOLD,12));
    comT2 = new JLabel("Lot 1641, Jln Sungai Tua, Batu Caves, 68100 Selangor Darul Ehsan");
    comT2.setFont(new Font("Sanserif",Font.PLAIN,10));
    comT3 = new JLabel("Tel : 03-61863093 03-61863091 Fax : 03-61863096");
    comT3.setFont(new Font("Sanserif",Font.PLAIN,10));
    Box comBox = Box.createVerticalBox();
    comBox.add(Box.createVerticalStrut(5));
    comBox.add(comT1);
    comBox.add(Box.createVerticalStrut(2));
    comBox.add(comT2);
    comBox.add(Box.createVerticalStrut(2));
    comBox.add(comT3);
    comBox.add(Box.createVerticalStrut(2));
    Box comNBox = Box.createHorizontalBox();
    comNBox.add(Box.createHorizontalStrut(10));
    comNBox.add(comBox);
    comNBox.add(Box.createHorizontalStrut(300));
    //line = new Line2D.Float();
    //line.setLine(10,50,600,50);
    //Graphics2D dfl = (Graphics2D)g;
    //dfl.drawLine(10,50,600,50);
    doT = new JLabel("Delivery Order");
    doT.setFont(new Font("Sanserif",Font.BOLD,17));
    doID = new JLabel("DO ID : ");
    doID.setFont(new Font("Sanserif",Font.BOLD,12));
    doIDNo = new JLabel("");
    doIDNo.setText("" + EnterDeliveryOrderNumberDialog.DOInfo.get(0));
    doIDNo.setFont(new Font("Sanserif",Font.PLAIN,12));
    receivedDate = new JLabel("Received Date : ");
    receivedDate.setFont(new Font("Sanserif",Font.BOLD,12));
    actualReceivedDate = new JLabel("");
    actualReceivedDate.setText("" + EnterDeliveryOrderNumberDialog.DOInfo.get(1));
    actualReceivedDate.setFont(new Font("Sanserif",Font.PLAIN,12));
    JPanel jp = new JPanel();
    jp.setLayout(new GridLayout(2,3));
    jp.add(doID);
    jp.add(doIDNo);
    jp.add(receivedDate);
    jp.add(actualReceivedDate);
    Box doBox = Box.createHorizontalBox();
    doBox.add(Box.createHorizontalStrut(200));
    doBox.add(doT);
    doBox.add(Box.createHorizontalStrut(50));
    doBox.add(jp);
    doBox.add(Box.createHorizontalStrut(100));
    //line1 = new Line2D.Float();
    //line1.setLine(10,0,600,0);
    //Graphics2D df2 = (Graphics2D)g;
    //df2.drawLine(10,100,600,100);
    deliveryTo = new JLabel("Delivery To :");
    deliveryTo.setFont(new Font("Sanserif",Font.BOLD,12));
    deliveryToCustomerInfo = new JLabel("");
    deliveryToCustomerInfo.setText("" + Laundry.companyDetails.get(1));
    deliveryToCustomerInfo.setFont(new Font("Sanserif",Font.PLAIN,12));
    Box deliveryToBox = Box.createHorizontalBox();
    deliveryToBox.add(Box.createHorizontalStrut(10));
    deliveryToBox.add(deliveryTo);
    deliveryToBox.add(Box.createHorizontalStrut(10));
    deliveryToBox.add(deliveryToCustomerInfo);
    deliveryToBox.add(Box.createHorizontalStrut(500));
    companyAddress = new JLabel("");
    companyAddress.setFont(new Font("Sanserif",Font.BOLD,12));
    companyAddressInfo = new JLabel("");
    companyAddressInfo.setText("" + Laundry.companyDetails.get(2));
    companyAddressInfo.setFont(new Font("Sanserif",Font.PLAIN,12));
    Box companyAddressBox = Box.createHorizontalBox();
    companyAddressBox.add(Box.createHorizontalStrut(98));
    companyAddressBox.add(companyAddress);
    companyAddressBox.add(Box.createHorizontalStrut(10));
    companyAddressBox.add(companyAddressInfo);
    companyAddressBox.add(Box.createHorizontalStrut(500));
    tel = new JLabel("Tel :");
    tel.setFont(new Font("Sanserif",Font.BOLD,12));
    telNo = new JLabel("");
    telNo.setText("" + '0'+Laundry.companyDetails.get(3));
    telNo.setFont(new Font("Sanserif",Font.PLAIN,12));
    Box telBox = Box.createHorizontalBox();
    telBox.add(Box.createHorizontalStrut(10));
    telBox.add(tel);
    telBox.add(Box.createHorizontalStrut(10));
    telBox.add(telNo);
    telBox.add(Box.createHorizontalStrut(500));
    dispatchDate = new JLabel("Dispatch Date :");
    dispatchDate.setFont(new Font("Sanserif",Font.BOLD,12));
    actualDispatchDate = new JLabel("");
    actualDispatchDate.setText("" + EnterDeliveryOrderNumberDialog.DOInfo.get(2));
    actualDispatchDate.setFont(new Font("Sanserif",Font.PLAIN,12));
    Box dispatchBox = Box.createHorizontalBox();
    dispatchBox.add(Box.createHorizontalStrut(10));
    dispatchBox.add(dispatchDate);
    dispatchBox.add(Box.createHorizontalStrut(10));
    dispatchBox.add(actualDispatchDate);
    dispatchBox.add(Box.createHorizontalStrut(500));
    remark = new JLabel("Remark :");
    remark.setFont(new Font("Sanserif",Font.BOLD,12));
    inputRemark = new JLabel("");
    inputRemark.setText("" + EnterDeliveryOrderNumberDialog.DOInfo.get(3));
    inputRemark.setFont(new Font("Sanserif",Font.PLAIN,12));
    Box remarkBox = Box.createHorizontalBox();
    remarkBox.add(Box.createHorizontalStrut(10));
    remarkBox.add(remark);
    remarkBox.add(Box.createHorizontalStrut(10));
    remarkBox.add(inputRemark);
    remarkBox.add(Box.createHorizontalStrut(500));
    Box infoBox = Box.createVerticalBox();
    infoBox.add(Box.createVerticalStrut(5));
    infoBox.add(deliveryToBox);
    infoBox.add(Box.createVerticalStrut(5));
    infoBox.add(companyAddressBox);
    infoBox.add(Box.createVerticalStrut(5));
    infoBox.add(telBox);
    infoBox.add(Box.createVerticalStrut(5));
    infoBox.add(dispatchBox);
    infoBox.add(Box.createVerticalStrut(5));
    infoBox.add(remarkBox);
    infoBox.add(Box.createVerticalStrut(5));
    Box northBox = Box.createVerticalBox();
    northBox.add(Box.createVerticalStrut(5));
    northBox.add(comNBox);
    northBox.add(Box.createVerticalStrut(5));
    northBox.add(doBox);
    northBox.add(Box.createVerticalStrut(5));
    northBox.add(infoBox);
    northBox.add(Box.createVerticalStrut(5));
    Shape firstShape = new Rectangle(350,100,10,5);
    //Font font = new Font("Sanserif",Font.PLAIN,5);
    String text = "Checked By";
    //g.drawString(text,365,105);
    //g.setFont(new Font("Sanserif",Font.PLAIN,5));
    //g.fill(firstShape);
    //g.draw(firstShape);
    //Box joinBox = Box.createHorizontalBox();
    //joinBox.add(northBox);
    //joinBox.add(Box.createHorizontalStrut(10));
    //joinBox.add(g);
    printBtn = new JButton("Print");
    printBtn.addActionListener(this);
    exitBtn = new JButton("Exit");
    exitBtn.addActionListener(this);
    JPanel jp3 = new JPanel();
    jp3.add(printBtn);
    jp3.add(exitBtn);
    total = new JLabel("Total");
    totalQuantity = new JLabel("Quantity");
    totalQuantity.setFont(new Font("Sanserif",Font.PLAIN,12));
    inputTotalQuantity = new JLabel("");
    inputTotalQuantity.setFont(new Font("Sanserif",Font.PLAIN,12));
    inputTotalQuantity.setText("" + quan);
    totalKg = new JLabel("Kg");
    totalKg.setFont(new Font("Sanserif",Font.PLAIN,12));
    inputTotalKg = new JLabel("");
    inputTotalKg.setFont(new Font("Sanserif",Font.PLAIN,12));
    inputTotalKg.setText("" + Kg);
    Box totalBox = Box.createHorizontalBox();
    totalBox.add(Box.createHorizontalStrut(270));
    totalBox.add(total);
    totalBox.add(Box.createHorizontalStrut(50));
    totalBox.add(totalQuantity);
    totalBox.add(Box.createHorizontalStrut(50));
    totalBox.add(inputTotalQuantity);
    totalBox.add(Box.createHorizontalStrut(30));
    totalBox.add(totalKg);
    totalBox.add(Box.createHorizontalStrut(50));
    totalBox.add(inputTotalKg);
    totalBox.add(Box.createHorizontalStrut(30));
    Box southBox = Box.createVerticalBox();
    southBox.add(Box.createVerticalStrut(10));
    southBox.add(totalBox);
    southBox.add(Box.createVerticalStrut(5));
    southBox.add(jp3);
    cp = getContentPane();
    cp.add(northBox, BorderLayout.NORTH);
    cp.add(southBox, BorderLayout.SOUTH);
    setSize(600,400);
    setLocation(100,100);
    public void actionPerformed(ActionEvent ae)
    if(ae.getSource() == printBtn)
    PageFormat page = new PageFormat();
    Paper paper = new Paper();
    paper.setSize(595.275590551181,841.8897637795276);
    paper.setImageableArea(70.8661417322835,70.8661417322835,453.5433070866141,700.1574803149607);
    page.setPaper(paper);
    page.setOrientation(PageFormat.PORTRAIT);
    PrinterJob printJob = PrinterJob.getPrinterJob();
    if(page == null)
    page = printJob.defaultPage();
    printJob.setPrintable(this,page);
    if(printJob.printDialog())
    try
    printJob.print();
    setVisible(false);
    JOptionPane.showMessageDialog(null,"Please Generate Normal Or Express JobList","JobList",JOptionPane.INFORMATION_MESSAGE);
    catch(PrinterException e)
    JOptionPane.showMessageDialog(this,e);
    else if(ae.getSource() == exitBtn)
    EnterDeliveryOrderNumberDialog.removeDOInfo();
    setVisible(false);
    public int print(Graphics g, PageFormat pf, int page) throws PrinterException
    if(page >= 1)
    return Printable.NO_SUCH_PAGE;
    Graphics2D g2 = (Graphics2D)g;
    g2.translate(pf.getImageableX(), pf.getImageableY());
    if(centered)
    g2.translate(pf.getImageableWidth(), pf.getImageableHeight());
    Dimension d = getSize();
    double scale = Math.min(pf.getImageableWidth() / d.width, pf.getImageableHeight() / d.height);
    if (scale < 1.0)
    g2.scale(scale, scale);
    if (centered)
    g2.translate(-d.width, -d.height);          
    paint(g2);
    return Printable.PAGE_EXISTS;

    Hi Thanx, your code helped. I have got another question. How do i implement a method from another method class into the applet. say, i want to implemen set frequency from the below code into my applet you wrote above?
    class Histogram
         int frequency[];
         String alphabet;
         Histogram(String alphabet)
              this.alphabet=alphabet;
              frequency=new int[alphabet.length()];
         void scan(String message)
              for(int i=0;i<message.length;i++)
                   frequncy[alphabet.IndexOf(message.charAt(i))]++;
         void setfrequency(int frequency[])
              for(int i=0;i<alphabet.length;i++)
              this.frequency=frequency[i];
         double entropy()
              int total=0;
              double probablity;
              log2=Math.log(2.0);
              for(int i=0;i<alphabet.length;i++)
                   total+=freguency[i];

Maybe you are looking for

  • How can I change the location of my movie folder

    Hello,  I just consolidated two mac computers into one mac mini.  Now both my wife and I want to share the same actual computer (new mac mini) and share media folders so we are not duplicating photo imports and movies.  I figured out how to map the i

  • Accessing mySQL database from Labview PDA

    Hi, Has anyone tried writing data to a mySQL database or any other database for that matter using the Labview PDA module?  I know it's easy to do from Labview and you have to download the ODBC drivers to get it working but I don't think these drivers

  • HELP:  After software update many software cannot open

    yesterday I make sure I have fully complete the software update then after restart finished after that shut down. But now I aware many softwares cannot open such as safari, dict, app store, dashboard as well as the software update. I have restart my

  • Improvement suggestion for java.lang.Iterable

    The current design limits each container to one collection. Wouldn't it be better to define java.lang.Iterable as interface Iterable<T> { Iterator<T> iterator(Class<T> class) Then a conainer could hold multiple collections, as long as each collection

  • Compate Dates

    I want to compare two dates. Say Purchase Date and Manufacturing Date, If the difference between purchase date is more than 100 days from the manufacturing date, it should return true else false. I tried with creating 2 Date Objects and then comparin