Tracking expended Inventory
Hello Everyone,
I am just starting the data migration into our production system of ByDesign. I am our production manager and have found myself banging heads with my accounting department. We do work for both the government and the commercial industries.
My question is...
How can inventory be tracked if it is expended to a project to invoice our customer?
Scenario:
I order part against a project. The parts are received and immediately expended to the project to be able to immediately invoice the customer.
In the system, I believe that these parts have to be consumed to generate an invoice to our customer. But the parts are physically in a storage location until they are needed.
I am just starting off with the financial side of the implementation. The MRP will be in phase 2. Is there anyway to handle this in the MRP?
I really do not want to managed expended materials in a secondary software system.
Any guidance at all will be greatly appreciated.
Thanks
Dave
My 2 cents here.
In PO you can capture the FOB rule in terms as say Supplier Site (as soon it leaves supplier site goods intransit are your inventory).
Based on ASN sent electronically by your freight carrier or supplier, you can perform receive transaction which will have accounting between your receiving account and accrual account.
Essentially you need to record this accrual as you are claiming responsibility for this Freight on Board as your inventory (am I right?).
This value in receiving account is your inventory value in transit. If you are on R12, you can change this account (in SLA's account derivation rules) from standard account that is taken from organization to your own intransit account if the FOB of PO is supplier's site. Of course you MAY have to change accounting happening for Delivery transaction as well to credit the intransit account generated at the time of receiving rather than the account from organization.
Thanks
Nagamohan
Similar Messages
-
Tracking of Inventory in Marble Industry
Dear Colleagues,
We have a division that produces Marbles Slabs & tiles mostly using MTS scenario.
There are special MTO Orders as well.
The production process is to get a marble block from the mine (quarry) and to use it for producing slabs / tiles.
Marble Block
This is a semi finished material.
Marble blocks are generally classified into 4 different types u2013 1. Desert Bronze Marble Blocks 2. Silver Marble Blocks 3. Rosa Marble Blocks 4. Desert Gold Marble Blocks
Each marble block has a different Size (M3) and Weight (TON).
Marble blocks are tracked in M3.
Slabs / Stripes / Tiles
This is a finished product.
Slabs / Stripes / Tiles
are produced and classified into 4 types (A / B / C / D) and the price depends on the classification.
Slabs / Stripes / Tiles are measured in M2.
For each slab the size varies.
At present, in factory, inventory is tracked as below:-
Marble Blocks:-
Inventory is tracked in m3 and also in pieces.
Each block is given a block #.
e.g. Q1-123 i.e. block from Quarry 1 and block # is 123.
Slabs
Inventory is tracked in m2 and also in pieces.
Each slab is given as slab#.
e.g. Q1-123-12 i.e. slab from block Q1-123 and slab # is 12.
Stripes
Inventory is tracked in m2 and also in pieces.
Each stripe is given an identification number as below:-
e.g. Q1-123-12 i.e. slab from block Q1-123 and slab # is 12.
This is done for the below purpose:-
1. Production manager knows the yield of slabs / stripes from a particular block.
2. Production manager knows the yield of tiles from a particular slab / stripe.
3. In the end, he can then know what is the yield for a day / period / machine / operation.
As I understand, if we need to model this in SAP, I need to use u201CBatch managementu201D functionality.
However, I have a below queries / concerns:-
1. may I know if this is the best practice followed in the industry?
2. no of batches would be very high and entering the batch details for every block / slab / stripe would be a cumbersome work. Is there any better way fo achieving this?
Please let me know your views.
Best Regards,
ROI_SAP.As stated in your posting:
>We want to track all inventory transfer transaction which are done from u201CTRC Warehouseu201D to u201CRestore Warehouseu201D and whether for the each inventory(from u201CTRC Warehouseu201D to u201CRestore Warehouseu201D ) transfer we have booked corresponding return entry (from Restore Warehouseu201D to u201CTRC Warehouseu201D).
I do believe you only need the report that without match. It means what you are looking for would be blank for all the last 3 fields. Is that what you need?
Thanks,
Gordon -
Track of Inventory opening balance
Hi All,
Can you please guide a bit regarding the below query
Track of Inventory opening balance
How to track or get the opening balances (of the concerned a/c(s)) entered for the items.
Thanks a lot in advance...HI,
under (Inventory->Inventory reports->'Inventory Audit report)... you can find it opening balance for each item -
Sub-Contracting Reports_ Tracking of Inventory
Scenarion:-
To Send item for repair at vendor side, we prepared inventory transfer transaction from u201CTRC Warehouseu201D to u201CRestore Warehouseu201D and when material gets repaired then we booked the inventory transfer transaction from Restore Warehouseu201D to u201CTRC Warehouseu201D.
We want to track all inventory transfer transaction which are done from u201CTRC Warehouseu201D to u201CRestore Warehouseu201D and whether for the each inventory(from u201CTRC Warehouseu201D to u201CRestore Warehouseu201D ) transfer we have booked corresponding return entry (from Restore Warehouseu201D to u201CTRC Warehouseu201D).
Report Format Will be like this
Posting Date / Doc.Num/ Item code/Item Name/ Qty / Return posting Date/ Return Doc.Num/Return Qty.
If against one inventory Transfer entry from u201CTRC Warehouseu201D to u201CRestore Warehouseu201D for a particular item we have not booked the return entry then i.e from Restore Warehouseu201D to u201CTRC Warehouseu201D then in report it should these fields (Return posting Date/ Return Doc.Num/Return Qty.) blank and skip to next entry and where there is match then we can analyze the report.
If there is any other format to analyze will be accepted.
Edited by: Paul Finneran on Oct 15, 2009 12:36 PMAs stated in your posting:
>We want to track all inventory transfer transaction which are done from u201CTRC Warehouseu201D to u201CRestore Warehouseu201D and whether for the each inventory(from u201CTRC Warehouseu201D to u201CRestore Warehouseu201D ) transfer we have booked corresponding return entry (from Restore Warehouseu201D to u201CTRC Warehouseu201D).
I do believe you only need the report that without match. It means what you are looking for would be blank for all the last 3 fields. Is that what you need?
Thanks,
Gordon -
Tracking Inbound inventory I own but have not received.
I have a common importers question without a response.
If I take ownership of inventory when it ships from my supplier (such as a China mfg shipping to the US distributor and my inventory that I own will be in transit for 4 weeks) how do 'see' that inventory in EBS?
I would want to be able to value that inventory for accounting purposes.
In the best case the shipper or my freight carrier would notify me electronicly when it leaves the factory and I take ownership. Would it make sense for me to create a phantom 'inbound warehouse' that I would receive the stock into? Then when the product was actually received in my physical warehouse transfer it from the phantom warehouse to my physical?
what are the ideas here?Dave
My 2 cents here.
In PO you can capture the FOB rule in terms as say Supplier Site (as soon it leaves supplier site goods intransit are your inventory).
Based on ASN sent electronically by your freight carrier or supplier, you can perform receive transaction which will have accounting between your receiving account and accrual account.
Essentially you need to record this accrual as you are claiming responsibility for this Freight on Board as your inventory (am I right?).
This value in receiving account is your inventory value in transit. If you are on R12, you can change this account (in SLA's account derivation rules) from standard account that is taken from organization to your own intransit account if the FOB of PO is supplier's site. Of course you MAY have to change accounting happening for Delivery transaction as well to credit the intransit account generated at the time of receiving rather than the account from organization.
Thanks
Nagamohan -
Tracking hardware inventory of client machines
hi experts
Is there any mechanism in oracle forms or other technology( in oracle ) provides to get track hardware status of the client machines.
or is there any other way to solve this thing.
pl give me the solution
Thanks in advandeWhat would you like to track?
Local IP?
Computer name?
MAC address?
what type of information do you need?
In java you can get some system info with this:
// Get all system properties
Properties props = System.getProperties();
// Enumerate all system properties
Enumeration enum = props.propertyNames();
for (; enum.hasMoreElements(); ) {
// Get property name
String propName = (String)enum.nextElement();
// Get property value
String propValue = (String)props.get(propName); } this is my bean to read some information as PJC bean
import oracle.forms.handler.IHandler;
import oracle.forms.properties.*;
import oracle.forms.ui.*;
import java.net.InetAddress;
public class ClientInfo extends VBean {
private static final ID CLIENT_IP = ID.registerProperty("CLIENT_IP");
private static final ID CLIENT_NAME = ID.registerProperty("CLIENT_NAME");
private static final ID CLIENT_OS = ID.registerProperty("CLIENT_OS");
private static final ID CLIENT_USER = ID.registerProperty("CLIENT_USER");
private IHandler mHandler;
private String hostAddress = "";
private String hostName = "";
private String hostOs = "";
private String hostUser="";
public ClientInfo() {
try {
System.out.println("+----------------------+");
System.out.println("+ClientInfro PJC +");
System.out.println("+Dat spr: 10.09.2007 +");
System.out.println("+Dat spr: 04.07.2008 +");
System.out.println("+Dat spr: 10.07.2008 +");
System.out.println("+----------------------+\n");
this.hostAddress = InetAddress.getLocalHost().getHostAddress();
this.hostName = InetAddress.getLocalHost().getHostName();
this.hostOs = System.getProperty("os.name");
this.hostUser = System.getProperty("user.name");
System.out.println("Host adress: " + hostAddress);
System.out.println("Host name: " + hostAddress);
System.out.println("Host op. syst: " + hostOs);
System.out.println("Host username: " + hostUser);
} catch (Exception e) {
System.out.println("Napaka pri inicializaciji beana: " +
e.toString());
public void init(IHandler handler) {
super.init(handler);
mHandler = handler;
System.out.println("Bean initialized..");
* metoda setira vrednost variable v formsih
* @return
* @param pid
public Object getProperty(ID pid) {
if (pid == CLIENT_IP) {
System.out.println("Client IP: " + this.hostAddress);
return ""+this.hostAddress;
if (pid == CLIENT_NAME) {
System.out.println("Client Name: " + this.hostName);
return ""+this.hostName;
if (pid == CLIENT_OS) {
System.out.println("Client os: " + this.hostOs);
return ""+this.hostOs;
if (pid == CLIENT_USER) {
System.out.println("Clientuser: " + this.hostUser);
return ""+this.hostUser;
return super.getProperty(pid);
}You can also get other infor for example "motherboard serial number" as this
import java.io.File;
import java.io.FileWriter;
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class MiscUtils {
private MiscUtils() { }
public static String getMotherboardSN() {
String result = "";
try {
File file = File.createTempFile("realhowto",".vbs");
file.deleteOnExit();
FileWriter fw = new java.io.FileWriter(file);
String vbs =
"Set objWMIService = GetObject(\"winmgmts:\\\\.\\root\\cimv2\")\n"
+ "Set colItems = objWMIService.ExecQuery _ \n"
+ " (\"Select * from Win32_BaseBoard\") \n"
+ "For Each objItem in colItems \n"
+ " Wscript.Echo objItem.SerialNumber \n"
+ " exit for ' do the first cpu only! \n"
+ "Next \n";
fw.write(vbs);
fw.close();
Process p = Runtime.getRuntime().exec("cscript //NoLogo " + file.getPath());
BufferedReader input =
new BufferedReader
(new InputStreamReader(p.getInputStream()));
String line;
while ((line = input.readLine()) != null) {
result += line;
input.close();
catch(Exception e){
e.printStackTrace();
return result.trim();
public static void main(String[] args){
String cpuId = MiscUtils.getMotherboardSN();
javax.swing.JOptionPane.showConfirmDialog((java.awt.Component)
null, cpuId, "Motherboard serial number",
javax.swing.JOptionPane.DEFAULT_OPTION);
}or hardisk serial number
public static String getSerialNumber(String drive) {
String result = "";
try {
File file = File.createTempFile("realhowto",".vbs");
file.deleteOnExit();
FileWriter fw = new java.io.FileWriter(file);
String vbs = "Set objFSO = CreateObject(\"Scripting.FileSystemObject\")\n"
+"Set colDrives = objFSO.Drives\n"
+"Set objDrive = colDrives.item(\"" + drive + "\")\n"
+"Wscript.Echo objDrive.SerialNumber"; // see note
fw.write(vbs);
fw.close();
Process p = Runtime.getRuntime().exec("cscript //NoLogo " + file.getPath());
BufferedReader input =
new BufferedReader
(new InputStreamReader(p.getInputStream()));
String line;
while ((line = input.readLine()) != null) {
result += line;
input.close();
catch(Exception e){
e.printStackTrace();
return result.trim();
}Or you can write a DLL in C, C++ and use it in Java with jni..
Edited by: Peterv6i on Aug 30, 2010 10:58 AM -
What module / component can be used to keep track software inventory
hi all experts,,
I have a business scenario but don't know what module / component in SAP can be help ?
There are many software / hardware in a user department. For hardware, its model no. maintenance contract with vendor name (and the contract renewal), responsible staff, date of purchase, its location should also be recorded but no financial impact should be monitored.
For software, no. of copies, date of purchase, responsible staff of each copy, vendor name, date of expiry, software version no. should be recorded.
I try to find if material management, equipment in Plant maintenance or asset management are suitable.
I don't know what module can be used to monitor all hardware renewal contract, copies of all software. Pls advise.Hi
I think that you have had the answer to your question. I am trying to get people to keep the forum tidy. If you have what you require could you award you points if you want to and mark your question as answered.
This helps everybody as there are at the moment 48 pages of open questions and if people do not close them the forum will grow and then people like me will not go through all of the pages as it takes too long and some people will not get answers to their questions.
Thank you
Frenchy -
Captialized material to be tracked back as inventory
Scenario:-The scenario is of telecom client where handset is given to client as Part of his procuring a connection from my client.
So the moment the connection is activacted the handset is capitalised.
But later on when customer gets its connection disconnected than he rturn the handset as its my clients asset.( by this time as the phoen is now no longer an inventory as its an asset.( in my client all the connection sold for a month is made one asset for the month)
Now how to handle the retunrprocess of t handset from customer who is rturning the handset( which is already cpatiased)
so that my invnetory moving avergae price also should no get impacted .
These materials are required to be tracked in inventory as thiese handset will be again given to new customer who procures the connection from my client.
.Regards
AmitHi Amit,
I think that you can assign a headset to a Material Type which handles Quantity and not price (Example: Material Type: UNBW) I have done this for an Oil company to keep track of valuable assets!.
This will force you to assign an "Account assignment" when you procure it (Asset), it will enter in the stock, but it will not be valuated when you move it.
Once you have it on you stock you can sent that stock to consignment (And assign it to a Client) so you will be able to know in which customers you have your headsets and the quantity.
When you write off the asset (For whichever reason) you can consume the material with 201 or any other movement (As it does not handle value no accounting will take place)
You can combine this with Serial Number o Batch managemente if you want to keep track with precision which headeset is at client house!.
Kind regards,
Federico -
Hello Experts,
I'm working on an implementation of DP and SNP within the SCM System, where we'll use DP to forecast our in-feed (across our 3rd party (3P) vendors) and transfer it to SNP. Once in SNP I need to net out inventory quantities, which is in a typical scenario no problem and quite easy. however, the scenario i am working doesn't seem to quite fit from what i understand and where i need some guidance.
First let me say i am looking for guidance on what documenation i could read that would help me solve my problem. Whether it be help documentation, white papers, etc.
In my organization, we have fully outsourced our operations to various 3rd party vendors, but we perform all the material planning so the material distributor(s) know how much material is going to be required to fulfill our network. The challenge i am facing is what is the best way to track the inventory levels at the various 3rd party locations? Please keep in mind we do not own nor manage the 3rd party inventory. Which means we do not perform GR or GI nor are we involved in the purchasing or selling of materials but, we need visibility into their inventory for netting in SNP. The first thought was to simply put the inventory quantities for each 3P into a BW cube and pull it from there. I haven't ruled this option out but before i committ to this i'd like to know if there is a standard solution to this problem. is there a way to store the inventory in ECC and CIF to SCM or whether storing the inventory directly in SCM. At this point i am not set on any given idea and i am really looking for a standard way to track our 3rd party inventory. one last comment is, i'm not opposed to using a standard modulel/process in a non-standard method meaning if there is a module out there that does 75 to 90 % of what i want but i have to rework somethings i'm open to that as well.
thank you in advance for taking the time to review my question.
MikeHi Mike,
I can think of the following options:
1) Are your vendors already a part of network in R/3? If yes, then you could get the inventory data from them using EDI. Then you could pass on this data to APO, and it could be used in planning.
2) You could also get the inventory data through EDI directly into APO. Then it could be used for planning.
Both the above 2 options would require that your vendors use some system and you need to maintain the EDI interface. If they are using only 2-3 types of systems, then it might be simple to get the data, but if there are lot of vendors using different type of systems, it could be quite complex to setup up the infrastructure.
3) I understand its also possible to get stock data from vendors using SNC, but I am not very clear if the same data could be used in APO-SNP or not.
PS: There would also be a possibility to upload stock using some custom program. You would not be able to get stock data in APO from the cube as far as I know (unless you have defined some custom time series key figure for stock).
Thanks - Pawan -
UNABLE TO TRACK THE SHIPPABLE ITEM FROM SALES ORDER
hi Experts,
Anybody can please help me on this issue that i create a shippable item with install base trackable option checked while doing the transactions like miscelleneous receipt and purchase order on that item automatically tracked in the install base while doing the sale order for the same item it is not tracked, but non shippable items are tracked in install base perfectly.
My requirement is shippable items are also tracked in install base, i already checked the option install base tracked in inventory master items form even though it is not tracked through sales order.
Thanks,
Christ.Dear Sheetal
Go to V/06, select the tax condition type and execute. There check whether you have maintained "Condition Class" as D. If not, maintain D and then retry.
thanks
G. Lakshmipathi -
Tracking of wip material in externally processed operation
Hi All,
As part of production process, most of the operations would be processed internally in the manufacturing plant and some of the operations would be
performed by vendor at his own premises (outside the manufacturing plant). Material will be called as WIP (work in process) material if it completes some of the operations (two operations completed out of four operations) in production process without forming its final product shape
WIP (work in process) material will be sent out to vendor against externally processed operation in production order. We’ve a business requirement to track the WIP (Work in Process, No inventory yet in system) material status details such as when was the WIP material shipped out to service provider by purchasing department or returned back to production floor from stores after receiving from vendor for externally processed operation in production
order
The scenario is explained below and the process in SAP would be as follows.
1. Production order would be created for
respective header material (semi-finished/finished) with required quantity with five operations to be processed, for example: OP10 (turning), OP20 (drilling), OP30 (milling), OP40 (shaping), OP50 (powder coating). OP10, OP20, OP40, OP50. would be processed internally in the shop floor of the manufacturing plant
2.After finishing the internal processing at OP10 and OP20, Operation no 30 (OP30-milling) for the respective header
material would be processed externally by sending the partially processed part(WIP) to vendor outside the manufacturing plant. In SAP, the partially processed part doesn't have any material code and will not be updated in the inventory and will be treated as WIP (work in process) and automatic purchase requisition for external processing through production order is generated as follows
For OP30 Milling (Externally processed operation), from PP module perspective, we would be maintaining a control key which supports external
processing in the Operation 30 (OP30, external processed operation - An externally processed operation is not carried out within own organization, but is assigned to a vendor, who then does the work) with relevant information such as material group, purchase group, description of operation, cost element to track costs in the production order.
When the respective production order is saved, system creates a purchase requisition for external processed operation 30. We can see
the number of the purchase requisition on the external processing tab of operation details screen of OP30 in SAP Production order.
Purchasing department generates a purchase order against the automatic purchase requisition generated in production order, which informs the
vendor which service is required.
With reference to the purchase order – service oriented, the WIP material (no material code exists in SAP) is sent out to vendor. After the material has been processed, the vendor delivers the material back to manufacturing plant. When a goods receipt against purchase order is posted at manufacturing plant, the system displays the received quantity on the external processing tab of operation details screen of the operation - OP30 in production order and also displays in order information system reports. It also possible to track the cost incurred for external operation. However, Goods receipt against production order does not cause an increase in the quantity and value of the warehouse stock of header material of production order.
The above mentioned process is not a subcontracting process - where in we send raw materials and receive semi-finished/finished materials from vendor
3. The respective partially processed part (WIP) received from vendor is sent to shop floor to complete the rest of the process
in OP40 (shaping) and OP50 (powder coating).
4. After OP50, the respective header material (semi-finished/finished) of the production order will be received (goods
receipt against production order) as inventory in respective storage location.
With reference to the above process, we can track the status of receipt of WIP material from vendor after processing at his premises;
however, we can’t track when WIP material ( after completing processing at OP20) was sent out to vendor for external processing by purchasing department and when WIP material was returned back to production shop floor for further processing at OP40 after receiving from vendor by stores.
Please provide your feedback for the possibility to track the details of WIP material (no material code exists in SAP system) sent out to
vendor and received back at shop floor from stores for external processed operation of production order
Thanks for help in advance.
Regards,
RajeshHi Rajesh,
Process what ever you have explained is the right process with respective to operation wise subcontracting as per SAP Best practice. As you rihtly said in operation wise subcontracting PR is created with any material code. Once PR is created after PO and GR actual cost of that particular operation will be seen on the order. I believe sub contact operation after GR can be confirmed through confirmation transactions. Since it is subcontract operation specfic to peration seperate inventory is not tracked instead cost is reflecting directly on order
If you to want to track the inventory of the intermdiate product then you need to have a seperate material code for intermediate product (Eg A) received after second operation and do seperate subcontacting PR for seperate new material (Eg B) by issuing the intermediate material (Eg. A). Upon receivng GR for PO inventory will be updated for the new material (Eg B).This new material can be issued to your final product which has operation 0040 and 0050. Here two different material codes will be required.
Else follow the suggestion given by expert Caetano.
Thanks & Regards,
Ramagiri -
Inventory Management in Excel or Access?
Hi, I am trying to create a functional inventory system for my stock room... I have been looking at templates and haven't found something that looks suitable for the programs we have on hand -- Excel 2010 being the primary choice, but I also have access
to (but limited familiarity with) Access. I see SharePoint is a good system and has a few threads in these forums, but I don't have it!
Currently there is no formal process, just receiving and distributing goods. I have at least started a spreadsheet to track who is taking what/when/for what purpose - but this doesn't help to show how much we have/when to reorder, or how much we had in the
first place to check back that no inventory went missing, etc.
Problems I'm trying to fix:
need to know how much stock is on hand (ideally without having to schedule a routine physical count)
need to track where inventory is going
Bonuses:
want to be able to include all relevant supplier information per product (i.e. supplier, cost, product #, notes)
want to be able to see when stock reaches a certain level (prompt or notification to reorder)
Is there a solution out there for me?Hi,
According to your description, your required could be done via Access
inventory system database.
It'll help you handle inventory tracking of your product stock, suppliers, employees, purchase orders and sales.
More reference:
http://office.microsoft.com/en-us/access-help/cut-expenses-manage-inventory-and-ship-effectively-by-using-the-goods-web-database-template-HA102430359.aspx
https://www.youtube.com/watch?v=p8NPcA7UIRI
Please Note: Since the web site is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.
Regards,
George Zhao
TechNet Community Support -
Conditional inventory value posting once at the end of the month.
Business Scenario : Our client is a service and facility services unit where in 97% of items are expensed at the time of the GR and assigned to cost objects.
However we have a requirement to track the inventory (stock as well value once at the end of month). For e,g we will do perpetual inventory for the whole month and do a stock take at the end of the month and post the value.
Options like UNBW/NLAG/OMS2 materials does not help as the value posting will happen once in a month but stock postings can happen on a daily basis. We are able to expense still take the stock for the materials but not able to post the value after a stock take at the end of the month.
We are fine for any exits and enhancements as long as it does not disturbs standard SAP.
Kindly suggests your idea's and suggestions
Regards
Swagat PandaHi,
You need a custom table for storing material issue data and a custom program to run goods issue in the background at month end.
Create a custom table where store man can enter quantity of material issue with material number. Again let store manager check and correct it if anything wrong.Once store manage happy, then you can run automatic custom program ( which you can run only at the month end ) which posts the goods issue in the background taking data from custom table.
Regards,
Biju K -
Material master codification & inventory mgmt- construction industry
Hi,
I am designing the process for a client in the construction industry. The implementation will include integration with PS module. The client is working on different projects and the materials requirement for each project differ from the other.
Example:
Though i may have pipe at a broad level, the requirement of pipes is based on the diameter of pipes and this would ideally form multiple material codes.
I want to know, if any of you have come across such a scenario where creation of material master to the lowest level of specification will be very tedious. And also the same material specification may not be used in more than a project.
But at the same time, the client wants to track his inventory based on the specifications of pump received and issued / consumed.
thankshi,
would appreciate any help on this.
thanks -
Total Inventory Line Problem...Help Please
I am creating a Inventory Program for my Java class. I have gotten all of the program to pull to the GUI I created but one. For some reason my total inventory calculation will not pull to the GUI. Can anyone help me find the problem within my code. Here is both the main program and my buttonframe. If the other two parts are needed just let me know. It will all compile, just the label were the total inventory goes is still at zero it will not put the number in the box. I will be forever grateful for any help or tips in fixing the problem. Thanks
// Inventory4.java
// Program will track total inventory items in stock.
import java.io.*;
import javax.swing.JFrame;
public class Inventory4 {
// shared BufferedReader for keyboard input
private static BufferedReader stdin = new BufferedReader( new InputStreamReader( System.in ) );
// shared BufferedReader for keyboard input
private static int totalCount = 5;
/** Create a new instance of Main */
public Inventory4() {
double unitPrice; // Unit price of each item
double quantityStock; // Number of items in stock
double inventoryValue; // Place holder for calculated inventory value
double totalInventory; // Place holder for calculated total inventory value
int itemNumber; // Item Number
String itemName = ""; // Name of each item
//Main Method begins execution of program
public static void main(String[] args)throws IOException {
// Declare an array of classes
SubItem myItem[];
// Declare number of arrays
myItem = new SubItem[5];
// Declare an array of my item classes
// Create a new instance of the class Item
myItem = new SubItem[5];
// Create an instance of my item classes
myItem[0] = new SubItem(1.79,24,4,1,"Breads");
myItem[1] = new SubItem(3.49,15,3,2,"Dairy");
myItem[2] = new SubItem(6.49,20,9,3,"Meats");
myItem[3] = new SubItem(0.25,31,12,4,"Can Goods");
myItem[4] = new SubItem(2.59,37,7,5,"Produce");
// Call print method
printArray(myItem);
// Call sort array
myItem = sortArray(myItem);
System.out.println(" Inventory List Sorted by Items \n\n");
printArray(myItem);
// Call the GUI constructor and pass array and totalcount
ItemButton itemButton = new ItemButton(myItem,totalCount); // Make ItemButton
itemButton.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
itemButton.setSize( 350,390 ); // Window size
itemButton.setVisible( true ); // display window
} // End Main Method
/// Start PrintArray Method ///
private static SubItem[] printArray(SubItem[] myItem) {
double totalInventory = 0;
double restockingFee = 0;
// Start Loop
for (int i = 0; i<5;++i) {
System.out.println("\n The Item Number is " + i + myItem.getItemNumber() );
System.out.println("\n Item Name is " + myItem[i].getItemName() );
System.out.println("\n Quantity in Stock is " + myItem[i].getQuantityStock() );
System.out.println("\n Inventory Write-off is " + myItem[i].getInventoryWriteoffs() );
System.out.println("\n Inventory Value is $" + myItem[i].computeinventoryValue());
totalInventory = totalInventory + myItem[i].computeinventoryValue();
restockingFee = totalInventory + myItem[i].computeRestockingFee();
} // End For Loop
System.out.println("\n Total Value of all inventory is " + totalInventory);
System.out.println("\n Total Value of all inventory with restock fee $" + restockingFee);
return myItem;
} // End PrintArray Method
/*** Bubble Sort Algorithm ***/
private static SubItem[] sortArray(SubItem[] myItem) {
// Create temporary place holder
SubItem temp = new SubItem();
// Counters for Sort are I and J
int i, j;
int array_size = 5;
for (i = (array_size - 1); i >= 0; i--) {
for (j = 1; j <= i; j++) {
if (myItem[j-1].getItemName().compareTo(myItem[j].getItemName()) > 1) {
temp = myItem[j-1];
myItem[j-1] = myItem[j];
myItem[j] = temp;
} // End if
} // End inner for loop
} // End outer for loop
return myItem;
} // End Method
} // End Class
// ItemButton.java
// This will create GUI buttons.
// Display the Items.
import java.awt.FlowLayout;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JFrame;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JOptionPane;
import javax.swing.SwingConstants;
public class ItemButton extends JFrame {
private JButton nextJButton; // text button
private JButton prevJButton; // icon button
private JLabel lblItemName; // text field with set size
private JTextField txtItemName; // text field constructed with text
private JTextField textField3; // text field with text and size
private JLabel lblItemNumber; // text field with set size
private JTextField txtItemNumber; // text field constructed with text
private JLabel lblUnitPrice; // text field with set size
private JTextField txtUnitPrice; // text field constructed with text
private JLabel lblQuantityStock; // text field with set size
private JTextField txtQuantityStock; // text field constructed with text
private JLabel lblInventoryWriteoffs; // text field with set size
private JTextField txtInventoryWriteoffs; // text field constructed with text
private JLabel lblcomputeRestockingFee; // text field with set size
private JTextField txtcomputeRestockingFee; // text field constructed with text
private JLabel lblcomputeinventoryValue; // text field with set size
private JTextField txtcomputeinventoryValue; // text field constructed with text
private JLabel lblcomputetotalInventory; // text field with set size
private JTextField txtcomputetotalInventory; // text field constructed with text
// Class variable of the SubItem array I passed
SubItem[] arraySubItem;
private int currentArrayCounter;
private int arrayCount;
// ItemButton adds JButtons to JFrame
public ItemButton(SubItem[] myItem, int totalArrayCount) {
super ( "Inventory" );
arraySubItem = myItem;
// Setting variable totalArrayCount
// to class arrayCounter
arrayCount = totalArrayCount;
currentArrayCounter = 0;
// Current array position 0
setLayout( new FlowLayout() ); // set frame layout
// Load the next and previous icons
Icon iconNext = new ImageIcon( getClass().getResource( "" ) );
Icon iconPrev = new ImageIcon( getClass().getResource( "" ) );
// Construct textfield with default text and 15 columns
lblItemName = new JLabel( "Item Name ");
add( lblItemName ); // textField3 to JFrame
txtItemName = new JTextField( "", 15 );
add( txtItemName ); // add textField3 to JFrame
lblItemNumber = new JLabel( "Item Number ");
add( lblItemNumber ); // textField3 to JFrame
txtItemNumber = new JTextField( "", 15 );
add( txtItemNumber ); // add textField3 to JFrame
lblUnitPrice = new JLabel( "Unit Price ");
add( lblUnitPrice ); // textField3 to JFrame
txtUnitPrice = new JTextField( "", 15 );
add( txtUnitPrice ); // add textField3 to JFrame
lblQuantityStock = new JLabel( "Quantity Stock " );
add( lblQuantityStock ); // textField3 to JFrame
txtQuantityStock = new JTextField( "", 15 );
add( txtQuantityStock ); // add textField3 to JFrame
lblInventoryWriteoffs = new JLabel( "Inventory Write-Offs " );
add( lblInventoryWriteoffs ); // textField3 to JFrame
txtInventoryWriteoffs = new JTextField( "", 15 );
add( txtInventoryWriteoffs ); // add textField3 to JFrame
lblcomputeRestockingFee = new JLabel( "Restocking Fee ");
add( lblcomputeRestockingFee ); // textField3 to JFrame
txtcomputeRestockingFee = new JTextField( "", 15 );
add( txtcomputeRestockingFee ); // add textField3 to JFrame
lblcomputeinventoryValue = new JLabel( "Inventory Value " );
add( lblcomputeinventoryValue ); // textField3 to JFrame
txtcomputeinventoryValue = new JTextField( "", 15 );
add( txtcomputeinventoryValue ); // add textField3 to JFrame
lblcomputetotalInventory = new JLabel( "Total Inventory ");
add( lblcomputetotalInventory ); // textField3 to JFrame
txtcomputetotalInventory = new JTextField( "", 15 );
add( txtcomputetotalInventory ); // add textField3 to JFrame
// Create the buttons
nextJButton = new JButton( "Next" ); // button with Next
prevJButton = new JButton( "Previous"); // button with Prev
add(prevJButton);
add(nextJButton); // add plainJButton to JFrame
// Create new ButtonHandler for button event handling
ButtonHandler handler = new ButtonHandler();
nextJButton.addActionListener( handler );
prevJButton.addActionListener( handler );
// SetTextFields to set the text fields
setTextFields();
} // End ButtonFrame constructor
// inner class for button event handling
private class ButtonHandler implements ActionListener
// handle button event
public void actionPerformed( ActionEvent event )
// Which button was pressed
if (event.getActionCommand()== "prevJButton") {
currentArrayCounter++;
else {
currentArrayCounter++;
setTextFields();
} // End Method ActionPerformed
} // End Private inner class ButtonHandler
private void setTextFields()
// Check to see if the end of array was past
if (currentArrayCounter == arrayCount)
currentArrayCounter = 0;
// Check to see if the first was past
if (currentArrayCounter < 0)
currentArrayCounter = arrayCount;
txtItemName.setText(arraySubItem[currentArrayCounter].getItemName());
txtItemNumber.setText(arraySubItem[currentArrayCounter].getItemNumber()+"");
txtUnitPrice.setText(arraySubItem[currentArrayCounter].getUnitPrice()+"");
txtQuantityStock.setText(arraySubItem[currentArrayCounter].getQuantityStock()+"");
txtInventoryWriteoffs.setText(arraySubItem[currentArrayCounter].getInventoryWriteoffs()+"");
txtcomputeRestockingFee.setText(arraySubItem[currentArrayCounter].computeRestockingFee()+"");
txtcomputeinventoryValue.setText(arraySubItem[currentArrayCounter].computeinventoryValue()+"");
txtcomputetotalInventory.setText(arraySubItem[currentArrayCounter].computetotalInventory()+"");
} // End class ItemButtonI am sorry guys,
When I run the program all labels are in place and data appears where it is suppose to be...but the total inventory line. The label for the total inventory is there, but where the data is suppose to be all it will put there is 0.0. It will not put in the dollar amount. I know the problem is with the GUI, because before I started with the buttonFrame and it was compiled it would give me me the dollar amount for the Total Inventory. Here is the rest of the code.
// Item.java
// Program Starts Item Class
public class Item {
private double unitPrice;
private double quantityStock;
private int inventoryWriteoffs;
private double inventoryValue;
private double totalInventory;
private int itemNumber;
private String itemName;
/** Create a new instance of Item Name */
public Item(double UnitPrice,double QuantityStock,int InventoryWriteoffs,int ItemNumber,String ItemName) {
itemName = ItemName;
itemNumber = itemNumber;
unitPrice = UnitPrice;
quantityStock = QuantityStock;
inventoryWriteoffs = InventoryWriteoffs;
} public Item() { }
// Set for Name
public void setItemName(String ItemName) {
itemName = ItemName;
// Set for Item Number
public void setItemNumber(int ItemNumber) {
itemNumber = ItemNumber;
// Set for Unit Price
public void setUnitPrice(double UnitPrice) {
unitPrice = UnitPrice;
// Set for Quanity Stock
public void setQuantityStock(double QuantityStock) {
quantityStock = QuantityStock;
// Set for Inventory Write-Offs
public void setInventoryWriteoffs(int InventoryWriteoffs) {
inventoryWriteoffs = InventoryWriteoffs;
// Get for Name
public String getItemName() {
return itemName;
// Get for Item Number
public int getItemNumber() {
return itemNumber;
// Get for Unit Price
public double getUnitPrice() {
return unitPrice;
// Get for Quantity Stock
public double getQuantityStock() {
return quantityStock;
// Get for Inventory Write-offs
public int getInventoryWriteoffs() {
return inventoryWriteoffs;
// Compute Inventory Value Method
public double computeinventoryValue() {
return quantityStock * unitPrice;
// Compute Total Inventory Method
public double computetotalInventory() {
return totalInventory = totalInventory + inventoryValue;
public String toString() {
return (itemName);
// SubItem.java
// Sub class to main program
public class SubItem extends Item {
private int inventoryWriteoffs;
private double restockingFee = .05;
public SubItem(double UnitPrice,double QuantityStock,int InventoryWriteoffs,int ItemNumber,String ItemName) {
setUnitPrice(UnitPrice);
setQuantityStock(QuantityStock);
setItemNumber(ItemNumber);
setItemName(ItemName);
inventoryWriteoffs = InventoryWriteoffs;
// Empty
public SubItem() {
// Set for Inventory Write-offs
public void setInventoryWriteoffs(int InventoryWriteoffs) {
inventoryWriteoffs = InventoryWriteoffs;
// Get for Inventory Write-offs
public int getInventoryWriteoffs() {
return inventoryWriteoffs;
// Method to compute Restocking Fee
public double computeRestockingFee() {
return ((getUnitPrice() * getQuantityStock()) * restockingFee);
Thanks again for any help.
Maybe you are looking for
-
Can I load two Apple Accounts on one iPod?
We have two Apple products (MacPro and iMac 2.0) so we both have iTunes accounts. We share an iPod (Video 30GB 5th gen) and want to put things from both accounts onto the one iPod. Can we? and how??? I know the short answer is to buy another iPod but
-
"I Need to Sign" options are greyed out in Reader
I created a fillable form with Acrobat, including two fields where signatures are required. When I test the form within Acrobat (clicking on the signature field), I am prompted to create/insert a digital signature. But when I try the same thing in Re
-
I have recently updated the operating system on my iPad. Now my alarm is silent and my FaceTime doesn't ring aloud when a call comes in. How do I fix this please?
-
Iphoto and Itunes not showing the same number of photos in albums
why does the number of photos in an iphoto album is not the same when synching my iphone. For example, in iphoto, my "family" album has 2700 photos, but in Itunes it only shows 2675. I have included the videos also. Thanks
-
I am comparing the query designer with the report. Both the KF and char. All rows and coloums match. Expect that on report there is another column called Total. Where in the Query designer is there a reference to this as I can not see how it was adde