How to add a JMenubar and a JTable in a JFrame in a single application

Hi all,
I require an urgent help from you.I am a beginer in programming Swing.I want to add a menu,combobox,and a table in a single application.I did coding as below:
package com.BSS;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.table.*;
import javax.swing.border.*;
import javax.swing.event.*;
public class newssa extends JFrame
     public JMenuBar menuBar;
     public JToolBar toolBar;
     public JFrame frame;
     private JLabel jLabel1;
     private JLabel jLabel2;
     private JLabel jLabel3;
     private JLabel jLabel4;
     private JLabel jLabel5;
     private JLabel jLabel6;
     private JComboBox jComboBox1;
     private JComboBox jComboBox2;
     private JComboBox jComboBox3;
     private JComboBox jComboBox4;
     private JComboBox jComboBox5;
     private JComboBox jComboBox6;
     private JTable jTable1;
     private JScrollPane jScrollPane1;
     private JPanel contentPane;
     public newssa()
          super();
          initializeComponent();
          this.setVisible(true);
     private void initializeComponent()
          jLabel1 = new JLabel();
          jLabel2 = new JLabel();
          jLabel3 = new JLabel();
          jLabel4 = new JLabel();
          jLabel5 = new JLabel();
          jLabel6 = new JLabel();
          jComboBox1 = new JComboBox();
          jComboBox2 = new JComboBox();
          jComboBox3 = new JComboBox();
          jComboBox4 = new JComboBox();
          jComboBox5 = new JComboBox();
          jComboBox6 = new JComboBox();
          frame=new JFrame();
          //Included here
          JMenuBar menuBar = new JMenuBar();
          JMenu general = new JMenu("General");
     menuBar.add(general);
     JMenu actions =new JMenu("Actions");
     menuBar.add(actions);
     JMenu view=new JMenu("View");
     menuBar.add(view);
     JMenu Timescale=new JMenu("TimeScale");
     menuBar.add(Timescale);
     Timescale.add("Today CTRL+D");
     Timescale.add("Current Week CTRL+W");
     Timescale.add("Current Month CTRL+M");
     Timescale.add("Current Quarter CTRL+Q");
     Timescale.add("Current Year CTRL+Y");
     Timescale.add("Custom TimeScale CTRL+U");
     JMenu start=new JMenu("Start");
     menuBar.add(start);
     JMenu options=new JMenu("Options");
     menuBar.add(options);
     JMenu help=new JMenu("Help");
     menuBar.add(help);
     JFrame.setDefaultLookAndFeelDecorated(true);
     frame.setJMenuBar(menuBar);
     frame.pack();
     frame.setVisible(true);
     toolBar = new JToolBar("Formatting");
     toolBar.addSeparator();
          //Before this included new
          String columnNames[] = { "ColorStatus", "Flash", "Service Order","Configuration","Configuration Description"};
          // Create some data
          String dataValues[][] =
               { "blue", "flash", "ORT001" },
               { "AVCONF", "av configuration with warrenty"}
          // Create a new table instance
          //jTable1 = new JTable( dataValues, columnNames );
          jTable1 = new JTable(dataValues,columnNames);
          jScrollPane1 = new JScrollPane(jTable1);
          contentPane = (JPanel)this.getContentPane();
          //scrollPane = new JScrollPane( table );
          //topPanel.add( scrollPane, BorderLayout.CENTER );
          // jLabel1
          jLabel1.setText("Service Centers");
          // jLabel2
          jLabel2.setText("Service Areas");
          // jLabel4
          jLabel3.setText("Skills");
          jLabel4.setText("Availablity Types");
          // jLabel5
          jLabel5.setText("From Date");
          // jLabel6
          jLabel6.setText("To");
          // jComboBox1
          jComboBox1.addItem("Coimbatore");
          jComboBox1.addItem("Chennai");
          jComboBox1.addItem("Mumbai");
          jComboBox1.addItem("New Delhi");
          jComboBox1.addActionListener(new ActionListener() {
               public void actionPerformed(ActionEvent e)
                    jComboBox1_actionPerformed(e);
          // jComboBox2
          jComboBox2.addItem("North Zone");
          jComboBox2.addItem("South Zone");
          jComboBox2.addItem("Central Zone");
          jComboBox2.addItem("Eastern Zone");
          jComboBox2.addItem("Western Zone");
          jComboBox2.addActionListener(new ActionListener() {
               public void actionPerformed(ActionEvent e)
                    jComboBox2_actionPerformed(e);
          // jComboBox3
          jComboBox3.addItem("Microsoft Components");
          jComboBox3.addItem("Java Technologies");
          jComboBox3.addItem("ERP");
          jComboBox3.addItem("Others");
          jComboBox3.addActionListener(new ActionListener() {
               public void actionPerformed(ActionEvent e)
                    jComboBox3_actionPerformed(e);
          // jComboBox4
          jComboBox4.addItem("One");
          jComboBox4.addItem("Two");
          jComboBox4.addItem("Three");
          jComboBox4.addItem("Four");
          jComboBox4.addItem("Five");
          jComboBox4.addActionListener(new ActionListener() {
               public void actionPerformed(ActionEvent e)
                    jComboBox4_actionPerformed(e);
          // jComboBox5
          jComboBox5.addItem("12/12/2004");
          jComboBox5.addItem("13/12/2004");
          jComboBox5.addItem("14/12/2004");
          jComboBox5.setEditable(true);
          jComboBox5.addActionListener(new ActionListener() {
               public void actionPerformed(ActionEvent e)
                    jComboBox5_actionPerformed(e);
          // jComboBox6
          jComboBox6.addItem("12/11/2004");
          jComboBox6.addItem("13/11/2004");
          jComboBox6.addItem("14/11/2004");
          jComboBox6.setEditable(true);
          jComboBox6.addActionListener(new ActionListener() {
               public void actionPerformed(ActionEvent e)
                    jComboBox6_actionPerformed(e);
          // jTable1
          jTable1.setModel(new DefaultTableModel(4, 4));
          // jScrollPane1
          jScrollPane1.setViewportView(jTable1);
          // contentPane
          contentPane.setLayout(null);
          addComponent(contentPane, jLabel1, 2,29,84,18);
          addComponent(contentPane, jLabel2, 201,33,76,18);
          addComponent(contentPane, jLabel3, 384,32,59,18);
          addComponent(contentPane, jLabel4, 2,77,85,18);
          addComponent(contentPane, jLabel5, 197,79,84,18);
          addComponent(contentPane, jLabel6, 384,80,60,18);
          addComponent(contentPane, jComboBox1, 85,32,100,22);
          addComponent(contentPane, jComboBox2, 276,32,100,22);
          addComponent(contentPane, jComboBox3, 419,30,100,22);
          addComponent(contentPane, jComboBox4, 88,76,100,22);
          addComponent(contentPane, jComboBox5, 276,79,100,22);
          addComponent(contentPane, jComboBox6, 421,78,100,22);
          addComponent(contentPane, jScrollPane1, 33,158,504,170);
          // newssa
          this.setTitle("SSA Service Scheduler");
          this.setLocation(new Point(0, 0));
          this.setSize(new Dimension(560, 485));
     /** Add Component Without a Layout Manager (Absolute Positioning) */
     private void addComponent(Container container,Component c,int x,int y,int width,int height)
          c.setBounds(x,y,width,height);
          container.add(c);
     // TODO: Add any appropriate code in the following Event Handling Methods
     private void jComboBox1_actionPerformed(ActionEvent e)
          int index = jComboBox1.getSelectedIndex();
          switch(index)
               case 0: System.out.println("Area Coimbatore Selected "); break;
               case 1: System.out.println("Area Chennai selected"); break;
               case 2: System.out.println("Mumbai being selected"); break;
               case 3: System.out.println("New Delhi being selected"); break;
     private void jComboBox2_actionPerformed(ActionEvent e)
          int index = jComboBox2.getSelectedIndex();
          switch(index)
               case 0: System.out.println("North Zone Selcted "); break;
               case 1: System.out.println("South Zone being selected"); break;
               case 2: System.out.println("Central Zone being selected"); break;
               case 3: System.out.println("Eastern Zone being selected"); break;
               case 4: System.out.println("Western Zone being selected"); break;
     private void jComboBox3_actionPerformed(ActionEvent e)
          int index = jComboBox3.getSelectedIndex();
          switch(index)
               case 0: System.out.println("Microsoft Components being selected"); break;
               case 1: System.out.println("Java Technologies being selected"); break;
               case 2: System.out.println("ERP Tehnologies being selected"); break;
               case 3: System.out.println("Other's selected"); break;
     private void jComboBox4_actionPerformed(ActionEvent e)
          int index = jComboBox4.getSelectedIndex();
          switch(index)
               case 0: System.out.println("One selected"); break;
               case 1: System.out.println("Two selected"); break;
               case 2: System.out.println("Three selected"); break;
               case 3: System.out.println("Four selected"); break;
               case 4: System.out.println("Five selected"); break;
     private void jComboBox5_actionPerformed(ActionEvent e)
          int index = jComboBox5.getSelectedIndex();
          switch(index)
               case 0: System.out.println("12/12/2004 being selected"); break;
               case 1: System.out.println("13/12/2004 being selected"); break;
               case 2: System.out.println("14/12/2004 being selected"); break;
     private void jComboBox6_actionPerformed(ActionEvent e)
          int index = jComboBox6.getSelectedIndex();
          switch(index)
               case 0: System.out.println("12/11/2004 being selected"); break;
               case 1: System.out.println("13/11/2004 being selected"); break;
               case 2: System.out.println("14/11/2004 being selected"); break;
     public static void main(String[] args)
          newssa ssa=new newssa();
          //JFrame.setDefaultLookAndFeelDecorated(true);
          //JDialog.setDefaultLookAndFeelDecorated(true);
          //JFrame frame = new JFrame("SSA Service Scheduler");
//frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//frame.setJMenuBar(ssa.menuBar);
//frame.getContentPane( ).add(ssa.toolBar, BorderLayout.NORTH);
//frame.getContentPane( ).add(ssa.pane, BorderLayout.CENTER);
//frame.pack( );
//frame.setVisible(true);
          try
               //UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
               UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");
          catch (Exception ex)
               System.out.println("Failed loading L&F: ");
               System.out.println(ex);
But as a O/P ,I am getting menu in a seperate windos and the rest of the combobox and jtable in a seperate window.Kindly help me to solve the application.
VERY URGENT PLEASE..
Thanks in advance
with kind regds
Satheesh.K

But did u mean this as the next problem,Which I will come across..Yes, the second setVisible(true) seemed to be producing a smaller frame behind the main frame.
And your JMenuBar is declared twice, but not sure if this will affect the code - haven't read it all.

Similar Messages

  • How to add new row and update existing rows at a time form the upload file

    hi
    How to add new row and update existing rows at a time form the upload file
    example:ztable(existing table)
    bcent                      smh            nsmh         valid date
    0001112465      7.4                       26.06.2007
    0001112466      7.5                       26.06.2007
    000111801                      7.6                       26.06.2007
    1982                      7.8                       26.06.2007
    Flat file structure
    bcent                       nsmh         valid date
    0001112465     7.8     26.06.2007  ( update into above table in nsmh)
    0001112466     7.9     26.06.2007  ( update into above table in nsmh) 
    000111801                     7.6      26.06.2007 ( update into above table in nsmh
    1985                      11              26.06.2007   new row it should insert in table
    thanks,
    Sivagopal R

    Hi,
    First upload the file into an internal table. If you are using a file that is on application server. Use open dataset and close dataset.
    Then :
    Loop at it.
    *insert or modify as per your requirement.
    Endloop.
    Regards,
    Srilatha.

  • How to ADD reference table and make a field as currency field in dictionary

    pls render some info on how to add refernce table and ref field if i want to make an added field as a currency or quantity field...

    Hi Kiran,
    It sounds like you are creating a "Z" table or structure and have defined a quantity (eg MENGE). But when you run the syntax check, the system is saying you need to define a reference table / field.
    Well when you are in SE11, click on the "Currency / Quantity Fields" tab. You will see 2 columns called "Reference Table" and "Reference Field". These 2 columns define the unit of measure for the currency / qty.
    If you have defined in your table MENGE and MEINS and the MEINS field is the unit of measure for the MENGE field you should define your fields as such (inthe Currency/Quantity Fields" tab:
    Table - ZVBAP
    MENGE MENGE_D QUAN ZVBAP MEINS
    MEINS MEINS   UNIT
    Hope this makes sense.
    Cheers,
    Pat.
    PS. Kindly assign Reward Points to the posts you find helpful.

  • Please help! How to add a combobox on a jtable

    Hi, I have seen on google and here many codes to add a combobox in a jtable but none of them seem to work, I need the urgently.
    My problem is that I must add a comboBox or a JComboBox to a cell inside a JTable on a predefined column. It means that on the column 2 I must add diferent comboboxes for eac row. How can I do it, please help.

    The celleditor is the component shown and the cellrenderer is the first render of a component in the cell and dont have to be the same jcombo box?
    The code on ther post does this:?
    returning a diferent combobox for all the cells on the column depending on the row selected, but as long as only one cell can be selected at a time it seems to hace different jcomboboxes added a time?
    Is there anyway to render any combobox with different values, my program must let the user chose the teacher it want to teach a definen subject, so the combo must have the teacher of a subject loaded on a database, the combos are not constants. I guess I can manage to use the way you showed me, but is there anyway to render a combo just by adding it to a cell! maybe doing changes to the tablemodel or things like that?

  • How to add extension fields and mashups to partner solution?

    To add extension fields and mashups I have log on to the system using a user with adaptation rights.
    There's no possibility to do that from within the UI designer, right?
    Now, if I adapt the screens with extension fields or by creating and adding mashups, how do I add these enhancements to my partner solution?
    Or in other words, how do I ship extension fields and mashups with my partner solution?

    Before you use the key user tools, you must "enable key user tools" in copernicus by right click on the solution. Now the changes will be added to the partner soltution transport order.
    But you can add extension field in copernicus as well by adding new item "business object extension" to the partner solution.

  • How to add the entries and how to delete the entries from custom Z-table?

    Hi Experts,
    My requirement is I need to add the entries from program to three custom z-tables . Assume as zabc1,zabc2,zabc3.
    Here how to add the entries from program to Z-table.???
    And one more requirement is I want to provide a deletion checkbox in selection screen . Initial it was unchecked. If I am giving tick mark then the entries should be deleted from above custom Z-tables. this all will done in backgroung job?
    Could you please guide me the logic how to crack this???
    Let me know if you need more Info
    Thanks
    Sanju

    Hi Sanjana,
    What you can do is to use the ABAP keyword INSERT or MODIFY to add or modify records to a given database table. Here are the syntax taken from SAP documentation:
    *Insert Statement
    INSERT dbtab
    Syntax
    INSERT { {INTO target VALUES source }
           | {     target FROM   source } }.
    Effect
    The INSERT statement inserts one or more rows specified in source in the database table specified in target. The two variants with INTO and VALUES or without INTO with FROM behave identically, with the exception that you cannot specify any internal tables in source after VALUES.
    System Fields
    The INSERT statement sets the values of the system fields sy-subrc and sy-dbcnt.
    sy-subrc Meaning
    0 At least one row was inserted.
    4 At least one row could not be inserted, because the database table already contains a row with the same primary key or a unique secondary index.
    The INSERT statement sets sy-dbcnt to the number of rows inserted.
    Note
    The inserted rows are finally included in the table in the next database commit. Up until this point, they can still be removed by a database rollback.
    *Modify Statement
    MODIFY dbtab
    Syntax
    MODIFY target FROM source.
    Effect
    The MODIFY statement inserts one or several lines specified in source in the database table specified in target, or overwrites existing lines.
    System fields
    The MODIFY statement sets the values of the sy-subrc and sy-dbcnt system fields.
    sy-subrc Meaning
    0 At least one line is inserted or changed.
    4 At least one line could not be processed since there is already a line with the same unique name secondary index in the database table.
    The MODIFY statement sets sy-dbcnt to the number of processed lines.
    Note
    The changes are transferred finally to the database table with the next database commit. Up to that point, they can be reversed using a database rollback.
    Hope it helps...
    P.S. Please award points if it helps...

  • How to add src, alt and title tags to a PS generated Web Photo Gallery

    I do some web design and need to add some tags to a web photo gallery created by Photoshop. Maybe this question should be directed to the GoLive / Dreamweaver Forum but since the gallery was created in PS I thought I'd start here.
    I need to add src, alt and title tags to the images in the web gallery. Normally this is as simple as working on the code in the html page in which the image sits but the PS gallery doesn't seem to be that simple.
    Can anyone tell me exactly how, and which files I need to work on, to add these tags to each of my 42 gallery images?
    Thanks.
    John.

    You can't do it in Photoshop.
    You can open the pages in a text editor adn easily ad any tags you want. They are simply html pages.
    If you really want to, you can use Dreamweaver or Golive. Using a text editor is generally faster and easier because you can just copy/paste between the files and not have to worry about code rewriting in the WYSIWYG applications. Don't believe the GoLive/Dreamweaver hype about "round trip code" they both will alter code.

  • How to add ship-to and sold-to party name in a view table.

    Hi Expert,
    May i know how to add in the field names for ship-to and sold-to party name in a view table? I know that the name should be retrieve from KNA1 but how to map the name to the respective fields? Please help urgently. Thanks.
    Regards,
    Shawn
    Message was edited by: Manish Kumar : Do not use urgent word.

    Hi,
         Use Table KNVP for Codes and Join with KNA1 for names using Alias LIKE
         select a~kunnr a~name1 b~kunnr b~name1 from
           kna1 as a
         INNER JOIN
           kna1 as b on a~kunnr eq b~kunnr
           INNER JOIN knvp as c
         on a~kunnr eq c~kunnr
         INTO TABLE IT_SHIP
         where c~parwe in ('AG','WE')
         AND KUNNR IN .....

  • How to Add JAR files and Config files to CLASSPATH at runtime?

    QUERY:
    During runtime, I need to load the JAR files and relevant config files( .cfg files and .properties file) into CLASSPATH and run a specific java program from one of the JAR which is available in CLASSPATH.
    Please advise me any relevant Java API details or a sample java program to implement the above use case.
    Thanks in advance.

    During runtime, I need to load the JAR files and relevant config files( .cfg files and .properties file) into CLASSPATH and run a specific java program from one of the JAR which is available in CLASSPATH.
    Please advise me any relevant Java API details or a sample java program to implement the above use case.
    You don't add to YOUR classpath once your app is launched.
    You create a NEW process for the app you want to run and provide the proper environment for it to run in - including any PATH or CLASSPATH environment variables.
    The Java API for the ProcessBuilder class has a simple example that shows how to create the arguments and launch an external application.
    ProcessBuilder (Java Platform SE 7 )
    There are also PLENTY of other examples of using ProcessBuilder; just search the net.

  • How to add PCI 7340 and UMI in my labview program from functions palette or how?

    Am using PCI 7340 and UMI7764 for motion control of a stepper motor.
    How to add the functions for PCI and UMI in my labVIEW program and how
    do I use these further? I need to control the direction of stepper
    motor rotation based on the pressure applied which we calculate as
    either clock.anti clockwise. So which function palette should I use for
    that.
    We use a darlington pair driver unit. ? The output
    from UMI are from the individual axis control whereas the driver input
    is through a serial bus. So what kind of cable should we use to connect
    the UMI with this and how do we connect this or should we use any other
    driver unit? Please explain in detail.
     Thank you

    Thank you I ll see to it

  • Webdynpro - how to add global variables and common proj to existing proj

    How to add global variable in either ViewController or CustomController.  We realise that codes must be added within the begin and end exction.  Codes outside that will be deleted when saved. 
    How can we add a common WDP project to an existing project?  We have actually added a common wdp project at the project references screen.  But during runtime, we encouter error.  The error is classNotFoundException.  The class is the class created in the common project.

    Hi.
    I think you need to assign ProB to ProA.
    Step1.
    Open propety of ProjectA.
    Step2.
    Select WebDynproRefrences
    Step3.
    Select Sharing references
    Step4.
    Choose add button.
    Step5.
    If your projectA named "testapp" and you are not using
    DC "local/testapp" is the proper name.
    I hope that it work!!!.

  • How to add a field and table control to BP transaction.

    Hi,
    I have a requirement to add a field and table control to the 'Control data' tab of the Transaction BP.
    Can some on please help me if having a solution and with any relavant documents.
    Thanks in advance.
    Raj & Khader.

    Also explore with EEWB tcode.
    Refer this threads
    Re: EEWB
    Created New fields in Business Activity with EEWB
    Cheers
    Manohar

  • How to add new text and an empty space before a file name with Automator

    I can create a new service to add to multiple files some text before the file name but I need to add even an empty space; e.g. file name original  becomes: new text(space)file name original. The aim is to add this text and space to multiple files.
    I hope to be understood. Please can somebody help me?
    Thanks

    This is an old Apple-supplied AppleScript that will do the job.
    IMPORTANT: note the conditions of use: it will choose the frontmost Finder window to operate on. Therefore, open the folder you want to change the names of and make it the front finder window BEFORE running the script.
    Add to File Names
    This script is designed to add a prefix or suffix to files in the front window of the desktop.
    If no folder windows are open, the script will affect items on the desktop.
    Copyright © 2001–2007 Apple Inc.
    You may incorporate this Apple sample code into your program(s) without
    restriction.  This Apple sample code has been provided "AS IS" and the
    responsibility for its operation is yours.  You are not permitted to
    redistribute this Apple sample code as "Apple sample code" after having
    made changes.  If you're going to redistribute the code, we require
    that you make it clear that the code was descended from Apple sample
    code, but that you've made changes.
    --March 2014: Changes by Phil Stokes to make the script work on 10.9
    --these changes are simply reversing the order of parameters in the lines that have "copy" in them
    -- The following line is disabled due to a Menu Manager bug
    --set the source_folder to (choose folder with prompt "Pick the folder containing the files to rename:")
    try
              tell application "Finder" to set the source_folder to (folder of the front window) as alias
    on error -- no open folder windows
              set the source_folder to path to desktop folder as alias
    end try
    set the prefix_or_suffix to ""
    repeat
              display dialog "Enter the prefix or suffix to use:" default answer the prefix_or_suffix buttons {"Cancel", "Prefix", "Suffix"}
              copy the result as list to {button_pressed, prefix_or_suffix}
              if the prefix_or_suffix is not "" then exit repeat
    end repeat
    set the item_list to list folder source_folder without invisibles
    set source_folder to source_folder as string
    repeat with i from 1 to number of items in the item_list
              set this_item to item i of the item_list
              set this_item to (source_folder & this_item) as alias
              set this_info to info for this_item
              set the current_name to the name of this_info
              if folder of this_info is false and ¬
                        alias of this_info is false then
                        if the button_pressed is "Prefix" then
                                  set the new_file_name to the (the prefix_or_suffix & the current_name) as string
                        else
                                  set the new_file_name to the (the current_name & the prefix_or_suffix) as string
                        end if
                        my set_item_name(this_item, the new_file_name)
              end if
    end repeat
    beep 2
    on set_item_name(this_item, new_item_name)
              tell application "Finder"
      --activate
                        set the parent_container_path to (the container of this_item) as text
                        if not (exists item (the parent_container_path & new_item_name)) then
                                  try
                                            set the name of this_item to new_item_name
                                  on error the error_message number the error_number
                                            if the error_number is -59 then
                                                      set the error_message to "This name contains improper characters, such as a colon (:)."
                                            else --the suggested name is too long
                                                      set the error_message to error_message -- "The name is more than 31 characters long."
                                            end if
      --beep
                                            tell me to display dialog the error_message default answer new_item_name buttons {"Cancel", "Skip", "OK"} default button 3
                                            copy the result as list to {button_pressed, new_item_name}
                                            if the button_pressed is "Skip" then return 0
                                            my set_item_name(this_item, new_item_name)
                                  end try
                        else --the name already exists
      --beep
                                  tell me to display dialog "This name is already taken, please rename." default answer new_item_name buttons {"Cancel", "Skip", "OK"} default button 3
                                  copy the result as list to {button_pressed, new_item_name}
                                  if the button_pressed is "Skip" then return 0
                                  my set_item_name(this_item, new_item_name)
                        end if
              end tell
    end set_item_name

  • How to add sales history and purchase history without affecting inventory.

    In order to help client migrating sales and purchase history into B1.
    I checked through the Business One objects reference file. I couldn't find any object that allow adding historical record into both Sales or Purchase history, via DIAPI.
    Do I have to always depend on the Sales Invoice object to add the document and let it affect the inventory level.

    No, you can't add historical data without affecting GL and Inventory.  In SAP B1 any invoice addition thru DI API will automatically behave like the regular B1 process and it will post to GL and inventory.
    I saw in the partner edge portal SAP B1 forum a post from an SAP employee that is working on developing a process where historical data will be able to be migrated without afecting inventory and GL.  But there is no ETA on when this will be available.
    Regards,
    WB

  • BAPI_MATERIAL_SAVEDATA  how to ADD a Plant and CHANGE Sales Org. info

    Hello All,
    I got a working version of the BAPI Changing some data, and i need to take it to the next level.
    In some cases I want to ADD a new plant to an existing material.
    I filled the Sector, Type and Materialnumber in the BAPIMATHEAD and added the Materialdescription-table.
    Since I´m creating I´m not to sure about the FLAGS in BAPIMATHEAD, I marked:
    PURCHASE_VIEW
    MRP_VIEW
    WORK_SCHED_VIEW
    STORAGE_VIEW
    Naturally I also filled PLANTDATA, I don´t know what to do with PLANTDATAX though, since I want to CREATE a new plant-View to an Existing Material, not change one...
    SAP can´t be expecting me to check every field in the PLANTDATAX, can they?
    Could somebody indicate what i´m doing wrong?
    PS: Is it possible to ADD a plant, and, in the same BAPI-Call, change Salesorg.-Data?
    Thanks a bunch for replying!
    Kind Regards,
    Pieter

    after a lot of hours, a friend discovered what I was doing wrong.
    I was doing:
    lt_unitsofmeasurex-alt_unit = 'X'.
    lt_unitsofmeasurex-alt_unit_iso = 'X'.
    instead of using the actual unit instead of 'X'

Maybe you are looking for