How to Change S012  Table Structure ..?

Hi MM Experts,
How to copy and how to create new structure  and new caracterstics and MAterial type from  table S012 .
T-code for execute MCE1 .
How to Change S012  Table Structure ..?
Regards,
Anthyodaya.
Edited by: anthyodaya Reddy Nagaram on Jul 7, 2010 12:44 PM

Anthyodaya,
Values?  Your newly created infostructure will have no data until you define how to update the underlying tables, and then execute the update.
You need to be a bit more specific.  Are you saying that you attempted a 1-to-1 copy of S012 into a new structure, and you got a failure?  What failure?  What error message?  If you have saved your new infostructure, you can run the consistency utility to see what if anything is missing/misconfigured  MCSCHECK.
If you have no experience with infostructures, I suggest you enlist the services of an experienced person to assist you.  Especially if you intend to implement non-standard characteristics and values, this can be a complex task.
SAP help in this area
Creating new IS
http://help.sap.com/saphelp_erp60_sp/helpdata/en/c1/3754f7449a11d188fe0000e8322f96/frameset.htm
Purchasing Info system
http://help.sap.com/saphelp_erp60_sp/helpdata/en/c1/375504449a11d188fe0000e8322f96/frameset.htm
Rgds,
DB49

Similar Messages

  • How to change the default structure when exporting data in CSV format?

    Hello,
    can some one tell us how to change the default structure in CRM when exporting lists in CSV format (with Option "Always use unformatted list format (CSV) for download" ? Because we want to add a new structure for our own -is it possible ?
    If it is possible where can we find these structure ? In the blueprint customizing ?
    Thank you very much,
    Christian

    There is a workaround to move from 1.5 version to the older 1.4 version. But this could be specific to the browser setting the JRE version.
    Excerpts from sun docs:
    However, a user can still run older versions. To do so, launch the Java Plug-in Control Panel for the older version, then (re)select the browser in the Browser tab.
    Example:
    Assume you are running on Microsoft Windows with Microsoft Internet Explorer, have first installed version 1.4.2, then version 5.0, and you want to run 1.4.2.
    Go to the j2re1.4.2\bin directory where JRE 1.4.2 was installed. On a Windows default installation, this would be here: C:\Program Files\Java\j2re1.4.2\bin
    Double-click the jpicpl32.exe file located there. It will launch the control panel for 1.4.2.
    Select the Browser tab. Microsoft Internet Explorer might still appear to be set (checked). However, when 5.0 was installed, the registration of the 1.4.2 JRE with Internet Explorer was overwritten by the 5.0 JRE.
    If Microsoft Internet Explorer is shown as checked, uncheck it and click Apply. You will see a confirmation dialog stating that browser settings have changed.
    Check Microsoft Internet Explorer and click Apply. You should see a confirmation dialog.
    Restart the browser. It should now use the 1.4.2 JRE for conventional APPLET tags.
    Details are here
    http://java.sun.com/j2se/1.5.0/docs/guide/deployment/deployment-guide/jcp.html
    My system (Windows XP) has the version 1.5_09 set as the default. However i just installed JRE 1.5_06 and would like to revert back to _06 as the default JRE..
    Will update if i find more information

  • How to check PSA Table Structure ?

    Hi Friends,
       Can you pls any one tell me how to find out PSA Table and how to check PSA Table Structure? .Thanks in advance.
    Regards,
    CS

    Hi Sri,
    Goto RSA1 trans> select your DS> right clcik> Manage> you will get a Pop-up with all the PSA requests--> on the top Left you can see the PSA name(Technical name) in the form PSA/BIC/BXXXXXX
    PSA & DS structue will be same. Goto RSO2 transaction> Enter your DS name> double click on the extract structure. It will take you to the Extract structure.
    (Or) if you know the extract structure name, directly goto Se11 trans & enter the technical name of Extract structure & Display.
    Take the screenshot & send it to your TL.
    Regards,
    Pavan

  • Change internal table structure dynamically

    Dear Experts , I have a requirement to add an attribute to already declared internal table which is declared in standard SAP code, is it possible to change internal table structure dynamically.
    my internal table is of type merel_t_grid2 which is standard table type in SAP , now I want to add an attribute of type  LVC_T_STYL in my internal table so that I can modify the cell property of ALV grid.
    I cant append LVC_T_STYL in standard structure because enhancement category of merel_t_grid2 is of type char and not deep
    my internal table contains data to be displayed in ALV.
    please help

    Dear Experts , I have a requirement to add an attribute to already declared internal table which is declared in standard SAP code, is it possible to change internal table structure dynamically.
    my internal table is of type merel_t_grid2 which is standard table type in SAP , now I want to add an attribute of type  LVC_T_STYL in my internal table so that I can modify the cell property of ALV grid.
    I cant append LVC_T_STYL in standard structure because enhancement category of merel_t_grid2 is of type char and not deep
    my internal table contains data to be displayed in ALV.
    please help

  • How to change the table's for an existing report

    Hello,
    How can I change the table names for reports created with a different table name? for e.g If I created a report which included a table called "2009_10_example", How can I change that table to a different table "2010_10_example1".
    I am using Crystal reports 2008, and the reports were created using Report Creating Wizard.
    Thanks,
    Abhishek

    In the Database Menu, there is an option Set Datasource Location.  This allows you to pick a table from the current tables used, and select a table to replace it with.  Press the Update button, and Crystal will swap one for the other.  If the field names and data types are all the same, it will automatically change all references throughout the report to the new table's fields.
    May I suggest that your tables are set up improperly if you have to change report code to run it for different months?  The data should all be in one table with dates, and parameters to select the date range to report on.  (That was said in the spirit of helping...)
    HTH,
    Carl

  • How to read a table/structure value in a container from a Z program

    Experts,
    I have a WF with one of the container element is a multiline table element of the strucuture BSEG. Now I have a report where given a WID, i need to read the contents of this structure from the workflow container and display in ALV grid.
    I'm using the FM SAP_WAPI_READ_CONTAINER or SWW_WI_CONTAINER_READ to read the container. No issues till here now.
    I'm able to read the contents of the attributes that are simple without being in a structure/table.
    But, how do i read the values from the table/structure in the container from this FM?
    I see lots of threads talking about SWC_GET_TABLE or something like that. But I don't know whether and how to use it in my scenario. Any sample programs will be greatly appreciated.
    Thanks,
    Sam

    Hey,
    No issues. I sorted out myself. Glory to God in the Heavens!
    -Sam

  • How to integrate different tables structures from different databases?

    Hi
    I'm new to oracle ..kindly help me with the below issue...
    I have same set of inter-related attributes (a,b,c,d) in two different databases A and B.
    The structure of tables in both the database are different but they carry same attributes in same relation.
    I have to integrate these attributes into single db object such that any update to base tables updates my object.How can i do this and what object will be helpful?
    Thanks

    Arun Rajesh wrote:
    Hi
    I'm new to oracle ..kindly help me with the below issue...
    I have same set of inter-related attributes (a,b,c,d) in two different databases A and B.
    The structure of tables in both the database are different but they carry same attributes in same relation.
    I have to integrate these attributes into single db object such that any update to base tables updates my object.How can i do this and what object will be helpful?
    ThanksWelcome to Forum!!!
    Please elaborate your question.
    Arun Rajesh wrote:
    I have same set of inter-related attributes (a,b,c,d) in two different databases A and B.1. What are the ATTRIBUTES?
    Arun Rajesh wrote:
    The structure of tables in both the database are different but they carry same attributes in same relation.2. Post the Table Structures.
    Arun Rajesh wrote:
    I have to integrate these attributes into single db object such that any update to base tables updates my object.How can i do this and what object will be helpful?3. What is the end result that you desire? A sample output shall help in our understanding.
    PS:- Please go through this to understand SQL and PL/SQL FAQ.
    Regards,
    P.

  • How to change the case structure to string input?

    Hi,
    I have the inner case structure that it will decide to set "DC Voltage" or "DC Current" mode. The "Output Function" contained the selection of function "DC Voltage" or "DC Current". So far it only work with DC Voltage not DC Current. My question is how do I change the case structure to string selector? When the output function is selected to DC Voltage then the case structure is selected DC voltage case. Please help Thanks.
    Attachments:
    test.vi ‏35 KB

    You don't really need to convert the value to a string? The problem is that the value of the individual ring items are not 0 and 1, as you assumed. The values generated by the controls are:
    DC Voltage: 1006
    DC Current: 1007.
    You can find this out by viewing the properties for the "Output Function" and going to the "Edit Items" tab.
    So, all you need to do is change the 0 to 1006 and the 1 to 1007 for your case items.
    By the way, your sequence frame serves no purpose.

  • How can  change the folder structure in Bex Analyser to match the Web

    Hi Experts,
    When I create a report using the Web Analyser and save it in My Portfolio or Bex Portfolio, I can't find the report (or folders) in Bex Analyser.
    How Can i change the folder structure in Bex Analyser to match the Web Analyser?

    Hi Reddy,
           As u have created reports and saved it in BEx portfolio or My portfolio it will be saved in the KM folder which is known as Knowledge management folder for the KM services such as feedback,rating etc.So u cant view them when u open in web analyzer.U can only see them when u save in favourites or the roles folders.
                              Hope this helps
                         Sunil Reddy

  • How to change the table name

    hi
    instead of copying and renaming
    is there any other way to change the ztable name .
    I have wrong named the table and activated now i need to
    change the table table from ztest to zvk01
    thanks

    these r the steps to change table  name ..
    goto se11 tcode.
    give ur oldtable.
    goto top of the se11 ->goto dictionary objects ->copy->
    give from table name to table name .
    And the copy of ur table will be new table name ..
    And to delete oldtable name.
    goto se80->goto ur package ->select datadictionary ->select the old table name ->rt click ->delete.
    I think its some what useful.

  • How to change the Element structure of a DefaultSyledDocument

    Hello,
    I'm trying to override the insertUpdate method of DefaultStyledDocument so that I could build my own Element structure by adding my own BranchElement- and LeafElement-s. If I examine the Element hierarchy everything seems OK. But when I use my document in a JTextPane. I get the error Exception in thread "AWT-EventQueue-0" javax.swing.text.StateInvariantError: GlyphView: Stale view: javax.swing.text.BadLocationException: Invalid location (I add the whole dump at the end of this message), whenever I add a new line to the document (to test this compile and run the included code and press then newline after the 'He' in 'Hello'. I suspect that the error is caused by the fact that the view hierarchy is not updated correctly but I'm not sure. To be honest I have searched for a while for some example code, explaning how you can make your own element hierarchy in a DefaultStyledDocument (without using ElementBuffer), but to no avail.
    Can any of the Text gurus here shed some lights on my code and see what is wrong with it or point me to some example code.
    Thanks a lot in advance.
    Marc Mertens
    Full Stack Dump
    Exception in thread "AWT-EventQueue-0" javax.swing.text.StateInvariantError: GlyphView: Stale view: javax.swing.text.BadLocationException: Invalid location
    at javax.swing.text.GlyphView.getText(GlyphView.java:117)
    at javax.swing.text.GlyphPainter1.getSpan(GlyphPainter1.java:43)
    at javax.swing.text.GlyphView.getPreferredSpan(GlyphView.java:537)
    at javax.swing.text.FlowView$LogicalView.getPreferredSpan(FlowView.java:689)
    at javax.swing.text.FlowView.calculateMinorAxisRequirements(FlowView.java:216)
    at javax.swing.text.BoxView.checkRequests(BoxView.java:911)
    at javax.swing.text.BoxView.getMinimumSpan(BoxView.java:542)
    at javax.swing.text.BoxView.calculateMinorAxisRequirements(BoxView.java:879)
    at javax.swing.text.BoxView.checkRequests(BoxView.java:911)
    at javax.swing.text.BoxView.setSpanOnAxis(BoxView.java:325)
    at javax.swing.text.BoxView.layout(BoxView.java:682)
    at javax.swing.text.BoxView.setSize(BoxView.java:379)
    at javax.swing.plaf.basic.BasicTextUI$RootView.setSize(BasicTextUI.java:1618)
    at javax.swing.plaf.basic.BasicTextUI.getPreferredSize(BasicTextUI.java:812)
    at javax.swing.JComponent.getPreferredSize(JComponent.java:1615)
    at javax.swing.JEditorPane.getPreferredSize(JEditorPane.java:1227)
    at javax.swing.ScrollPaneLayout.layoutContainer(ScrollPaneLayout.java:769)
    at java.awt.Container.layout(Container.java:1401)
    at java.awt.Container.doLayout(Container.java:1390)
    at java.awt.Container.validateTree(Container.java:1473)
    at java.awt.Container.validate(Container.java:1448)
    at javax.swing.RepaintManager.validateInvalidComponents(RepaintManager.java:379)
    at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:113)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    Exception in thread "AWT-EventQueue-0" javax.swing.text.StateInvariantError: GlyphView: Stale view: javax.swing.text.BadLocationException: Invalid location
    at javax.swing.text.GlyphView.getText(GlyphView.java:117)
    at javax.swing.text.GlyphPainter1.getSpan(GlyphPainter1.java:43)
    at javax.swing.text.GlyphView.getPreferredSpan(GlyphView.java:537)
    at javax.swing.text.FlowView$LogicalView.getPreferredSpan(FlowView.java:689)
    at javax.swing.text.FlowView.calculateMinorAxisRequirements(FlowView.java:216)
    at javax.swing.text.BoxView.checkRequests(BoxView.java:911)
    at javax.swing.text.BoxView.getMinimumSpan(BoxView.java:542)
    at javax.swing.text.BoxView.calculateMinorAxisRequirements(BoxView.java:879)
    at javax.swing.text.BoxView.checkRequests(BoxView.java:911)
    at javax.swing.text.BoxView.setSpanOnAxis(BoxView.java:325)
    at javax.swing.text.BoxView.layout(BoxView.java:682)
    at javax.swing.text.BoxView.setSize(BoxView.java:379)
    at javax.swing.plaf.basic.BasicTextUI$RootView.setSize(BasicTextUI.java:1618)
    at javax.swing.plaf.basic.BasicTextUI.modelToView(BasicTextUI.java:946)
    at javax.swing.text.DefaultCaret.repaintNewCaret(DefaultCaret.java:1246)
    at javax.swing.text.DefaultCaret$1.run(DefaultCaret.java:1225)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    Exception in thread "AWT-EventQueue-0" javax.swing.text.StateInvariantError: GlyphView: Stale view: javax.swing.text.BadLocationException: Invalid location
    at javax.swing.text.GlyphView.getText(GlyphView.java:117)
    at javax.swing.text.GlyphPainter1.getSpan(GlyphPainter1.java:43)
    at javax.swing.text.GlyphView.getPreferredSpan(GlyphView.java:537)
    at javax.swing.text.FlowView$LogicalView.getPreferredSpan(FlowView.java:689)
    at javax.swing.text.FlowView.calculateMinorAxisRequirements(FlowView.java:216)
    at javax.swing.text.BoxView.checkRequests(BoxView.java:911)
    at javax.swing.text.BoxView.getMinimumSpan(BoxView.java:542)
    at javax.swing.text.BoxView.calculateMinorAxisRequirements(BoxView.java:879)
    at javax.swing.text.BoxView.checkRequests(BoxView.java:911)
    at javax.swing.text.BoxView.setSpanOnAxis(BoxView.java:325)
    at javax.swing.text.BoxView.layout(BoxView.java:682)
    at javax.swing.text.BoxView.setSize(BoxView.java:379)
    at javax.swing.plaf.basic.BasicTextUI$RootView.setSize(BasicTextUI.java:1618)
    at javax.swing.plaf.basic.BasicTextUI.modelToView(BasicTextUI.java:946)
    at javax.swing.text.DefaultCaret.setVisible(DefaultCaret.java:952)
    at javax.swing.text.DefaultCaret.focusLost(DefaultCaret.java:347)
    at java.awt.AWTEventMulticaster.focusLost(AWTEventMulticaster.java:172)
    at java.awt.Component.processFocusEvent(Component.java:5380)
    at java.awt.Component.processEvent(Component.java:5244)
    at java.awt.Container.processEvent(Container.java:1966)
    at java.awt.Component.dispatchEventImpl(Component.java:3955)
    at java.awt.Container.dispatchEventImpl(Container.java:2024)
    at java.awt.Component.dispatchEvent(Component.java:3803)
    at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1810)
    at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:840)
    at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:530)
    at java.awt.Component.dispatchEventImpl(Component.java:3841)
    at java.awt.Container.dispatchEventImpl(Container.java:2024)
    at java.awt.Component.dispatchEvent(Component.java:3803)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
    at java.awt.SentEvent.dispatch(SentEvent.java:50)
    at java.awt.DefaultKeyboardFocusManager$DefaultKeyboardFocusManagerSentEvent.dispatch(DefaultKeyboardFocusManager.java:161)
    at java.awt.DefaultKeyboardFocusManager.sendMessage(DefaultKeyboardFocusManager.java:188)
    at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:595)
    at java.awt.Component.dispatchEventImpl(Component.java:3841)
    at java.awt.Container.dispatchEventImpl(Container.java:2024)
    at java.awt.Window.dispatchEventImpl(Window.java:1778)
    at java.awt.Component.dispatchEvent(Component.java:3803)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
    at java.awt.SequencedEvent.dispatch(SequencedEvent.java:93)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    java.lang.ThreadDeath
    at java.lang.Thread.stop(Thread.java:698)
    at java.lang.ThreadGroup.stopOrSuspend(ThreadGroup.java:671)
    at java.lang.ThreadGroup.stop(ThreadGroup.java:584)
    at org.netbeans.core.execution.DefaultSysProcess.stop(DefaultSysProcess.java:54)
    at org.netbeans.core.execution.ProcessNodeItem$1.stop(ProcessNodeItem.java:41)
    at org.netbeans.core.execution.ProcessNodeItem$TerminateProcessAction.performAction(ProcessNodeItem.java:69)
    at org.openide.util.actions.NodeAction$3.run(NodeAction.java:531)
    at org.netbeans.modules.openide.util.ActionsBridge.doPerformAction(ActionsBridge.java:47)
    at org.openide.util.actions.NodeAction$DelegateAction.actionPerformed(NodeAction.java:527)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
    at javax.swing.AbstractButton.doClick(AbstractButton.java:302)
    at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1000)
    at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1041)
    at java.awt.Component.processMouseEvent(Component.java:5488)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
    at java.awt.Component.processEvent(Component.java:5253)
    at java.awt.Container.processEvent(Container.java:1966)
    at java.awt.Component.dispatchEventImpl(Component.java:3955)
    at java.awt.Container.dispatchEventImpl(Container.java:2024)
    at java.awt.Component.dispatchEvent(Component.java:3803)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
    at java.awt.Container.dispatchEventImpl(Container.java:2010)
    at java.awt.Window.dispatchEventImpl(Window.java:1778)
    at java.awt.Component.dispatchEvent(Component.java:3803)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    package Document;
    import java.util.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.text.*;
    import javax.swing.text.AbstractDocument.*;
    * EditorDocument.java
    * Created on September 10, 2006, 3:58 PM
    * To change this template, choose Tools | Template Manager
    * and open the template in the editor.
    * Document to represent the content of a syntax highlighting editor
    * @author marc
    public class EditorDocument extends DefaultStyledDocument {
        /** List of the white space characters */
        private char[] _whiteSpaceChars;
        /** List of the delimiter characters */
        private char[] _delimiterChars;
        /** Creates a new instance of EditorDocument */
        public EditorDocument(char[] whiteSpaceChars,char[] delimiterChars) {
            _whiteSpaceChars=whiteSpaceChars;
            _delimiterChars=delimiterChars;
         * Updates document structure as a result of text insertion.  This
         * will happen within a write lock.  Since this document simply
         * maps out lines, we refresh the line map.
         * @param chng the change event describing the dit
         * @param attr the set of attributes for the inserted text
        protected void insertUpdate(AbstractDocument.DefaultDocumentEvent chng, AttributeSet attr) {
            int begin=Math.max(0,chng.getOffset()-1);
            int end=begin+chng.getLength()+1;
            Element rootElement=getDefaultRootElement();
            int index;
            int m=rootElement.getElementCount();
            AbstractDocument.BranchElement line;
            super.insertUpdate(chng,attr);
            // Add the tokens
            index=rootElement.getElementIndex(begin);
            m=rootElement.getElementCount();
            if (index>=0)
                for (;index<m && (line=(AbstractDocument.BranchElement) rootElement.getElement(index)).getStartOffset()<=end;index++) {
                chng.addEdit(addTokens(line,attr));
            //fireChangedUpdate(chng);
        protected void insertUpdate(AbstractDocument.DefaultDocumentEvent chng,AttributeSet attr) {
            int begin=chng.getOffset();
            int end=begin+chng.getLength();
            BranchElement root=(BranchElement) getDefaultRootElement();
            // Find the lines that must be removed
            int indexFirstLine=root.getElementIndex(begin);
            int indexLastLine=root.getElementIndex(end);
            BranchElement[] removeLines=new BranchElement[indexLastLine-indexFirstLine+1];
            for (int i=indexFirstLine;i<=indexLastLine;i++)
                removeLines=(BranchElement) root.getElement(i);
    // Add the lines must replace the removed lines
    int beginFirstLine=removeLines[0].getStartOffset();
    int endLastLine=removeLines[removeLines.length-1].getEndOffset();
    Segment segment=new Segment();
    ArrayList<BranchElement> newLines=new ArrayList<BranchElement>(removeLines.length); // Guess the length of the new lines
    try {
    getText(beginFirstLine,endLastLine,segment);
    char c=segment.current();
    BranchElement line;
    while (c!=Segment.DONE) {
    if (c=='\n') {
    line=new BranchElement(root,attr);
    newLines.add(line);
    addTokens(line,attr,beginFirstLine,segment.getIndex()+1);
    beginFirstLine=segment.getIndex()+1;
    c=segment.next();
    if (beginFirstLine<endLastLine) {
    line=new BranchElement(root,attr);
    newLines.add(line);
    addTokens(line,attr,beginFirstLine,endLastLine);
    // Add the lines to the Root element
    BranchElement[] linesAdded=newLines.toArray(new BranchElement[newLines.size()]);
    root.replace(indexFirstLine,indexLastLine-indexFirstLine+1,linesAdded);
    // Notify listeners
    DefaultDocumentEvent edit=new DefaultDocumentEvent(begin,end-begin,DefaultDocumentEvent.EventType.CHANGE);
    edit.addEdit(new ElementEdit(root,indexFirstLine,removeLines,linesAdded));
    fireChangedUpdate(edit);
    } catch (Exception e) {
    throw new EditorException("Error in insertUpdate, message was "+e.getMessage(),e);
    //super.insertUpdate(chng,attr);
    private void addTokens(AbstractDocument.BranchElement line,AttributeSet attr,int begin,int end) {
    try {
    ArrayList<TokenElement> childTokens=new ArrayList<TokenElement>();
    int strLength=end-begin;
    // Create the new tokens
    Segment segment=new Segment();
    getText(begin,end-begin,segment);
    char c;
    int b=0;
    TokenElement token;
    //System.out.println(str);
    c=segment.current();
    while (c!=Segment.DONE) {
    if (isWhite(c)) {
    // Whitespace character
    if (b<segment.getIndex()) {
    token=new TokenElement(line,attr,begin+b,begin+segment.getIndex(),false);
    childTokens.add(token);
    b=segment.getIndex();
    // Find all the white spaces
    while ((c=segment.next())!=Segment.DONE && isWhite(c));
    token=new TokenElement(line,attr,begin+b,begin+segment.getIndex(),true);
    childTokens.add(token);
    b=segment.getIndex(); // Begin of next token
    } else if (isDelimiter(c)) {
    // Delimiter
    if (b<segment.getIndex()) {
    token=new TokenElement(line,attr,begin+b,begin+segment.getIndex(),false);
    childTokens.add(token);
    token=new TokenElement(line,attr,begin+segment.getIndex(),begin+segment.getIndex(),c);
    childTokens.add(token);
    b=segment.getIndex();
    c=segment.next();
    } else {
    c=segment.next();
    if (b<segment.getIndex()) {
    token=new TokenElement(line,attr,begin+b,begin+segment.getIndex(),false);
    childTokens.add(token);
    Element[] removed=new Element[line.getElementCount()];
    for (int i=0;i<removed.length;i++)
    removed[i]=line.getElement(i);
    TokenElement[] newElements=childTokens.toArray(new TokenElement[childTokens.size()]);
    line.replace(0,line.getElementCount(),newElements);
    } catch (Exception e) {
    throw new EditorException("Unexpected BadlocationException ");
    * Returns a iterator of the tokens starting from the given position
    * @param The position that is covered by the first token returned by this iterator
    * @return A iterator of all the tokens starting at the given position
    public Iterator<IToken> getTokensFrom(int position) {
    return new TokenIterator(position);
    private String getText(Element element) {
    int begin=element.getStartOffset();
    int end=Math.min(element.getEndOffset(),getLength());
    try {
    return getText(begin,end-begin);
    } catch (BadLocationException e) {
    throw new EditorException("Unexpected BadLocationException (this should not happen at all)");
    * Check if a character is a white space
    * @return True if a character is a white space
    private boolean isWhite(char c) {
    if (c=='\n') // End of line is always a white space
    return true;
    for (char whiteChar : _whiteSpaceChars)
    if (whiteChar==c)
    return true;
    return false;
    * Check if a character is a delimiter character (different from a white space character)
    * @return True if a character is a delimiter character
    private boolean isDelimiter(char c) {
    for (char delimiterChar : _delimiterChars)
    if (delimiterChar==c)
    return true;
    return c=='\0';
    * Test code
    public static void main(String[] args) {
    // Display a test frame containing a test document
    try {
    JFrame frm=new JFrame();
    EditorDocument doc=new EditorDocument(new char[] {' ','\n','\t','\r'},new char[0]);
    doc.insertString(0,"Hello",null);
    JTextPane pane=new JTextPane(doc);
    JScrollPane scroll=new JScrollPane(pane);
    frm.getContentPane().add(scroll);
    frm.setSize(200,300);
    frm.setVisible(true);
    } catch (Exception e) {
    * Class that is a iterator over the tokens in the document
    private class TokenIterator implements Iterator<IToken> {
    private int _lineIndex=-1;
    private int _tokenIndex=-1;
    public TokenIterator(int position) {
    AbstractDocument.BranchElement root=(AbstractDocument.BranchElement) getDefaultRootElement();
    _lineIndex=root.getElementIndex(position);
    AbstractDocument.BranchElement line=(AbstractDocument.BranchElement) root.getElement(_lineIndex);
    _tokenIndex=line.getElementIndex(position)-1;
    * Removes from the underlying collection the last element returned by the
    * iterator (optional operation). This method can be called only once per
    * call to <tt>next</tt>. The behavior of an iterator is unspecified if
    * the underlying collection is modified while the iteration is in
    * progress in any way other than by calling this method.
    * @exception UnsupportedOperationException if the <tt>remove</tt>
    *           operation is not supported by this Iterator.
    * @exception IllegalStateException if the <tt>next</tt> method has not
    *           yet been called, or the <tt>remove</tt> method has already
    *           been called after the last call to the <tt>next</tt>
    *           method.
    public void remove() {
    // Do nothing
    * Returns the next element in the iteration. Calling this method
    * repeatedly until the {@link #hasNext()} method returns false will
    * return each element in the underlying collection exactly once.
    * @return the next element in the iteration.
    * @exception NoSuchElementException iteration has no more elements.
    public IToken next() {
    Element root=getDefaultRootElement();
    if (_lineIndex>=root.getElementCount())
    return null;
    Element line=root.getElement(_lineIndex);
    _tokenIndex++;
    if (_tokenIndex>=line.getElementCount()) {
    _lineIndex++;
    if (_lineIndex>=root.getElementCount())
    return null;
    line=root.getElement(_lineIndex);
    if (line.getElementCount()==0)
    return null;
    _tokenIndex=0;
    return (IToken) line.getElement(_tokenIndex);
    * Returns <tt>true</tt> if the iteration has more elements. (In other
    * words, returns <tt>true</tt> if <tt>next</tt> would return an element
    * rather than throwing an exception.)
    * @return <tt>true</tt> if the iterator has more elements.
    public boolean hasNext() {
    int lineIndex=_lineIndex;
    int tokenIndex=_tokenIndex;
    Element root=getDefaultRootElement();
    if (lineIndex>=root.getElementCount())
    return false;
    Element line=root.getElement(lineIndex);
    tokenIndex++;
    if (tokenIndex>=line.getElementCount()) {
    lineIndex++;
    if (lineIndex>=root.getElementCount())
    return false;
    line=root.getElement(lineIndex);
    if (line.getElementCount()==0)
    return false;
    return true;
    * Represents a token in the document
    private class TokenElement extends AbstractDocument.LeafElement implements IToken, Comparable<TokenElement> {
    private boolean _isWhiteSpace;
    private char _separatorChar='\0';
    public TokenElement(Element parent,AttributeSet attributeSet,int offs0,int offs1,boolean whiteSpace) {
    super(parent,attributeSet,offs0,offs1);
    _isWhiteSpace=whiteSpace;
    public TokenElement(Element parent,AttributeSet attributeSet,int offs0,int offs1,char separatorChar) {
    super(parent,attributeSet,offs0,offs1);
    _separatorChar=separatorChar;
    * Returns the separator character if this token is a separator, returns '\0' otherwise
    * @return The separator charactor or null otherwise
    public char getSeparatorChar() {
    return _separatorChar;
    * Compares this object with the specified object for order. Returns a
    * negative integer, zero, or a positive integer as this object is less
    * than, equal to, or greater than the specified object.<p>
    * In the foregoing description, the notation
    * <tt>sgn(</tt><i>expression</i><tt>)</tt> designates the mathematical
    * <i>signum</i> function, which is defined to return one of <tt>-1</tt>,
    * <tt>0</tt>, or <tt>1</tt> according to whether the value of <i>expression</i>
    * is negative, zero or positive.
    * The implementor must ensure <tt>sgn(x.compareTo(y)) ==
    * -sgn(y.compareTo(x))</tt> for all <tt>x</tt> and <tt>y</tt>. (This
    * implies that <tt>x.compareTo(y)</tt> must throw an exception iff
    * <tt>y.compareTo(x)</tt> throws an exception.)<p>
    * The implementor must also ensure that the relation is transitive:
    * <tt>(x.compareTo(y)>0 && y.compareTo(z)>0)</tt> implies
    * <tt>x.compareTo(z)>0</tt>.<p>
    * Finally, the implementer must ensure that <tt>x.compareTo(y)==0</tt>
    * implies that <tt>sgn(x.compareTo(z)) == sgn(y.compareTo(z))</tt>, for
    * all <tt>z</tt>.<p>
    * It is strongly recommended, but <i>not</i> strictly required that
    * <tt>(x.compareTo(y)==0) == (x.equals(y))</tt>. Generally speaking, any
    * class that implements the <tt>Comparable</tt> interface and violates
    * this condition should clearly indicate this fact. The recommended
    * language is "Note: this class has a natural ordering that is
    * inconsistent with equals."
    * @param o the Object to be compared.
    * @return a negative integer, zero, or a positive integer as this object
    *           is less than, equal to, or greater than the specified object.
    * @throws ClassCastException if the specified object's type prevents it
    * from being compared to this Object.
    public int compareTo(TokenElement o) {
    return getStartOffset()-o.getStartOffset();
    * Indicates this is a white space token
    * @return true if this is a white space token false otherwise
    public boolean isWhiteSpace() {
    return _isWhiteSpace;
    * Returns the string this token is representing
    * @return The string behind this token
    public String getText() {
    return EditorDocument.this.getText(this);
    class SearchToken implements IToken {
    private int _offset;
    public SearchToken(int offset) {
    _offset=offset;
    * @return The start of the token used in comparisation operations
    public int getEndOffset() {
    return _offset;
    public int getStartOffset() {
    return _offset;
    public boolean isWhiteSpace() {
    throw new EditorException("May not be called");
    public String getText() {
    throw new EditorException("May not be called");
    public char getSeparatorChar() {
    throw new EditorException("May not be called");

    I am trying to add primitive syntax highlighting to my JTextPane and have serious problems which I already stated in this forum. Now I read from uncle_alice that the text package from swing is not ment for that and that I need to write my own JTextPane and my own document and view.
    Can you explain what you mean by "writing my own JTextPane and View and Dcoument".
    My own Document I already have in order to provide SQL-highlighting.
    But what exactly do you mean by suggesting to write my own View! Whoever uses JTextPane doesnt really have much to do with its view. Can you give me a hint as I am completely stuck with an Exception : "javax.swing.text.StateInvariantError: GlyphView: Stale view: javax.swing.text.BadLocationException: Length must be positive"
    can you pinpoint the standard text-package's deficiency? it lacks what? what is the best work around?
    cheers
    ioannis

  • How to change destination table dynamically in configuration file in ssis?

    hello,
            i have a package i am having one data flow task.in data flow task i have one source and one destination.source and destination are different.i have created xml configuration file by configuring source and destination connection
    strings.
    now i want to change destination in the same server to different database with out opening the package.i want to directly change in the config file.we can change it by modifying configured value proerty and intial catalogue value.but if the table is not
    existed in the changed database.how we can create it dynamically.

    HI jiri Neoral,
                       thanks for reply,as you said above process by this we can do change only databasename.if in my destination database,the table which i used in package is not existed,can we create it dynamically
    using config file.later changing table name is possible?
    For that you need to have a step in SSIS package prior to data flow task to check if table exists and if not create it
    You can use  execute sql task with query like below
    IF OBJECT_ID('TableName') IS NULL
    CREATE TABLE TableName
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • How to change "read table ......" sentense to OO method ?

    READ TABLE lt_origin_table  into lt_target_table
                 WITH KEY user_id= lt_target_table-user_id.
    This sentense is allowed in function module but can not be written in an OO method , so what can i do ?
    Now I use 2 loops ,
    Loop at lt_origin_table ....
       loop at lt_target_table
       endloop.
    endloop.
    The result is OK , but the performance is not good enough , can any one help me ?
    Regards .

    <b>Example  :</b>   Selection of a particular line in the internal table sflight_tab and assigning it to a field symbol <sflight>. After the line has been successfully assigned, the content of a component of the line is changed in the internal table.
    PARAMETERS: p_carrid TYPE sflight-carrid,
                p_connid TYPE sflight-connid,
                p_fldate TYPE sflight-fldate.
    DATA sflight_tab TYPE SORTED TABLE OF sflight
                     WITH UNIQUE KEY carrid connid fldate.
    FIELD-SYMBOLS <sflight> TYPE sflight.
    SELECT *
           FROM sflight
           INTO TABLE sflight_tab
           WHERE carrid = p_carrid AND
                 connid = p_connid.
    IF sy-subrc = 0.
      READ TABLE sflight_tab
           WITH TABLE KEY carrid = p_carrid
                          connid = p_connid
                          fldate = p_fldate
           ASSIGNING <sflight>.
      IF sy-subrc = 0 AND
         <sflight> IS ASSIGNED.
         <sflight>-price = <sflight>-price * '0.9'.
      ENDIF.
    ENDIF.
    reward  points if it is usefull ....
    Girish

  • How to change in Transfer structure

    Hi All,
    I want change the mapping of one of my info object in transfer structure.
    When I am clicking on the change-display button (pen/spec icon),it's not going into change mode & every thing remains disabled.
    I tried with SAPALL authorization from BASIS.....still its the same..
    Is there any other way ??
    Plz suggest.
    Regards,
    Kironmoy Banerjee

    hii,
    firstly check whether the info object u want to insert is available in ur data source or not.if available then there is no need to insert that info object into the transfer structure.but if not,then u have to first insert the Info object in to the data source,then the info object will itself  comes into the transfer structure.
    Neha

  • Editing Chart legends: How to change the line structure within the legend?

    Hi,
    I have one problem: I have several charts in Numbers and since I need to print them in black/white, colors cannot be used to differentiate between the lines. So if I have a dotted line and a solid line, the legend only shows me solid lines as line symbols, so the line structure is not reflected within the legend. Can I change that?

    _This question was already asked and responded._
    Put a text box with the true kind of line above the one displayed automatically.
    Yvan KOENIG (VALLAURIS, France) samedi 1 mai 2010 16:52:44

Maybe you are looking for

  • IPhone wont send email from a certain mail account

    I know the settings are right, but the iPhone wont send mail from one of my mail accounts (hosted by the company i work for, which offers mail hosting as a service, and has hundreds of other iPhone users with the same account settings.) The progress

  • Error loading JDBC driver

    Hi, I have an rpt file developed in crystal report 2008. it connects to SQL Server using ODBC(RDO) connection. I have a jsp file that needs to change the datasource to use JDBC (JNDI). The scriptlet for changing datasource is given below. I have my s

  • PHP OCI8 1.4.0 Alpha is now available

    I just released an Alpha version of PECL OCI8 1.4 on http://pecl.php.net/package/oci8 The code is also merged to what will eventually be the PHP 5.3.2 and PHP 6.0 releases. Documentation will appear on http://www.php.net/manual/en/ref.oci8.php in the

  • How to cancel my imessage completely

    I have purchased a Samsung Gallaxy S5 and am not able to get messages. I was told i needed to cancel my imessage account. How do I do this?

  • How to call variant

    Hi, In my selectin screen i have variable like Fiscal year. that fiscal year need to pick up year from one perticular table. so how can i create a variant for that and give link between my selection screen and table. regards raja