JButton not visible after use of Jpanel removeAll ..
Hi!
I'm having a calculator class that inherits JFrame. I need to add more buttons after setting an option from the (view) menu bar .. (from normal to scientific calculator). I needed to use the JPanel removeAll method and then add the normal buttons plus extra buttons. But the problem is, that the Buttons are only visible when I touch them with the mouse.
Does anybody know why? Thanks for your help!
See code below (still in construction phase):
Name: Hemanth. B
Original code from Website: java-swing-tutorial.html
Topic : A basic Java Swing Calculator
Conventions Used in Source code
1. All JLabel components start with jlb*
2. All JPanel components start with jpl*
3. All JMenu components start with jmenu*
4. All JMenuItem components start with jmenuItem*
5. All JDialog components start with jdlg*
6. All JButton components start with jbn*
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Calculator extends JFrame
implements ActionListener {
// Constants
final int NORMAL = 0;
final int SCIENTIFIC = 8;
final int MAX_INPUT_LENGTH = 20;
final int INPUT_MODE = 0;
final int RESULT_MODE = 1;
final int ERROR_MODE = 2;
// Variables
int displayMode;
int calcType = SCIENTIFIC;
boolean clearOnNextDigit, percent;
double lastNumber;
String lastOperator, title;
private JMenu jmenuFile, jmenuView, jmenuHelp;
private JMenuItem jmenuitemExit, jmenuitemAbout;
private JRadioButtonMenuItem jmenuItemNormal = new JRadioButtonMenuItem("Normal");
private JRadioButtonMenuItem jmenuItemScientific = new JRadioButtonMenuItem("Scientific");
private ButtonGroup viewMenuButtonGroup = new ButtonGroup();
private JLabel jlbOutput;
private JButton jbnButtons[];
private JPanel jplButtons, jplMaster, jplBackSpace, jplControl;
* Font(String name, int style, int size)
Creates a new Font from the specified name, style and point size.
Font f12 = new Font("Verdana", 0, 12);
Font f121 = new Font("Verdana", 1, 12);
// Constructor
public Calculator(String title) {
/* Set Up the JMenuBar.
* Have Provided All JMenu's with Mnemonics
* Have Provided some JMenuItem components with Keyboard Accelerators
//super(title);
this.title = title;
//displayCalculator(title);
} //End of Contructor Calculator
private void displayCalculator (String title) {
//add WindowListener for closing frame and ending program
addWindowListener (
new WindowAdapter() {
public void windowClosed(WindowEvent e) {
System.exit(0);
//setResizable(false);
//Set frame layout manager
setBackground(Color.gray);
validate();
createMenuBar();
createMasterPanel();
createDisplayPanel();
clearAll();
this.getContentPane().validate();
requestFocus();
pack();
//getContentPane().
setVisible(true);
private void createMenuBar() {
jmenuFile = new JMenu("File");
jmenuFile.setFont(f121);
jmenuFile.setMnemonic(KeyEvent.VK_F);
jmenuitemExit = new JMenuItem("Exit");
jmenuitemExit.setFont(f12);
jmenuitemExit.setAccelerator(KeyStroke.getKeyStroke( KeyEvent.VK_X,
ActionEvent.CTRL_MASK));
jmenuFile.add(jmenuitemExit);
jmenuView = new JMenu("View");
jmenuFile.setFont(f121);
jmenuFile.setMnemonic(KeyEvent.VK_W);
jmenuItemNormal.setMnemonic(KeyEvent.VK_N);
viewMenuButtonGroup.add(jmenuItemNormal);
jmenuView.add(jmenuItemNormal);
jmenuItemScientific.setMnemonic(KeyEvent.VK_S);
viewMenuButtonGroup.add(jmenuItemScientific);
jmenuView.add(jmenuItemScientific);
if (jmenuItemNormal.isSelected() == false &&
jmenuItemScientific.isSelected() == false)
jmenuItemScientific.setSelected(true);
jmenuHelp = new JMenu("Help");
jmenuHelp.setFont(f121);
jmenuHelp.setMnemonic(KeyEvent.VK_H);
jmenuitemAbout = new JMenuItem("About Calculator");
jmenuitemAbout.setFont(f12);
jmenuHelp.add(jmenuitemAbout);
JMenuBar menubar = new JMenuBar();
menubar.add(jmenuFile);
menubar.add(jmenuView);
menubar.add(jmenuHelp);
setJMenuBar(menubar);
jmenuItemNormal.addActionListener(this);
jmenuItemScientific.addActionListener(this);
jmenuitemAbout.addActionListener(this);
jmenuitemExit.addActionListener(this);
private void createDisplayPanel() {
if (jlbOutput != null) {
jlbOutput.removeAll();
jlbOutput = new JLabel("0",JLabel.RIGHT);
jlbOutput.setBackground(Color.WHITE);
jlbOutput.setOpaque(true);
// Add components to frame
getContentPane().add(jlbOutput, BorderLayout.NORTH);
jlbOutput.setVisible(true);
private void createMasterPanel() {
if (jplMaster != null) {
jplMaster.removeAll();
jplMaster = new JPanel(new BorderLayout());
createCalcButtons();
jplMaster.add(jplBackSpace, BorderLayout.WEST);
jplMaster.add(jplControl, BorderLayout.EAST);
jplMaster.add(jplButtons, BorderLayout.SOUTH);
((JPanel)getContentPane()).revalidate();
// Add components to frame
getContentPane().add(jplMaster, BorderLayout.SOUTH);
jplMaster.setVisible(true);
private void createCalcButtons() {
int rows = 4;
int cols = 5 + calcType/rows;
jbnButtons = new JButton[31];
// Create numeric Jbuttons
for (int i=0; i<=9; i++) {
// set each Jbutton label to the value of index
jbnButtons[i] = new JButton(String.valueOf(i));
// Create operator Jbuttons
jbnButtons[10] = new JButton("+/-");
jbnButtons[11] = new JButton(".");
jbnButtons[12] = new JButton("=");
jbnButtons[13] = new JButton("/");
jbnButtons[14] = new JButton("*");
jbnButtons[15] = new JButton("-");
jbnButtons[16] = new JButton("+");
jbnButtons[17] = new JButton("sqrt");
jbnButtons[18] = new JButton("1/x");
jbnButtons[19] = new JButton("%");
jplBackSpace = new JPanel();
jplBackSpace.setLayout(new GridLayout(1, 1, 2, 2));
jbnButtons[20] = new JButton("Backspace");
jplBackSpace.add(jbnButtons[20]);
jplControl = new JPanel();
jplControl.setLayout(new GridLayout(1, 2, 2 ,2));
jbnButtons[21] = new JButton(" CE ");
jbnButtons[22] = new JButton("C");
jplControl.add(jbnButtons[21]);
jplControl.add(jbnButtons[22]);
//if (calcType == SCIENTIFIC) {
jbnButtons[23] = new JButton("s");
jbnButtons[24] = new JButton("t");
jbnButtons[25] = new JButton("u");
jbnButtons[26] = new JButton("v");
jbnButtons[27] = new JButton("w");
jbnButtons[28] = new JButton("x");
jbnButtons[29] = new JButton("y");
jbnButtons[30] = new JButton("z");
// Setting all Numbered JButton's to Blue. The rest to Red
for (int i=0; i<jbnButtons.length; i++) {
//activate ActionListener
System.out.println("add action listener: " + i);
jbnButtons.addActionListener(this);
//set button text font/colour
jbnButtons[i].setFont(f12);
jbnButtons[i].invalidate();
if (i<10)
jbnButtons[i].setForeground(Color.blue);
else
jbnButtons[i].setForeground(Color.red);
// container for Jbuttons
jplButtons = new JPanel(new GridLayout(rows, cols, 2, 2));
System.out.println("Cols: " + cols);
//Add buttons to keypad panel starting at top left
// First row
// extra left buttons for scientific
if (calcType == SCIENTIFIC) {
System.out.println("Adding Scientific buttons");
setSize(400, 217);
setLocation(200, 250);
jplButtons.add(jbnButtons[23]);
jplButtons.add(jbnButtons[27]);
} else {
setSize(241, 217);
setLocation(200, 250);
for(int i=7; i<=9; i++) {
jplButtons.add(jbnButtons[i]);
// add button / and sqrt
jplButtons.add(jbnButtons[13]);
jplButtons.add(jbnButtons[17]);
// Second row
// extra left buttons for scientific
if (calcType == SCIENTIFIC) {
System.out.println("Adding Scientific buttons");
jplButtons.add(jbnButtons[24]);
jplButtons.add(jbnButtons[28]);
for(int i=4; i<=6; i++) {
jplButtons.add(jbnButtons[i]);
// add button * and x^2
jplButtons.add(jbnButtons[14]);
jplButtons.add(jbnButtons[18]);
// Third row
// extra left buttons for scientific
if (calcType == SCIENTIFIC) {
System.out.println("Adding Scientific buttons");
jplButtons.add(jbnButtons[25]);
jplButtons.add(jbnButtons[29]);
for( int i=1; i<=3; i++) {
jplButtons.add(jbnButtons[i]);
//adds button - and %
jplButtons.add(jbnButtons[15]);
jplButtons.add(jbnButtons[19]);
//Fourth Row
// extra left buttons for scientific
if (calcType == SCIENTIFIC) {
System.out.println("Adding Scientific buttons");
jplButtons.add(jbnButtons[26]);
jplButtons.add(jbnButtons[30]);
// add 0, +/-, ., +, and =
jplButtons.add(jbnButtons[0]);
jplButtons.add(jbnButtons[10]);
jplButtons.add(jbnButtons[11]);
jplButtons.add(jbnButtons[16]);
jplButtons.add(jbnButtons[12]);
jplButtons.revalidate();
// Perform action
public void actionPerformed(ActionEvent e){
double result = 0;
if(e.getSource() == jmenuitemAbout) {
//JDialog dlgAbout = new CustomABOUTDialog(this,
// "About Java Swing Calculator", true);
//dlgAbout.setVisible(true);
} else if(e.getSource() == jmenuitemExit) {
System.exit(0);
if (e.getSource() == jmenuItemNormal) {
calcType = NORMAL;
displayCalculator(title);
if (e.getSource() == jmenuItemScientific) {
calcType = SCIENTIFIC;
displayCalculator(title);
System.out.println("Calculator is set to "
+ (calcType == NORMAL?"Normal":"Scientific") + " :" + jbnButtons.length);
// Search for the button pressed until end of array or key found
for (int i=0; i<jbnButtons.length; i++) {
if(e.getSource() == jbnButtons[i]) {
System.out.println(i);
switch(i) {
case 0:
addDigitToDisplay(i);
break;
case 1:
System.out.println("1");
addDigitToDisplay(i);
break;
case 2:
addDigitToDisplay(i);
break;
case 3:
addDigitToDisplay(i);
break;
case 4:
addDigitToDisplay(i);
break;
case 5:
addDigitToDisplay(i);
break;
case 6:
addDigitToDisplay(i);
break;
case 7:
addDigitToDisplay(i);
break;
case 8:
addDigitToDisplay(i);
break;
case 9:
addDigitToDisplay(i);
break;
case 10: // +/-
processSignChange();
break;
case 11: // decimal point
addDecimalPoint();
break;
case 12: // =
processEquals();
break;
case 13: // divide
processOperator("/");
break;
case 14: // *
processOperator("*");
break;
case 15: // -
processOperator("-");
break;
case 16: // +
processOperator("+");
break;
case 17: // sqrt
if (displayMode != ERROR_MODE) {
try {
if (getDisplayString().indexOf("-") == 0)
displayError("Invalid input for function!");
result = Math.sqrt(getNumberInDisplay());
displayResult(result);
catch(Exception ex) {
displayError("Invalid input for function!");
displayMode = ERROR_MODE;
break;
case 18: // 1/x
if (displayMode != ERROR_MODE){
try {
if (getNumberInDisplay() == 0)
displayError("Cannot divide by zero!");
result = 1 / getNumberInDisplay();
displayResult(result);
catch(Exception ex) {
displayError("Cannot divide by zero!");
displayMode = ERROR_MODE;
break;
case 19: // %
if (displayMode != ERROR_MODE){
try {
result = getNumberInDisplay() / 100;
displayResult(result);
catch(Exception ex) {
displayError("Invalid input for function!");
displayMode = ERROR_MODE;
break;
case 20: // backspace
if (displayMode != ERROR_MODE) {
setDisplayString(getDisplayString().substring(0,
getDisplayString().length() - 1));
if (getDisplayString().length() < 1)
setDisplayString("0");
break;
case 21: // CE
clearExisting();
break;
case 22: // C
clearAll();
break;
void setDisplayString(String s) {
jlbOutput.setText(s);
String getDisplayString () {
return jlbOutput.getText();
void addDigitToDisplay(int digit) {
if (clearOnNextDigit)
setDisplayString("");
String inputString = getDisplayString();
if (inputString.indexOf("0") == 0) {
inputString = inputString.substring(1);
if ((!inputString.equals("0") || digit > 0)
&& inputString.length() < MAX_INPUT_LENGTH) {
setDisplayString(inputString + digit);
displayMode = INPUT_MODE;
clearOnNextDigit = false;
void addDecimalPoint() {
displayMode = INPUT_MODE;
if (clearOnNextDigit)
setDisplayString("");
String inputString = getDisplayString();
// If the input string already contains a decimal point, don't
// do anything to it.
if (inputString.indexOf(".") < 0)
setDisplayString(new String(inputString + "."));
void processSignChange() {
if (displayMode == INPUT_MODE) {
String input = getDisplayString();
if (input.length() > 0 && !input.equals("0")) {
if (input.indexOf("-") == 0)
setDisplayString(input.substring(1));
else
setDisplayString("-" + input);
} else if (displayMode == RESULT_MODE) {
double numberInDisplay = getNumberInDisplay();
if (numberInDisplay != 0)
displayResult(-numberInDisplay);
void clearAll() {
setDisplayString("0");
lastOperator = "0";
lastNumber = 0;
displayMode = INPUT_MODE;
clearOnNextDigit = true;
void clearExisting() {
setDisplayString("0");
clearOnNextDigit = true;
displayMode = INPUT_MODE;
double getNumberInDisplay() {
String input = jlbOutput.getText();
return Double.parseDouble(input);
void processOperator(String op) {
if (displayMode != ERROR_MODE) {
double numberInDisplay = getNumberInDisplay();
if (!lastOperator.equals("0")) {
try {
double result = processLastOperator();
displayResult(result);
lastNumber = result;
catch (DivideByZeroException e) {
displayError("Cannot divide by zero!");
} else {
lastNumber = numberInDisplay;
clearOnNextDigit = true;
lastOperator = op;
void processEquals() {
double result = 0;
if (displayMode != ERROR_MODE){
try {
result = processLastOperator();
displayResult(result);
catch (DivideByZeroException e) {
displayError("Cannot divide by zero!");
lastOperator = "0";
double processLastOperator() throws DivideByZeroException {
double result = 0;
double numberInDisplay = getNumberInDisplay();
if (lastOperator.equals("/")) {
if (numberInDisplay == 0)
throw (new DivideByZeroException());
result = lastNumber / numberInDisplay;
if (lastOperator.equals("*"))
result = lastNumber * numberInDisplay;
if (lastOperator.equals("-"))
result = lastNumber - numberInDisplay;
if (lastOperator.equals("+"))
result = lastNumber + numberInDisplay;
return result;
void displayResult(double result){
setDisplayString(Double.toString(result));
lastNumber = result;
displayMode = RESULT_MODE;
clearOnNextDigit = true;
void displayError(String errorMessage){
setDisplayString(errorMessage);
lastNumber = 0;
displayMode = ERROR_MODE;
clearOnNextDigit = true;
public static void main(String args[]) {
Calculator calci = new Calculator("My Calculator");
calci.displayCalculator("My Calculator");
System.out.println("Exitting...");
} //End of Swing Calculator Class.
class DivideByZeroException extends Exception{
public DivideByZeroException() {
super();
public DivideByZeroException(String s) {
super(s);
class CustomABOUTDialog extends JDialog implements ActionListener {
JButton jbnOk;
CustomABOUTDialog(JFrame parent, String title, boolean modal){
super(parent, title, modal);
setBackground(Color.black);
JPanel p1 = new JPanel(new FlowLayout(FlowLayout.CENTER));
StringBuffer text = new StringBuffer();
text.append("Calculator Information\n\n");
text.append("Developer: Hemanth\n");
text.append("Version: 1.0");
JTextArea jtAreaAbout = new JTextArea(5, 21);
jtAreaAbout.setText(text.toString());
jtAreaAbout.setFont(new Font("Times New Roman", 1, 13));
jtAreaAbout.setEditable(false);
p1.add(jtAreaAbout);
p1.setBackground(Color.red);
getContentPane().add(p1, BorderLayout.CENTER);
JPanel p2 = new JPanel(new FlowLayout(FlowLayout.CENTER));
jbnOk = new JButton(" OK ");
jbnOk.addActionListener(this);
p2.add(jbnOk);
getContentPane().add(p2, BorderLayout.SOUTH);
setLocation(408, 270);
setResizable(false);
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
Window aboutDialog = e.getWindow();
aboutDialog.dispose();
pack();
public void actionPerformed(ActionEvent e) {
if(e.getSource() == jbnOk) {
this.dispose();
Message was edited by:
dungorg
Swing related questions should be posted in the Swing forum.
After adding or removing components from a visible panel you need to use panel.revalidate() and sometimes panel.repaint();
If you need further help then you need to create a [url http://homepage1.nifty.com/algafield/sscce.html]Short, Self Contained, Compilable and Executable, Example Program (SSCCE) that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.
Don't forget to use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags so the posted code retains its original formatting.
Similar Messages
-
Portal content not visible after installation nw2004s
Hello
Portal Content folders not visible after logon to EP after installation
using the url http://172.22.218.120:50400/irj
logon is using Administrator id.
top level navigation is displayed. but no folder hierarchy in PCD.
Please help
regards
JohnHello John,
Used the host name instead of the ip address in the url http://<host name>:50400/irj/portal.
Maintain the host name in the host file of the OS.
ip address host name.
Regards
Deb
[Reward Points for helpful answers] -
Autocad 2010 drawing pasted in microsoft excel 2007 spread sheet not visible after converting excel
Hello, I am having an issue with Autocad 2010 drawings not showing up in a pdf document. Normally, I cut and paste part of an Autocad 2010 drawing into a Microsoft Excel 2007 spread sheet. Then, using Adobe Distiller, I convert the Excel spread sheet into a pdf document for propriatary purposes. However, recently the drawing pasted into Excel will not fully appear on the pdf, the drawing is cut off past a certain point. The drawing will print normally in Excel, but in pdf will not print normally. If the drawing is shrunk below the "cut off" point, it appears normally. If the drawing is expanded above the "cut off" point, any additional image is lost. Any suggestions on how to fix the problem would be appreciated.
See "[Creating, Editing & Exporting PDFs] How to correct bad PDFdisplay
of Excel 2007 graph-Adobe ProX?" and similar discussions. Are you
scaling it to less than 100%?
Jeffry Calhoun
Workforce Analytics Manager
Ohio Department of Job & Family Services
P.O. Box 1618, Columbus, OH 43216-1618
InterAgency: F376, 4020 E. 5th Avenue
614-644-0564
Fax 614-728-5938
[email protected]
OhioMeansJobs.com -
The next best thing to having an HR department.
OhioMeansJobs.com -
Ohio's premier website for connecting businesses and job seekers -
quickly, easily, and for free!
>>> jblairdynis <[email protected]> 4/19/2012 10:44 AM >>>
autocad 2010 drawing pasted in microsoft excel 2007 spread sheet not
visible after converting excel created by jblairdynis (
http://forums.adobe.com/people/jblairdynis ) in Creating, Editing &
Exporting PDFs - View the full discussion (
http://forums.adobe.com/message/4346704#4346704 )
Hello, I am having an issue with Autocad 2010 drawings not showing
up in a pdf document. Normally, I cut and paste part of an Autocad 2010
drawing into a Microsoft Excel 2007 spread sheet. Then, using Adobe
Distiller, I convert the Excel spread sheet into a pdf document for
propriatary purposes. However, recently the drawing pasted into Excel
will not fully appear on the pdf, the drawing is cut off past a certain
point. The drawing will print normally in Excel, but in pdf will not
print normally. If the drawing is shrunk below the "cut off" point, it
appears normally. If the drawing is expanded above the "cut off" point,
any additional image is lost. Any suggestions on how to fix the problem
would be appreciated.
Replies to this message go to everyone subscribed to this thread, not
directly to the person who posted the message. To post a reply, either
reply to this email or visit the message page:
http://forums.adobe.com/message/4346704#4346704
To unsubscribe from this thread, please visit the message page at
http://forums.adobe.com/message/4346704#4346704. In the Actions box on
the right, click the Stop Email Notifications link.
Start a new discussion in Creating, Editing & Exporting PDFs by email (
mailto:discussions-community-acrobat-creating__editing_%[email protected]
) or at Adobe Forums (
http://forums.adobe.com/choose-container!input.jspa?contentType=1&containerType=14&contain er=4697
For more information about maintaining your forum email notifications
please go to http://forums.adobe.com/message/2936746#2936746.
Ohio Means Jobs
You're looking for something unique. Use more than an ordinary site.
http://www.ohiomeansjobs.com
This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain private, confidential, and/or privileged information. Any unauthorized review, use, disclosure, or distribution is prohibited. If you are not the intended recipient, employee, or agent responsible for delivering this message, please contact the sender by reply e-mail and destroy all copies of the original e-mail message. -
Hot spot s not visible after latest iOS version update on my iPad please help
hey personal hot spot is not visible after iOS latest version update on my iPad mini please help
Hey Devinder from chd,
For most issues with Personal Hotspot, try out the basic troubleshooting in the article below. It does talk about iPhone but the troubleshooting is the same for your iPad. If you are still having issues, let me know and I can see what else we can do after that.
iOS: Troubleshooting Personal Hotspot
http://support.apple.com/en-us/HT203302
Basic troubleshooting
See if your iOS device, computer, and wireless plan all meet the system requirements for Personal Hotspot.
Make sure Personal Hotspot is on: Tap Settings > Cellular > Personal Hotspot.
Check the Internet connection on your iOS device: Tap Safari and load a new webpage.
If one connection type doesn't work, try another. For example, instead of connecting using Wi-Fi, use USB or Bluetooth.
Turn Personal Hotspot off and on: Tap Settings > Personal Hotspot or Settings > Cellular > Personal Hotspot.
Install the latest version of iOS.
Reset your network settings: Tap Settings > General > Reset > Reset Network Settings.
If you still see the issue, restore the iPhone.
Take it easy,
-Norm G. -
Download button on appstore is not visible after I have upgrated IOS 7 in my Iphone 5
Download button on appstore is not visible after I have upgrated IOS 7 in Iphone 5, how can I fix it?
I am using iPhone 4S. Under iOS 7.04 everything was working fine. Now that I have updated to new 7.1 version, I am finding that the overall phone speed as been degregated.
Some times when answering the phone, you select to answer or swipe, it seems to hang up the phone. I end up missing the call.
Some times when I try to hang up the phone, it does not hang up right away. The phone appears to get stuck, you hear voices on the other end, but the call has not dropped. It takes a while for the call to drop and free up the phone.
Typing is slow. As you type, it does not show right away, only after 2 to 4 words have been typed then it will show all those characters.
Internet browsing is slow.
I mostly use the phone for 3 things - Making/Receiving calls, Texting, and Internet browsing. I don't play apps.
This is NOT a jailbrake phone, it's as original as it can get. I am hoping a fix is put into place. I have really lost faith in Apple's way of iOS upgrades. This is my 2nd regret in upgrading to new iOS. -
F8 debug widow not working (At-least not visible) after entering into the "Currently installed Windows 7 Image"
F8 option turned on in the boot image.
F8 debug window works in Windows PE.
F8 debug window does not show-up on F8 key-press after entering the 'Currently installed Windows 7 Image" all the way to the end of the task sequence.
But after a 'Restart Step' (and if F8 was pressed) the Task Sequence tends to pause indefinitely as if the
F8 debug screen is open in the background.
I am using SCCM 2012 SP1 (CU 1 is
not an option at the moment).
Any ideas as to how I could get the debug F8 option back?There have been a couple reported occurrences of this (or something similar) to my knowledge with no resolution in the forums. Your best bet may be to open a case with CSS.
Also note that if you were going to do a CU, why would you pick CU1 instead of CU4? And, can I ask why it's not an option out of curiosity?
Jason | http://blog.configmgrftw.com -
Overhead calculation not happening after using Overhead key and orgin group
overhead calculation not happening after using Overhead key and orgin group.
There was a runtime error earlier related to u201Cdefine credit u201C IMG node under costing sheet component and we have applied SAP note 769946 and that error was gone out of the way
We want to apply/add Overhead to SFG/FG materials.
We are using PP order with PCC(product cost collector) as the cost object , i.e costing by period.(system ECC 6)
But our problem is with material standard cost estimate process.
We have assigned overhead keys to the percentage rates in costing sheet for material standard costing and assigned the origin groups to the credits of costing sheet. But after running the cost estimate overhead is not taking into account for standard cost calculation.
In the define credit entry table key field is valid to date strangly and actually system should allow one than one entry with same valid to date and same sec.Cost element(type-41) for different cost centers.
But if we without using overhead key and origin group, the entire cost in that supporting cost center will come to all materials (SFG/FG) and we can not distinguish between different product materials(SFG /FG).
We have checked all things as mentined below.
Firstly that the correct costing sheet is assigned to the valuation
variant.
That the costing sheet is entered for the appropriate material type:
Finished and semi finished or material components.
All of the above can be checked and verified via transaction OKKN.
In addition make sure that the base value maintained is present in the
costing, for example the base may include an Origin group, is that
origin group part of the materials being costed?
Similarly if the base is found and values exist how is the overhead
rate of the costing sheet set up, is it valid etc.
And finally do a similar check for the credit.
we doubt this as a programm error...
So, request all experts to have ur feedback..Dear,
Check your origin group & material unit of mesaurement is same.
some time in costing sheet origin group is maintain in different unit & for materail it's maitain in other unit of mesaurement.
You can see unit of measure for material in Additional data - unit of measure.
Check BOM component material unit also.
Check same unit of measure is maintain in KZS2
I hope above will useful.
GOPAN -
Overhead calculation not happening after using orgin group.
overhead calculation not happening after using orgin group.
There was a runtime error earlier related to u201Cdefine credit u201C IMG node under costing sheet component and we have applied SAP note 769946 and that error was gone out of the way
We want to apply/add Overhead to SFG/FG materials.
We are using PP order with PCC(product cost collector) as the cost object , i.e costing by period.(system ECC 6)
But our problem is with material standard cost estimate process.
We have assigned overhead keys to the percentage rates in costing sheet for material standard costing and assigned the origin groups to the credits of costing sheet. But after running the cost estimate overhead is not taking into account for standard cost calculation.
In the define credit entry table key field is valid to date strangly and actually system should allow one than one entry with same valid to date and same sec.Cost element(type-41) for different cost centers.
But if we without using overhead key and origin group, the entire cost in that supporting cost center will come to all materials (SFG/FG) and we can not distinguish between different product materials(SFG /FG).
We have checked all things as mentined below.
Firstly that the correct costing sheet is assigned to the valuation
variant.
That the costing sheet is entered for the appropriate material type:
Finished and semi finished or material components.
All of the above can be checked and verified via transaction OKKN.
In addition make sure that the base value maintained is present in the
costing, for example the base may include an Origin group, is that
origin group part of the materials being costed?
Similarly if the base is found and values exist how is the overhead
rate of the costing sheet set up, is it valid etc.
And finally do a similar check for the credit.
we doubt this as a programm error...
So, request all experts to have ur feedback..Dear,
Check your origin group & material unit of mesaurement is same.
some time in costing sheet origin group is maintain in different unit & for materail it's maitain in other unit of mesaurement.
You can see unit of measure for material in Additional data - unit of measure.
Check BOM component material unit also.
Check same unit of measure is maintain in KZS2
I hope above will useful.
GOPAN -
Google toolbar buttons (other then print) are not visible after installing Firefox 4 for Mac.
Yes - there is a fix... called IE9... http://windows.microsoft.com/en-US/internet-explorer/downloads/ie-9/worldwide-languages
-
battery is not charged after using all of my battery. what's wrong? is it about charge machine or my computer?
battery is not charged after using all of my battery.
Of course it isn't — you've just drained it. Plug your AC adapter in and charge it up again. -
Thumbnails do not display after using rebuild tool
I am using OSX 10.7.5, and iPhoto 8.1.2.
recently I made a back up copy of my files.
I then reinstalled my operating system.
I then copied my iphoto library back onto my computer.
imported my iPhoto library into iPhoto
Pictures are in iPhoto.
Thumbnails do not display.
I have used the rebuild tools provided by iPhoto.
Still no thumbnails displaying.
any other ideas?It relates to your suggestion in that, the reason I posted was to solve a thumbnail issue.
"re: Thumbnails do not display after using rebuild tool"
Terence suggested reloading my back up library.
I asked Terence where I should import to.
I was thinking that my thumbnail issue was related to the way I imported my back up.
You clarified where to import the library...
I tried it and I still have no thumbnails
I have already tried repairing permissions and rebuilding thumbnails using the i photo repair tool.
can you help me? -
SHCess field not appearing after using utilization tab in excise invoice
Dear All,
SHCess field not appearing after using utilization tab in excise invoice.The other fields and values releated to SHCess are appearing.
Please give the inputs.
Regards,
deeptiissue resolved
-
I have updated iOS 6 in my iPhone 4S and it went perfectly fine. Just after that when I opened the message app I found that the sms body of system generated messages was not visible after tapping on them.
The terms of service of the Apple Support Communities prevent us from helping anyone with a jailbroken phone.
You're on your own. Good luck. -
Mail not working after using migration assistant - what am I missing?
Mail not working after using migration assistant - what am I missing?
The mailbox list is divided into categories with headings in caps, such as ON MY MAC. When you hover the cursor over one of those headings (except for MAILBOXES), you should see the word Show or Hide on the right. Click Show. The MAILBOXES category can't be hidden.
In each category, the mailboxes are arranged in groups, such as Inbox. To the left of each group is a small disclosure triangle. If the triangle points to the right, click it so that it points down. -
Data in CSV uploads successfully, but it is not visible after upload.
Hi,
I am using Apex 3.2 on Oracle 11g.
This is an imported application for which I am making changes as per my requirements. As I am new to Apex and even SQL, I request forum members to help me with this.
Please find below the old code for uploading data from CSV. It displays only 6 columns - Database Name, Server Name, Application Name, Application Provider, Critical, Remarks. This was successfully uploading all the data from CSV and that data was visible after upload.
OLD CODE:_
--PLSQL code for uploading application details
DECLARE
v_blob_data BLOB;
v_blob_len NUMBER;
v_position NUMBER;
v_raw_chunk RAW(10000);
v_char CHAR(1);
c_chunk_len NUMBER:= 1;
v_line VARCHAR2 (32767):= NULL;
v_data_array wwv_flow_global.vc_arr2;
v_rows NUMBER;
v_count NUMBER;
v_dbid NUMBER;
v_serverid NUMBER;
v_sr_no NUMBER:=1;
v_last_char varchar2(2);
BEGIN
-- Read data from wwv_flow_files
SELECT blob_content INTO v_blob_data FROM wwv_flow_files
WHERE last_updated = (SELECT MAX(last_updated) FROM wwv_flow_files WHERE UPDATED_BY = :APP_USER)
AND id = (SELECT MAX(id) FROM wwv_flow_files WHERE updated_by = :APP_USER);
v_blob_len := dbms_lob.getlength(v_blob_data);
v_position := 1;
-- For removing the first line
WHILE ( v_position <= v_blob_len )
LOOP
v_raw_chunk := dbms_lob.substr(v_blob_data,c_chunk_len,v_position);
v_char := chr(hex_to_decimal(rawtohex(v_raw_chunk)));
v_position := v_position + c_chunk_len;
-- When a whole line is retrieved
IF v_char = CHR(10) THEN
EXIT;
END IF;
END LOOP;
-- Read and convert binary to char
WHILE ( v_position <= v_blob_len )
LOOP
v_raw_chunk := dbms_lob.substr(v_blob_data,c_chunk_len,v_position);
v_char := chr(hex_to_decimal(rawtohex(v_raw_chunk)));
v_line := v_line || v_char;
v_position := v_position + c_chunk_len;
-- When a whole line is retrieved
IF v_char = CHR(10) THEN
--removing the new line character added in the end
v_line := substr(v_line, 1, length(v_line)-2);
--removing the double quotes
v_line := REPLACE (v_line, '"', '');
--checking the absense of data in the end
v_last_char:= substr(v_line,length(v_line),1);
IF v_last_char = CHR(44) THEN
v_line :=v_line||'-';
END IF;
-- Convert each column separated by , into array of data
v_data_array := wwv_flow_utilities.string_to_table (v_line, ',');
-- Insert data into target tables
SELECT SERVERID into v_serverid FROM REPOS_SERVERS WHERE SERVERNAME=v_data_array(2);
SELECT DBID into v_dbid FROM REPOS_DATABASES WHERE DBNAME=v_data_array(1) AND SERVERID=v_serverid;
--Checking whether the data already exist
SELECT COUNT(APPID) INTO v_count FROM REPOS_APPLICATIONS WHERE DBID=v_dbid AND APPNAME=v_data_array(1);
IF v_count = 0 THEN
EXECUTE IMMEDIATE 'INSERT INTO
REPOS_APPLICATIONS (APPID,APPNAME,APP_PROVIDER,DBID,SERVERID,CRITICAL,LAST_UPDATE_BY,LAST_UPDATE_DATE,REMARKS) VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9)'
USING
APP_ID_SEQ.NEXTVAL,
v_data_array(3),
v_data_array(4),
v_dbid,
v_serverid,
v_data_array(5),
v_data_array(6),
v_data_array(7),
v_data_array(8);
END IF;
-- Clearing out the previous line
v_line := NULL;
END IF;
END LOOP;
END;
==============================================================================================================================
Please find below the new code (which I modified as per my requirements) for uploading data from CSV. It displays 17 columns - Hostname, IP Address, Env Type, Env Num, Env Name, Application, Application Component, Notes, Cluster , Load Balanced, Business User Access Mechanism for Application, Env Owner, Controlled Environment, SSO Enabled, ADSI / LDAP / External Directory Authentication, Disaster Recovery Solution in Place, Interfaces with other application.
This is successfully uploading all the data from CSV, But this uploaded data is not visible in its respective tab.
_*NEW CODE:*_
--PLSQL code for uploading application details
DECLARE
v_blob_data BLOB;
v_blob_len NUMBER;
v_position NUMBER;
v_raw_chunk RAW(10000);
v_char CHAR(1);
c_chunk_len NUMBER:= 1;
v_line VARCHAR2 (32767):= NULL;
v_data_array wwv_flow_global.vc_arr2;
v_rows NUMBER;
v_count NUMBER;
v_dbid NUMBER;
v_serverid NUMBER;
v_sr_no NUMBER:=1;
v_last_char varchar2(2);
BEGIN
-- Read data from wwv_flow_files
SELECT blob_content INTO v_blob_data FROM wwv_flow_files
WHERE last_updated = (SELECT MAX(last_updated) FROM wwv_flow_files WHERE UPDATED_BY = :APP_USER)
AND id = (SELECT MAX(id) FROM wwv_flow_files WHERE updated_by = :APP_USER);
v_blob_len := dbms_lob.getlength(v_blob_data);
v_position := 1;
-- For removing the first line
WHILE ( v_position <= v_blob_len )
LOOP
v_raw_chunk := dbms_lob.substr(v_blob_data,c_chunk_len,v_position);
v_char := chr(hex_to_decimal(rawtohex(v_raw_chunk)));
v_position := v_position + c_chunk_len;
-- When a whole line is retrieved
IF v_char = CHR(10) THEN
EXIT;
END IF;
END LOOP;
-- Read and convert binary to char
WHILE ( v_position <= v_blob_len )
LOOP
v_raw_chunk := dbms_lob.substr(v_blob_data,c_chunk_len,v_position);
v_char := chr(hex_to_decimal(rawtohex(v_raw_chunk)));
v_line := v_line || v_char;
v_position := v_position + c_chunk_len;
-- When a whole line is retrieved
IF v_char = CHR(10) THEN
--removing the new line character added in the end
v_line := substr(v_line, 1, length(v_line)-2);
--removing the double quotes
v_line := REPLACE (v_line, '"', '');
--checking the absense of data in the end
v_last_char:= substr(v_line,length(v_line),1);
IF v_last_char = CHR(44) THEN
v_line :=v_line||'-';
END IF;
-- Convert each column separated by , into array of data
v_data_array := wwv_flow_utilities.string_to_table (v_line, ',');
-- Insert data into target tables
--SELECT SERVERID into v_serverid FROM REPOS_SERVERS WHERE SERVERNAME=v_data_array(2);
--SELECT DBID into v_dbid FROM REPOS_DATABASES WHERE DBNAME=v_data_array(1) AND SERVERID=v_serverid;
--Checking whether the data already exist
--SELECT COUNT(APPID) INTO v_count FROM REPOS_APPLICATIONS WHERE DBID=v_dbid AND APPNAME=v_data_array(1);
IF v_count = 0 THEN
EXECUTE IMMEDIATE 'INSERT INTO
REPOS_APPLICATIONS (APPID,HOSTNAME,IPADDRESS,ENV_TYPE,ENV_NUM,ENV_NAME,APPLICATION,APPLICATION_COMPONENT,NOTES,CLSTR,LOAD_BALANCED,BUSINESS,ENV_OWNER,CONTROLLED,SSO_ENABLED,ADSI,DISASTER,INTERFACES) VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14,:15,:16,:17,:18)'
USING
APP_ID_SEQ.NEXTVAL,
v_data_array(1),
v_data_array(2),
v_data_array(3),
v_data_array(4),
v_data_array(5),
v_data_array(6),
v_data_array(7),
v_data_array(8),
v_data_array(9),
v_data_array(10),
v_data_array(11),
v_data_array(12),
v_data_array(13),
v_data_array(14),
v_data_array(15),
v_data_array(16),
v_data_array(17);
END IF;
-- Clearing out the previous line
v_line := NULL;
END IF;
END LOOP;
END;
============================================================================================================================
FYI, CREATE TABLE_ is as below:
CREATE TABLE "REPOS_APPLICATIONS"
( "APPID" NUMBER,
"APPNAME" VARCHAR2(50),
"APP_PROVIDER" VARCHAR2(50),
"DBID" NUMBER,
"CRITICAL" VARCHAR2(3),
"REMARKS" VARCHAR2(255),
"LAST_UPDATE_DATE" TIMESTAMP (6) DEFAULT SYSDATE NOT NULL ENABLE,
"LAST_UPDATE_BY" VARCHAR2(10),
"SERVERID" NUMBER,
"HOSTNAME" VARCHAR2(20),
"IPADDRESS" VARCHAR2(16),
"ENV_TYPE" VARCHAR2(20),
"ENV_NUM" VARCHAR2(20),
"ENV_NAME" VARCHAR2(50),
"APPLICATION" VARCHAR2(50),
"APPLICATION_COMPONENT" VARCHAR2(50),
"NOTES" VARCHAR2(255),
"CLSTR" VARCHAR2(20),
"LOAD_BALANCED" VARCHAR2(20),
"BUSINESS" VARCHAR2(255),
"ENV_OWNER" VARCHAR2(20),
"CONTROLLED" VARCHAR2(20),
"SSO_ENABLED" VARCHAR2(20),
"ADSI" VARCHAR2(20),
"DISASTER" VARCHAR2(50),
"INTERFACES" VARCHAR2(50),
CONSTRAINT "REPOS_APPLICATIONS_PK" PRIMARY KEY ("APPID") ENABLE
ALTER TABLE "REPOS_APPLICATIONS" ADD CONSTRAINT "REPOS_APPLICATIONS_R01" FOREIGN KEY ("DBID")
REFERENCES "REPOS_DATABASES" ("DBID") ENABLE
ALTER TABLE "REPOS_APPLICATIONS" ADD CONSTRAINT "REPOS_APPLICATIONS_R02" FOREIGN KEY ("SERVERID")
REFERENCES "REPOS_SERVERS" ("SERVERID") ENABLE
==============================================================================================================================
It would be of great help if someone can help me to resolve this issue with uploading data from CSV.
Thanks & Regards
SharathHi,
You can see the installed dictionaries and change between them by right-clicking and choosing '''Languages''' inside a live text box eg. the box you are in when replying or right-clicking on the '''Search''' box on the top right corner of this page and choosing '''Check Spelling'''.
Maybe you are looking for
-
What is sqlcxt and what it does?
I am having code-> string read_stmt= "some query" strcpy(sqlstmt,read_stmt); struct sqlexd sqlstm; sqlstm.sqlvsn = 12; sqlstm.arrsiz = 1; sqlstm.sqladtp = &sqladt; sqlstm.sqltdsp = &sqltds; sqlstm.stmt = ""; sqlstm.iters = (unsigned int )1; sqlstm.of
-
Tabs and options buttons HUGE! HALP!
This is affecting my computer using ANY version of firefox all the way down to v2.1 (the earliest release I've tested.). The tabs and buttons are gigantic and I can't figure out why. This is with the default theme, default add-ons, and default extent
-
I am not able to access flex 3 in a week vedios ?
Hi, From past two weeks I am searching for vedios of flex 3 training. I am not able to find anywhere. Please help me out in my projext we are using flex 3 not flex 4 or 4.5. Thanks
-
Hello All, I am using Oracle RAC 11g R2 + ASM. I have basic below 2 questions concerning ASM and OCR and voting disks data 1. Is there any way to backup the ASM instance? Is that needed in a production environment? What is the best way to do that ? i
-
Dynamically set Analysis Services Connection Manager in a Fooreach loop [SSIS 2008]
I am storing connection strings for "Analysis Services Connection Manager" in a database table and on run time i am fetching them all, storing in an object and iterating through them inside a Foreach loop. Variable gets updated with a new connection