Access to EHS data from system outside of SAP

We are creating a Formulation tool in a SQL database with a Access front end which will need to use EHS Specification data and eventually push the Formulation data back into the SAP EHS Spec database.
I would like this new database to have Real-Time access to SAP data. We currently are using RFC connections with tools such as EASY-Expert and a external Rules based program Atrion as well, so I know it is possible to feed this data back and forth using XML files.
Any advice on how I should proceed and maybe some external tools for purchase that will help me do this.

Hi Beverly,
it is possible to access EH&S data from outside SAP by using the standard SAP BAPIs (e.g. BAPI_BUS1077_GETDETAIL for reading EH&S data) which are RFC enabled. Another possibility would be to develop your own RFC enabled function modules in the SAP system and call them from outside.
From your access database you can use VBA to perform the RFC call.
Best regards,
Andreas

Similar Messages

  • BAPI name to access employee data from systems like CSS, ISP GTP etc

    Hi All,
    Could you please suggest which BAPIs we need to use to access employee data from systems like CSS, ISP GTP etc
    Regards,
    Poonam
    Moderator message: Welcome to SCN!
    Moderator message: please do more research before asking, show what you have done yourself when asking.
    [Rules of engagement|http://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement]
    [Asking Good Questions in the Forums to get Good Answers|/people/rob.burbank/blog/2010/05/12/asking-good-questions-in-the-forums-to-get-good-answers]
    Edited by: Thomas Zloch on May 20, 2011 2:09 PM

    Hi All,
    Could you please suggest which BAPIs we need to use to access employee data from systems like CSS, ISP GTP etc
    Regards,
    Poonam
    Moderator message: Welcome to SCN!
    Moderator message: please do more research before asking, show what you have done yourself when asking.
    [Rules of engagement|http://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement]
    [Asking Good Questions in the Forums to get Good Answers|/people/rob.burbank/blog/2010/05/12/asking-good-questions-in-the-forums-to-get-good-answers]
    Edited by: Thomas Zloch on May 20, 2011 2:09 PM

  • How to access listbox binding data from a button which is not part of listbox in xaml page

    Hi
    I have the below listbox and its bdining as below
     <ListBox x:Name="listMyPosts" ItemsSource="{Binding Path=MyPostsDataSource}" Grid.Row="0"  >
               <ListBox.ItemTemplate >
                          <DataTemplate >                                      
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Text="{Binding
    NewPostText ,Mode=TwoWay}"/>
                                            <TextBlock Text="{Binding
    NewPostSender}"/>
                                        </StackPanel>                                      
                                </DataTemplate>
                </ListBox.ItemTemplate>
               <Button content="Send Post" command ="Binding SendClickCommand} />
      </ListBox>
    And i am assining postsViewmodel
    private PostsViewModel _PostsViewModel ;
    public Conversation()
    InitializeComponent();
    _PostsViewModel = new PostsViewModel ();
    this.DataContext = _PostsViewModel ;
    public ObservableCollection<PostsModel> MyPostsDataSource
    get
    if (_MyPostsDataSource== null)
    _MyPostsDataSource= GetMyPosts();
    return _MyPostsDataSource;
    set
    this._MyPostsDataSource = value;
    RaisePropertyChanged("MyPostsDataSource");
    is that possible to access listbox binding data from the ViewModel's SendClickCommand property ?
    Krrishna

    If you need to pass to the command selected item, try this
    <Button Сontent="Send Post"
          Сommand ="{Binding SendClickCommand}"
          CommandParameter={Binding ElementName=listMyPosts,
    Path=SelectedItem}/>
    msdn

  • Access Address Book data from terminal

    Hi everyone,
    I was wondering if there is a way to access Address Book data from the terminal. For instance, I would
    need a command that would output an address of a given person.
    Thanks in advance for your input

    this script could be used in Terminal (save the code below as
    "getaddress" and mark it as executable):
    case $# in
    2) firstname=$1; lastname=$2;;
    *) echo 'Usage: getaddress <firstname> <lastname>' 1>&2; exit 1 ;;
    esac
    count=`osascript -e "tell application \"Address Book\" to count (people whose first name is \"${firstname}\" and last name is \"${lastname}\")"`
    case $count in
    0) echo "$firstname $lastname is not in Address Book." 1>&2; exit 1;;
    1) ;;
    *) echo "There are multiple entries for $firstname $lastname in Address Book (unhandled error)." 1>&2; exit 1;;
    esac
    osascript -e "tell application \"Address Book\" to get formatted address of address of first person whose first name is \"${firstname}\" and last name is \"${lastname}\""
    Message was edited by: jazzy79

  • How to access internal table data from webdynpro to Flex application.

    Hi Connoisseur
    The data transfer from Abap WebDeypro to flex island works well. I followed , there is an example from Thomas Jung (by the way as always Great Work) and  Karthikeyan Venkatesan (Infosys) but this example covers simple type only.
    There is no example with complex types like arrayCollection which handle the transfer of data from flex to WebDynpro.
    i tried to do pass internal table value  to flex-datagrid.but its not work.
    i would like to know
    1.how to access internal table data from webdynpro to Flex application.
    2.how to pass the internal table to flex-datagrid.
    2.how to pass dynamically in ADOBE flex.
    3. how to do Flex is receiving the wd context data?
    4. how can we update WD context with FLEX data.
    Ple give me sample example and step by step procedure.
    Regards
    laxmikanth

    Hi Laxmikanth,
    Please refer this...
    Flash island: update complex type from flex
    Cheers..
    kris.

  • Load Grid with data from System.Data.DataTable

    Hi all.
    A have a System.Data.DataTable e need load a grid with data from this DataTable.
    How Load a Grid with data from System.Data.DataTable?

    Hi Francisco,
    actually i don't think that you can use a .NET datatable to fill a business one grid.
    the business one has it's own datatable.
    in c# it would look like this:
    oForm.DataSources.DataTables.Add("MyDataTable");
    ((SAPbouiCOM.Grid)(oForm.Items.Item("grid").Specific)).DataTable = oForm.DataSources.DataTables.Item("MyDataTable");
    oForm.DataSources.DataTables.Item(0).ExecuteQuery("SELECT Field FROM [dbname].dbo.TABLE");
    ((SAPbouiCOM.Grid)(oForm.Items.Item("grid").Specific)).CollapseLevel = 1;
    ((SAPbouiCOM.Grid)(oForm.Items.Item("grid").Specific)).AutoResizeColumns();
    ((SAPbouiCOM.Grid)(oForm.Items.Item("grid").Specific)).SelectionMode = SAPbouiCOM.BoMatrixSelect.ms_Single;
    good night
    lg David

  • Access SQL-Server Data from Oracle 10gXE

    Hello,
    I want to access sql-server data from oracle 10g XE. I need the same functionality provided by Sql-server by Linked Servers, by which we can query on any data source(oracle, Excel, Access).
    do, Oracle 10gXE provide us with same functionality ???
    any pointers ???

    Yes, it does work with Express Edition.
    Here is a thread from the XE forum with examples.
    Re: Database Link to MS Access
    They refer to a MS Access database, but the procedure is the same.
    Doug

  • How to access Sybase IQ data from SAP BW

    Hi,
    I read from Sybase website that we can access Sybase IQ data from SAP BW using Remote Cube through JDBC driver.
    Is there any documentation on how to configure that?
    Thanks in advance for your help.
    Our BW version is 7.01
    Sybase IQ is 15.4
    Thanks,
    CH

    Hi,
    The two files that are created are one is Control File ( will save as filename_s ) and other is data file. The control file will give you the details of your fields in your Infospoke
    regards
    Srini
    Message was edited by:
            Srinivas

  • Transfer data from dot net to sap system

    Hi gurus!
    please , help me out , i wanna transfer data from dot net to sap system. i have no idea abt it.
    Points can be given sure!!!!!!
    Rahul Deshmukh

    Hi,
    You need to create a RFC(Remote Function Call) to achieve this.
    Goto Transaction SE37
    Import Parameters(What all data you are going to pass from JAVA to SAP)
    EXPORT parameters(What all data you want to pass from SAP to JAVA)
    TABLES parameters (What all tables you want to pass from JAVA to SAP)
    Goto Attributes tab & select Remote Enabled.
    Do the coding to insert records in ZTABLE.
    Activate the RFC
    Now, in JAVA code to login to sap & call the RFC with the required data.
    Best regards,
    Prashant

  • How to Transfer the Data from ORACLE APPS to SAP

    Hi Gurus,
    Here are my couple of quieries regarding Data Migration from Legacy(Oracle Apps) to SAP.
    1. How to link between Legacy system(ORACLE APPS) and SAP ?
    2. How to migrate the data from Oracle tables to SAP directly, instead of loading the flat files(.txt, .xls) ?
    Please respond to my queries ASAP.
    Thanks,
    SAPSURE.
    Edited by: sapsure on Sep 9, 2010 11:39 AM
    Edited by: sapsure on Sep 10, 2010 2:32 PM

    1. How to link between Legacy system(ORACLE APPS) and SAP ?
            If you have SAP PI in place then you can interact with oracle database tables directly from PI and then data can be posted to SAP transactions through IDocs/BAPIs.
            If you did not have SAP PI still you can do JDBC connection directly from ABAP program. Not sure about the exact steps check in forum.
    2. How to migrate the data from Oracle tables to SAP directly, instead of loading the flat files(.txt, .xls) ?
            If you want to directly post the data SAP transactions (I hope not directly to SAP tables) then connection needs to establish through ABAP program or Via. PI.
    Regards,

  • Pls Help me with steps to add data from xml file to SAP B1 through B1iSN.

    Pls Help me with steps to add data from xml file to SAP B1 through B1iSN. I  am getting stuck in xsl transformation. not able to understand where the mapping code needs to be added.
    Pls explain me the steps for adding data from xml to B1 quotation step by step.
    thanks and regards
    Priya

    Hi,
    Have you checked this: https://sap.na.pgiconnect.com/p45508295/?launcher=false&fcsContent=true&pbMode=normal ?
    Thanks,
    Gordon

  • How to Extract the data from Microsoft BI to SAP BI 7

    Dear All,
    We have a requirement to Extract the data from Microsoft BI to Sap BI 7. How can we achieve this??
    Shall we use the DB connection for this??
    If anyone knows about this please give me some suggestion.
    Thanks in advance
    Sathiya

    Hi All,
    How to include the DBMS name when I give the connection. We are using the Data base as MS-BI.
    Please guide me
    Thanks in advance.
    Regards
    Sathiya

  • Accessing  linkbutton cell data from a system matrix

    I am using the UI SDK with SBO to develop an add-in. I am trying to access data from the matrix on the Sales Order form and I am stuck where the cell type is a link button.
    I have figured out how to do it for an Edit cell and a Combobox cell using the UI SDK, but in the case of a link button, the only property available for that item type is the LinkedObject property which is a BoLinkedObject enumeration.
    How whould I get the "Item No." value for example as entered in the form's matrix by the user?

    hi,
    A linked button works the same as an edit text. Just cast the specific object of the cell in an edit text object
    In C# code this gives the following
    string val = ((SAPbouiCOM.EditText)mtrx.Columns.Item(colID).Cells.Item(row).Specific).Value;
    Yannick

  • Need help pulling data from an outside file into my array.  Please help  =)

    Hi,
    I need help adapting my array to read the interest rates from an outside file. Here is my code and the outside file I wrote. Please help. Oh, the array in question is on line 259, inside of my calculation() method.
    Thanks...
    import javax.swing.*;
    import javax.swing.event.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.text.NumberFormat;
    import java.text.DecimalFormat;
    import java.io.*;
    import javax.swing.JOptionPane;
    public class Workshop5 extends JFrame implements ActionListener
         //declare gui components
         //declare labels
         JPanel contentPane = new JPanel();
         JPanel graphPane = new JPanel();
        JLabel instructionLabel = new JLabel();
        JLabel amountLabel = new JLabel();
         JLabel orLabel = new JLabel();
         JLabel comboBoxLabel = new JLabel();
         JLabel termLabel = new JLabel();
         JLabel rateLabel = new JLabel();
         JLabel calcLabel = new JLabel();
         JLabel paymentLabel = new JLabel();
         JLabel tableLabel = new JLabel();
         //declare font object
         Font labelFont = new Font("Tahoma", Font.PLAIN, 16);
         //declare text fields
         JTextField amountField = new JTextField(20);    
         JTextField termField = new JTextField(20);     
         JTextField rateField = new JTextField(20);
         JTextField paymentField= new JTextField(20);
         //declare combo box for loan selection
         JComboBox comboBox = new JComboBox();
        //declare button group and radio buttons
        ButtonGroup buttonGroup = new ButtonGroup();
        JRadioButton enterRadioButton = new JRadioButton("Enter amount, term, & rate", true);
        JRadioButton selectRadioButton = new JRadioButton("Select a preset term/rate loan", false);
         //declare button objects
         JButton clearButton = new JButton();
        JButton calcButton = new JButton();
        JButton quitButton = new JButton();
         //declare text area for amortization
         JTextArea amortTextArea = new JTextArea();
         JTextArea testTextArea = new JTextArea();
         //declare scroll bar for amortization table
         JScrollPane scrollPane = new JScrollPane(amortTextArea,ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
         public Workshop5()
              instructionLabel.setText("Choose one of the following payment calculation options:");
              instructionLabel.setFont(new Font("Tahoma",Font.PLAIN,16));
              //adds both buttons to button group     
              buttonGroup.add(enterRadioButton);
              buttonGroup.add(selectRadioButton);
              enterRadioButton.setFont(labelFont);
              enterRadioButton.setBackground(Color.WHITE);
              enterRadioButton.setContentAreaFilled(false);
             enterRadioButton.addActionListener(this); //adds action listener to enter radio button
              orLabel.setText("OR");
              orLabel.setFont(new Font("Tahoma",Font.BOLD,18));
              selectRadioButton.setFont(labelFont);
              selectRadioButton.setBackground(Color.WHITE);
              selectRadioButton.setContentAreaFilled(false);
              selectRadioButton.addActionListener(this); //adds action listener to select radio button
              amountLabel.setText("Enter mortgage amount");
              amountLabel.setFont(new Font("Tahoma", Font.PLAIN,16));
              amountField.requestFocusInWindow();
              termLabel.setText("Enter term length in years:");
              termLabel.setFont(new Font("Tahoma", Font.PLAIN,14));
              rateLabel.setText("Enter interest rate:");
             rateLabel.setFont(new Font("Tahoma", Font.PLAIN,14));
                comboBoxLabel.setText("Select a loan:");
             comboBoxLabel.setFont(new Font("Tahoma", Font.PLAIN,14));
             comboBox.setBackground(new Color(255,255,255));
             comboBox.setFont(new Font("Tahoma", Font.PLAIN, 14));
             comboBox.setEnabled(false);
             ComboBox();
              calcLabel.setText("Press Calculate button to determine monthly payment.");
             calcLabel.setFont(new Font("Tahoma", Font.PLAIN, 16));
             calcButton.setText("Calculate");                    
             calcButton.setFont(new Font("Tahoma", Font.BOLD, 14));
             calcButton.addActionListener(this);
                //define monthly payment label
             paymentLabel.setText("Monthly payment:");
             paymentLabel.setFont(new Font("Tahoma", Font.PLAIN, 16));
             //define monthly payment text field
             paymentField.setFont(new Font("Tahoma", Font.BOLD,16));
             paymentField.setBackground(new Color(255,255,255));
             paymentField.setEditable(false); 
              //define clear button
              clearButton.setText("Clear"); 
              clearButton.setFont(new Font("Tahoma", Font.BOLD,14));
              clearButton.addActionListener(this);
              //define quit button
              quitButton.setText("Quit");
              quitButton.setFont(new Font("Tahoma", Font.BOLD,14));
              quitButton.addActionListener(this);         
              tableLabel.setText("Amoritization Table");
              tableLabel.setFont(new Font("Tahoma", Font.BOLD, 16));
              graphPane.setBackground(Color.WHITE);
              //add components to content     
              getContentPane().add(contentPane);
              contentPane.setLayout(null);
              addComponent(contentPane, instructionLabel, 80,10,450,26);
              addComponent(contentPane, enterRadioButton, 30,40,220,30);
              addComponent(contentPane, orLabel, 280,40,100,30);
              addComponent(contentPane, selectRadioButton, 335,40,350,30);
              addComponent(contentPane, amountLabel, 100,80,220,26);
              addComponent(contentPane, amountField, 300,80,150,26);
              addComponent(contentPane, termLabel, 15,125,200,30);
              addComponent(contentPane, termField, 195,125,125,30);
              addComponent(contentPane, rateLabel, 62,160,200,30);
              addComponent(contentPane, rateField, 195,165,125,30);
              addComponent(contentPane, comboBoxLabel, 400,125,200,26);
              addComponent(contentPane, comboBox, 400,155,150,30);
              addComponent(contentPane, calcLabel, 100,200,400,30);
              addComponent(contentPane, calcButton, 250,240,100,30);
              addComponent(contentPane, paymentLabel, 150,285,200,30);
              addComponent(contentPane, paymentField, 300,285,100,30);
              addComponent(contentPane, clearButton, 100,330,100,30);
              addComponent(contentPane, quitButton, 400,330,100,30);
              addComponent(contentPane, tableLabel, 200,370,300,26);
              addComponent(contentPane, scrollPane, 10,400,450,360);
              addComponent(contentPane, graphPane, 475,400,305,360);
              //add window listener to close window when user presses X
              addWindowListener(new WindowAdapter()
                   public void windowClosing(WindowEvent e)    
                        System.exit(0);
             pack();   
         //method to add components
         private void addComponent(Container container, Component c, int x, int y, int width, int height)
              c.setBounds(x, y, width, height);
              container.add(c);
         //action performed method
         public void actionPerformed(ActionEvent event)
              Object source = event.getSource();
              if (source == calcButton)
                   Calculate();
              if (source == clearButton)
                   Clear();
              if (source == quitButton)
                   Exit();
              //defines active area based on user selection of mortgage calculation method
               //if user chooses to enter the mortgage manually, combo box fields are inactive
               if (source == enterRadioButton)
                    comboBox.setEnabled(false);
                    termField.setEnabled(true);
                 termField.setEditable(true);
                 rateField.setEnabled(true);
                 rateField.setEditable(true);
                 amountField.setText("");
                   amountField.requestFocusInWindow();
                   termField.setText("");
                  rateField.setText("");
                  paymentField.setText("");
                  amortTextArea.setText("");
              //if user chooses to select from a preset mortgage, rate and term fields are inactive
              if (source == selectRadioButton)
                   comboBox.setEnabled(true);
                   termField.setEnabled(false);
                   termField.setEditable(false);
                   rateField.setEnabled(false);
                   rateField.setEditable(false);
                   amountField.setText("");
                   amountField.requestFocusInWindow();
                   termField.setText("");
                   rateField.setText("");
                   paymentField.setText("");
                   amortTextArea.setText("");
         }//end of action performed method
         //combo box method
          public void ComboBox()
               String[] LoanArray = {" 7 years at 5.35 %", " 15 years at 5.50 %", " 30 years at 5.75 %"};
               for (int i = 0; i < LoanArray.length; i++)
                    comboBox.addItem(LoanArray);
         }//end combo box method
         //calculation method
         void Calculate()
              //resets fields
              paymentField.setText("");
         amortTextArea.setText("");
              //calculation variables
         NumberFormat currency = NumberFormat.getCurrencyInstance();
              int [] termArray = {7, 15, 30};                               //array of years
                   double [] yearlyInterestArray = {5.35, 5.5, 5.75};           //array of interest
                   int totalMonths = 0;                                    //total months
                   double Loan = 0.0;                               //amount of loan
                   double MonthlyInterest = 0.0;                               //monthly interest rate
                   double Payment = 0.0;                               //calculate payment
                   double monthlyPayment = 0.0;                                   //calculate monthly payment
                   double Interest = 0.0;                                              //variable for Interest Array input
                   int Term = 0;                                              //variable for Term Array input
                   double NewMonthlyInterest = 0.0;                               //new interest amount
                   double NewLoan = 0.0;                               //new loan amount
                   double Reduction = 0.0;                               //principle reduction
                   //validate input
                   try
                        Loan = Double.parseDouble(amountField.getText());
                   catch (NumberFormatException e)
                        JOptionPane.showMessageDialog(null,"Invalid Entry. Please enter valid loan amount.", "Error", JOptionPane.WARNING_MESSAGE);
                   //resets input fields after error message
              amountField.setText("");
              amountField.requestFocusInWindow();
                   //if select button is chosen
              if (selectRadioButton.isSelected())
                   int index = comboBox.getSelectedIndex();
                   Term = termArray[index];
                   Interest = yearlyInterestArray[index];
              //if user chooses to enter mortgage information
              else
                   if (enterRadioButton.isSelected())
                        //validates input
              try
              Term = Integer.parseInt(termField.getText());
              catch (NumberFormatException e)
                   JOptionPane.showMessageDialog(null,"Invalid entry. Please enter valid term length in years.", "Error",JOptionPane.WARNING_MESSAGE);
                   //clears fields after error message
                   termField.setText("");
                   termField.requestFocusInWindow();
              try
                   Interest = Double.parseDouble(rateField.getText());
              catch (NumberFormatException e)
                   JOptionPane.showMessageDialog(null,"Invalid entry. Please enter valid rate (without percent symbol).","Error",JOptionPane.WARNING_MESSAGE);
              //clears fields after error message
              rateField.setText("");
                             rateField.requestFocusInWindow();
                   //perform calculations
                   if (Loan > 0)
                        Loan = Double.parseDouble(amountField.getText());
                        MonthlyInterest = (Interest / 12)/100;
                        totalMonths = Term * 12;
                        monthlyPayment = Loan * MonthlyInterest *(Math.pow((1 + MonthlyInterest), totalMonths)/(Math.pow((1 + MonthlyInterest), totalMonths)-1));
              paymentField.setText("" + currency.format(monthlyPayment));
                        //send information to amortization text area
                   amortTextArea.append("Number\t");
                   amortTextArea.append(" Amount\t");
                   amortTextArea.append("Interest\t");
                   amortTextArea.append("Principle\t");
                   amortTextArea.append("Balance\n");
              NewLoan = Loan;
                        for (int i = 1; i <= totalMonths; i++)
                             NewMonthlyInterest = MonthlyInterest * NewLoan;
                             Reduction = monthlyPayment - NewMonthlyInterest;
                             NewLoan = NewLoan - Reduction;
                             amortTextArea.append(" " + i +"\t");
                             amortTextArea.append(" " + currency.format(monthlyPayment) + "\t");
                             amortTextArea.append(" " + currency.format(NewMonthlyInterest)+ "\t");
                             amortTextArea.append(" " + currency.format(Reduction) + "\t");
                             amortTextArea.append(" " + currency.format(NewLoan) + "\n");
                        //resets fields if loan amount is less than zero
                        if((Loan <= 0 || Term <= 0 || Interest <= 0))
                             paymentField.setText("");
                             amortTextArea.setText("");
         }//end calcualtion method
         //clear method
         void Clear()
              amountField.setText("");
              amountField.requestFocusInWindow();
              termField.setText("");
              rateField.setText("");
              paymentField.setText("");
              amortTextArea.setText("");
         }//end of clear method
         //main method
         public static void main(String args[])
              Workshop5 f = new Workshop5();
              f.setTitle("Carol's Mortgage Calculator");
              f.setBounds(200,100,800,800);
              f.setResizable(false);
              f.setVisible(true);
         }//end of main method
         //exit method
         void Exit()
              System.exit(0);
         }//end of exit method
    }//program end
    My data file is called: "InterestData.dat" and only contains the following text:
    5.35, 5.5, 5.75

    Ok, now I am getting this error message:
    cannot resolve symbol method lenght()
    Please help me out here, this is due tomorrow and I've been killing myself on it...
    attaching program with revised code included, see beginning of calculation method line 250:
    import javax.swing.*;
    import javax.swing.event.*;
    import java.awt.*;
    import java.awt.event.* ;
    import java.text.NumberFormat;
    import java.text.DecimalFormat;
    import java.io.*;
    import javax.swing.JOptionPane;
    public class Workshop5 extends JFrame implements ActionListener
         //declare gui components
        //declare labels
        JPanel contentPane = new JPanel();
         JPanel graphPane = new JPanel();
         JLabel instructionLabel = new JLabel();
            JLabel amountLabel = new JLabel();
        JLabel orLabel = new JLabel();
        JLabel comboBoxLabel = new JLabel();
        JLabel termLabel = new JLabel();
        JLabel rateLabel = new JLabel();
        JLabel calcLabel = new JLabel();
        JLabel paymentLabel = new JLabel();
        JLabel tableLabel = new JLabel();
        //declare font object
        Font labelFont = new Font("Tahoma", Font.PLAIN, 16);
        //declare text fields
        JTextField amountField = new JTextField(20);
        JTextField termField = new JTextField(20);
        JTextField rateField = new JTextField(20);
        JTextField paymentField= new JTextField(20);
        //declare combo box for loan selection
        JComboBox comboBox = new JComboBox();
            //declare button group and radio buttons
            ButtonGroup buttonGroup = new ButtonGroup();
            JRadioButton enterRadioButton = new JRadioButton("Enter amount, term, & rate", true);
            JRadioButton selectRadioButton = new JRadioButton("Select a preset term/rate loan", false);
        //declare button objects
        JButton clearButton = new JButton();
            JButton calcButton = new JButton();
            JButton quitButton = new JButton();
        //declare text area for amortization
        JTextArea amortTextArea = new JTextArea();
        JTextArea testTextArea = new JTextArea();
        //declare scroll bar for amortization table
        JScrollPane scrollPane = new JScrollPane(amortTextArea, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
         public Workshop5()
             instructionLabel.setText("Choose one of the following payment calculation options:");
            instructionLabel.setFont(new Font("Tahoma",Font.PLAIN,16));
            //adds both buttons to button group
            buttonGroup.add(enterRadioButton);
            buttonGroup.add (selectRadioButton);
            enterRadioButton.setFont(labelFont);
            enterRadioButton.setBackground(Color.WHITE);
            enterRadioButton.setContentAreaFilled(false);
            enterRadioButton.addActionListener(this); //adds action listener to enter radio button
            orLabel.setText("OR");
            orLabel.setFont(new Font("Tahoma",Font.BOLD,18));
            selectRadioButton.setFont(labelFont);
            selectRadioButton.setBackground(Color.WHITE);
            selectRadioButton.setContentAreaFilled(false);
            selectRadioButton.addActionListener (this); //adds action listener to select radio button
              amountLabel.setText("Enter mortgage amount");
            amountLabel.setFont(new Font("Tahoma", Font.PLAIN,16));
            amountField.requestFocusInWindow();
            termLabel.setText("Enter term length in years:");
            termLabel.setFont(new Font("Tahoma", Font.PLAIN,14));
            rateLabel.setText("Enter interest rate:");
            rateLabel.setFont(new Font("Tahoma", Font.PLAIN,14));
            comboBoxLabel.setText("Select a loan:");
            comboBoxLabel.setFont(new Font("Tahoma", Font.PLAIN,14));
            comboBox.setBackground(new Color(255,255,255));
            comboBox.setFont(new Font("Tahoma", Font.PLAIN, 14));
            comboBox.setEnabled(false);
            ComboBox();
            calcLabel.setText("Press Calculate button to determine monthly payment.");
            calcLabel.setFont(new Font("Tahoma", Font.PLAIN, 16));
            calcButton.setText("Calculate");
            calcButton.setFont(new Font("Tahoma", Font.BOLD, 14));
            calcButton.setBackground(new Color(202,255,112));
            calcButton.addActionListener(this);
            //define monthly payment label
            paymentLabel.setText("Monthly payment:");
            paymentLabel.setFont(new Font("Tahoma", Font.PLAIN, 16));
            //define monthly payment text field
            paymentField.setFont (new Font("Tahoma", Font.BOLD,16));
            paymentField.setBackground(new Color(255,255,255));
            paymentField.setEditable(false);
              //define clear button
            clearButton.setText("Clear");
            clearButton.setFont(new Font("Tahoma", Font.BOLD,14));
            clearButton.setBackground(new Color(202,255,112));
            clearButton.addActionListener(this);
            //define quit button
            quitButton.setText("Quit");
            quitButton.setFont(new Font("Tahoma", Font.BOLD,14));
            quitButton.setBackground(new Color(202,255,112));
            quitButton.addActionListener(this);
              //define label for amortization table
            tableLabel.setText ("Amoritization Table");
              tableLabel.setFont(new Font("Tahoma", Font.BOLD, 16));
            graphPane.setBackground(Color.WHITE);
            //add components to content
            getContentPane().add(contentPane);
            contentPane.setLayout(null);
              addComponent(contentPane, instructionLabel, 80,10,450,26);
            addComponent(contentPane, enterRadioButton, 30,40,220,30);
            addComponent(contentPane, orLabel, 280,40,100,30);
            addComponent(contentPane, selectRadioButton, 335,40,350,30);
            addComponent(contentPane, amountLabel, 100,80,220,26);
            addComponent(contentPane, amountField, 300,80,150,26);
            addComponent(contentPane, termLabel, 15,125,200,30);
            addComponent(contentPane, termField, 195,125,125,30);
            addComponent(contentPane, rateLabel, 62,160,200,30);
            addComponent(contentPane, rateField, 195,165,125,30);
            addComponent(contentPane, comboBoxLabel, 400,125,200,26);
            addComponent(contentPane, comboBox, 400,155,150,30);
            addComponent(contentPane, calcLabel, 100,200,400,30);
            addComponent(contentPane, calcButton, 250,240,100,30);
            addComponent(contentPane, paymentLabel, 150,285,200,30);
            addComponent(contentPane, paymentField, 300,285,100,30);
            addComponent(contentPane, clearButton, 100,330,100,30);
            addComponent(contentPane, quitButton, 400,330,100,30);
            addComponent(contentPane, tableLabel, 200,370,300,26);
            addComponent(contentPane, scrollPane, 10,400,450,360);
            addComponent(contentPane, graphPane, 475,400,305,360);
            //add window listener to close window when user presses X
            addWindowListener(new WindowAdapter()
                 public void windowClosing(WindowEvent e)
                      System.exit(0);
            pack();
           //method to add components
           private void addComponent(Container container, Component c, int x, int y, int width, int height)
                   c.setBounds(x, y, width, height);
                   container.add(c);
           //action performed method
           public void actionPerformed(ActionEvent event)
                   Object source = event.getSource();
                   if (source == calcButton)
                           Calculate();
                   if (source == clearButton)
                           Clear();
                   if (source == quitButton)
                           Exit();
                   //defines active area based on user selection of mortgage calculation method
                   //if user chooses to enter the mortgage manually, combo box fields are inactive
                   if (source == enterRadioButton)
                           comboBox.setEnabled(false);
                           termField.setEnabled(true);
                   termField.setEditable(true);
                   rateField.setEnabled(true);
                   rateField.setEditable(true);
                   amountField.setText ("");
                           amountField.requestFocusInWindow();
                           termField.setText("");
                       rateField.setText("");
                       paymentField.setText ("");
                       amortTextArea.setText("");
                   //if user chooses to select from a preset mortgage, rate and term fields are inactive
                   if (source == selectRadioButton)
                           comboBox.setEnabled(true);
                           termField.setEnabled(false);
                           termField.setEditable(false);
                           rateField.setEnabled (false);
                           rateField.setEditable(false);
                           amountField.setText("");
                           amountField.requestFocusInWindow();
                           termField.setText ("");
                           rateField.setText("");
                           paymentField.setText("");
                           amortTextArea.setText("");
           }//end of action performed method
           //combo box method
            public void ComboBox()
                   String[] LoanArray = {" 7 years at 5.35 %", " 15 years at 5.50 %", " 30 years at 5.75 %"};
                   for (int i = 0; i < LoanArray.length; i++)
                           comboBox.addItem(LoanArray);
    }//end combo box method
    //calculation method
         void Calculate()
              //resets fields
              paymentField.setText("");
              amortTextArea.setText("");
              //calculation variables
              NumberFormat currency = NumberFormat.getCurrencyInstance();
              //declare input stream object
              InputStream istream;
              //create a file object to refer to the outside file
              File interestData = new File("InterestFile.dat");
              //assign instream to the new file object
              istream = new FileInputStream(interestData);
              try
                   StringBuffer sb = new StringBuffer();
                   BufferedReader in = new BufferedReader(new FileReader(interestData));
                   String line = "";
                   while((line = in.readLine()) != null)
                        sb.append(line);
                   in.close();
                   String fileData = sb.toString();
                   String[] splitData = fileData.split(", ");
                   double [] yearlyInterestArray = new double[splitData.length()];
                   for(int j = 0; j < splitData.length(); j++)
                        yearlyInterestArray[j] = new Double(splitData[j]).doubleValue();
              catch (IOException e)
                   JOptionPane.showMessageDialog(null, "File does not exist." + e.getMessage());
              int [] termArray = {7, 15, 30}; //array of years
              double [] yearlyInterestArray = { 5.35, 5.5, 5.75}; //array of interest
              int totalMonths = 0; //total months
              double Loan = 0.0; //amount of loan
              double MonthlyInterest = 0.0; //monthly interest rate
              double Payment = 0.0; //calculate payment
    double monthlyPayment = 0.0; //calculate monthly payment
    double Interest = 0.0; //variable for Interest Array input
    int Term = 0; //variable for Term Array input
    double NewMonthlyInterest = 0.0; //new interest amount
    double NewLoan = 0.0; //new loan amount
    double Reduction = 0.0; //principle reduction
    //validate input
    try
         Loan = Double.parseDouble(amountField.getText());
    catch (NumberFormatException e)
         JOptionPane.showMessageDialog(null,"Invalid Entry. Please enter valid loan amount.", "Error", JOptionPane.WARNING_MESSAGE);
    //resets input fields after error message
    amountField.setText("");
    amountField.requestFocusInWindow ();
              //if select button is chosen
              if (selectRadioButton.isSelected())
                   int index = comboBox.getSelectedIndex ();
                   Term = termArray[index];
                   Interest = yearlyInterestArray[index];
              //if user chooses to enter mortgage information
              else
                   if (enterRadioButton.isSelected())
              //validates input
              try
                   Term = Integer.parseInt(termField.getText());
    catch (NumberFormatException e)
         JOptionPane.showMessageDialog(null,"Invalid entry. Please enter valid term length in years.", "Error",JOptionPane.WARNING_MESSAGE);
         //clears fields after error message
         termField.setText("");
         termField.requestFocusInWindow();
    try
         Interest = Double.parseDouble(rateField.getText());
    catch (NumberFormatException e)
         JOptionPane.showMessageDialog(null,"Invalid entry. Please enter valid rate (without percent symbol).","Error",JOptionPane.WARNING_MESSAGE);
         //clears fields after error message
         rateField.setText("");
         rateField.requestFocusInWindow();
              //perform calculations
              if (Loan > 0)
                   Loan = Double.parseDouble(amountField.getText ());
                   MonthlyInterest = (Interest / 12)/100;
                   totalMonths = Term * 12;
                   monthlyPayment = Loan * MonthlyInterest *(Math.pow ((1 + MonthlyInterest), totalMonths)/(Math.pow((1 + MonthlyInterest), totalMonths)-1));
    paymentField.setText("" + currency.format(monthlyPayment));
    //send information to amortization text area
    amortTextArea.append("Number\t");
    amortTextArea.append(" Amount\t");
    amortTextArea.append("Interest\t");
    amortTextArea.append("Principle\t");
    amortTextArea.append("Balance\n");
                   NewLoan = Loan;
                   for (int i = 1; i <= totalMonths; i++)
         NewMonthlyInterest = MonthlyInterest * NewLoan;
         Reduction = monthlyPayment - NewMonthlyInterest;
         NewLoan = NewLoan - Reduction;
         amortTextArea.append(" " + i +"\t");
         amortTextArea.append (" " + currency.format(monthlyPayment) + "\t");
         amortTextArea.append(" " + currency.format(NewMonthlyInterest)+ "\t");
         amortTextArea.append(" " + currency.format(Reduction) + "\t");
         amortTextArea.append(" " + currency.format(NewLoan) + "\n");
    //resets fields if loan amount is less than zero
    if((Loan <= 0 || Term <= 0 || Interest <= 0))
         paymentField.setText("");
         amortTextArea.setText("");
         }//end calcualtion method
    //clear method
    void Clear()
    amountField.setText("");
    amountField.requestFocusInWindow();
    termField.setText("");
    rateField.setText("");
    paymentField.setText("");
    amortTextArea.setText("");
    }//end of clear method
    //main method
    public static void main(String args[])
    Workshop5 f = new Workshop5();
    f.setTitle("Carol's Mortgage Calculator");
    f.setBounds(200,100,800,800);
    f.setResizable(false);
    f.setVisible(true);
    }//end of main method
    //exit method
    void Exit()
    System.exit(0);
    }//end of exit method
    }//program end

  • How to extract data from ODS to non-SAP system

    Hi,
    Can anybody tell me, step by step, how to extract data from ODS to a non-SAP system?
    Is it possible to do it without programming effort? And is there volume limits for this kind of extraction?
    The non-SAP system is an unix system.
    Thanks in advance
    Ella

    Ella,
    You can look at it from the concept of a BADI / Infospoke
    Extract the data from the ODS to a Flat file / RDBMS using an infospoke. I am not sure as to how the infospoke loads data into the RDBMS ( did it very long ago ) but then you can push it into an RDBMS and I am sure it will be system neutral.
    Hope this helps...
    Arun
    Assign points if it helps

Maybe you are looking for

  • Safari keeps crashing and wont reset or clear history.

    Safari keeps crashing and a Netflix pop up opens everytime I open Safari. The same window and tabs keep reloading every time I open Safari. I have tried clearing the history and resetting Safari, but nothing is working. Below is the error report I am

  • File & Printer Sharing with  Windows Vista

    Hi All, I work in a small office, I'm the only mac user & I supply my own Macbook 10.5.6. We have just had a new Samsung printer installed in the office which all PC's have been enabled for printer sharing, but I cant seem to get my Mac to pick up th

  • Transaction Iview - SAP GUI for HTML

    Hi, In SAP transaction iviews - SAP GUI for HTML in portal there is a possibility to go to menu,other transactions from the transaction field.Is there any way to remove the Menu button and hide the transaction field from transaction iview. Please sug

  • Need ALOT of help for itunes?

    Ok,well i just got a new computer and i had backed up all my songs from my old computer to a cd. My old computer was an Emachine. When i tried to back up the songs to my computer it would not work,so I used my ipod to put my songs into itunes.After a

  • Where to get v.4 pls

    How do I downgrade to Safari 4? And where to get it?? version 5 is really really bad. It slows down my entire system. (I dont have any 3rd party plugins or whatever)