DIFFERENCE BETWEEN TECO AND CLOSED
What is the difference between teco and closed?
Dear Debasish,
check this.
<u><b>For TECO Status:</b></u>
The following actions are executed if an order is set to Technically complete.
The order is not relevant for MRP planning
Reservations are deleted
Capacity requirements are deleted
Purchase requisitions for external operations or non-stock materials are deleted
The order and its operations receive the system status Technically Completed (TECO)
If an order is technically complete, you cannot change it. The fields in the order
are displayed but cannot be changed. You can however cancel technical
completion, for instance if order data has to be changed.
<u><b>For Closed Status:</b></u>
The Closed (CLSD) status has been introduced in the production order. It has the following characteristics:
No more costs can be posted to the order, that is, confirmations and goods movements are no longer permitted for the order.
The order can no longer be changed. Exceptions to this are revoking the CLSD status and setting the deletion flag.
All actions relating to the status technically completed (TECO) are executed.
In a collective order, the CLSD status is also set for subordinate orders.
If the system comes across an order in the collective order that cannot be closed, the orders that come between this order and the leading order are also not closed. Other subtrees are closed if they only contain orders that can be closed.
Check this links for further understanding
<u><a href="http://help.sap.com/saphelp_erp2005/helpdata/en/a5/63198843a211d189410000e829fbbd/frameset.htm">closed status</a></u>
<u><a href="http://help.sap.com/saphelp_erp2005/helpdata/en/a5/63198843a211d189410000e829fbbd/frameset.htm">TECO</a></u>
Regards
Mangal
Similar Messages
-
What is the difference between TECO and Order settlement?
What is the diff. between TECO and order settlement and what is the use of both?
Hi,
Technical completion means ending a production order from a logistical viewpoint. This function is usually used, if the execution of an order has to be stopped prematurely or if the order could not be executed in the required manner and open requirements for the order (reservations, capacities) should be deleted.
Where as Settlement of an order is carried out periodically to settle the costs related to the order to a settlement receiver.
for more details read
http://help.sap.com/saphelp_46b/helpdata/en/a9/ab7422414111d182b10000e829fbfe/frameset.htm
and
http://help.sap.com/saphelp_46b/helpdata/en/a3/664a3397e311d1b5a70000e8359890/frameset.htm
Regards,
Sumeet -
Difference between TECO and CLSD in internal order/WBS
Hi friends,
Can anyone please tell me what is the difference between These two status TECO[Technically Complete] and CLSD [Closed] in internal order/WBS elements.
Thanks
WilsonHi,
Good morning and greetings,
The term TECO stands for Technically Completed and this status is activated to do month end settlements to the IO so that costs accumulated till that point would be compared against the planned cost and would be settled for difference... The TECO status would be revoked after the month end to continue for further collecting of costs and would be settled finally...Once you invoke the status CLSD the system will not allow you to post any more further postings to the internal order.
Please reward points if found useful
Thanking you
With kindest regards
Ramesh Padmanabhan -
Blends: Difference between open and closed paths modifying spine
Okay, just had a discovery today about the blend tool.
The difference between closed paths and open paths is critical when you want to modify a blend spine, such as make it curve. Between open paths, there is no spine shown when a blend is created. Ever notice this? Between closed paths, there is a spine, which can be modified, such as making it curved. Now, the trick is how to modify a spine with open paths when there is no spine shown. Found out today that starting with a closed path, segments can be deleted to make the path open, then the spine can be modified and the open path state maintained!
This is a huge bug in Illustrator and makes no sense to me. Wanting Adobe to fix this in the next major release. Hope this helps anyone struggling with this issue.One thing you should be aware of concerning open ended splines:
It makes an enormous difference as to how the blend behaves whether the endpoints have handles or not.
Give them handles and you will find that you can alter the distribution of the blend objects just by adjusting the handles or by dragging on the spline itself.
Give it a try. -
DIFFERENCE BETWEEN TECO AND LOCK
Will u kindly tell me the difference between Technically Complete(TECO) and Locking
Dear Mr.Deabsish,
Check this content which's taken from sap.help
<b>Technical completion</b> means ending a production order from a logistical viewpoint. This function is usually used, if the execution of an order has to be stopped prematurely or if the order could not be executed in the required manner and open requirements for the order (reservations, capacities) should be deleted.
<b>Prerequisites</b>
The Technically complete function must be allowed for the operation, that is, it cannot be disallowed due to a system or user status.
<b>The following actions are executed if an order is set to Technically complete.
The order is not relevant for MRP planning
Reservations are deleted
Capacity requirements are deleted
Purchase requisitions for external operations or non-stock materials are deleted
The order and its operations receive the system status Technically Completed (TECO)</b>
If an order is technically complete, you cannot change it. The fields in the order are displayed but cannot be changed. You can however cancel technical completion, for instance if order data has to be changed.
After technical completion you can still make postings for the order. For instance, material withdrawal or a confirmation can be posted if they were previously forgotten.
<b>Activities</b>
You can execute this function in two ways:
When you are changing an order, choose Functions - Restrict processing - Technically complete.
Technically complete is a function that you can use in mass processing.
You can reverse technical completion as follows:
When you are changing an order, choose Functions - Restrict processing - Revoke technical completion.
<b>Reward points & close this thread.</b>
Regards
Mangal -
GL balances differences between Year end closing and opening balances
Hi friends,
One GL account balances showing differences between year end closing & year opening balances.
Example: 2006 closing balance is 250000 $
2007 opening balance is 150000 $
difference is 100000 $ . why should coming like this. already completed balances carryforward (F.16) in 2006 & 2007 year.
any programe for this solution ?
One more point is just 2 days back i posted 2 entries for 2006 year equal to 100000 $ . after this entries shall we need go for F.16 (carry forwarded balances).
please do the needful. It is very urgant issue.
RajHI,
There shouldn't be any more postings to a GL Account once Balance carry forward has been executed.
If postings have been made then you should execute the Balance carry forward again, otherwise you will see difference in opening and closing GL balance (as mentioned by you).
Regards -
Difference between techo and close order
Dear all
plz tell what is a difference between techo and close production order
guide me
Rgds
SDB
Edited by: surendra patil on Aug 21, 2008 12:18 PMTECO means ending a production order from a logistical viewpoint. This function is usually used, if the execution of an order has to be stopped prematurely or if the order
could not be executed in the required manner and open requirements for the order (reservations,capacities) should be deleted.
The following actions are executed if an order is set to TECO:
· The order is not relevant for MRP planning
· Reservations are deleted
· Capacity requirements are deleted
· Purchase requisitions for external operations or non-stock materials are deleted
· The order and its operations receive the system status (TECO)
If an order is technically complete, you cannot change it. The fields in the order are displayed but
cannot be changed. You can however cancel technical completion, for instance if order data has
to be changed.
After technical completion you can still make posting for order.
For instance,material withdrawal or a confirmation can be posted if they were previously forgotten.
*Closed Order :
*The Closed (CLSD) status has been introduced in the production order. It has the following
characteristics:
· No more costs can be posted to the order, that is, confirmations and goods movements are
no longer permitted for the order.
· The order can no longer be changed. Exceptions to this are revoking the CLSD status and
setting the deletion flag.
· All actions relating to the status technically completed are executed
· In a collective order, the CLSD status is also set for subordinate orders.
· If the system comes across an order in the collective order that cannot be closed, the orders
that come between this order and the leading order are also not closed. Other subtrees are
closed if they only contain orders that can be closed.
Regards,
Hrishi. -
ABST2 - Differences between Assets and G/L accts
Hi Experts
We are working on ECC 6.0 and INR is our local currency.
At the end of FY 2007 by mistake direct postings were made to Dep Fund Account which is a Recon a/c and FY 2007 was closed
And because of which FI-GL and FI-AA doesnt match by INR 37353.71 (amt posted in above doc) as shown in ABST2
I've referred SAP notes 104567 & 69225 and found the note 69225 relevant to follow as the difference has not resulted in the current or open years.
So we have passed direct entry which is exactly the reversal of entry posted above using ABF1 (INR -37353.71)
After posting the 2nd document, in ABST2 another line has appeared of INR -37353.71. Although the sum for my recon GL is now zero.
The output of ABST2 is as below now -
Sc Acct no. BusA Year SG 1st local difference LCurr Doc.no. Period
AS 31100 2009 37,353.71- INR W004
AS 31100 2009 37,353.71 INR W004 999
When I come out of ABST2 , addition to 1st, error no 2 is also coming which I thought would disappear.
1.Differences between assets and G/L accts in the balance carried forward
Message no. MQ555
2.Differences between assets and G/L accounts at the key date
Message no. MQ557
Is still something else needs to be done?
Or can I move ahead as the summation of the difference is now zero?
Please suggest.
KapilWe referred to SAP and they suggeted that the tagging of W004 in both the lines means that now there is no error even system prompts it as error.
So we continued with the transactions and after closing the FY 2009, today when we run ABST2, we dont get any error messages as there is no difference left between Assets & GL. -
Difference Between Shutdown and Close Database
Hi all,
Let say I want to start the instance of database with the following processes :
1. STARTUP MOUNT
2. ALTER DATABASE OPEN
With two commands above, now the database is open. Then, I want to close the database with command :
3. ALTER DATABASE CLOSE
After this, I want to reopen the database again by using this :
4. ALTER DATABASE OPEN
I know that it will produce an error because when the database is opened and closed, its lifetime has already ended, so we must shutdown it first.
My questions are :
1. What's the difference between CLOSE and SHUTDOWN ? Suppose in the case above, I want to close the database. Why don't I just type SHUTDOWN ? Why is it necessary for me to use command CLOSE instead of SHUTDOWN ?
2. What are the conditions of database when I CLOSE database, also, what are the conditions of database when I SHUTDOWN database ? I want to know more detail because I have tried to find in google, but now satisfying result
Thanks before
Edited by: cycon on Nov 8, 2010 9:00 AMalter database close;this you can execute only from OPEN status
when ever you close the database it will go to mount status here you cannot open the database again, you need to clean sutdown and need to startup.
alter database open;ths you can execute only on MOUNT status, it will takes you to mount --> open status.
Thanks -
Differences between LSMW and BDC
Hi All
Please can you give me the few points about the differences between LSMW and BDC?
Awaiting for your Responce
PraveenHai Check with the following document
GOOD
THERE IS THREE TYPE OF METHOD IN BDC
BDC SESSION
CALL TRANSACTION
CALL DIALOG
What is BDC or batch input
The Batch Input is a SAP technic that allows automating the input in transactions. It lies on a BDC (Batch Data Commands) scenario.
BDC functions:
· BDC_OPEN_GROUP : Opens a session group
· BDC_CLOSE_GROUP : Closes a session
· BDC_INSERT : Insert a BDC scenario in the session
· The ABAP statement "CALL TRANSACTION" is also called to run directly a transaction from its BDC table.
It runs the program RSBDCSUB in order to launch automatically the session. The session management is done through the transaction code SM35.
The object itself is maintanable through the transaction SE24.
BDC methods:
Method
Description
Parameters
OPEN_SESSION
Opens a session
SUBRC (Return Code 0 OK)
SESSIONNAME (Session to be created)
CLOSE_SESSION
Closes a session
None
RESET_BDCDATA
Resets the BDC Internal Table...
None. Normally, for internal purpose
BDC_DYNPRO
Handles a new screen
PROGNAME (Name of the program)
DYNPRONR (Screen Number)
BDC_FIELD
Puts a value on the screen
FIELDNAME (Name of the field)
FIELDVALUE (Value to be passed)
CONSTRUCTOR
Constructor - Initializes NO_DATA
NODATA (No data character). The constructor is called automatically when the object is created.
RUN_SESSION
Launches a session with RSBDCBTC
None
CALL_TRANSACTION
Calls a transaction with the current BDC Data
MODE (Display Mode)
UPDATE (Update Mode)
TCODE (Transaction to be called)
BDC_INSERT
Inserts the BDC scenario in the session
TCODE (Transaction to be called)
BDC techniques used in programs:
1) Building a BDC table and calling a transaction,
2) Building a session and a set of BDC scenarios and keeping the session available in SM35,
3) Building a session and lauching the transaction right after closing the session.
BDC using Call Transaction
BDC using Call transaction involves calling an SAP transaction in back ground from within the ABAP
program. The process involves building an Internal BDC table containing the screen information needed to
execute the required transaction and then passing this to the Call transaction command (See code example).
The full procedure for creating a BDC program is as follows:
What is the difference between batch input and call transaction in BDC?
Session method.
1) synchronous processing.
2) can tranfer large amount of data.
3) processing is slower.
4) error log is created
5) data is not updated until session is processed.
Call transaction.
1) asynchronous processing
2) can transfer small amount of data
3) processing is faster.
4) errors need to be handled explicitly
5) data is updated automatically
BATINPUT/DIRECT INPUT
A: Batch-inputs can not be used to fill the "delivery due list" screen because it is not a dynpro. This is a standard SAP report. A SAP report (check with "System -> Status") may be called using SUBMIT sentence with the appropriate options . It is preferred to call a report than create a Batch-input program.
GO THROUGH THIS LINK
http://www.guidancetech.com/people/holland/sap/abap/zzsni001.htm
The LSM Workbench is an SAP R/3 based tool that supports the one-time or periodic transfer of data from non-SAP systems ("legacy systems") to SAP systems.
The LSM Workbench helps you to organize your data migration project and guides you through the process by using a clear sequence of steps.
The most common conversion rules are predefined. Reusable conversion rules assure consistent data conversion for different data objects.
LSMW vs DX Workbench
The LSM Workbench covers the following steps:
Read the legacy data from one or several files (e.g. spreadsheet tables, sequential files).
Convert the data from source format to target format.
Import the data using standard interfaces (Batch Input, Direct Input, BAPI, IDoc).
Experiences made in successful implementation projects have shown that using the LSM Workbench significantly contributes to accelerating data migration.
SAP provides this tool along with documentation to customers and partners free of charge.
Users of the LSM Workbench receive the usual support via SAP Net - R/3 Frontend (component BC-SRV-DX-LSM).
Releases:
Version 1.7.2 of the LSM Workbench ("LSMW 1.7.2") available
Attention : LSMW 1.7.2 requires an SAP R/3 system with SAP R/3 4.0 or SAP R/3 4.5.
Version 1.8.0 of the LSM Workbench (1.21mb) ("LSMW 1.8.0") available
Attention : LSMW 1.8.0 requires an SAP R/3 system with SAP R/3 4.6.
Version 3.0 of the LSM Workbench (1.89mb) ("LSMW 3.0") available for Web Application Server 6.10
Attention : LSMW 3.0 requires a SAP WAS 6.10. Functionality of version 1.7.2 and 3.0 are identical !
Version 4.0 of the LSM Workbench ("LSMW 4.0") integrated in Web Application Server 6.20
Attention : LSMW 4.0 is an integrated part of SAP WAS 6.20.
Thanks & regards
Sreenivasulu P
Message was edited by: Sreenivasulu Ponnadi -
Differences between cookies and sessions
Hi there,
I want to learn the differences between sessions and cookies in PHP.Please help me.
Please let me know if there any video demonstrations that explain sessions and cookies.
Thanks in advance.Cookies and server side sessions are related in that they are both ways to persist data. This is required because of the fact that http is a stateless protocol, meaning that each request and response are independent transactions. Cookies are stored on the client. You might use them to store the contents of a shopping cart, or a user login id for a particular site. Or you could store a setting so that the user is automatically logged in, similar to what occurs here in the adobe site / forums. You can set various options for when cookies expire. Cookies that persist when the browser is closed are store in files, otherwise they could be store in memory only. Cookies can be created using either client or server side code.
Server side sessions are created on the server with a server side scripting language. A session id is generated and stored as a token on the client (in an in memory cookie) so that the server can track requests from the same originating client. Session variables are ways to store data related to the session on the server. Sessions use server resources which is why you should only use them when necessary and destroy them when done. When the session is destroyed, the session variables are gone so if you want to keep them for later you can store them in a database or store them in a cookie.
HTTP cookie - Wikipedia, the free encyclopedia
Hope that helps -
Difference between open_form and start_form
difference between open_form and start_form?
hi,
Any driver program must contain Open_Form, Close_Form and Write_Form. Other function modules are optional.
OPEN_FORM: This function module opens layout set printing. One must call this function module before he uses any of other layout set function modules like Write_Form, Start_Form, Control_Form etc., You need specify a layout set name in the export parameters of this function module. If nothing is passed to Open_Form then one should use Start_Form function module to open layout set before starting the output. The layout set opened by Open_Form should be closed by Close_Form function module, other wise output doesnt appear. We can use any number of Open_Form, Close_Form functions in one single program. But Close_Form must be there for every Open_Form in the program.
Some of the important export parameters we have to pass to Open_Form function module.
Form: Enter the Layout set name here, which then controls the output formatting. If nothing is specified then we must use Start_Form for opening layout set.
Language: Layout sets are Language dependent. Enter the desired language here. If the entered layout set is not in that language, then the function tries to open the Form entered in its original language. The default value is SY-LANGU.
Device: SAP Script can format a text on different device types. The device can be PRINTER or TELEX, TELEFAX, ABAP and SCREEN.
Dialog: Use parameter DIALOG to determine whether to display a dialog box before printing, in which the user can set several spool parameters for print formatting. Possible values: SPACE displays no print parameter screen. 'X' display print parameter screen. Default value: 'X'
Options: Use parameter OPTIONS to set several options for print formatting. The parameter has the structure ITCPO. The user can change some of the defined settings on the print control screen. The default value for Options is . We will discuss about ITCPO structure in detail later.
Other Export, Import and Exceptions are self-explanatory.
Start_Form: In-between the function modules OPEN_FORM and CLOSE_FORM, we can use different layout sets. This allows us to combine several different layout sets into one print output. However, we can combine only those layout sets that have the same page format. To switch layout sets, use the function module START_FORM. If another layout set is still open, we must close it first using END_FORM. If we specify no layout set name when calling START_FORM, the system restarts the last open layout set. If after OPEN_FORM no layout set was activated yet, the system leaves the function module with the exception UNUSED. Some of the important export parameters for this function module are
Form: The parameter contains the name of the layout set you want to use for printing. If you specify no layout set here, the system restarts the last active layout set.
Language: Layout sets are language-dependent. Enter the desired language here. If the layout set does not exist in this language, the system tries to call the layout set in its original language. If the parameter LANGUAGE is empty, the system uses the language of the last active layout set.
Startpage: Usually, SAP script starts with the page specified as start page in the layout set definition. If we want to start output with another layout set page, enter the name of the desired layout set page here. If the desired page is not defined, the system uses the start page defined in the layout set.
Program: To replace program symbols, SAP script must know which active program contains the work areas for the values to be passed. If we omit the parameter, the system searches for the field values in the program that was specified in the parameter OPTIONS (field TDPROGRAM) of OPEN_FORM. If we enter a program name, the system replaces the program symbols with the values from this program up to the next END_FORM.
Exceptions and other Export, Import parameters are self-explanatory.
Regards
Kiran Sure -
Activity System status: differences between u0093Openu0094 and u0093In processu0094 status
Dear Experts,
Whats the difference between Open and In process system status? In help.sap.com it: There are four system statuses that represent the life cycle of the business transaction:
Open: has been recently created and not yet processed (for example, contract from the Internet)
In process: administrator is clearing up questions
But, how does the system assumes the In Process status ?? Ive tested business activities creation with different employees assigned and, when editing and saving the business activities with these BPs the system status does not change.
However, in other unknown situations the status system is changed to in Process.
Any ideas about the meaning of the In Process status? And when the business activity switches to that?
Thanks in advance,
JoaoHi,
These four system statuses that represent the life cycle of the business transaction:
· Open: has been recently created and not yet processed (for example, contract from the Internet)
· In process: administrator is clearing up questions
· Released: contract is complete and legal. Follow-up processes can be started (printing, billing, distribution, releases and so on)
· Completed: All actions directly linked to contract are completed
· Closed: all actions indirectly linked to the contract are closed (for example, from R/3: batch run to actual costs)
Each status having its own control at the configuration level. If you observe the following process you may understand the importance of various statuses.
For example in any transaction by default status would be Open. Once the transaction opened by the respective responsible person he will change the status as In Process, Once the assigned task is completed he will change the status as Completed.
Please notice the configuration settings in the following navigation path:
SPRO->IMG->CRM->Transactions->Basic Functions->Status Management-> Change Status Profile for User Status->Select Quotation->Double click on the different status. You can observe the difference.
Hope I convinced.
Best Regards,
Johnny.
Reward if it helps. -
What is the difference between 1KEK and 2KEE
Hi
What is the difference between 1KEK and 2KEE2KEE is a report of Total Records but 1KEK is used to transfer the Balance Sheet AP and AR items at the period end closing to complete the PCtr Balance Sheet.
Regards,
Dave -
Differences between awt and swing
Ive written the following code, however Ive implemented the gui in awt rather then swing. Ive been told it hs too be in swing. What is the difference between swing and awt what will I need to change in my program so that its done using swing rather then the awt? Heres the code:
// pp.java
// Grant Brown
// 22/02/02
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.util.*;
import javax.swing.*;
// =========================================================
// Class: pp
// This class drives the customer manager. It contains the
// main method which gets called as soon as this application
// begins to run.
// =========================================================
class pp extends Frame implements ActionListener
// Container of customer objects
private Vector customers = new Vector (100);
// List of names component. (Must specify java.awt in
// front of List to distinguish the List class in the
// java.awt package from the List class in the java.util
// package.)
private java.awt.List names = new java.awt.List ();
// Delete and update button components.
private Button delete;
private Button update;
// Default constructor.
public pp ()
// Assign "Paper Round Manager" to title bar of frame window.
super ("Paper Round Manager");
// Add a listener that responds to window closing
// events. When this event occurs (by clicking on the
// close box in the title bar), save customers and exit.
addWindowListener (new WindowAdapter ()
public void windowClosing
(WindowEvent e)
saveCustomers ();
System.exit (0);
// Place an empty label in the north part of the frame
// window. This is done to correct an AWT positioning
// problem.
Label l = new Label ();
add ("North", l);
// Place the names component in the center part of the
// frame window.
add ("Center", names);
// Create a panel object to hold four buttons.
Panel p = new Panel ();
Button b;
// Add an Insert button to the Panel object and register
// the current pp object as a listener for button events.
p.add (b = new Button ("Insert"));
b.addActionListener (this);
// Add a Delete button to the Panel object and register
// the current pp object as a listener for button events.
p.add (delete = new Button ("Delete"));
delete.addActionListener (this);
// The Delete button should be disabled until there is at
// least one customer to delete.
delete.setEnabled (false);
// Add an Update button to the Panel object and register
// the current pp object as a listener for button events.
p.add (update = new Button ("Update"));
update.addActionListener (this);
// The Update button should be disabled until there is at
// least one customer to update.
update.setEnabled (false);
// Add a Finish button to the Panel object and register
// the current customer object as a listener for button events.
p.add (b = new Button ("Finish"));
b.addActionListener (this);
// Add the panel object to the frame window container.
add ("South", p);
// Set the background of the frame window container to
// lightGray
setBackground (Color.lightGray);
// Set the size of the frame window container to 400
// pixels horizontally by 200 pixels vertically.
setSize (400, 200);
// Allow the user to resize the frame window.
setResizable (true);
// Load all contacts.
loadCustomers ();
// Make sure that the frame window is visible.
setVisible (true);
public void actionPerformed (ActionEvent e)
if (e.getActionCommand ().equals ("Delete"))
delete ();
else
if (e.getActionCommand ().equals ("Finish"))
saveCustomers ();
System.exit (0);
else
if (e.getActionCommand ().equals ("Insert"))
insert ();
else
update ();
public Insets getInsets ()
// Return an Insets object that describes the number of
// pixels to reserve as a border around the edges of the
// frame window.
return new Insets (10, 10, 10, 10);
public static void main (String [] args)
// Create a new pp object and let it do its thing.
new pp ();
private void delete ()
// Obtain index of selected contact item from the names
// component.
int index = names.getSelectedIndex ();
// If no item was selected, index is -1. We cannot update
// a contact if no contact item in the names component was
// selected - because we would have nothing to work with.
if (index != -1)
// Remove the contact item from the names component.
names.remove (index);
// Remove the Customer object from the contacts Vector
// object.
customers.remove (index);
// If there are no more customers ...
if (customers.size () == 0)
delete.setEnabled (false);
update.setEnabled (false);
else
// Make sure that the first contact item in the names
// list is highlighted.
names.select (0);
private void insert ()
// Create an Insert data entry form to enter information
// for a new customer.
DataEntryForm def = new DataEntryForm (this, "Insert");
// If the bOk Boolean flag is set, this indicates the user
// exited the form by pressing the Ok button.
if (def.bOk)
// Create a Contact object and assign information from
// the form to its fields.
Customer temp = new Customer ();
temp.name = new String (def.name.getText ());
temp.publication = new String (def.publication.getText ());
temp.round = new String (def.round.getText ());
temp.address = new String (def.address.getText ());
temp.phone = new String (def.phone.getText ());
// Add a new customer item to the names component.
names.add (temp.name + ", " + temp.publication);
// Add the Customer object to the contacts Vector
// object.
customers.add (temp);
// Make sure that the Delete and Update buttons are
// enabled.
delete.setEnabled (true);
update.setEnabled (true);
// Destroy the dialouge box.
def.dispose ();
// Make sure that the first customer item in the names list
// is highlighted.
names.select (0);
// ===========================================================
// Load all contacts from contacts.dat into the contacts
// Vector object. Also, make sure that the last name/first
// name from each contact is combined into a String object and
// inserted into the names component - as a contact item.
// ===========================================================
private void loadCustomers ()
FileInputStream fis = null;
try
fis = new FileInputStream ("Customers.dat");
DataInputStream dis = new DataInputStream (fis);
int nCustomers = dis.readInt ();
for (int i = 0; i < nCustomers; i++)
Customer temp = new Customer ();
temp.name = dis.readUTF ();
temp.publication = dis.readUTF ();
temp.round = dis.readUTF ();
temp.address = dis.readUTF ();
temp.phone = dis.readUTF ();
names.add (temp.name + ", " + temp.publication);
customers.add (temp);
if (nCustomers > 0)
delete.setEnabled (true);
update.setEnabled (true);
catch (IOException e)
finally
if (fis != null)
try
fis.close ();
catch (IOException e) {}
// Make sure that the first contact item in the names list
// is highlighted.
names.select (0);
// ========================================================
// Save all Customer objects from the customer Vector object
// to customer.dat. The number of customerss are saved as an
// int to make it easy for loadCustomers () to do its job.
// ========================================================
private void saveCustomers ()
FileOutputStream fos = null;
try
fos = new FileOutputStream ("customers.dat");
DataOutputStream dos = new DataOutputStream (fos);
dos.writeInt (customers.size ());
for (int i = 0; i < customers.size (); i++)
Customer temp = (Customer) customers.elementAt (i);
dos.writeUTF (temp.name);
dos.writeUTF (temp.publication);
dos.writeUTF (temp.round);
dos.writeUTF (temp.address);
dos.writeUTF (temp.phone);
catch (IOException e)
MsgBox mb = new MsgBox (this, "PP Error",
e.toString ());
mb.dispose ();
finally
if (fos != null)
try
fos.close ();
catch (IOException e) {}
private void update ()
// Obtain index of selected customer item from the names
// component.
int index = names.getSelectedIndex ();
// If no item was selected, index is -1. We cannot update
// a customer if no customer item in the names component was
// selected - because we would have nothing to work with.
if (index != -1)
// Obtain a reference to the customer object (from the
// customers Vector object) that is associated with the
// index.
Customer temp = (Customer) customers.elementAt (index);
// Create and display an update entry form.
DataEntryForm def = new DataEntryForm (this, "Update",
temp.name,
temp.publication,
temp.round,
temp.address,
temp.phone);
// If the user pressed Ok...
if (def.bOk)
// Update the customer information in the customers
// Vector object.
temp.name = new String (def.name.getText ());
temp.publication = new String (def.publication.getText ());
temp.round = new String (def.round.getText ());
temp.address = new String (def.address.getText ());
temp.phone = new String (def.phone.getText ());
// Make sure the screen reflects the update.
names.replaceItem (temp.name + ", " + temp.publication,
index);
// Destroy the dialouge box.
def.dispose ();
// Make sure that the first customer item in the names
// list is highlighted.
names.select (0);Ive doen pretty much what you said burt now my program isnt working at all. The window comes up but instead of doing something when you click the button it just throws shit loads of exceptions. Heres my abridged code
// pp.java
// Grant Brown
// 22/02/02
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.util.*;
import javax.swing.*;
// =========================================================
// Class:PP
// This class drives the Paper Round manager. It contains the
// main method which gets called as soon as this application
// begins to run.
// =========================================================
class pp extends JFrame implements ActionListener
// Container of customer objects (one object per customer)
private Vector customers = new Vector (100);
// List of names component. (Must specify java.awt in
// front of List to distinguish the List class in the
// java.awt package from the List class in the java.util
// package.)
private java.awt.List names = new java.awt.List ();
// Delete and update button components.
private JButton delete;
private JButton update;
// Default constructor.
public pp ()
// Assign Contact Manager to title bar of frame window.
super ("Paper Round Manager");
// Add a listener that responds to window closing
// events. When this event occurs (by clicking on the
// close box in the title bar), save contacts and exit.
addWindowListener (new WindowAdapter ()
public void windowClosing
(WindowEvent e)
saveCustomers ();
System.exit (0);
// Place an empty label in the north part of the frame
// window. This is done to correct an AWT positioning
// problem. (One thing that you'll come to realize as
// you work with the AWT is that there are lots of bugs.)
JLabel l = new JLabel ();
getContentPane().add ("North", l);
// Place the names component in the center part of the
// frame window.
getContentPane().add ("Center", names);
// Create a panel object to hold four buttons.
JPanel p = new JPanel ();
JButton b;
// Add an Insert button to the Panel object and register
// the current cm object as a listener for button events.
p.add (b = new JButton ("Insert"));
b.addActionListener (this);
// Add a Delete button to the Panel object and register
// the current cm object as a listener for button events.
p.add (delete = new JButton ("Delete"));
delete.addActionListener (this);
// The Delete button should be disabled until there is at
// least one contact to delete.
delete.setEnabled (false);
// Add an Update button to the Panel object and register
// the current cm object as a listener for button events.
p.add (update = new JButton ("Update"));
update.addActionListener (this);
// The Update button should be disabled until there is at
// least one contact to update.
update.setEnabled (false);
// Add a Finish button to the Panel object and register
// the current cm object as a listener for button events.
p.add (b = new JButton ("Finish"));
b.addActionListener (this);
// Add the panel object to the frame window container.
getContentPane().add ("South", p);
// Set the background of the frame window container to
// lightGray (to give a pleasing effect).
setBackground (Color.lightGray);
// Set the size of the frame window container to 400
// pixels horizontally by 200 pixels vertically.
setBounds (50, 100, 400, 200);
// Do not allow the user to resize the frame window.
loadCustomers ();
// Load all contacts.
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// Make sure that the frame window is visible.
setVisible (true);
public void actionPerformed (ActionEvent e)
if (e.getActionCommand ().equals ("Delete"))
delete ();
else
if (e.getActionCommand ().equals ("Finish"))
saveCustomers ();
System.exit (0);
else
if (e.getActionCommand ().equals ("Insert"))
insert ();
else
update ();
public Insets getInsets ()
// Return an Insets object that describes the number of
// pixels to reserve as a border around the edges of the
// frame window.
return new Insets (10, 10, 10, 10);
public static void main (String [] args)
// Create a new cm object and let it do its thing.
new pp ();
private void delete ()
// Obtain index of selected customer item from the names
// component.
int index = names.getSelectedIndex ();
// If no item was selected, index is -1. We cannot update
// a contact if no contact item in the names component was
// selected - because we would have nothing to work with.
if (index != -1)
// Remove the customer item from the names component.
names.remove (index);
// Remove the Customer object from the contacts Vector
// object.
customers.remove (index);
// If there are no more customers ...
if (customers.size () == 0)
delete.setEnabled (false);
update.setEnabled (false);
else
// Make sure that the first contact item in the names
// list is highlighted.
names.select (0);
private void insert ()
// Create an Insert data entry form to enter information
// for a new contact.
DataEntryForm def = new DataEntryForm (this, "Insert");
// If the bOk Boolean flag is set, this indicates the user
// exited the form by pressing the Ok button.
if (def.bOk)
// Create a Customer object and assign information from
// the form to its fields.
Customer temp = new Customer ();
temp.name = new String (def.name.getText ());
temp.publication = new String (def.publication.getText ());
temp.address = new String (def.address.getText ());
temp.round = new String (def.round.getText ());
temp.phone = new String
(def.phone.getText ());
// Add a new customer item to the names component.
names.add (temp.publication + ", " + temp.address);
// Add the Customer object to the contacts Vector
// object.
customers.add (temp);
// Make sure that the Delete and Update buttons are
// enabled.
delete.setEnabled (true);
update.setEnabled (true);
// Destroy the dialog box.
def.dispose ();
// Make sure that the first customer item in the names list
// is highlighted.
names.select (0);
// ===========================================================
// Load all customers from customers.dat into the customers
// Vector object. Also, make sure that the last name/first
// name from each contact is combined into a String object and
// inserted into the names component - as a contact item.
// ===========================================================
private void loadCustomers ()
FileInputStream fis = null;
try
fis = new FileInputStream ("customers.dat");
DataInputStream dis = new DataInputStream (fis);
int nCustomers = dis.readInt ();
for (int i = 0; i < nCustomers; i++)
Customer temp = new Customer ();
temp.name = dis.readUTF ();
temp.publication = dis.readUTF ();
temp.address = dis.readUTF ();
temp.round = dis.readUTF ();
temp.phone = dis.readUTF ();
names.add (temp.publication + ", " + temp.address);
customers.add (temp);
if (nCustomers > 0)
delete.setEnabled (true);
update.setEnabled (true);
catch (IOException e)
finally
if (fis != null)
try
fis.close ();
catch (IOException e) {}
// Make sure that the first customer item in the names list
// is highlighted.
names.select (0);
// ========================================================
// Save all customer objects from the contacts Vector object
// to customers.dat. The number of contacts are saved as an
// int to make it easy for loadCustomers () to do its job.
// ========================================================
private void saveCustomers ()
FileOutputStream fos = null;
try
fos = new FileOutputStream ("customers.dat");
DataOutputStream dos = new DataOutputStream (fos);
dos.writeInt (customers.size ());
for (int i = 0; i < customers.size (); i++)
Customer temp = (Customer) customers.elementAt (i);
dos.writeUTF (temp.name);
dos.writeUTF (temp.publication);
dos.writeUTF (temp.address);
dos.writeUTF (temp.round);
dos.writeUTF (temp.phone);
catch (IOException e)
MsgBox mb = new MsgBox (this, "PP Error",
e.toString ());
mb.dispose ();
finally
if (fos != null)
try
fos.close ();
catch (IOException e) {}
private void update ()
// Obtain index of selected customer item from the names
// component.
int index = names.getSelectedIndex ();
// If no item was selected, index is -1. We cannot update
// a customer if no customer item in the names component was
// selected - because we would have nothing to work with.
if (index != -1)
// Obtain a reference to the Customer object (from the
// customer Vector object) that is associated with the
// index.
Customer temp = (Customer) customers.elementAt (index);
// Create and display an update entry form.
DataEntryForm def = new DataEntryForm (this, "Update",
temp.name,
temp.publication,
temp.address,
temp.round,
temp.phone);
// If the user pressed Ok...
if (def.bOk)
// Update the customer information in the customers
// Vector object.
temp.name = new String (def.name.getText ());
temp.publication = new String (def.publication.getText ());
temp.address = new String (def.address.getText ());
temp.round = new String (def.round.getText ());
temp.phone = new String (def.phone.getText ());
// Make sure the screen reflects the update.
names.replaceItem (temp.publication + ", " + temp.address,
index);
// Destroy the dialog box.
def.dispose ();
// Make sure that the first customer item in the names
// list is highlighted.
names.select (0);
// ========================================================
// Class: Customer
// This class describes the contents of a business customer.
// ========================================================
class Customer
public String name;
public String publication;
public String address;
public String round;
public String phone;
// ==========================================================
// Class: DataEntryForm
// This class provides a data entry form for entering customer
// information.
// ==========================================================
class DataEntryForm extends JDialog implements ActionListener
// bOk is a boolean flag. When true, it indicates that
// the Ok button was pressed to terminate the dialog box
// (as opposed to the Cancel button).
public boolean bOk;
// The following components hold the text that the user
// entered into the visible text fields.
public JTextField name;
public JTextField publication;
public JTextField address;
public JTextField round;
public JTextField phone;
public void actionPerformed (ActionEvent e)
// If the user pressed the Ok button, indicate this
// by assigning true to bOk.
if (e.getActionCommand ().equals ("Ok"))
bOk = true;
// Destroy the dialog box and return to the point
// just after the creation of the DataEntryForm object.
dispose ();
public DataEntryForm (JFrame parent, String title)
// Call the other constructor. The current constructor
// is used for insert operations. The other constructor
// is used for update operations.
this (parent, title, "", "", "", "", "");
public DataEntryForm (JFrame parent, String title,
String name, String publication,
String address, String round,
String phone)
// Initialize the superclass layer.
super (parent, title, true);
// Choose a grid bag layout so that components can be more
// accurately positioned. (It looks nicer.)
setLayout (new GridBagLayout ());
// Add appropriate first name, last name, phone, fax, and
// email components to the current DataEntryForm container.
// (Remember, DataEntryForm is a subclass of Dialog.
// Dialog is a container. Therefore, DataEntryForm
// inherits the ability to be a container.)
addComponent (this, new JLabel ("Name: "), 0, 0, 1, 1,
GridBagConstraints.NONE,
GridBagConstraints.WEST);
this.name = new JTextField (15);
addComponent (this, this.name, 1, 0, 1, 1,
GridBagConstraints.NONE,
GridBagConstraints.CENTER);
if (title.equals ("Update"))
this.name.setText (name);
addComponent (this, new JLabel ("Publications: "), 0, 1, 1, 1,
GridBagConstraints.NONE,
GridBagConstraints.WEST);
this.publication = new JTextField (15);
addComponent (this, this.publication, 1, 1, 1, 1,
GridBagConstraints.NONE,
GridBagConstraints.CENTER);
if (title.equals ("Update"))
this.publication.setText (publication);
addComponent (this, new JLabel ("Address "), 0, 2, 1, 1,
GridBagConstraints.NONE,
GridBagConstraints.WEST);
this.address = new JTextField (15);
addComponent (this, this.address, 1, 2, 1, 1,
GridBagConstraints.NONE,
GridBagConstraints.CENTER);
if (title.equals ("Update"))
this.address.setText (address);
addComponent (this, new JLabel ("Round No "), 0, 3, 1, 1,
GridBagConstraints.NONE,
GridBagConstraints.WEST);
this.round = new JTextField (15);
addComponent (this, this.round, 1, 3, 1, 1,
GridBagConstraints.NONE,
GridBagConstraints.CENTER);
if (title.equals ("Update"))
this.round.setText (round);
addComponent (this, new JLabel ("Phone Number "), 0, 4, 1, 1,
GridBagConstraints.NONE,
GridBagConstraints.WEST);
this.phone = new JTextField (15);
addComponent (this, this.phone, 1, 4, 1, 1,
GridBagConstraints.NONE,
GridBagConstraints.CENTER);
if (title.equals ("Update"))
this.phone.setText (phone);
addComponent (this, new JLabel (""), 0, 5, 1, 1,
GridBagConstraints.NONE,
GridBagConstraints.CENTER);
addComponent (this, new JLabel (""), 1, 5, 1, 1,
GridBagConstraints.NONE,
GridBagConstraints.CENTER);
JButton b;
// Add an Ok button to this container.
addComponent (this, b = new JButton ("Ok"), 0, 6, 1, 1,
GridBagConstraints.NONE,
GridBagConstraints.CENTER);
b.addActionListener (this);
// Add a Cancel button to this container.
addComponent (this, b = new JButton ("Cancel"), 1, 6, 1, 1,
GridBagConstraints.NONE,
GridBagConstraints.CENTER);
b.addActionListener (this);
// Set the size of the dialog window to 250 pixels
// horizontally by 200 pixels vertically.
setSize (250, 200);
// Do not allow users to resize the dialog window.
setResizable (false);
// Make sure that the dialog window is visible.
setVisible (true);
private void addComponent (Container con, Component com,
int gridx, int gridy,
int gridw, int gridh, int fill,
int anchor)
// Get the current layout manager. It is assumed to
// be a GridBagLayout object.
LayoutManager lm = con.getLayout ();
// Create a GridBagConstraints object to make it
// possible to customize component positioning.
GridBagConstraints gbc = new GridBagConstraints ();
// Assign the x and y grid positions.
gbc.gridx = gridx;
gbc.gridy = gridy;
// Assign the number of grid blocks horizontally and
// vertically that are occupied by the component.
gbc.gridwidth = gridw;
gbc.gridheight = gridh;
// Specify the component's resize policy (fill) and
// the direction in which the component is positioned
// when its size is smaller than available space (anchor).
gbc.fill = fill;
gbc.anchor = anchor;
// Set the new constraints that the grid bag layout
// manager will use.
((GridBagLayout) lm).setConstraints (com, gbc);
// Add the component to the container.
con.add (com);
// ===========================================================
// Class: MsgBox
// This class displays a message box to the user. The message
// is usually an error message. The user must press the Ok
// button to terminate the message box.
// ===========================================================
class MsgBox extends JDialog implements ActionListener
public void actionPerformed (ActionEvent e)
// Terminate the dialog box in response to the user
// pressing the Ok button.
dispose ();
public MsgBox (JFrame parent, String title, String msg)
// Initialize the superclass layer.
super (parent, title, true);
// Store the msg argument in a Label object and add
// this object to the center part of the dialog window.
JLabel l = new JLabel (msg);
add ("Center", l);
// Create a Button object and add it to the south part
// of the dialog window.
JButton b = new JButton ("Ok");
add ("South", b);
// Make the current object a listener to events that
// occur as a result of the user pressing the Ok
// button.
b.addActionListener (this);
// Make sure that the Ok button has the focus.
b.requestFocus ();
// Do not allow users to resize the dialog window.
setResizable (false);
// Allow the layout manager to choose an appropriate
// size for the dialog window.
pack ();
// Make sure that the dialog window is visible.
setVisible (true);
}
Maybe you are looking for
-
How can you restore photo stream photos back to Apple TV after accidentally deleting from your iPad
After accidentally deleting photo stream photos on my iPad, this deleted photo stream photos on my Apple TV. How can I restore these photos back to my Apple TV and also to my iPad? Suggestions welcomed
-
N97/Windows 7/ Vista Music problems
Hi all hope someone can help I have a laptop running Windows 7 a PC running Vista and the N97, I got a couple of tracks from the Nokia music store and not one of these gadgets are able to play the music. When I try to play the songs Vista crashes all
-
Yesterday I updated my ipod Touch to iOS5 to use iCloud. When I completed my iCloud sync I lost all my purchased apps. I turned off iCloud and connected to my computer to sync and still none of my purchased apps! Any suggestions?
-
My Nomad Jukebox 10GB player won't start anym
I rarely use my Nomad Jukebox 0GB, only on long driving tri ps. I've been trying to charge it all day but it still won't turn on. I tried changing the rechargable batteries with some replacement ones it came with but it still won't turn on by itself.
-
Oracle Procedure Question - Subquery
I have a procedure that I invoke from Java, it does work properly, I would like to add two additional columns to my resultset, namely; legal_entity_id and legal_entity_name, I have written the subquery to extract the two additional columns but I am h