Use textfield in actionperformed function

Hello,
I want to extract value of e.ActionCommand where e is an object of ActionEvent
in a TextField in the main function in the actionPerformed(ActionEvent e) function.
How and where do I add the TextField in the main function. I created a Frame inside the main function

public static void main(String args[])
Frame f1=new Frame("Frame Window");
menushow x; //Applet class instance
x=new menushow();
x.init();
MenuBar mb;
mb=new MenuBar();
f1.setMenuBar(mb);
Menu test=new Menu("File");
mb.add(test);
MenuItem c1=new MenuItem("New");
ActionListener listener=new ActionListener()
public void actionPerformed(ActionEvent e)
String str4;
str4=e.getActionCommand();
c1.addActionListener(listener);
test.add(c1);
f1.setLocation(50,50);
f1.setSize(700,500);
f1.add("Center",x);
f1.show();
}

Similar Messages

  • Using global data in actionPerformed function

    i am giving the code snipet and want to know how is it possible to use an integer array in the actionPerformed function. If i use in the it as in the code following error is generated.
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    The code is:
    package ntictactoe;
    import java.awt.Font;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JButton;
    import javax.swing.JOptionPane;
    import javax.swing.JPanel;
    * @author root
    public class TBoard extends javax.swing.JFrame{
    /** Creates new form TBoard */
    JButton buttons[];
    int pos;
    int board[];
    public TBoard(int gridSize) {
    // initComponents();
    if(gridSize<3 || gridSize>6) {
    JPanel Mp = new JPanel();
    JOptionPane.showMessageDialog(Mp,"Invalid Grid Size, \n Please Enter size between 3 and 6");
    System.exit(0);
    } else{
    int k=gridSize*gridSize;
    jPanel1 = new javax.swing.JPanel();
    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    jPanel1.setLayout(new java.awt.GridLayout(gridSize, gridSize, 1, 1));
    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(layout.createSequentialGroup()
    .addContainerGap()
    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 412, Short.MAX_VALUE)
    .addContainerGap())
    layout.setVerticalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(layout.createSequentialGroup()
    .addContainerGap()
    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 350, Short.MAX_VALUE)
    .addContainerGap())
    ActionListener l = new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    JButton button = (JButton)e.getSource();
    String ac = button.getActionCommand();
    System.out.println("ac = " + ac);
    button.setEnabled(false);
    button.setText("X");
    pos=Integer.parseInt(ac);
    board[pos]=1;
    //System.out.println(""+pos);
    // computerResponse(board[pos]);
    int i;
    JButton buttons[]= new JButton[k];
    int board[]=new int[k];
    for(i=0;i<k;i++){
    buttons=new JButton("");
    jPanel1.add(buttons[i]);
    buttons[i].addActionListener(l);
    buttons[i].setText(""+i);
    board[i]=0;
    System.out.println(board[0]);
    pack();
    void computerResponse(int pos){
    // board[pos]=1;
    System.out.println(""+pos);
    /** This method is called from within the constructor to
    * initialize the form.
    * WARNING: Do NOT modify this code. The content of this method is
    * always regenerated by the Form Editor.
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">
    private void initComponents() {
    jPanel1 = new javax.swing.JPanel();
    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    setResizable(false);
    jPanel1.setLayout(new java.awt.GridLayout(4, 4, 1, 1));
    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(layout.createSequentialGroup()
    .addContainerGap()
    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 344, Short.MAX_VALUE)
    .addContainerGap())
    layout.setVerticalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(layout.createSequentialGroup()
    .addContainerGap()
    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 269, Short.MAX_VALUE)
    .addContainerGap())
    pack();
    }// </editor-fold>
    * @param args the command line arguments
    public static void main(String args[]) {
    /*int gridSize = Integer.parseInt(JOptionPane.showInputDialog(null,
    "Enter the Grid size",
    "Tic Tac Toe",
    JOptionPane.QUESTION_MESSAGE));*/
    java.awt.EventQueue.invokeLater(new Runnable() {
    public void run() {
    new TBoard(Integer.parseInt(JOptionPane.showInputDialog(null,
    "Enter the Grid size",
    "Tic Tac Toe",
    JOptionPane.QUESTION_MESSAGE))).setVisible(true);
    /* public void actionPerformed(ActionEvent e) {
    int i;
    JButton bt = (JButton)(e.getSource());
    for(i=0;i<16;i++){
    if(bt==buttons[i]){
    System.out.println(buttons[i]);
    break;
    // Variables declaration - do not modify
    private javax.swing.JPanel jPanel1;
    // End of variables declaration

    First, read this: http://forum.java.sun.com/help.jspa?sec=formatting
    Then: try posting again.
    Then: tell us where the exception happens.
    better yet: look at it, read the exception's API docs for its causes and fix it yourself.

  • Newbie : Using "this" in a function

    I have a function in my main class that spawns
    a Dialog for user input. The strange thing is, that I get
    a compiler error anytime i try to use "this" inside my
    function. Please help. Can you see anything wrong
    with the code in this function? I am calling it from
    another class.
    public static void createNewCell() {
    JDialog newDialog = new JDialog();
    newDialog.setTitle("New Cell Site");
    newDialog.setResizable(false);
    newDialog.setModal(true);
    //create txt fields
    CDBTextField txtCellID = new CDBTextField(15,10);
    //create buttons
    JButton btnOK = new JButton("OK");
    btnOK.setActionCommand("ok");
    btnOK.addActionListener(this);
    JButton btnCancel = new JButton("Cancel");
    btnCancel.setActionCommand("cancel");
    btnCancel.addActionListener(this);
    //Layout the labels in a panel
    JPanel labelPane = new JPanel();
    labelPane.setLayout(new GridLayout(0, 1));
    labelPane.add(new JLabel("Cell ID:"));
    //Layout the text fields in a panel
    JPanel fieldPane = new JPanel();
    fieldPane.setLayout(new GridLayout(0, 1));
    fieldPane.add(txtCellID);
    //Layout the buttons in a panel
    JPanel buttonPane = new JPanel();
    buttonPane.setLayout(new GridLayout(0, 2));
    buttonPane.add(btnCancel);
    buttonPane.add(btnOK);
    //Put the panels in another panel, labels on left,
    //text fields on right
    JPanel contentPane = new JPanel();
    contentPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
    contentPane.setLayout(new BorderLayout(10,10));
    contentPane.add(labelPane, BorderLayout.CENTER);
    contentPane.add(fieldPane, BorderLayout.EAST);
    contentPane.add(buttonPane, BorderLayout.SOUTH);
    newDialog.setContentPane(contentPane);
    newDialog.pack();
    newDialog.show();
    Here is the compiler message
    CDBTest.java:152: non-static variable this cannot be referenced from a static co
    ntext
    btnOK.addActionListener(this);
    ^
    CDBTest.java:155: non-static variable this cannot be referenced from a static co
    ntext
    btnCancel.addActionListener(this);
    ^
    2 errors
    I guess I don't really understand how to use static and
    when not to use static, and how to use "this"
    But I know I need to use "this" for the actionlisteners
    on my buttons.
    THanks
    Josh

    Thank you , Thank you, Thank you!
    Here is my entire main class, and then below it I'll
    paste the class that is calling my function.
    import java.io.*;
    import java.util.StringTokenizer;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.ArrayList;
    public class CDBTest extends JFrame implements ActionListener {
            public static CellList cellList = new CellList();
            public static Tabs cdbTabs = new Tabs();
            public static ArrayList cellArrayList = new ArrayList();
            public static int internalCellId = 0;    
            public CDBTest() {
                    JMenuBar mainMenuBar = new JMenuBar();
                    JMenu mainMenu;
                    JMenuItem mainMenuItem;
                    JPanel mainPanel = new JPanel();
                    //Attach Menu Bar
                    setJMenuBar(mainMenuBar);
                    //Build the first menu.
                    mainMenu = new JMenu("File");
                    mainMenu.setMnemonic(KeyEvent.VK_F);
                    mainMenuBar.add(mainMenu);
                    //JMenuItems
                    mainMenuItem = new JMenuItem("New",KeyEvent.VK_N);
                    mainMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, ActionEvent.CTRL_MASK));
                    mainMenuItem.addActionListener(this);
                    mainMenu.add(mainMenuItem);
                    mainMenuItem = new JMenuItem("Open",KeyEvent.VK_O);
                    mainMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, ActionEvent.CTRL_MASK));
                    mainMenuItem.addActionListener(this);
                    mainMenu.add(mainMenuItem);
                    mainMenu.addSeparator();
                    mainMenuItem = new JMenuItem("Save",KeyEvent.VK_S);
                    mainMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, ActionEvent.CTRL_MASK));
                    mainMenuItem.addActionListener(this);
                    mainMenu.add(mainMenuItem);
                    mainMenuItem = new JMenuItem("Save As",KeyEvent.VK_A);
                    mainMenuItem.addActionListener(this);
                    mainMenu.add(mainMenuItem);
                    mainMenu.addSeparator();
                    mainMenuItem = new JMenuItem("Exit",KeyEvent.VK_E);
                    mainMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F4, ActionEvent.ALT_MASK));
                    mainMenuItem.addActionListener(this);
                    mainMenu.add(mainMenuItem);
                    //define main content panel
                    mainPanel.setPreferredSize(new Dimension(600, 350));
                    //Turn border off for now 3/19/02
                    //mainPanel.setBorder(BorderFactory.createLineBorder(Color.black));
                    setResizable(false);
                    setTitle("Cell Site Database Editor");
                    //define and add components
                    mainPanel.add(cellList);
                    mainPanel.add(cdbTabs);
                    setContentPane(mainPanel);
            public void actionPerformed(ActionEvent e) {
                    JMenuItem source = (JMenuItem)(e.getSource());
                    if (source.getText() == "Open") {
                            // "." represents current dir, NOT APP-DIR,
                            // AND worse, the "Up" feature in filechooser now broken
                            // DAMNIT!
                            //final JFileChooser fc = new JFileChooser(".");
                            final JFileChooser fc = new JFileChooser();
                            fc.addChoosableFileFilter(new CDBFileFilter());
                            int returnVal = fc.showOpenDialog(this);
                            if (returnVal == JFileChooser.APPROVE_OPTION) {
                                    File file = fc.getSelectedFile();
                                    //this is where a real application would open the file.
                                    //JOptionPane.showMessageDialog(this, "Opening " + file.getName());
                                    try {
                                            // Clear out any existing entries
                                            if (cellList.isFilled()) {
                                                    cellArrayList.clear();
                                                    cellList.removeAllFromJList();
                                                    internalCellId = 0;
                                            FileReader cdbReader = new FileReader(file);
                                            BufferedReader br = new BufferedReader(cdbReader);
                                            //JComboBox cellList = new JComboBox();
                                            //cellList.addActionListener(this);
                                            String line;
                                            while((line = br.readLine()) != null){
                                                    // Looping through each line
                                                    cellArrayList.add(internalCellId, Split(line,",")); //Add array with an index
                                                    String[] arCells = (String[]) cellArrayList.get(internalCellId); //Extract array object and cast as a String Array
                                                    cellList.AddCell(arCells[0] + " " + arCells[1]);
                                                    //cellList.addItem(arCells[0] + " " + arCells[1]);
                                                    internalCellId++;
                                            cellList.list.setSelectedIndex(0);
                                    } catch (FileNotFoundException fnf) {
                                            System.err.println("Unable to open file for reading: " + fnf.getMessage());
                                    } catch (IOException ioe) {
                                            System.err.println("unable to buffer read file: " + ioe.getMessage());
                            } else {
                                    JOptionPane.showMessageDialog(this, "Cancelled ");
                    } else if (source.getText() == "Exit") {
                            System.exit(0);
                    } else {
                            String s = "Action event detected.\n"
                               + "    Event source: " + source.getText()
                               + " (an instance of " + getClassName(source) + ")";
                            JOptionPane.showMessageDialog(this, s);
            public static String[ ] Split(String str2Split, String separator) {
                    StringTokenizer parser = new StringTokenizer(str2Split, separator);
                    int numTokens=parser.countTokens( );
                    String[ ] arString = new String[numTokens];
                    for (int i=0; i < numTokens; i++) {
                            arString[i] = parser.nextToken( );
                    return arString;
            public void createNewCell() {
                    JDialog newDialog = new JDialog();
                    newDialog.setTitle("New Cell Site");
                    newDialog.setResizable(false);
                    newDialog.setModal(true);
                    //create txt fields
                    CDBTextField txtCellID = new CDBTextField(15,10);
                    CDBTextField txtCellName = new CDBTextField(15,20);
                    CDBTextField txtSwitch = new CDBTextField(15,10);
                    CDBTextField txtSectorID = new CDBTextField(1,1);
                    CDBTextField txtSectorName = new CDBTextField(15,12);
                    //create buttons
                    JButton btnOK = new JButton("OK");
                    btnOK.setActionCommand("ok");
                    btnOK.addActionListener(this);
                    JButton btnCancel = new JButton("Cancel");
                    btnCancel.setActionCommand("cancel");
                    btnCancel.addActionListener(this);
                    //Layout the labels in a panel
                    JPanel labelPane = new JPanel();
                    labelPane.setLayout(new GridLayout(0, 1));
                    labelPane.add(new JLabel("Cell ID:"));
                    labelPane.add(new JLabel("Cell Name:"));
                    labelPane.add(new JLabel("Switch:"));
                    labelPane.add(new JLabel("Sector ID:"));
                    labelPane.add(new JLabel("Sector Name:"));
                    //Layout the text fields in a panel
                    JPanel fieldPane = new JPanel();
                    fieldPane.setLayout(new GridLayout(0, 1));
                    fieldPane.add(txtCellID);
                    fieldPane.add(txtCellName);
                    fieldPane.add(txtSwitch);
                    fieldPane.add(txtSectorID);
                    fieldPane.add(txtSectorName);
                    //Layout the buttons in a panel
                    JPanel buttonPane = new JPanel();
                    buttonPane.setLayout(new GridLayout(0, 2));
                    buttonPane.add(btnCancel);
                    buttonPane.add(btnOK);
                    //Put the panels in another panel, labels on left,
                    //text fields on right
                    JPanel contentPane = new JPanel();
                    contentPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
                    contentPane.setLayout(new BorderLayout(10,10));
                    contentPane.add(labelPane, BorderLayout.CENTER);
                    contentPane.add(fieldPane, BorderLayout.EAST);
                    contentPane.add(buttonPane, BorderLayout.SOUTH);
                    newDialog.setContentPane(contentPane);
                    newDialog.pack();
                    newDialog.show();      
            // Returns just the class name -- no package info.
            protected String getClassName(Object o) {
                    String classString = o.getClass().getName();
                    int dotIndex = classString.lastIndexOf(".");
                    return classString.substring(dotIndex+1);
            public static void main(String args[]) {
                    final CDBTest CDBApp = new CDBTest();
                    CDBApp.addWindowListener(new WindowAdapter() {
                        public void windowClosing(WindowEvent e) {
                            System.exit(0);
                    CDBApp.pack();
                    CDBApp.show();
    I'm new to Java and trying tio pick it up as I code
    so please give me any recommendations you have
    some things I don't really understand.
    And here is the code of my class that calls the function
    in my main class.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class ActionButtons extends JPanel implements ActionListener {
            protected JButton btnNew, btnCopy, btnDelete;
            private int btnWidth = 35;
            private int btnHeight = 34;
            public ActionButtons() {
                    ImageIcon icoBtnNew = new ImageIcon("images/new.gif");
                    ImageIcon icoBtnCopy = new ImageIcon("images/copy.gif");
                    ImageIcon icoBtnDelete = new ImageIcon("images/delete.gif");
                    btnNew = new JButton(icoBtnNew);
                    btnNew.setPreferredSize(new Dimension(btnWidth,btnHeight));
                    btnNew.setToolTipText("Create a new cell site.");
                    btnNew.setActionCommand("new");
                    btnNew.addActionListener(this);
                    add(btnNew);
                    btnCopy = new JButton(icoBtnCopy);
                    btnCopy.setPreferredSize(new Dimension(btnWidth,btnHeight));
                    btnCopy.setToolTipText("Copy selected cell site.");
                    btnCopy.setActionCommand("copy");
                    btnCopy.addActionListener(this);
                    add(btnCopy);
                    btnDelete = new JButton(icoBtnDelete);
                    btnDelete.setPreferredSize(new Dimension(btnWidth,btnHeight));
                    btnDelete.setToolTipText("Delete selected cell site.");
                    btnDelete.setActionCommand("delete");
                    btnDelete.addActionListener(this);
                    add(btnDelete);
           public void actionPerformed(ActionEvent e) {
                    if (e.getActionCommand() == "new") {
                            //switch tabs to general tab
                            CDBTest.createNewCell();
    Thanks
    Josh

  • Since installing LTR 5.4, which I've now upgraded to 5.6, I've encountered repeated slowness and malfunctions in operations, especially when using the Compare View function and the Tab key to open and close the right and left side panels.  Such problems n

    Since installing LTR 5.4, which I've now upgraded to 5.6, I've encountered repeated slowness and malfunctions in operations, especially when using the Compare View function and the Tab key to open and close the right and left side panels.  Such problems never arose during two years of using LTR-4 and nothing else has changed on my computer.  I have a pretty simple system with only a few plug-ins, which are usually not in operation.  I have 12GB of RAM in my Windows 7 PC.  I could illustrate these problems with screen shots if you would tell me how to submit screen shots.  Otherwise I will try to describe the problems in words.
    The problem is clearly cumulative, growing worse as usage time passes.  Compare View feature gradually slows down and eventually seems to choke as my work session proceeds. If I Exit LTR and re-enter and start all over, things will work normally for maybe 30 minutes, but then the Compare View feature begins to become very slow to respond.   In a recent example with my screen full of thumbnails in Library mode I highlighted two images to compare. LTR started to open the Compare View screen by first having the top row of thumbnails disappear to be replaced by the "SELECT" and "CANDIDATE" words in their spaces  (but no images), but Compare View never succeeded in gaining control of the screen. After some seconds the top row of thumbnails reasserted its position and the Compare View windows disappeared. But LTR kept trying to bring them back. Again the top row of thumbnails would go away, Select and candidate would reappear, try again, and give up. This went on for at least 2-3 minutes before I tried to choose File and Exit, but even that did not initially want to respond. It doesn't like to accept other commands when it's trying to open Compare View. Finally it allowed me to exit.
    To experiment I created a new catalog of 1100 images.  After 30-40 minutes, the Compare View function began to operate very slowly. With left and right side panels visible and two thumbnails highlighted, hitting Compare View can take half a minute before the two mid-size  images open in their respective SELECT and CANDIDATE windows. When the side panels are open and two images are in the Select/Candidate spaces, hitting the Tab button to close the side panels produces a very delayed response--25-30 seconds to close them, a few more seconds to enlarge the two images to full size. To reverse the process (i.e., to recall the two side panels), hitting Tab would make the two sides of the screen go black for up to a minute, with no words visible. Eventually the info fields in the panels would open up.
    I also created a new user account and imported a folder of 160 images. After half an hour Compare View began mis-placing data.  (I have a screen shot to show this.)  CANDIDATE appears on the left side of SELECT, whereas it should be on the right. The accompanying camera exposure data appears almost entirely to the left of the mid-screen dividing line. Although the Candidate and Select headings were transposed, the image exposure data was not, but the data for the image on the right was almost entirely to the left of the line dividing the screen in two.
    Gurus in The Lightroom Forum have examined Task Manager data showing Processes running and Performance indicators and they see nothing wrong.  I could also send screen shots of this data.
    At this point, the only way I can process my images is to work 30-40 minutes and then shut down everything, exit, and re-start LTR.  This is not normal.  I hope you can find the cause, and then the solution.  If you would like to see my screen shots, tell me how to submit them.
    Ollie
    [email protected]

    Since installing LTR 5.4, which I've now upgraded to 5.6, I've encountered repeated slowness and malfunctions in operations, especially when using the Compare View function and the Tab key to open and close the right and left side panels.  Such problems never arose during two years of using LTR-4 and nothing else has changed on my computer.  I have a pretty simple system with only a few plug-ins, which are usually not in operation.  I have 12GB of RAM in my Windows 7 PC.  I could illustrate these problems with screen shots if you would tell me how to submit screen shots.  Otherwise I will try to describe the problems in words.
    The problem is clearly cumulative, growing worse as usage time passes.  Compare View feature gradually slows down and eventually seems to choke as my work session proceeds. If I Exit LTR and re-enter and start all over, things will work normally for maybe 30 minutes, but then the Compare View feature begins to become very slow to respond.   In a recent example with my screen full of thumbnails in Library mode I highlighted two images to compare. LTR started to open the Compare View screen by first having the top row of thumbnails disappear to be replaced by the "SELECT" and "CANDIDATE" words in their spaces  (but no images), but Compare View never succeeded in gaining control of the screen. After some seconds the top row of thumbnails reasserted its position and the Compare View windows disappeared. But LTR kept trying to bring them back. Again the top row of thumbnails would go away, Select and candidate would reappear, try again, and give up. This went on for at least 2-3 minutes before I tried to choose File and Exit, but even that did not initially want to respond. It doesn't like to accept other commands when it's trying to open Compare View. Finally it allowed me to exit.
    To experiment I created a new catalog of 1100 images.  After 30-40 minutes, the Compare View function began to operate very slowly. With left and right side panels visible and two thumbnails highlighted, hitting Compare View can take half a minute before the two mid-size  images open in their respective SELECT and CANDIDATE windows. When the side panels are open and two images are in the Select/Candidate spaces, hitting the Tab button to close the side panels produces a very delayed response--25-30 seconds to close them, a few more seconds to enlarge the two images to full size. To reverse the process (i.e., to recall the two side panels), hitting Tab would make the two sides of the screen go black for up to a minute, with no words visible. Eventually the info fields in the panels would open up.
    I also created a new user account and imported a folder of 160 images. After half an hour Compare View began mis-placing data.  (I have a screen shot to show this.)  CANDIDATE appears on the left side of SELECT, whereas it should be on the right. The accompanying camera exposure data appears almost entirely to the left of the mid-screen dividing line. Although the Candidate and Select headings were transposed, the image exposure data was not, but the data for the image on the right was almost entirely to the left of the line dividing the screen in two.
    Gurus in The Lightroom Forum have examined Task Manager data showing Processes running and Performance indicators and they see nothing wrong.  I could also send screen shots of this data.
    At this point, the only way I can process my images is to work 30-40 minutes and then shut down everything, exit, and re-start LTR.  This is not normal.  I hope you can find the cause, and then the solution.  If you would like to see my screen shots, tell me how to submit them.
    Ollie
    [email protected]

  • How to use Logical database in function module?

    I will create a function module in HR.
    but how to use Logical database  in function module ?  Logical database PNP always show screen.in function (RFC) code , it is a matter.

    You cannot attach the LDB to the main program of the function group.
    - So you may [SUBMIT|https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=submit&adv=false&sortby=cm_rnd_rankvalue] a report which use the LDB and get back the data (export/import), by default in the syntax of SUBMIT the selection-screen will not be displayed
    - Use [LDB_PROCESS|https://www.sdn.sap.com/irj/sdn/advancedsearch?query=ldb_process&cat=sdn_all], fill a structured table for selection, and get data back in another table
    - Use [HR function modules to read Infotypes|https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=hrfunctionmodulestoread+Infotypes&adv=false&sortby=cm_rnd_rankvalue].
    Regards

  • If we use DML statement in function then that function can be used inside s

    if we use DML statement in function then that function can be used inside select query or any DML query?

    select f from t2;I think you meant to query t1.
    It works if the function is an autonomous transaction:
    create or replace function f return number
    is
    PRAGMA AUTONOMOUS_TRANSACTION;
    begin
        update t1 set c=2;
        commit;
        return 1;
    end;
    select f from t1But as Billy said why would you want to do DML this way. And this is not the way autonomous procedures should be used either.
    An an answer to an interview question though nothing wrong with it.

  • How do I use the Match Pattern Function to exclude only 0.000?

    Hi,
    I'm trying to use the mattch pattern function to find the first string in a table thats is >0. My table looks like:
    1,0.000000,0.000 %2007/01/13 00:16:19 196281
    1,0.000000,0.000 %2007/01/13 00:16:22 196282
    1,0.831262,0.000 %2007/01/13 00:17:20 196375
    2,0.811154,0.000 %2007/01/13 00:17:20 196375
    If I us the paremeter "1,[~0]" It doesn't find the line 1,0.831262,0.000... which is the one that I want. I also tried :1,[0-9].+[~0] and that didn't work either. the problem is that the first digit after to 1, isn't allways going to go from 0 to 0.0 sometimes it might go from 0 to 2.??.
    Thanks for the help
    Matt

    "Matt361" <[email protected]> wrote in message news:[email protected]..
    Hi,
    &nbsp;
    I'm trying to use the mattch pattern function to find the first string in a table thats is &gt;0. My table looks like:
    1,0.000000,0.000 %2007/01/13 00:16:19 196281
    1,0.000000,0.000 %2007/01/13 00:16:22 196282
    1,0.831262,0.000 %2007/01/13 00:17:20 196375
    2,0.811154,0.000 %2007/01/13 00:17:20 196375
    If I us the paremeter "1,[~0]" It doesn't find the line 1,0.831262,0.000... which is the one that I want. I also tried :1,[0-9].+[~0] and that didn't work either. the problem is that the first digit after to 1, isn't allways going to go from 0 to 0.0 sometimes it might go from 0 to 2.??.
    &nbsp;
    Thanks for the help
    Matt
    &nbsp;
    Hi,
    1,[~0] matches a "1" a "," and then any character that is not "0".
    1,[0-9].+[~0] matches a "1" a "," and then any character that is "0-9", any number of anything!! (1 or more) and then anything that is not "0". Note that you have to escape a . to match a ".". Like this "\.".
    There is no way to check if there is anything other then a "0" in the match, from within the match pattern function. So I think you won't be able to find a pattern that does the trick.
    Why not use a whileloop to find the first item? Or use the Spreadsheet String To Array, and then compare the desired row or column with the string "0.000000"? (Or replace all ,0.000000, by a string like ",NULL,", then match the pattern?)
    In LabVIEW 8 there is a new Match Regular Expression function. Haven't tried it, but it should be much more powerfull then the Match Pattern function. But also much more complex.
    Regards,
    Wiebe.

  • Use of Procedure and Functions in ADF BC

    Hi,
    In ADF 11g
    1. can I use oracle function and procedures ( having in and OUT parameters) to expose as service interface
    2. if yes , How can this be done. and what are the allowed data types as input to procedure/function and can be returned by procedure/function
    3. How the transaction control will be achieved using ADF BC service interface.
    E.g. one ADF BC creates orders in order details and second creates Order lines in Order lines table. Now if order is created successfully but line creation fails then I want order to be rolled back also.
    Thanks.

    google it out.
    How to get two out param which is used in Procedure
    http://sameh-nassar.blogspot.in/2010/01/create-plsql-function-and-call-it-from.html
    http://adf-tools.blogspot.in/2010/09/adf-function-call-from-el-statement-in.html
    http://adf-tools.blogspot.in/2010/03/adf-plsql-procedure-or-function-call.html
    http://adfhowto.blogspot.in/2010/11/call-db-procedure-or-function-from-adf.html
    Re: use of Procedure and Functions in ADF BC

  • Not able to copying files/folders from one Document Library to another Document Library using Open with Browser functionality

    Hi All, 
    We have SharePoint Production server 2013 where users are complaining that they are not able to copy or move files from one document library to another document library using “Open with Explorer” functionality.
    We tried to activate publishing features on production server but it did not work. We users reported following errors:  
    Copying files from one document library to another document library:
    Tried to map the document libraries and still not get the error to copy files: 
    In our UAT environment we are able to copy and move folders from using “Open with Explorer” though.
    We have tried to simulate in the UAT environment but could not reproduce the production environment.  
    Any pointers about this issue would be highly appertained.
    Thanks in advance
    Regards,
    Aroh  
    Aroh Shukla

    Hi John and all,
    One the newly created web applications that we created few days back and navigated to document library, clicked on “Open with Explorer”, we get this error.
    We're having a problem opening this location in file explorer. Add this website to your trusted and try again.
    We added to the trusted site in Internet Explorer for this web application, cleared the cache and open the site with same document library but still get the same above error.
    However, another existing web application (In same the Farm) that we are troubleshooting at the moment, we are able click on “Open with Explorer”,  login in credentials opens and we entered the details we are able to open the document
    library and tried to follow these steps:
    From Windows Explorer (using with Open with Explorer), tried to copy or move a files to
    source document library.
    From Windows Explorer moved this file to another destination document library and we got this error.
    What we have to achieve is users should be able to copy files and folders using
    Open with Explorer functionality. We don’t know why Open with Explorer
    functionality not work working for our environment.  
    Are we doing something wrong? 
    We have referred to following websites.
    we hope concepts of copying / Moving files are similar as SharePoint 2010. Our production environment is SharePoint 2013.   
    http://www.mcstech.net/blog/index.cfm/2012/1/4/SharePoint-2010-Moving-Documents-Between-Libraries https://andreakalli.wordpress.com/2014/01/28/moving-or-copying-files-and-folders-in-sharepoint/
    Please advise us. Thank you.
    Regards,
    Aroh
    Aroh Shukla

  • How To use the going back function in Safari (multitouch)? Going back on Websites ist only possible using the arrow Key on the left corner but not by using the sweep function like it is possible in macOS.

    How can i use the going back function in Safari like it is possible in MacOS? On the Mac i can chance back to previous Websites by sweeping with two Fingers. Unfortuntely is this Not possible on the ipad. I tried with one and to fingers but it doesn't work.
    The multitouch function is switched on but still Not working. What is wrong? Thx for help.

    To go back a web page in Safari touch the screen with one finger at the extreme left and swipe to the right.
    To go forward a web page in Safari touch the screen with one finger at the extreme right and swipe to the left.

  • How to use Table valued MSSQL  function in OBIEE

    Hi all,
    Can some one help me to understand how to use table valued function in OBIEE? I want to use a table valued function (MSSQL function, with some input parameter), in the physical layer to pull the data?
    I know for MSSQL Stored Procedure we can write as
    EXEC SP_NAME @Parameter = 'VLUEOF(NQ_SESSION.Variablename)'
    but now I have a table valued function in the query window I can get the data as
    select * from myfunction(parametervalue)
    In physical layer of OBIEE I have tried as
    select * from myfunction('VLUEOF(NQ_SESSION.Variablename)'), but I'm getting error as the NQ_SESSION variable doesn't have a value , but actually I have initialized the variable but still Im getting error.
    Can some one help me to solve this.
    Thanks,
    Mithun

    Follow this link and try yourself. let me know for issues
    Substring instr issue in obiee
    Appreciate if you mark
    Edited by: Srini VEERAVALLI on Feb 20, 2013 8:13 AM

  • Is there any way to create a circular buffer using the INSERT ARRAY function?

    I saw the example using the REPLACE ARRAY function, but it uses too much CPU power on my laptop. I'm using it for a very sensitive application and saw that the INSERT ARRAY function used much less CPU power.
    I am also not wiring the index on the INSERT ARRAY function so that whatever is read from the buffer is added to the array.
    However, since it is not indexed, I don't know how to set the "write" index back to 0 when it reaches a certain sized array (ie 1000 elements). I was looking for an array property node, but couldn't figure out if one exists for the "current write index".
    Can anyone help?
    Thanks

    I will try to answer this question to my best understanding. I apologize if I interpreted the question wrong.
    You are using the "Insert Array" vi without wiring the index. By doing that, new elements will be added (appended) to the array.
    If you just want to know the current index to stop your acquisition when the array reach certain amount of elements, then you can use the "Array Size" vi to keep track of the size of the growing array. Remember that Array Size = last index + 1 because the index start at zero.
    A second option is that you may want to start over the array when it hits the maximum number of elements that you will allow. If that's the case, then you may want to re-initialize the array to a NULL state by stablishing a condition (for example, when the
    size of the array is 1000, re-initialize). I provided an example attached to this message showing how this can be accomplished. In the example, an 1D array grows in size using the "Insert Array" vi and inserting a random number. When the array reach 4 elements, it is re-initialized. You can expand this example by saving the array first to a file or some other holder before re-initializing the array. The example is in LabVIEW 6.
    Finally, if you want to replace the current values with new values, I think you do not have other choice but to use the "Replace Array" vi.
    Hope this can be of help.
    Regards;
    Enrique Vargas
    www.vartortech.com
    Attachments:
    array_example.vi ‏20 KB

  • Is there a way of using a mail merge function while on the iphone or ipad, i wish to email a "Word style, ot TXT" document to 250 of my contacts

    Is there a way of using a mail merge function while on the iphone or ipad, i wish to email a "Word style, ot TXT" document to 250 of my contacts, I have tried downloading my contacts to my PC's outlook but only 1 contact comes across at a time despite the fact that Icloud says downloading namedperson + 249 other contacts to a CSV file

    Hi everyone!
    Looking also for an app that allows me to merge email and send them out to each recipient individually. Apparently that's not possible yet. Here's what the guys at RedbitsApps told me about Group Email capabilities: 
    "The current version of the app relies on the device operating system to send the emails. For this reason, sending individual email instead of a single email to multiple recipients is not possible. Apple doesn't allow apps to send single emails to many recipients easily. We may use a custom sending software in a future version."
    Let's keep looking guys... 

  • Every time I try to upload a video to youtube (or pictures to blog services like tumblr) using Firefox, I cannot upload them unless I use the "basic uploader" function. Why and what can be done?

    Every time I try to upload a video to youtube or a pictures to a blog service, such as tumblr, I am unable to do so with the default uploading options (usually something that allows multiple uploads, etc). Instead, I can upload these media using their "basic upload" functions. Why and what can be done?
    == URL of affected sites ==
    http://www.youtube.com; http://www.tumblr.com

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It’s unlikely to solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    The purpose of the test is to determine whether the problem is caused by third-party software that loads automatically at startup or login, by a peripheral device, by a font conflict, or by corruption of the file system or of certain system caches.
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards, if applicable. Start up in safe mode and log in to the account with the problem. You must hold down the shift key twice: once when you turn on the computer, and again when you log in.
    Note: If FileVault is enabled, or if a firmware password is set, or if the startup volume is a Fusion Drive or a software RAID, you can’t do this. Ask for further instructions.
    Safe mode is much slower to start up and run than normal, with limited graphics performance, and some things won’t work at all, including sound output and Wi-Fi on certain models. The next normal startup may also be somewhat slow.
    The login screen appears even if you usually login automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    Test while in safe mode. Same problem?
    After testing, restart as usual (not in safe mode) and verify that you still have the problem. Post the results of the test.

  • I have a macbook pro4.1 and the sound chip in it failed. My speakers and microphone no longer work. Does anyone know of an external speaker and microphone set that plugs into the USB port so I can continue to use both of these functions?

    I have a macbook pro4.1 and the sound chip in it failed. My speakers and microphone no longer work. Does anyone know of an external speaker and microphone set that plugs into the USB port so I can continue to use both of these functions and not have to pay to have the entire main board replaced. Preferably something under $100.

    I don't think you're likely to find a set of external speakers that come with a microphone and plug directly into a USB port. There are USB audio cards that look like tiny flash drives but have microphone and headphone ports in them, to which you can connect a typical two-plug Windows PC headset with a microphone, or else you can connect external speakers and a stand-alone microphone. Those adapters typically cost under $10. I don't know anything about the quality of sound that can be expected from them.
    I have a Griffin iMic, which is much the same idea but larger, a bit more expensive (retail~$40), and perhaps delivers somewhat better sound quality (I hope so, but I don't know because I've never had occasion to try one of the little ones).
    http://www.google.com/products/catalog?oe=UTF-8&hl=en&client=safari&q=usb+sound+ card&um=1&ie=UTF-8&tbm=shop&cid=9618463009759678039&sa=X&ei=tgQoT5zYOMfZ0QHkiICw Ag&ved=0CHcQ8gIwAQ
    http://compare.ebay.com/like/320779457703?var=lv&ltyp=AllFixedPriceItemTypes&var =sbar

Maybe you are looking for

  • IMac 27" running OS 10.6.7 trying to install Win7 error message 0x80070017

    Hi all, For the last 10 hours I have been trying to install Win7 on my iMac 27".  After finding the solution to the black screen issue and getting through to selecting which version of Win7 I'd like to install blah blah, it starts writing the files a

  • Sreen goes black during start up

    Hi all. I have a MacBookPro early 2011 and after the latest Apple update to 10.7.5, my screen starts up normal then it goes to black sreen then back up to the normal gray with the Apple icon. This has never happened before, only after the update was

  • BEx Analyzer 7.0 result column

    Hi Gurus I have a question regarding the BEx Analyzer 7.0. Hope you can help. My customer wants to use BEx Analyzer 7.0 but is not happy with the fact that the excel query result starts in column F instead of column A (like the old BEx Analyzer did.)

  • Adobe reader showing no default email client

    I am using Adobe Reader X on a windows 7 64 bit machine.  I am also using Office 2010 with Outlook.  When I click the email icon in Adobe reader X it pops up a window saying that I have no default email client chose.  Outlook is set to be the default

  • Gnome pulseaudio using lots of shared memory

    Out of curisoty I did the following ls -l /dev/shm and I saw the following files:- -r-------- 1 peter users 67108904 Mar 23 10:40 pulse-shm-3021221787 -r-------- 1 peter users 67108904 Mar 23 10:24 pulse-shm-3538772094 -r-------- 1 peter users 671089